From c7a9e7926b8ecb7586cf553e4b47df140f14bd5e Mon Sep 17 00:00:00 2001 From: Niklas Date: Tue, 1 Oct 2024 23:10:45 +0200 Subject: [PATCH] Geht wieder mehr --- lib/main.dart | 55 -------------------- lib/screens/detail_widget.dart | 11 +--- lib/screens/home.dart | 13 ++--- lib/screens/subheader_Datepicker.dart | 74 ++++++++++++--------------- 4 files changed, 39 insertions(+), 114 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index a1cacc3..1abdbfa 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -45,59 +45,4 @@ class MyApp extends StatelessWidget { ); } } -/* class MyApp extends StatelessWidget { - const MyApp({super.key}); - @override - Widget build(BuildContext context) { - return const MaterialApp( - title: 'Events', - home: HomePage(), - ); - } -} - -class HomePage extends StatefulWidget { - const HomePage({super.key}); - - @override - State createState() => _HomePageState(); -} - -class _HomePageState extends State { - final _future = Supabase.instance.client - .from('events') - .select(); - - @override - Widget build(BuildContext context) { - return Scaffold( - body: FutureBuilder( - future: _future, - builder: (context, snapshot) { - if (!snapshot.hasData) { - return const Center(child: CircularProgressIndicator()); - } - final events = snapshot.data!; - return ListView.builder( - itemCount: events.length, - itemBuilder: ((context, index) { - final event = events[index]; - return ListTile( - title: Text(event['name']), - subtitle: Text(event['description']), - ); - }), - ); - }, - ), - ); - } -} - - - - - - - */ diff --git a/lib/screens/detail_widget.dart b/lib/screens/detail_widget.dart index a13b46c..9c13bab 100644 --- a/lib/screens/detail_widget.dart +++ b/lib/screens/detail_widget.dart @@ -48,7 +48,7 @@ class Frame28 extends StatelessWidget { SizedBox(height: 10), Text( 'Heute', style: TextStyle(color: Color(0xFF171717), fontSize: 12, fontFamily: 'Inter', fontWeight: FontWeight.w600, height: 0,),), //Kurze Zwischenbereich zum trennen - SizedBox(height: 4), + //SizedBox(height: 4), //EventCard2Section(), /* const SizedBox(height: 20), EventCard2Section(), @@ -57,14 +57,7 @@ class Frame28 extends StatelessWidget { //Kurze Zwischenbereich zum trennen const SizedBox(height: 4), EventCard2Section(), - const SizedBox(height: 20), - EventCard2Section(), - const SizedBox(height: 20), - EventCard2Section(), - const SizedBox(height: 20), - EventCard2Section(), - const SizedBox(height: 20), - EventCard2Section(), */ + const SizedBox(height: 20), */ ], ), ), diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 8469677..ff2f407 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -22,8 +22,10 @@ class HomePage extends StatelessWidget { final response = await supabase .from("events") //.innerJoin('event_category', 'events.id = event_category.event_id') - .select('id,name,description,detail,subheader,location(name),time(start_date),event_category(*), event_category!inner(events_id)') + .select('id,name,description,detail,subheader,location(name),time(event_id,start_date),event_category!inner(event_id)') .eq('event_category.category_id',category); + //.gte('time.start_date', DateTime.now().toIso8601String().split('T')[0]) // Beginn des heutigen Tages + //.lt('time.start_date', DateTime.now().add(Duration(days: 1)).toIso8601String().split('T')[0]); // Morgen; //select('id, name, cities(id, name)') //find all events mit Ort und zusatzinfos die die Kathegorie haben welche ausgewählt wurde am heutigen Tag dann kommender Tag usw. final test = response[0]['time'][0]['start_date']; @@ -89,14 +91,7 @@ class HomePage extends StatelessWidget { ))); }, child: Card( - color: Data.recipes[index].color,//Color.fromARGB(255, 249, 171, 21), - //color: Color.fromARGB(255, 253, 73, 73), //FD4949 //Nachtleben - //color: Color.fromARGB(255, 80, 168, 250), //50A8FA//Kunst - //color: Color.fromARGB(255, 80, 240, 250), //50F0FA //Sport - //color: Color.fromARGB(255, 130, 73, 253), //8249FD //Gesundheit - //color: Color.fromARGB(255, 253, 73, 73), //FD4949//Essen - //color: Color.fromARGB(255, 255, 0, 199), //FF00C7//Soziales - //color: Color.fromARGB(255, 66, 255, 0), //42FF00//Familie + color: Data.recipes[index].color, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(6.0), ), diff --git a/lib/screens/subheader_Datepicker.dart b/lib/screens/subheader_Datepicker.dart index 1f7e450..024addd 100644 --- a/lib/screens/subheader_Datepicker.dart +++ b/lib/screens/subheader_Datepicker.dart @@ -163,7 +163,9 @@ class EventCard2Section extends StatelessWidget { return Container( width: 379, height: 120, + margin: new EdgeInsets.fromLTRB(20.0, 0, 0.0, 8.0), child: Stack( + children: [ Positioned( left: 0, @@ -200,41 +202,31 @@ class EventCard2Section extends StatelessWidget { width: 130, // Breite des Bildes ), ), - Positioned( - right: 30, - top: 12, - child: Container( - width: 32, - height: 32, - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: 32, - height: 32, - decoration: BoxDecoration( - color: Color.fromARGB( - 196, 171, 170, 170), // Hintergrundfarbe des Buttons - shape: BoxShape.circle, // Runde Form - ), - child: IconButton( - padding: EdgeInsets.zero, // Entfernt zusätzlichen Abstand - icon: Icon(Icons.bookmark_border_outlined), - color: Colors.white, // Icon-Farbe - iconSize: 16, // Größe des Icons - onPressed: () { - // Aktion beim Drücken des Buttons - }, - ), - ), - ], - ), - ), + Positioned( // Bookmark Button + left: 320, + top: 12, + child: Container( + width: 32, + height: 32, + decoration: BoxDecoration( + color: Color.fromARGB(196, 171, 170, 170), // Hintergrundfarbe des Buttons + shape: BoxShape.circle, // Runde Form ), - Positioned( - left: 15, + child: IconButton( + padding: EdgeInsets.zero, // Entfernt zusätzlichen Abstand + icon: Icon(Icons.bookmark_border_outlined), + color: Colors.white, // Icon-Farbe + iconSize: 16, // Größe des Icons + onPressed: () { + // Aktion beim Drücken des Buttons + }, + ), + + ), + ), + + Positioned( //Location + left: 10, top: 14, child: SizedBox( //width: 55, @@ -251,7 +243,7 @@ class EventCard2Section extends StatelessWidget { ), ), ), - Positioned( + Positioned( //Title left: 92, top: 14, child: Text( @@ -266,8 +258,8 @@ class EventCard2Section extends StatelessWidget { ), ), - Positioned( - left: 15, + Positioned(//Description + left: 10, top: 90, child: SizedBox( //width: 196, @@ -284,8 +276,8 @@ class EventCard2Section extends StatelessWidget { ), ), ), - Positioned( - left: 15, + Positioned( //Start time + left: 10, top: 70, child: SizedBox( width: 72.79, @@ -302,8 +294,8 @@ class EventCard2Section extends StatelessWidget { ), ), ])))), - Positioned( - left: 15, + Positioned( //Text Beginn + left: 10, top: 45, child: SizedBox( width: 72.79,