Icons added and hoepfully added to the front view

This commit is contained in:
Niklas 2024-10-05 00:21:50 +02:00
parent 47704c78e8
commit cc00cb38b7
18 changed files with 170 additions and 287 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
assets/images/Kultur.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -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(

View File

@ -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 <Widget>[
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: <Widget>[
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<String> 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<String>? 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>? 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();

View File

@ -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 {
],
),
),
),
), */
),
);
},

View File

@ -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(

View File

@ -8,18 +8,21 @@ class Nutrients {
}
class Recipe {
String id, imageUrl, title,category;
String id, imageUrl, iconUrl,title,category;
Color color;
List<String> steps;
List<String> ingredients;
List<Nutrients> nutrients;
double? textheight;
//List<String> steps;
//List<String> ingredients;
//List<Nutrients> 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});
}

View File

@ -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,

View File

@ -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"

View File

@ -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