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,8 +36,13 @@ class _AccountsPageState extends State<AccountsPage> {
@override @override
void initState() { void initState() {
super.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(); _initializeGoogle();
} }
}
GoogleCalendarConnection? get connection => GoogleCalendarConnection? get connection =>
widget.connections.isEmpty ? null : widget.connections.first; widget.connections.isEmpty ? null : widget.connections.first;
@ -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,
); );
} }