From 9f0a56ca0ece336b4199cafc603471469fc84b70 Mon Sep 17 00:00:00 2001 From: Miller Adulu Date: Wed, 28 Aug 2024 13:41:56 +0300 Subject: [PATCH] Remove unnecessary logs --- lib/common/repository/auth_repository.dart | 16 +++++----------- lib/features/home/widgets/sessions_card.dart | 4 ++-- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/common/repository/auth_repository.dart b/lib/common/repository/auth_repository.dart index 5028fc6..9c90b58 100644 --- a/lib/common/repository/auth_repository.dart +++ b/lib/common/repository/auth_repository.dart @@ -1,7 +1,6 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:fluttercon/common/data/models/models.dart'; import 'package:fluttercon/common/utils/network.dart'; -import 'package:fluttercon/firebase_options.dart'; import 'package:google_sign_in/google_sign_in.dart'; import 'package:injectable/injectable.dart'; import 'package:logger/logger.dart'; @@ -22,22 +21,18 @@ class AuthRepository { Future signInWithGoogle() async { try { final googleSignInAccount = await _googleSignIn.signIn(); - Logger().f(googleSignInAccount); + final googleSignInAuthentication = await googleSignInAccount?.authentication; - Logger().f(googleSignInAuthentication); final AuthCredential credential = GoogleAuthProvider.credential( idToken: googleSignInAuthentication?.idToken, accessToken: googleSignInAuthentication?.accessToken, ); - Logger().f(credential); final authResult = await _auth.signInWithCredential(credential); - Logger().f(authResult); final user = authResult.user; - Logger().f(user); if (user != null) { assert(!user.isAnonymous, 'User must not be anonymous'); @@ -48,10 +43,9 @@ class AuthRepository { } else { throw Failure(message: 'An unexpected error occured'); } - } catch (e, st) { - Logger().f(DefaultFirebaseOptions.currentPlatform); - Logger().f(st); - Logger().e(e); + } catch (error, stackTrace) { + Logger().f(stackTrace); + Logger().e(error); rethrow; } } @@ -75,8 +69,8 @@ class AuthRepository { Future logOut() async { try { - await _networkUtil.postReq('/logout'); await _googleSignIn.signOut(); + await _networkUtil.postReq('/logout'); } catch (e) { rethrow; } diff --git a/lib/features/home/widgets/sessions_card.dart b/lib/features/home/widgets/sessions_card.dart index 3c5d952..5ac6c77 100644 --- a/lib/features/home/widgets/sessions_card.dart +++ b/lib/features/home/widgets/sessions_card.dart @@ -102,7 +102,7 @@ class _SessionsCardState extends State { ), const SizedBox(height: 16), SizedBox( - height: size.height * .3, + height: size.height * .33, child: BlocBuilder( builder: (context, state) => state.maybeWhen( loaded: (sessions, _) => ListView.builder( @@ -153,7 +153,7 @@ class _SessionsCardState extends State { const SizedBox(height: 16), Padding( padding: const EdgeInsets.symmetric(horizontal: 16), - child: AutoSizeText( + child: Text( session.title, maxLines: 2, style: TextStyle(