Flutter-Ernaehrungsapp/lib/android/andoird_app.dart

26 lines
762 B
Dart
Raw Permalink 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');
print("got it ${box.get("USER")}");
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
2023-05-29 22:04:44 +02:00
scaffoldBackgroundColor: Colors.grey.shade100, //<-- 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(),
},
);
}
}