email y contraseña registro

This commit is contained in:
Juan Felipe Duarte
2023-03-29 16:19:19 -05:00
parent 4727967a57
commit b80c99469c
7 changed files with 250 additions and 113 deletions
+10 -16
View File
@@ -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(),
);
}
}