Files
Casha/lib/shared/services/google_auth_service.dart
2026-06-29 20:43:13 +03:00

25 lines
591 B
Dart

import 'dart:async';
import 'package:google_sign_in/google_sign_in.dart';
class GoogleAuthService {
final GoogleSignIn _googleSignIn;
GoogleAuthService() : _googleSignIn = GoogleSignIn(scopes: [
'email',
'https://www.googleapis.com/auth/drive.appdata',
]);
GoogleSignInAccount? get currentUser => _googleSignIn.currentUser;
Stream<GoogleSignInAccount?> get onCurrentUserChanged =>
_googleSignIn.onCurrentUserChanged;
Future<void> signIn() async {
await _googleSignIn.signIn();
}
Future<void> signOut() async {
await _googleSignIn.signOut();
}
}