This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Event event = Event(); // Create object of event | |
event.summary = summaryText; //Setting summary of object | |
EventDateTime start = new EventDateTime(); //Setting start time | |
start.dateTime = startTime; | |
start.timeZone = "GMT+05:00"; | |
event.start = start; | |
EventDateTime end = new EventDateTime(); //setting end time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insertEvent(event){ | |
try { | |
clientViaUserConsent(_clientID, _scopes, prompt).then((AuthClient client){ | |
var calendar = CalendarApi(client); | |
String calendarId = "primary"; | |
calendar.events.insert(event,calendarId).then((value) { | |
print("ADDEDDD_________________${value.status}"); | |
if (value.status == "confirmed") { | |
log('Event added in google calendar'); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class APIManager { | |
// Self Instance since we are creating a Singleton Class | |
static final APIManager _shared = APIManager._internal(); | |
// Private Constructor | |
APIManager._internal(); | |
// Factory Constructor | |
factory APIManager() { | |
return _shared; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum DataState { | |
Uninitialized, | |
Refreshing, | |
Initial_Fetching, | |
More_Fetching, | |
Fetched, | |
No_More_Data, | |
Error | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:http/http.dart' as http; | |
import 'dart:io'; | |
Future<String> getIdToken({bool? force}) async { | |
// fetch update token | |
return "abc*******"; | |
} | |
Future<void> main() async { | |
final client = http.Client(); | |
String token = await getIdToken(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
class CountController extends StateNotifier<AsyncValue<int>> { | |
CountController() : super(const AsyncData<int>(0)) { | |
state = const AsyncLoading<int>(); | |
} |
OlderNewer