From 9f609c87ea1cac4eafb690a7e3787fb03ceb5fcb Mon Sep 17 00:00:00 2001 From: BhaktiAgr <145220429+BhaktiAgr@users.noreply.github.com> Date: Sat, 31 Aug 2024 15:18:14 +0530 Subject: [PATCH] Create Update UI for Authentication --- Update UI for Authentication | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Update UI for Authentication diff --git a/Update UI for Authentication b/Update UI for Authentication new file mode 100644 index 00000000..55eb0005 --- /dev/null +++ b/Update UI for Authentication @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'auth_service.dart'; + +class AuthScreen extends StatelessWidget { + final AuthService _authService = AuthService(); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: Text('Sign In')), + body: Center( + child: ElevatedButton( + onPressed: () async { + User? user = await _authService.signInWithGoogle(); + if (user != null) { + Get.offNamed('/home'); // Navigate to home screen on successful login + } + }, + child: Text('Sign in with Google'), + ), + ), + ); + } +} +