-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.dart
25 lines (22 loc) · 880 Bytes
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:hackhound/profile/profile/edit%20profile/user_prefs.dart';
import 'package:hackhound/profile/profile/profile.dart';
import 'package:hackhound/screens/homepage.dart';
import 'package:hackhound/screens/sign_in.dart';
import 'package:shared_preferences/shared_preferences.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await UserPreferences.init();
await Firebase.initializeApp();
SharedPreferences prefs = await SharedPreferences.getInstance();
var email = prefs.getString('email');
var pass = prefs.getString('email');
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: Colors.indigo),
home: email == null && pass == null ? SignInScreen() : HomePage(),
),
);
}