email y contraseña registro
This commit is contained in:
+10
-16
@@ -1,4 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||
import 'package:prosappco/src/provider/google_sign.dart';
|
||||
import 'package:prosappco/src/screens/login.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
@@ -18,12 +20,13 @@ void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
).then((value) => Get.put(AuthenticationRepository()));
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
final FirebaseAuth _auth = FirebaseAuth.instance;
|
||||
final GoogleSignIn googleSignIn = GoogleSignIn();
|
||||
|
||||
Future<UserCredential> signInWithGoogle() async {
|
||||
final GoogleSignInAccount? googleSignInAccount = await googleSignIn.signIn();
|
||||
final GoogleSignInAuthentication googleSignInAuthentication =
|
||||
@@ -42,20 +45,11 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (_auth.currentUser == null) {
|
||||
return MaterialApp(
|
||||
theme: ThemeData(fontFamily: 'Poppins'),
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'ProsApp',
|
||||
home: LoginScreen(),
|
||||
);
|
||||
} else {
|
||||
return MaterialApp(
|
||||
theme: ThemeData(fontFamily: 'Poppins'),
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'ProsApp',
|
||||
home: WelcomeScreen(),
|
||||
);
|
||||
}
|
||||
return GetMaterialApp(
|
||||
theme: ThemeData(fontFamily: 'Poppins'),
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'ProsApp',
|
||||
home: const LoginScreen(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user