File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -357,6 +357,7 @@ Push Section:
357357- Section title: "Push" with info icon for tooltip
358358- Push Subscription ID display (readonly)
359359- Enabled toggle switch (controls optIn/optOut)
360+ - Disabled when notification permission is NOT granted
360361- Notification permission is automatically requested when home screen loads
361362- PROMPT PUSH button:
362363 - Only visible when notification permission is NOT granted (fallback if user denied)
@@ -799,6 +800,7 @@ Notification permission is automatically requested when the home screen loads:
799800- This ensures prompt appears after user sees the app UI
800801- PROMPT PUSH button remains as fallback if user initially denied
801802- Button hidden once permission is granted
803+ - Keep Push "Enabled" toggle disabled until permission is granted
802804```
803805
804806---
Original file line number Diff line number Diff line change @@ -49,7 +49,9 @@ class PushSection extends StatelessWidget {
4949 ToggleRow (
5050 label: 'Enabled' ,
5151 value: vm.pushEnabled,
52- onChanged: vm.togglePush,
52+ onChanged: vm.hasNotificationPermission
53+ ? vm.togglePush
54+ : null ,
5355 ),
5456 ],
5557 ),
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ class ToggleRow extends StatelessWidget {
44 final String label;
55 final String ? description;
66 final bool value;
7- final ValueChanged <bool > onChanged;
7+ final ValueChanged <bool >? onChanged;
88
99 const ToggleRow ({
1010 super .key,
1111 required this .label,
1212 this .description,
1313 required this .value,
14- required this .onChanged,
14+ this .onChanged,
1515 });
1616
1717 @override
You can’t perform that action at this time.
0 commit comments