Skip to content

Commit

Permalink
Remove unnecessary logs
Browse files Browse the repository at this point in the history
  • Loading branch information
MillerAdulu committed Aug 28, 2024
1 parent c65125a commit 9f0a56c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
16 changes: 5 additions & 11 deletions lib/common/repository/auth_repository.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -22,22 +21,18 @@ class AuthRepository {
Future<String> 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');
Expand All @@ -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;
}
}
Expand All @@ -75,8 +69,8 @@ class AuthRepository {

Future<void> logOut() async {
try {
await _networkUtil.postReq('/logout');
await _googleSignIn.signOut();
await _networkUtil.postReq('/logout');
} catch (e) {
rethrow;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/features/home/widgets/sessions_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class _SessionsCardState extends State<SessionsCard> {
),
const SizedBox(height: 16),
SizedBox(
height: size.height * .3,
height: size.height * .33,
child: BlocBuilder<FetchSessionsCubit, FetchSessionsState>(
builder: (context, state) => state.maybeWhen(
loaded: (sessions, _) => ListView.builder(
Expand Down Expand Up @@ -153,7 +153,7 @@ class _SessionsCardState extends State<SessionsCard> {
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: AutoSizeText(
child: Text(
session.title,
maxLines: 2,
style: TextStyle(
Expand Down

0 comments on commit 9f0a56c

Please sign in to comment.