Last active
August 31, 2020 07:41
-
-
Save hamza39460/61653df6e6868c4faeb243c0876f6b30 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
log("Unable to add event in google calendar"); | |
} | |
}); | |
}); | |
} catch (e) { | |
log('Error creating event $e'); | |
} | |
} | |
void prompt(String url) async { | |
if (await canLaunch(url)) { | |
await launch(url); | |
} else { | |
throw 'Could not launch $url'; | |
} | |
} |
when do i use function "prompt() " ?
how i get the "url" ?
when do i use function "prompt() " ?
how i get the "url" ?
I just updated the gist. Sorry I forgot to add it earlier.
its working, thanks..., but it always prompt for access calendar, how to use without open browser or hardcode credential maybe?
thank you for the answer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
can i see the full code, please...