Geht wieder mehr

This commit is contained in:
Niklas 2024-10-01 23:10:45 +02:00
parent 18257ff1d2
commit c7a9e7926b
4 changed files with 39 additions and 114 deletions

View File

@ -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<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
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']),
);
}),
);
},
),
);
}
}
*/

View File

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

View File

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

View File

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