2023-05-12 18:12:28 +02:00
|
|
|
import 'package:ernaehrung/android/pages/nav_pages/main_page.dart';
|
2023-05-31 23:22:38 +02:00
|
|
|
import 'package:ernaehrung/android/pages/welcome.dart';
|
2023-05-12 18:12:28 +02:00
|
|
|
import 'package:flutter/material.dart';
|
2023-05-31 23:22:38 +02:00
|
|
|
import 'package:hive/hive.dart';
|
|
|
|
|
|
|
|
import 'models/user.dart';
|
2023-05-12 18:12:28 +02:00
|
|
|
|
|
|
|
class AndroidApp extends StatelessWidget {
|
|
|
|
const AndroidApp({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-05-31 23:22:38 +02:00
|
|
|
final box = Hive.box<User>('USER_BOX');
|
2023-05-12 18:12:28 +02:00
|
|
|
return MaterialApp(
|
|
|
|
title: 'Flutter Demo',
|
|
|
|
theme: ThemeData(
|
2023-06-02 01:42:56 +02:00
|
|
|
scaffoldBackgroundColor: Colors.grey.shade200, //<-- SEE
|
2023-05-12 18:12:28 +02:00
|
|
|
),
|
2023-05-31 23:22:38 +02:00
|
|
|
home: box.get("USER") == null ? const OnboardingPage() : const MainPage(),
|
2023-05-12 18:12:28 +02:00
|
|
|
routes: {
|
2023-05-31 23:22:38 +02:00
|
|
|
'/navigation': (context) => const MainPage(),
|
2023-05-12 18:12:28 +02:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|