Make Google calendar setup user friendly
This commit is contained in:
parent
7f365d6ce5
commit
ff677dc870
@ -36,7 +36,12 @@ class _AccountsPageState extends State<AccountsPage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_initializeGoogle();
|
if (googleCalendarServerClientId.trim().isEmpty) {
|
||||||
|
statusMessage =
|
||||||
|
'A Google napt\u00e1rkapcsolat m\u00e9g nincs bek\u00f6tve ebbe az appverzi\u00f3ba. A csal\u00e1dtagoknak nem kell client ID-t megadniuk; ezt egyszer, fejleszt\u0151i be\u00e1ll\u00edt\u00e1sk\u00e9nt kell az apphoz rendelni.';
|
||||||
|
} else {
|
||||||
|
_initializeGoogle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GoogleCalendarConnection? get connection =>
|
GoogleCalendarConnection? get connection =>
|
||||||
@ -116,15 +121,15 @@ class _AccountsPageState extends State<AccountsPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _ensureGoogleInitialized() async {
|
Future<void> _ensureGoogleInitialized() async {
|
||||||
if (googleCalendarServerClientId.isEmpty) {
|
final clientId = googleCalendarServerClientId.trim();
|
||||||
|
if (clientId.isEmpty) {
|
||||||
throw Exception(
|
throw Exception(
|
||||||
'Hi\u00e1nyzik a Google server client ID. Add meg buildel\u00e9skor: '
|
'A Google napt\u00e1rkapcsolat m\u00e9g nincs bek\u00f6tve ebbe az appverzi\u00f3ba.',
|
||||||
'--dart-define=GOOGLE_SERVER_CLIENT_ID=<Web application OAuth client ID>',
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await googleSignIn.initialize(
|
await googleSignIn.initialize(
|
||||||
serverClientId: googleCalendarServerClientId,
|
serverClientId: clientId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user