lot of work on rfplus

This commit is contained in:
Kima
2024-02-28 22:37:21 +01:00
parent 55a9a41722
commit 25464eff79
8 changed files with 214 additions and 30 deletions

View File

@@ -11,8 +11,10 @@ import 'package:googleapis/calendar/v3.dart';
import 'package:google_sign_in/google_sign_in.dart';
class ThirdPartyProvider with ChangeNotifier {
late List<Event>? _googleEvents;
late List<LinkedAccount> _linkedAccounts;
// google specific
late List<Event>? _googleEvents;
late List<Calendar>? _googleCalendars;
late BuildContext _context;
@@ -21,9 +23,12 @@ class ThirdPartyProvider with ChangeNotifier {
CalendarApi.calendarEventsScope,
]);
List<Event> get googleEvents => _googleEvents ?? [];
// public
List<LinkedAccount> get linkedAccounts => _linkedAccounts;
List<Event> get googleEvents => _googleEvents ?? [];
List<Calendar> get googleCalendars => _googleCalendars ?? [];
ThirdPartyProvider({
required BuildContext context,
List<LinkedAccount>? initialLinkedAccounts,
@@ -64,6 +69,11 @@ class ThirdPartyProvider with ChangeNotifier {
return null;
}
Future<void> signOutAll() async {
await _googleSignIn.signOut();
_linkedAccounts.clear();
}
// Future<void> fetchGoogle() async {
// try {
// var httpClient = (await _googleSignIn.authenticatedClient())!;