diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index 952c81f..a6e1a10 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -3,151 +3,151 @@ "packages": [ { "name": "async", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.10.0", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/async-2.10.0", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "boolean_selector", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/boolean_selector-2.1.1", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1", "packageUri": "lib/", "languageVersion": "2.17" }, { "name": "card_swiper", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/card_swiper-2.0.4", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/card_swiper-2.0.4", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "characters", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/characters-1.2.1", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/characters-1.2.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "clock", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/clock-1.1.1", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/clock-1.1.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "collection", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/collection-1.17.0", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/collection-1.17.0", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "cupertino_icons", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.5", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.5", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "fake_async", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.1", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/fake_async-1.3.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "flutter", - "rootUri": "file:///C:/Users/Nutzer/flutter/packages/flutter", + "rootUri": "file:///usr/local/Caskroom/flutter/3.7.7/flutter/packages/flutter", "packageUri": "lib/", "languageVersion": "2.17" }, { "name": "flutter_lints", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_lints-2.0.1", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/flutter_lints-2.0.1", "packageUri": "lib/", "languageVersion": "2.17" }, { "name": "flutter_test", - "rootUri": "file:///C:/Users/Nutzer/flutter/packages/flutter_test", + "rootUri": "file:///usr/local/Caskroom/flutter/3.7.7/flutter/packages/flutter_test", "packageUri": "lib/", "languageVersion": "2.17" }, { "name": "js", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/js-0.6.5", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/js-0.6.5", "packageUri": "lib/", "languageVersion": "2.16" }, { "name": "lints", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/lints-2.0.1", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/lints-2.0.1", "packageUri": "lib/", "languageVersion": "2.17" }, { "name": "matcher", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/matcher-0.12.13", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/matcher-0.12.13", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "material_color_utilities", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/material_color_utilities-0.2.0", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0", "packageUri": "lib/", "languageVersion": "2.13" }, { "name": "meta", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/meta-1.8.0", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/meta-1.8.0", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "path", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/path-1.8.2", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/path-1.8.2", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "sky_engine", - "rootUri": "file:///C:/Users/Nutzer/flutter/bin/cache/pkg/sky_engine", + "rootUri": "file:///usr/local/Caskroom/flutter/3.7.7/flutter/bin/cache/pkg/sky_engine", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "source_span", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/source_span-1.9.1", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/source_span-1.9.1", "packageUri": "lib/", "languageVersion": "2.14" }, { "name": "stack_trace", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/stack_trace-1.11.0", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/stack_trace-1.11.0", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "stream_channel", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/stream_channel-2.1.1", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/stream_channel-2.1.1", "packageUri": "lib/", "languageVersion": "2.14" }, { "name": "string_scanner", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/string_scanner-1.2.0", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/string_scanner-1.2.0", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "term_glyph", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/term_glyph-1.2.1", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/term_glyph-1.2.1", "packageUri": "lib/", "languageVersion": "2.12" }, { "name": "test_api", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/test_api-0.4.16", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/test_api-0.4.16", "packageUri": "lib/", "languageVersion": "2.18" }, { "name": "vector_math", - "rootUri": "file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/vector_math-2.1.4", + "rootUri": "file:///Users/bogdan/.pub-cache/hosted/pub.dev/vector_math-2.1.4", "packageUri": "lib/", "languageVersion": "2.14" }, @@ -158,7 +158,7 @@ "languageVersion": "2.19" } ], - "generated": "2023-04-16T10:37:14.046582Z", + "generated": "2023-04-17T20:45:45.108623Z", "generator": "pub", "generatorVersion": "2.19.6" } diff --git a/.dart_tool/package_config_subset b/.dart_tool/package_config_subset index 17af9d8..f5fefb5 100644 --- a/.dart_tool/package_config_subset +++ b/.dart_tool/package_config_subset @@ -1,105 +1,105 @@ async 2.18 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.10.0/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.10.0/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/async-2.10.0/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/async-2.10.0/lib/ boolean_selector 2.17 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/boolean_selector-2.1.1/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/boolean_selector-2.1.1/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/boolean_selector-2.1.1/lib/ card_swiper 2.12 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/card_swiper-2.0.4/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/card_swiper-2.0.4/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/card_swiper-2.0.4/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/card_swiper-2.0.4/lib/ characters 2.12 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/characters-1.2.1/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/characters-1.2.1/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/characters-1.2.1/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/characters-1.2.1/lib/ clock 2.12 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/clock-1.1.1/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/clock-1.1.1/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/clock-1.1.1/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/clock-1.1.1/lib/ collection 2.12 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/collection-1.17.0/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/collection-1.17.0/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/collection-1.17.0/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/collection-1.17.0/lib/ cupertino_icons 2.12 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.5/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.5/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.5/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.5/lib/ fake_async 2.12 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.1/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.1/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/fake_async-1.3.1/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/fake_async-1.3.1/lib/ flutter_lints 2.17 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_lints-2.0.1/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_lints-2.0.1/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/flutter_lints-2.0.1/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/flutter_lints-2.0.1/lib/ js 2.16 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/js-0.6.5/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/js-0.6.5/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/js-0.6.5/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/js-0.6.5/lib/ lints 2.17 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/lints-2.0.1/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/lints-2.0.1/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/lints-2.0.1/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/lints-2.0.1/lib/ matcher 2.18 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/matcher-0.12.13/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/matcher-0.12.13/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/matcher-0.12.13/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/matcher-0.12.13/lib/ material_color_utilities 2.13 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/material_color_utilities-0.2.0/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/material_color_utilities-0.2.0/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/material_color_utilities-0.2.0/lib/ meta 2.12 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/meta-1.8.0/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/meta-1.8.0/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/meta-1.8.0/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/meta-1.8.0/lib/ path 2.12 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/path-1.8.2/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/path-1.8.2/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/path-1.8.2/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/path-1.8.2/lib/ source_span 2.14 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/source_span-1.9.1/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/source_span-1.9.1/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/source_span-1.9.1/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/source_span-1.9.1/lib/ stack_trace 2.18 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/stack_trace-1.11.0/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/stack_trace-1.11.0/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/stack_trace-1.11.0/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/stack_trace-1.11.0/lib/ stream_channel 2.14 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/stream_channel-2.1.1/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/stream_channel-2.1.1/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/stream_channel-2.1.1/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/stream_channel-2.1.1/lib/ string_scanner 2.18 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/string_scanner-1.2.0/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/string_scanner-1.2.0/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/string_scanner-1.2.0/lib/ term_glyph 2.12 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/term_glyph-1.2.1/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/term_glyph-1.2.1/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/term_glyph-1.2.1/lib/ test_api 2.18 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/test_api-0.4.16/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/test_api-0.4.16/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/test_api-0.4.16/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/test_api-0.4.16/lib/ vector_math 2.14 -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/vector_math-2.1.4/ -file:///C:/Users/Nutzer/AppData/Local/Pub/Cache/hosted/pub.dev/vector_math-2.1.4/lib/ -sky_engine -2.12 -file:///C:/Users/Nutzer/flutter/bin/cache/pkg/sky_engine/ -file:///C:/Users/Nutzer/flutter/bin/cache/pkg/sky_engine/lib/ -flutter -2.17 -file:///C:/Users/Nutzer/flutter/packages/flutter/ -file:///C:/Users/Nutzer/flutter/packages/flutter/lib/ -flutter_test -2.17 -file:///C:/Users/Nutzer/flutter/packages/flutter_test/ -file:///C:/Users/Nutzer/flutter/packages/flutter_test/lib/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/vector_math-2.1.4/ +file:///Users/bogdan/.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/ ernaehrung 2.19 -file:///C:/Users/Nutzer/source/repos/Flutter-Ernaehrungsapp/ -file:///C:/Users/Nutzer/source/repos/Flutter-Ernaehrungsapp/lib/ +file:///Users/bogdan/IdeaProjects/erna%CC%88hrung/ +file:///Users/bogdan/IdeaProjects/erna%CC%88hrung/lib/ +sky_engine +2.12 +file:///usr/local/Caskroom/flutter/3.7.7/flutter/bin/cache/pkg/sky_engine/ +file:///usr/local/Caskroom/flutter/3.7.7/flutter/bin/cache/pkg/sky_engine/lib/ +flutter +2.17 +file:///usr/local/Caskroom/flutter/3.7.7/flutter/packages/flutter/ +file:///usr/local/Caskroom/flutter/3.7.7/flutter/packages/flutter/lib/ +flutter_test +2.17 +file:///usr/local/Caskroom/flutter/3.7.7/flutter/packages/flutter_test/ +file:///usr/local/Caskroom/flutter/3.7.7/flutter/packages/flutter_test/lib/ 2 diff --git a/.dart_tool/version b/.dart_tool/version index ad64131..7560320 100644 --- a/.dart_tool/version +++ b/.dart_tool/version @@ -1 +1 @@ -3.7.11 \ No newline at end of file +3.7.9 \ No newline at end of file diff --git a/lib/components/cardComponent.dart b/lib/components/cardComponent.dart new file mode 100644 index 0000000..0e3e437 --- /dev/null +++ b/lib/components/cardComponent.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +class CardComponent extends StatelessWidget { + final String title; + final String description; + + const CardComponent({super.key, required this.title, required this.description}); + + @override + Widget build(BuildContext context) { + return SizedBox( + height: MediaQuery.of(context).size.height * 0.8, + child: Card( + margin: const EdgeInsets.all(20.0), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: const TextStyle(fontSize: 24.0)), + const SizedBox(height: 8.0), + Text(description, style: const TextStyle(fontSize: 16.0)), + ], + ), + ), + ), + ); + + } +} \ No newline at end of file diff --git a/lib/components/welcomePageChildrenTextField.dart b/lib/components/welcomePageChildrenTextField.dart new file mode 100644 index 0000000..5ea0ac8 --- /dev/null +++ b/lib/components/welcomePageChildrenTextField.dart @@ -0,0 +1,187 @@ +import 'package:ernaehrung/views/navigation/navigationScreen.dart'; +import 'package:flutter/material.dart'; + +class WelcomePageStateTextFieldState extends StatefulWidget { + const WelcomePageStateTextFieldState({super.key}); + + @override + State createState() => + _WelcomePageStateTextFieldState(); +} + +class _WelcomePageStateTextFieldState + extends State { + final firstnameTextEditingController = TextEditingController(); + final secondnameTextEditingController = TextEditingController(); + final weightTextEditingController = TextEditingController(); + final heightTextEditingController = TextEditingController(); + final caloriesTextEditingController = TextEditingController(); + + bool isNameVisible = false; + bool isSNameVisible = false; + bool isWeightVisible = false; + bool isHeightVisible = false; + bool isCaloriesVisible = false; + + void setNameVisible(bool visibility) { + setState(() => isNameVisible = visibility); + } + + void setSNameVisible(bool visibility) { + setState(() => isSNameVisible = visibility); + } + + void setWeightVisible(bool visibility) { + setState(() => isWeightVisible = visibility); + } + + void setHeightVisible(bool visibility) { + setState(() => isHeightVisible = visibility); + } + + void setCaloriesVisible(bool visibility) { + setState(() => isCaloriesVisible = visibility); + } + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const SizedBox( + height: 24, + ), + TextFormField( + onChanged: (newText) { + if (newText.isNotEmpty) { + setNameVisible(true); + } else { + setNameVisible(false); + } + }, + controller: firstnameTextEditingController, + decoration: InputDecoration( + hintText: 'Name', + border: const OutlineInputBorder(gapPadding: 8), + suffixIcon: isNameVisible + ? IconButton( + onPressed: () { + firstnameTextEditingController.clear(); + setState(() => isNameVisible = false); + }, + icon: const Icon(Icons.clear)) + : null, + ), + keyboardType: TextInputType.text, + ), + const SizedBox( + height: 24, + ), + TextFormField( + onChanged: (newText) { + if (newText.isNotEmpty) { + setSNameVisible(true); + } else { + setSNameVisible(false); + } + }, + controller: secondnameTextEditingController, + decoration: InputDecoration( + hintText: 'Vorname', + border: const OutlineInputBorder(gapPadding: 8), + suffixIcon: isSNameVisible + ? IconButton( + onPressed: () { + secondnameTextEditingController.clear(); + setState(() => isSNameVisible = false); + }, + icon: const Icon(Icons.clear)) + : null, + ), + keyboardType: TextInputType.text), + const SizedBox( + height: 24, + ), + TextFormField( + onChanged: (newText) { + if (newText.isNotEmpty) { + setWeightVisible(true); + } else { + setWeightVisible(false); + } + }, + controller: weightTextEditingController, + decoration: InputDecoration( + hintText: 'Gewicht', + border: const OutlineInputBorder(gapPadding: 8), + suffixIcon: isWeightVisible + ? IconButton( + onPressed: () { + weightTextEditingController.clear(); + setState(() => isWeightVisible = false); + }, + icon: const Icon(Icons.clear)) + : null, + ), + keyboardType: TextInputType.number), + const SizedBox( + height: 24, + ), + TextFormField( + onChanged: (newText) { + if (newText.isNotEmpty) { + setHeightVisible(true); + } else { + setHeightVisible(false); + } + }, + controller: heightTextEditingController, + decoration: InputDecoration( + hintText: 'Größe', + border: const OutlineInputBorder(gapPadding: 8), + suffixIcon: isHeightVisible + ? IconButton( + onPressed: () { + heightTextEditingController.clear(); + setState(() => isHeightVisible = false); + }, + icon: const Icon(Icons.clear)) + : null, + ), + keyboardType: TextInputType.number), + const SizedBox( + height: 24, + ), + TextFormField( + onChanged: (newText) { + if (newText.isNotEmpty) { + setCaloriesVisible(true); + } else { + setCaloriesVisible(false); + } + }, + controller: caloriesTextEditingController, + decoration: InputDecoration( + hintText: 'gewünschte Kalorienzufuhr', + border: const OutlineInputBorder(gapPadding: 8), + suffixIcon: isCaloriesVisible + ? IconButton( + onPressed: () { + caloriesTextEditingController.clear(); + setState(() => isCaloriesVisible = false); + }, + icon: const Icon(Icons.clear)) + : null, + ), + keyboardType: TextInputType.number), + const SizedBox( + height: 24, + ), + ElevatedButton(onPressed: (){ + Navigator.pushAndRemoveUntil(context, + MaterialPageRoute(builder: (context) => const NavigationScreen()), (r) => false); + }, child: const Text('Bestätigen')) + ], + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index 1c4a394..d688926 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,11 +1,14 @@ +import 'package:ernaehrung/views/navigation/navigationScreen.dart'; +import 'package:ernaehrung/views/welcome/welcomeScreen.dart'; import 'package:flutter/material.dart'; -import 'package:card_swiper/card_swiper.dart'; void main() { - runApp(MyApp()); + runApp(const MyApp()); } class MyApp extends StatelessWidget { + const MyApp({super.key}); + @override Widget build(BuildContext context) { return MaterialApp( @@ -13,127 +16,10 @@ class MyApp extends StatelessWidget { theme: ThemeData( primarySwatch: Colors.blue, ), - home: MyHomePage(title: 'Flutter Demo Home Page'), + home: const WelcomeScreen(), + routes: { + '/navigation': (context) => const NavigationScreen(), + }, ); } } - -class MyHomePage extends StatefulWidget { - final String title; - - MyHomePage({required this.title}); - - @override - _MyHomePageState createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _selectedIndex = 0; - final PageController _pageController = PageController(initialPage: 0); - - void _onItemTapped(int index) { - setState(() { - _selectedIndex = index; - _pageController.animateToPage(index, - duration: const Duration(milliseconds: 300), curve: Curves.easeInOut); - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(widget.title), - ), - body: PageView( - controller: _pageController, - children: _widgetOptions, - onPageChanged: (int index) { - setState(() { - _selectedIndex = index; - }); - }, - ), - bottomNavigationBar: BottomNavigationBar( - items: const [ - BottomNavigationBarItem( - icon: Icon(Icons.home), - label: 'Page 1', - ), - BottomNavigationBarItem( - icon: Icon(Icons.work), - label: 'Page 2', - ), - BottomNavigationBarItem( - icon: Icon(Icons.school), - label: 'Page 3', - ), - ], - currentIndex: _selectedIndex, - onTap: _onItemTapped, - ), - ); - } - - static final List _widgetOptions = [ - Swiper( - itemBuilder: (BuildContext context, int index) { - return const CardContent( - title: 'Page 1', - description: 'This is page 1', - ); - }, - itemCount: 1, - loop: false, - ), - Swiper( - itemBuilder: (BuildContext context, int index) { - return const CardContent( - title: 'Page 2', - description: 'This is page 2', - ); - }, - itemCount: 1, - loop: false, - ), - Swiper( - itemBuilder: (BuildContext context, int index) { - return const CardContent( - title: 'Page 3', - description: 'This is page 3', - ); - }, - itemCount: 1, - loop: false, - ), - ]; -} - -class CardContent extends StatelessWidget { - final String title; - final String description; - - const CardContent({required this.title, required this.description}); - - @override - Widget build(BuildContext context) { - return SizedBox( - height: MediaQuery.of(context).size.height * 0.8, - child: Card( - margin: const EdgeInsets.all(20.0), - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(title, style: const TextStyle(fontSize: 24.0)), - const SizedBox(height: 8.0), - Text(description, style: const TextStyle(fontSize: 16.0)), - ], - ), - ), - ), - ); - - } -} diff --git a/lib/views/navigation/navigationScreen.dart b/lib/views/navigation/navigationScreen.dart new file mode 100644 index 0000000..9885192 --- /dev/null +++ b/lib/views/navigation/navigationScreen.dart @@ -0,0 +1,89 @@ +import 'package:card_swiper/card_swiper.dart'; +import 'package:ernaehrung/components/cardComponent.dart'; +import 'package:flutter/material.dart'; + +class NavigationScreen extends StatefulWidget { + const NavigationScreen({super.key}); + + @override + NavigationScreenState createState() => NavigationScreenState(); +} + +class NavigationScreenState extends State { + int _selectedIndex = 0; + final PageController _pageController = PageController(initialPage: 0); + + void _onItemTapped(int index) { + setState(() { + _selectedIndex = index; + _pageController.animateToPage(index, + duration: const Duration(milliseconds: 300), curve: Curves.easeInOut); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: PageView( + controller: _pageController, + children: _widgetOptions, + onPageChanged: (int index) { + setState(() { + _selectedIndex = index; + }); + }, + ), + bottomNavigationBar: BottomNavigationBar( + items: const [ + BottomNavigationBarItem( + icon: Icon(Icons.home), + label: 'Page 1', + ), + BottomNavigationBarItem( + icon: Icon(Icons.work), + label: 'Page 2', + ), + BottomNavigationBarItem( + icon: Icon(Icons.school), + label: 'Page 3', + ), + ], + currentIndex: _selectedIndex, + onTap: _onItemTapped, + ), + ); + } + + static final List _widgetOptions = [ + Swiper( + itemBuilder: (BuildContext context, int index) { + return const CardComponent( + title: 'Page 1', + description: 'This is page 1', + ); + }, + itemCount: 1, + loop: false, + ), + Swiper( + itemBuilder: (BuildContext context, int index) { + return const CardComponent( + title: 'Page 2', + description: 'This is page 2', + ); + }, + itemCount: 1, + loop: false, + ), + Swiper( + itemBuilder: (BuildContext context, int index) { + return const CardComponent( + title: 'Page 3', + description: 'This is page 3', + ); + }, + itemCount: 1, + loop: false, + ), + ]; +} diff --git a/lib/views/welcome/welcomeScreen.dart b/lib/views/welcome/welcomeScreen.dart new file mode 100644 index 0000000..dd4106c --- /dev/null +++ b/lib/views/welcome/welcomeScreen.dart @@ -0,0 +1,42 @@ +import 'package:ernaehrung/components/welcomePageChildrenTextField.dart'; +import 'package:flutter/material.dart'; + +class WelcomeScreen extends StatelessWidget { + const WelcomeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return const MaterialApp( + title: 'Welcome Screen', + home: WelcomeScreenPage(), + ); + } +} + +class WelcomeScreenPage extends StatefulWidget { + const WelcomeScreenPage({super.key}); + + @override + State createState() => WelcomeScreenPageState(); +} + +class WelcomeScreenPageState extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Welcome Screen'), + ), + body: const SizedBox( + height: double.infinity, + width: double.infinity, + child: SingleChildScrollView( + child: Form( + child: WelcomePageStateTextFieldState(), + ) + ), + ) + ); + } +}