Make Google calendar setup user friendly
This commit is contained in:
parent
7f365d6ce5
commit
ff677dc870
@ -36,8 +36,13 @@ class _AccountsPageState extends State<AccountsPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
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 =>
|
||||
widget.connections.isEmpty ? null : widget.connections.first;
|
||||
@ -116,15 +121,15 @@ class _AccountsPageState extends State<AccountsPage> {
|
||||
}
|
||||
|
||||
Future<void> _ensureGoogleInitialized() async {
|
||||
if (googleCalendarServerClientId.isEmpty) {
|
||||
final clientId = googleCalendarServerClientId.trim();
|
||||
if (clientId.isEmpty) {
|
||||
throw Exception(
|
||||
'Hi\u00e1nyzik a Google server client ID. Add meg buildel\u00e9skor: '
|
||||
'--dart-define=GOOGLE_SERVER_CLIENT_ID=<Web application OAuth client ID>',
|
||||
'A Google napt\u00e1rkapcsolat m\u00e9g nincs bek\u00f6tve ebbe az appverzi\u00f3ba.',
|
||||
);
|
||||
}
|
||||
|
||||
await googleSignIn.initialize(
|
||||
serverClientId: googleCalendarServerClientId,
|
||||
serverClientId: clientId,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user