ELEC60013-ES-CW1/App/lib/main.dart

36 lines
1 KiB
Dart
Raw Normal View History

2022-02-11 18:14:40 +00:00
import 'package:firebase_core/firebase_core.dart';
2022-02-09 15:09:03 +00:00
import 'package:flutter/material.dart';
import 'package:leg_barkr_app/view/home.dart';
2022-02-09 18:29:27 +00:00
import 'package:flutter/services.dart';
2022-02-11 18:14:40 +00:00
import 'package:leg_barkr_app/view/auth/login_form.dart';
import 'package:leg_barkr_app/view/auth/register_form.dart';
import 'firebase_options.dart';
2022-02-09 15:09:03 +00:00
2022-02-11 18:14:40 +00:00
void main() async {
2022-02-09 18:29:27 +00:00
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.black12));
2022-02-11 18:14:40 +00:00
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
runApp(Main());
2022-02-09 15:09:03 +00:00
}
2022-02-09 15:50:52 +00:00
class Main extends StatelessWidget {
const Main({Key? key}) : super(key: key);
2022-02-09 15:09:03 +00:00
@override
Widget build(BuildContext context) {
return MaterialApp(
2022-02-09 15:50:52 +00:00
theme: ThemeData.light(),
2022-02-11 18:14:40 +00:00
//home: HomeScreen(),
initialRoute: '/',
routes: {
'/': (context) => const HomeScreen(),
'/login': (context) => const LoginForm(),
'/register': (context) => const RegisterForm()
}
2022-02-09 15:09:03 +00:00
);
}
}