Added a exception handler if the old event's doesn't have a main category. And figuring out why I don't get a responsive frontend ... with the categorie cards.

This commit is contained in:
Niklas 2024-10-27 13:04:37 +01:00
parent 9998a90fc0
commit 585df15d2e
2 changed files with 9 additions and 2 deletions

View File

@ -172,7 +172,11 @@ class Frame28 extends StatelessWidget {
start_time:
extractTime24h(events[index]['time'][0]['start_date']),
color: extractColor(events[index]['main_category_id']),
color: events[index]['main_category_id'] != null
? extractColor(events[index]['main_category_id'])
: color,
//extractColor(events[index]['main_category_id']),
// oder ein beliebiger Standardwert
screen_size: screen_size,
);
},

View File

@ -103,8 +103,11 @@ class _HomePage extends State<HomePage> {
//single_categories.updateCategoryAmount('Ingolstadt');
/*24 is for notification bar on Android*/
//final double itemHeight = (size.height - kToolbarHeight - 270) / 4; 290 for iOs 230 android
final double itemHeight = (size.height - 230-90) / 4;
final double itemHeight = (size.height - 240-90) / 4;
final double itemWidth = (size.width-40)/ 2;
// Verfügbarer Bereich auf dem Bildschirm
final screenWidth = MediaQuery.of(context).size.width;
final screenHeight = MediaQuery.of(context).size.height;
MediaQueryData queryData;
queryData = MediaQuery.of(context);