Skip to content

Commit

Permalink
Use experimental flag for push notifications (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo authored May 31, 2024
1 parent 459d8f2 commit 22a9bfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/settings/pages/debug_settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class _DebugSettingsPageState extends State<DebugSettingsPage> {
onTap: null,
),
),
if (!kIsWeb && Platform.isAndroid && kDebugMode) ...[
if (!kIsWeb && Platform.isAndroid && enableExperimentalFeatures) ...[
const SliverToBoxAdapter(child: SizedBox(height: 8.0)),
SliverToBoxAdapter(
child: SettingsListTile(
Expand Down Expand Up @@ -333,7 +333,7 @@ class _DebugSettingsPageState extends State<DebugSettingsPage> {
: null,
),
),
if (kDebugMode) ...[
if (enableExperimentalFeatures) ...[
SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 6.0, bottom: 6.0),
Expand Down
9 changes: 7 additions & 2 deletions lib/settings/pages/general_settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ class _GeneralSettingsPageState extends State<GeneralSettingsPage> with SingleTi
String? unifiedPushConnectedDistributorApp;
int? unifiedPushAvailableDistributorApps;

/// Enable experimental features in the app.
bool enableExperimentalFeatures = false;

Future<void> setPreferences(attribute, value) async {
final prefs = (await UserPreferences.instance).sharedPreferences;

Expand Down Expand Up @@ -293,6 +296,8 @@ class _GeneralSettingsPageState extends State<GeneralSettingsPage> with SingleTi
controller.text = pushNotificationServer;

accounts = accountList;

enableExperimentalFeatures = prefs.getBool(LocalSettings.enableExperimentalFeatures.name) ?? false;
});
}

Expand Down Expand Up @@ -809,7 +814,7 @@ class _GeneralSettingsPageState extends State<GeneralSettingsPage> with SingleTi
payload: NotificationType.local,
softWrap: true,
),
if (kDebugMode)
if (enableExperimentalFeatures)
ListPickerItem(
icon: Icons.notifications_active_rounded,
label: l10n.useUnifiedPushNotifications,
Expand Down Expand Up @@ -845,7 +850,7 @@ class _GeneralSettingsPageState extends State<GeneralSettingsPage> with SingleTi
payload: NotificationType.none,
softWrap: true,
),
if (kDebugMode)
if (enableExperimentalFeatures)
ListPickerItem(
icon: Icons.notifications_active_rounded,
label: l10n.useApplePushNotifications,
Expand Down

0 comments on commit 22a9bfd

Please sign in to comment.