Flutter-Ernaehrungsapp/lib/android/android_app.dart

25 lines
722 B
Dart
Raw Normal View History

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';
import 'package:flutter/material.dart';
2023-05-31 23:22:38 +02:00
import 'package:hive/hive.dart';
import 'models/user.dart';
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');
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
2023-06-02 01:42:56 +02:00
scaffoldBackgroundColor: Colors.grey.shade200, //<-- SEE
),
2023-05-31 23:22:38 +02:00
home: box.get("USER") == null ? const OnboardingPage() : const MainPage(),
routes: {
2023-05-31 23:22:38 +02:00
'/navigation': (context) => const MainPage(),
},
);
}
}