diff --git a/assets/images/Icons/Icon_Essen.png b/assets/images/Icons/Icon_Essen.png new file mode 100644 index 0000000..424216c Binary files /dev/null and b/assets/images/Icons/Icon_Essen.png differ diff --git a/assets/images/Icons/Icon_Familie.png b/assets/images/Icons/Icon_Familie.png new file mode 100644 index 0000000..57142c4 Binary files /dev/null and b/assets/images/Icons/Icon_Familie.png differ diff --git a/assets/images/Icons/Icon_Gesundheit.png b/assets/images/Icons/Icon_Gesundheit.png new file mode 100644 index 0000000..254839a Binary files /dev/null and b/assets/images/Icons/Icon_Gesundheit.png differ diff --git a/assets/images/Icons/Icon_Kultur.png b/assets/images/Icons/Icon_Kultur.png new file mode 100644 index 0000000..fccd996 Binary files /dev/null and b/assets/images/Icons/Icon_Kultur.png differ diff --git a/assets/images/Icons/Icon_Musik.png b/assets/images/Icons/Icon_Musik.png new file mode 100644 index 0000000..2d0dc50 Binary files /dev/null and b/assets/images/Icons/Icon_Musik.png differ diff --git a/assets/images/Icons/Icon_Nachtleben.png b/assets/images/Icons/Icon_Nachtleben.png new file mode 100644 index 0000000..7955bef Binary files /dev/null and b/assets/images/Icons/Icon_Nachtleben.png differ diff --git a/assets/images/Icons/Icon_Soziales.png b/assets/images/Icons/Icon_Soziales.png new file mode 100644 index 0000000..d9d3204 Binary files /dev/null and b/assets/images/Icons/Icon_Soziales.png differ diff --git a/assets/images/Icons/Icon_Sport.png b/assets/images/Icons/Icon_Sport.png new file mode 100644 index 0000000..d62ba3a Binary files /dev/null and b/assets/images/Icons/Icon_Sport.png differ diff --git a/assets/images/Kultur.png b/assets/images/Kultur.png new file mode 100644 index 0000000..65941af Binary files /dev/null and b/assets/images/Kultur.png differ diff --git a/assets/images/filter_wann.png b/assets/images/filter_wann.png deleted file mode 100644 index d9ea876..0000000 Binary files a/assets/images/filter_wann.png and /dev/null differ diff --git a/lib/screens/detail_widget.dart b/lib/screens/detail_widget.dart index 7e6474b..7370403 100644 --- a/lib/screens/detail_widget.dart +++ b/lib/screens/detail_widget.dart @@ -36,14 +36,13 @@ class Frame28 extends StatelessWidget { child: TimeButtonSection(), // Dein Button-Bereich ), Container( - height: 10, - child: MusikHeader(), + height: 10, ), Container( height: 35, - child: MusikHeader(), + child: MusikHeader(), ), - //Container(child: MusikHeader(),), + //Container(), Column( children: [ Container( diff --git a/lib/screens/details.dart b/lib/screens/details.dart deleted file mode 100644 index 36c34a7..0000000 --- a/lib/screens/details.dart +++ /dev/null @@ -1,164 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:learn_project/utils/class.dart'; -import 'package:learn_project/utils/widgets.dart'; -import 'package:supabase_flutter/supabase_flutter.dart'; - -class DetailsPage extends StatelessWidget { - final Recipe recipe; - - const DetailsPage({required this.recipe}); - - @override - Widget build(BuildContext context) { - return Scaffold( - body: NestedScrollView( - headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverAppBar( - expandedHeight: 200.0, - floating: false, - pinned: true, - title: Text(recipe.title), - flexibleSpace: FlexibleSpaceBar( - background: Hero( - tag: recipe.id, - child: FadeInImage( - image: NetworkImage(recipe.imageUrl), - fit: BoxFit.cover, - placeholder: AssetImage('assets/images/loading.gif'), - ), - ), - ), - ), - ]; - }, - body: Container( - color: Colors.white, - padding: EdgeInsets.only(top: 8.0), - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - children: [ - Text('Nutrition', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 20)), - NutritionWidget( - nutrients: recipe.nutrients, - ), - Divider(color: Colors.white, endIndent: 40.0, indent: 40.0), - Text('Ingredients', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 20)), - IngredientsWidget( - ingredients: recipe.ingredients, - ), - Divider(color: Colors.white, endIndent: 40.0, indent: 40.0), - Text('Steps', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 20)), - RecipeSteps( - steps: recipe.steps, - ) - ], - ), - ), - ), - ), - ); - } -} - -class RecipeSteps extends StatelessWidget { - final List steps; - RecipeSteps({this.steps = const []}); - - @override - Widget build(BuildContext context) { - return ListView.builder( - itemCount: steps.length, - padding: const EdgeInsets.all(0.0), - shrinkWrap: true, - physics: ClampingScrollPhysics(), - scrollDirection: Axis.vertical, - itemBuilder: (BuildContext context, int index) { - return ListTile( - leading: CircleAvatar( - backgroundColor: Color(0xff8DB646), - child: Text('${index + 1}', - style: TextStyle( - color: Colors.black, fontWeight: FontWeight.bold)), - ), - title: Text(steps[index], - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 16))); - }, - ); - } -} - -class IngredientsWidget extends StatelessWidget { - final List? ingredients; - IngredientsWidget({this.ingredients}); - - @override - Widget build(BuildContext context) { - return SizedBox( - height: 50, - width: double.infinity, - child: ListView.builder( - itemCount: ingredients!.length, - shrinkWrap: true, - scrollDirection: Axis.horizontal, - physics: BouncingScrollPhysics(), - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Chip( - backgroundColor: Color(0xff8DB646), - label: Text(ingredients![index], - style: TextStyle( - color: Colors.black, fontWeight: FontWeight.bold)), - ), - ); - }, - ), - ); - } -} - -class NutritionWidget extends StatelessWidget { - final List? nutrients; - NutritionWidget({this.nutrients}); - @override - Widget build(BuildContext context) { - return SizedBox( - height: 86, - width: double.infinity, - child: Center( - child: ListView.builder( - itemCount: nutrients!.length, - scrollDirection: Axis.horizontal, - shrinkWrap: true, - physics: BouncingScrollPhysics(), - itemBuilder: (BuildContext context, int index) { - return CircleIndicator( - percent: nutrients![index].percent, - nutrient: nutrients![index], - ); - }, - ), - ), - ); - } -} -final _future = Supabase.instance.client - .from('events') - .select(); \ No newline at end of file diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 8216fdf..d99f55a 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -86,8 +86,9 @@ class HomePage extends StatelessWidget { var size = MediaQuery.of(context).size; /*24 is for notification bar on Android*/ - final double itemHeight = (size.height - kToolbarHeight - 24) / 5; + final double itemHeight = (size.height - kToolbarHeight - 100) / 6; final double itemWidth = size.width / 2.3; + var appBar = AppBar( leading: SizedBox( height: 60, @@ -205,7 +206,97 @@ class HomePage extends StatelessWidget { color: Data.recipes[index].color, ))); }, - child: Card( + child: + Container( + width: itemWidth, + height: 130, + child: Stack( + children: [ + Positioned( + left: 0, + top: 0, + child: Container( + width: itemWidth, + height: 130, + decoration: ShapeDecoration( + image: DecorationImage( + image: + AssetImage(Data.recipes[index].imageUrl), + fit: BoxFit.cover, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8)), + shadows: [ + BoxShadow( + color: Data.recipes[index].color, + blurRadius: 0, + offset: Offset(0, 10), + spreadRadius: 0, + ) + ], + ), + ), + ), + Positioned( + left: 16, + top: 15, + child: Text( + '64', + style: TextStyle( + color: Colors.white, + fontSize: 18, + fontFamily: 'Inter', + fontWeight: FontWeight.w500, + height: 0, + ), + ), + ), + Positioned( + left: 13, + top: Data.recipes[index].textheight, //86, + child: + Container( + width: itemWidth-20,// Set a fixed width or use constraints + child: Wrap( + children: [ + Text( + Data.recipes[index].title, + style: TextStyle( + color: Colors.white, + fontSize: 24, + fontFamily: 'Inter', + fontWeight: FontWeight.w800, + height: 0, + ), + ), ], + ),), + + + ), + Positioned.fill( + left:127, + top:9, + child: Image.asset( + Data.recipes[index].iconUrl, + fit: BoxFit.cover, + ), + + ), + Positioned( + left: 127, + top: 9, + child: Container( + width: 31, + height: 31, + clipBehavior: Clip.antiAlias, + decoration: BoxDecoration(), + ), + ), + ], + ), + ), + + /* Card( color: Data.recipes[index].color, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(6.0), @@ -248,7 +339,7 @@ class HomePage extends StatelessWidget { ], ), ), - ), + ), */ ), ); }, diff --git a/lib/screens/subheader_Datepicker.dart b/lib/screens/subheader_Datepicker.dart index 208744d..172a6bd 100644 --- a/lib/screens/subheader_Datepicker.dart +++ b/lib/screens/subheader_Datepicker.dart @@ -386,7 +386,7 @@ class GesundheitWellnes extends StatelessWidget { decoration: ShapeDecoration( image: DecorationImage( image: - NetworkImage("https://via.placeholder.com/167x130"), + AssetImage('assets/images/Musik.png'), fit: BoxFit.cover, ), shape: RoundedRectangleBorder( diff --git a/lib/utils/class.dart b/lib/utils/class.dart index d2c0dc1..e30b551 100644 --- a/lib/utils/class.dart +++ b/lib/utils/class.dart @@ -8,18 +8,21 @@ class Nutrients { } class Recipe { - String id, imageUrl, title,category; + String id, imageUrl, iconUrl,title,category; Color color; - List steps; - List ingredients; - List nutrients; + double? textheight; + //List steps; + //List ingredients; + //List nutrients; Recipe( {required this.id, required this.title, required this.imageUrl, - required this.steps, - required this.ingredients, - required this.nutrients, + required this.iconUrl, + //required this.steps, + //required this.ingredients, + //required this.nutrients, required this.color, - required this.category}); + required this.category, + required this.textheight}); } diff --git a/lib/utils/data.dart b/lib/utils/data.dart index fec3b8c..2aee178 100644 --- a/lib/utils/data.dart +++ b/lib/utils/data.dart @@ -14,9 +14,11 @@ class Data { id: '1', title: 'Musik', imageUrl: 'assets/images/Musik.png', + iconUrl:'assets/images/Icons/Icon_Musik.png', color: Color.fromARGB(255, 249, 171, 21), //FD4949 //Musik category: '34725c49-740b-45c5-8a51-7c742f92a621', - nutrients: [ + textheight: 86, + /* nutrients: [ Nutrients(name: 'Calories', weight: '200', percent: 0.7), Nutrients(name: 'Protein', weight: '10gm', percent: 0.5), Nutrients(name: 'Carb', weight: '50gm', percent: 0.9), @@ -31,120 +33,72 @@ class Data { ingredients: [ '2 shots espresso (a double shot)', '4 ounces milk' - ]), + ] */), Recipe( id: '2', title: 'Nachtleben', imageUrl: 'assets/images/Nachtleben.png', + iconUrl:'assets/images/Icons/Icon_Nachtleben.png', color: Color.fromARGB(255, 253, 73, 73), //FD4949 //Nachtleben category: '2d8c714e-3290-4d8c-8a95-e3b100ad8599', - nutrients: [ - Nutrients(name: 'Calories', weight: '200', percent: 0.7), - Nutrients(name: 'Protein', weight: '10gm', percent: 0.5), - Nutrients(name: 'Carb', weight: '50gm', percent: 0.9), - ], - steps: [ - 'Gather the ingredients.', - 'Pull a double shot of espresso into a cappuccino cup.', - 'Foam the milk to double its original volume.' - 'Top the espresso with foamed milk right after foaming. When initially poured, cappuccinos are only espresso and foam, but the liquid milk quickly settles out of the foam to create the (roughly) equal parts foam, steamed milk, and espresso for which cappuccino is known.', - 'Serve immediately.' - ], - ingredients: [ - '2 shots espresso (a double shot)', - '4 ounces milk' - ]), + textheight: 86, + ), Recipe( id: '3', title: 'Kunst & Kultur', - imageUrl: 'assets/images/Soziales.png', + imageUrl: 'assets/images/Kultur.png', + iconUrl:'assets/images/Icons/Icon_Kultur.png', color: Color.fromARGB(255, 80, 168, 250), //50A8FA//Kunst category: '09d1f862-2b56-47af-8ee6-3c50056e3fa2', - nutrients: [ - Nutrients(name: 'Calories', weight: '100', percent: 0.2), - Nutrients(name: 'Protein', weight: '10gm', percent: 0.7), - Nutrients(name: 'Carb', weight: '50gm', percent: 0.6), - Nutrients(name: 'Fat', weight: '10gm', percent: 0.3), - ], - steps: [ - 'Gather the ingredients.', - 'Pull a double shot of espresso into a cappuccino cup.', - 'Foam the milk to double its original volume.' - 'Top the espresso with foamed milk right after foaming. When initially poured, cappuccinos are only espresso and foam, but the liquid milk quickly settles out of the foam to create the (roughly) equal parts foam, steamed milk, and espresso for which cappuccino is known.', - 'Serve immediately.' - ], - ingredients: [ - '2 shots espresso (a double shot)', - '4 ounces milk' - ]), + textheight: 58, + ), Recipe( id: '4', title: 'Sport & Verein', imageUrl: 'assets/images/Sport.png', + iconUrl:'assets/images/Icons/Icon_Sport.png', color: Color.fromARGB(255, 80, 240, 250), //50F0FA //Sport - category: '', - nutrients: [ - Nutrients(name: 'Calories', weight: '200', percent: 0.7), - Nutrients(name: 'Protein', weight: '10gm', percent: 0.5), - Nutrients(name: 'Carb', weight: '50gm', percent: 0.9), - ], - steps: [ - 'Gather the ingredients.', - 'Pull a double shot of espresso into a cappuccino cup.', - 'Foam the milk to double its original volume.' - 'Top the espresso with foamed milk right after foaming. When initially poured, cappuccinos are only espresso and foam, but the liquid milk quickly settles out of the foam to create the (roughly) equal parts foam, steamed milk, and espresso for which cappuccino is known.', - 'Serve immediately.' - ], - ingredients: [ - '2 shots espresso (a double shot)', - '4 ounces milk' - ]), + category: '15119876-9ff0-41e5-8fe5-c3675af5e054', + textheight: 58, + ), Recipe( id: '5', title: 'Gesundheit', imageUrl: 'assets/images/Gesundheit.png', - color: Color.fromARGB(255, 130, 73, 253), //8249FD //Gesundheit - category: '', - nutrients: [ - Nutrients(name: 'Calories', weight: '200', percent: 0.7), - Nutrients(name: 'Protein', weight: '10gm', percent: 0.5), - Nutrients(name: 'Carb', weight: '50gm', percent: 0.9), - ], - steps: [ - 'Gather the ingredients.', - 'Pull a double shot of espresso into a cappuccino cup.', - 'Foam the milk to double its original volume.' - 'Top the espresso with foamed milk right after foaming. When initially poured, cappuccinos are only espresso and foam, but the liquid milk quickly settles out of the foam to create the (roughly) equal parts foam, steamed milk, and espresso for which cappuccino is known.', - 'Serve immediately.' - ], - ingredients: [ - '2 shots espresso (a double shot)', - '4 ounces milk' - ]), + iconUrl:'assets/images/Icons/Icon_Gesundheit.png', + color: Color.fromARGB(255,130, 73, 253), //8249FD //Gesundheit + category: '4ad3ac2d-04fc-4aa1-afae-17ec7bfc1714', + textheight: 86, + ), Recipe( id: '6', title: 'Essen & Trinken', imageUrl: 'assets/images/Essen.png', - color: Color.fromARGB(255, 253, 73, 73), //FD4949//Essen - category: '', - nutrients: [ - Nutrients(name: 'Calories', weight: '200', percent: 0.7), - Nutrients(name: 'Protein', weight: '10gm', percent: 0.5), - Nutrients(name: 'Carb', weight: '50gm', percent: 0.9), - ], - steps: [ - 'Gather the ingredients.', - 'Pull a double shot of espresso into a cappuccino cup.', - 'Foam the milk to double its original volume.' - 'Top the espresso with foamed milk right after foaming. When initially poured, cappuccinos are only espresso and foam, but the liquid milk quickly settles out of the foam to create the (roughly) equal parts foam, steamed milk, and espresso for which cappuccino is known.', - 'Serve immediately.' - ], - ingredients: [ - '2 shots espresso (a double shot)', - '4 ounces milk' - ]), + iconUrl:'assets/images/Icons/Icon_Essen.png', + color: Color.fromARGB(255,253, 73,73), //FD4949//Essen + category: 'ef83c4d3-228a-44e1-8a5d-8b47d2dfc351', + textheight: 58, +), +Recipe( + id: '7', + title: 'Soziales', + imageUrl: 'assets/images/Soziales.png', + iconUrl:'assets/images/Icons/Icon_Soziales.png', + color: Color.fromARGB(255,255,0,199), //FF00C7//Essen + category: '53a1782b-e07b-491d-b778-d99ef9cf57e2', + textheight: 86, + ), + Recipe( + id: '8', + title: 'Familie', + imageUrl: 'assets/images/Familie.png', + iconUrl:'assets/images/Icons/Icon_Familie.png', + color: Color.fromARGB(255,66,255,0), //42FF00//Essen //HSL 104 100 50 100 + category: '30cb3481-c425-4068-9714-adc86df85d3f', + textheight: 86, + ), ]; - + //color: Color.fromARGB(255, 255, 0, 199), //FF00C7//Soziales //color: Color.fromARGB(255, 66, 255, 0), //42FF00//Familie, diff --git a/pubspec.lock b/pubspec.lock index 85cab7d..b98a613 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -188,18 +188,18 @@ packages: dependency: transitive description: name: functions_client - sha256: e63f49cd3b41727f47b3bde284a11a4ac62839e0604f64077d4257487510e484 + sha256: b09f01be55ceec6a7a0916a0934e0c58d551292790901f15a24ae9d5654ea1f9 url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" gotrue: dependency: transitive description: name: gotrue - sha256: "8703db795511f69194fe77125a0c838bbb6befc2f95717b6e40331784a8bdecb" + sha256: f3d4b70b8df6d05be2c6d558e8887576766685918be4ef87dbb8d7e547aeb049 url: "https://pub.dev" source: hosted - version: "2.8.4" + version: "2.9.0" gtk: dependency: transitive description: @@ -444,18 +444,18 @@ packages: dependency: transitive description: name: postgrest - sha256: c4197238601c7c3103b03a4bb77f2050b17d0064bf8b968309421abdebbb7f0e + sha256: "3c6aea8d41cbb7cc33190a67fd8b0f21735a74d5871e52ada4c274aa3aa50dbb" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" realtime_client: dependency: transitive description: name: realtime_client - sha256: d897a65ee3b1b5ddc1cf606f0b83792262d38fd5679c2df7e38da29c977513da + sha256: "5d449be6dd49a413847b6da5cf48b44f7379047bc0ddc6f301d387d2ce4633b9" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.3.0" retry: dependency: transitive description: @@ -553,10 +553,10 @@ packages: dependency: transitive description: name: storage_client - sha256: "28c147c805304dbc2b762becd1fc26ee0cb621ace3732b9ae61ef979aab8b367" + sha256: "060aa8651ad2b30ce6fc30f4652317f45d21f8c6f6cc222b2430fc7f69f7d8ba" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.1.0" stream_channel: dependency: transitive description: @@ -577,18 +577,18 @@ packages: dependency: transitive description: name: supabase - sha256: "4ed1cf3298f39865c05b2d8557f92eb131a9b9af70e32e218672a0afce01a6bc" + sha256: c3a03d656110e13dd80ccabba7a5c591fece4c56ec3a21108e51b1e18d9c9a94 url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.0" supabase_flutter: dependency: "direct main" description: name: supabase_flutter - sha256: ff6ba3048fd47d831fdc0027d3efb99346d99b95becfcb406562454bd9b229c5 + sha256: "79e5067f08572c7900bc77251e6c1e0cac80c3059b5820ba2b86469b22822b75" url: "https://pub.dev" source: hosted - version: "2.6.0" + version: "2.7.0" term_glyph: dependency: transitive description: @@ -737,10 +737,10 @@ packages: dependency: transitive description: name: yet_another_json_isolate - sha256: "47ed3900e6b0e4dfe378811a4402e85b7fc126a7daa94f840fef65ea9c8e46f4" + sha256: "56155e9e0002cc51ea7112857bbcdc714d4c35e176d43e4d3ee233009ff410c9" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" sdks: dart: ">=3.4.0 <4.0.0" flutter: ">=3.22.0" diff --git a/pubspec.yaml b/pubspec.yaml index 45a16d7..e4880b2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 - supabase_flutter: ^2.5.2 + supabase_flutter: ^2.7.0 timeago: ^3.1.0 image_picker: ^1.1.2