From afb9e5ee2cb815875bb87c041cc3c558821483c1 Mon Sep 17 00:00:00 2001 From: Kima Date: Fri, 12 Apr 2024 21:28:15 +0200 Subject: [PATCH] only show relevant calendar sync options --- .../settings/submenu/calendar_sync.dart | 136 +++++++++--------- 1 file changed, 70 insertions(+), 66 deletions(-) diff --git a/lib/ui/mobile/settings/submenu/calendar_sync.dart b/lib/ui/mobile/settings/submenu/calendar_sync.dart index 0cfee61..edc0118 100644 --- a/lib/ui/mobile/settings/submenu/calendar_sync.dart +++ b/lib/ui/mobile/settings/submenu/calendar_sync.dart @@ -1,5 +1,7 @@ // ignore_for_file: use_build_context_synchronously +import 'dart:io'; + import 'package:refilc/api/providers/user_provider.dart'; import 'package:refilc/models/linked_account.dart'; import 'package:refilc/models/settings.dart'; @@ -196,77 +198,79 @@ class CalendarSyncScreenState extends State if (thirdPartyProvider.linkedAccounts.isEmpty) Column( children: [ - SplittedPanel( - title: Text('choose_account'.i18n), - padding: EdgeInsets.zero, - cardPadding: const EdgeInsets.all(4.0), - isSeparated: true, - children: [ - PanelButton( - onPressed: () async { - await Provider.of(context, - listen: false) - .googleSignIn(); + if (Platform.isAndroid) + SplittedPanel( + title: Text('choose_account'.i18n), + padding: EdgeInsets.zero, + cardPadding: const EdgeInsets.all(4.0), + isSeparated: true, + children: [ + PanelButton( + onPressed: () async { + await Provider.of(context, + listen: false) + .googleSignIn(); - setState(() {}); - }, - title: Text( - 'Google', - style: TextStyle( - color: AppColors.of(context) - .text - .withOpacity(.95), + setState(() {}); + }, + title: Text( + 'Google', + style: TextStyle( + color: AppColors.of(context) + .text + .withOpacity(.95), + ), + ), + leading: Image.asset( + 'assets/images/ext_logo/google.png', + width: 24.0, + height: 24.0, + ), + borderRadius: const BorderRadius.vertical( + top: Radius.circular(12), + bottom: Radius.circular(12), ), ), - leading: Image.asset( - 'assets/images/ext_logo/google.png', - width: 24.0, - height: 24.0, - ), - borderRadius: const BorderRadius.vertical( - top: Radius.circular(12), - bottom: Radius.circular(12), - ), - ), - ], - ), - const SizedBox( - height: 9.0, - ), - SplittedPanel( - padding: EdgeInsets.zero, - cardPadding: const EdgeInsets.all(4.0), - isSeparated: true, - children: [ - PanelButton( - onPressed: null, - title: Text( - 'Apple', - style: TextStyle( - color: AppColors.of(context) - .text - .withOpacity(.55), - decoration: TextDecoration.lineThrough, + ], + ), + // const SizedBox( + // height: 9.0, + // ), + if (Platform.isIOS) + SplittedPanel( + padding: EdgeInsets.zero, + cardPadding: const EdgeInsets.all(4.0), + isSeparated: true, + children: [ + PanelButton( + onPressed: null, + title: Text( + 'Apple', + style: TextStyle( + color: AppColors.of(context) + .text + .withOpacity(.55), + decoration: TextDecoration.lineThrough, + ), + ), + leading: Image.asset( + 'assets/images/ext_logo/apple.png', + width: 24.0, + height: 24.0, + ), + trailing: Text( + 'soon'.i18n, + style: const TextStyle( + fontStyle: FontStyle.italic, + fontSize: 14.0), + ), + borderRadius: const BorderRadius.vertical( + top: Radius.circular(12), + bottom: Radius.circular(12), ), ), - leading: Image.asset( - 'assets/images/ext_logo/apple.png', - width: 24.0, - height: 24.0, - ), - trailing: Text( - 'soon'.i18n, - style: const TextStyle( - fontStyle: FontStyle.italic, - fontSize: 14.0), - ), - borderRadius: const BorderRadius.vertical( - top: Radius.circular(12), - bottom: Radius.circular(12), - ), - ), - ], - ), + ], + ), ], ),