Flutter-Ernaehrungsapp/lib/functions/welcome_crud.dart

11 lines
499 B
Dart
Raw Normal View History

import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:hive/hive.dart';
void storeUserData(String sname, String fname, int weight, int height, int calories) async {
final userBox = Hive.box(dotenv.env['USER_BOX']!);
userBox.put(dotenv.env['FIRST_NAME_FIELD']!, sname);
userBox.put(dotenv.env['SECOND_NAME_FIELD']!, fname);
userBox.put(dotenv.env['WEIGHT_FIELD']!, weight);
userBox.put(dotenv.env['HEIGHT_FIELD']!, height);
userBox.put(dotenv.env['CALORIES_FIELD']!, calories);
}