Android App in Android Ordner bewegt, Gericht / Speisen suchen und auswählen, Kalorien zählen und summieren, Daten in der DB speichern

welcome
Bogdan Kotikov 2023-05-13 13:02:42 +02:00
parent cf568e4fdd
commit 2dd5e9a18d
7 changed files with 168 additions and 141 deletions

8
.env
View File

@ -1,3 +1,11 @@
USER_BOX=USER
FIRST_NAME_FIELD=FIRST_NAME
SECOND_NAME_FIELD=SECOND_NAME
WEIGHT_FIELD=WEIGHT
HEIGHT_FIELD=HEIGHT
CALORIES_FIELD=CALORIES
FIRST_NAME_FIELD=FIRST_NAME
FIRST_NAME_FIELD=FIRST_NAME
TODAY_BOX=TODAY TODAY_BOX=TODAY
DATE_FIELD=DATE # datum DATE_FIELD=DATE # datum
BREAKFAST_FIELD=FRÜHSTÜCK # frühstück BREAKFAST_FIELD=FRÜHSTÜCK # frühstück

View File

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.2/","native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.2/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.10/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.6/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2023-05-12 18:02:09.137836","version":"3.7.9"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.2/","native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.2/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.10/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/bogdan/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.6/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2023-05-12 23:04:16.870373","version":"3.7.9"}

View File

@ -1,13 +0,0 @@
import 'package:flutter/material.dart';
class CardItemComponent extends StatelessWidget {
final String title;
final int calories;
const CardItemComponent(Image? image, this.title, this.calories, {super.key});
@override
Widget build(BuildContext context) {
return Column();
}
}

View File

@ -178,10 +178,15 @@ class _WelcomePageStateTextFieldState
const SizedBox( const SizedBox(
height: 24, height: 24,
), ),
ElevatedButton(onPressed: (){ ElevatedButton(
Navigator.pushAndRemoveUntil(context, onPressed: () {
MaterialPageRoute(builder: (context) => const NavigationScreen()), (r) => false); Navigator.pushAndRemoveUntil(
}, child: const Text('Bestätigen')) context,
MaterialPageRoute(
builder: (context) => const NavigationScreen()),
(r) => false);
},
child: const Text('Bestätigen'))
], ],
); );
} }

View File

@ -0,0 +1,16 @@
import 'package:flutter/cupertino.dart';
class OnboardingPage extends StatefulWidget {
const OnboardingPage({Key? key}) : super(key: key);
@override
State<OnboardingPage> createState() => _OnboardingPageState();
}
class _OnboardingPageState extends State<OnboardingPage> {
@override
Widget build(BuildContext context) {
return const Placeholder();
}
}

View File

View File

@ -0,0 +1,11 @@
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);
}