Make Google calendar setup user friendly

This commit is contained in:
zsolt 2026-08-13 01:24:03 +02:00
parent 7f365d6ce5
commit ff677dc870

View File

@ -36,7 +36,12 @@ class _AccountsPageState extends State<AccountsPage> {
@override
void 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 =>
@ -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,
);
}