Flutter-Ernaehrungsapp/lib/app.dart

26 lines
851 B
Dart
Raw Normal View History

2023-06-25 14:43:07 +02:00
import 'package:ernaehrung/pages/nav_pages/main_page.dart';
import 'package:ernaehrung/pages/user_data_form/initial_user_data_form.dart';
import 'package:flutter/material.dart';
2023-06-25 14:43:07 +02:00
import 'package:flutter_dotenv/flutter_dotenv.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-06-25 14:43:07 +02:00
final box = Hive.box<User>(dotenv.env['USER_BOX'] ?? 'USER');
return MaterialApp(
debugShowCheckedModeBanner: false,
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(),
},
);
}
}