mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
fix notification toggle
This commit is contained in:
@ -23,7 +23,7 @@ class _NotificationDialogState extends State<NotificationDialog> {
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 798,
|
||||
width: 660,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
@ -70,8 +70,11 @@ class _NotificationDialogState extends State<NotificationDialog> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ToggleWidget(
|
||||
value: true,
|
||||
SizedBox(
|
||||
width: 170,
|
||||
height: 135,
|
||||
child: ToggleWidget(
|
||||
value: isLowBatteryNotificationEnabled,
|
||||
code: 'notification',
|
||||
deviceId: '',
|
||||
label: 'Low Battery',
|
||||
@ -82,8 +85,12 @@ class _NotificationDialogState extends State<NotificationDialog> {
|
||||
},
|
||||
icon: '-1',
|
||||
),
|
||||
ToggleWidget(
|
||||
value: true,
|
||||
),
|
||||
SizedBox(
|
||||
width: 170,
|
||||
height: 135,
|
||||
child: ToggleWidget(
|
||||
value: isClosingRemindersEnabled,
|
||||
code: 'notification',
|
||||
deviceId: '',
|
||||
label: 'Closing\nReminders',
|
||||
@ -94,8 +101,12 @@ class _NotificationDialogState extends State<NotificationDialog> {
|
||||
},
|
||||
icon: '-1',
|
||||
),
|
||||
ToggleWidget(
|
||||
value: true,
|
||||
),
|
||||
SizedBox(
|
||||
width: 170,
|
||||
height: 135,
|
||||
child: ToggleWidget(
|
||||
value: isDoorAlarmEnabled,
|
||||
code: 'notification',
|
||||
deviceId: '',
|
||||
label: 'Door Alarm',
|
||||
@ -106,6 +117,7 @@ class _NotificationDialogState extends State<NotificationDialog> {
|
||||
},
|
||||
icon: '-1',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
@ -6,12 +6,13 @@ class WaterLeakNotificationDialog extends StatefulWidget {
|
||||
const WaterLeakNotificationDialog({super.key});
|
||||
|
||||
@override
|
||||
State<WaterLeakNotificationDialog> createState() => _WaterLeakNotificationDialogState();
|
||||
State<WaterLeakNotificationDialog> createState() => _NotificationDialogState();
|
||||
}
|
||||
|
||||
class _WaterLeakNotificationDialogState extends State<WaterLeakNotificationDialog> {
|
||||
class _NotificationDialogState extends State<WaterLeakNotificationDialog> {
|
||||
bool isLowBatteryNotificationEnabled = true;
|
||||
bool isWaterLeakageNotificationEnabled = true;
|
||||
bool isClosingRemindersEnabled = true;
|
||||
bool isWaterLeakage = true;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -22,7 +23,7 @@ class _WaterLeakNotificationDialogState extends State<WaterLeakNotificationDialo
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: SizedBox(
|
||||
width: 400,
|
||||
width: 560,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
@ -69,8 +70,11 @@ class _WaterLeakNotificationDialogState extends State<WaterLeakNotificationDialo
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
ToggleWidget(
|
||||
value: true,
|
||||
SizedBox(
|
||||
width: 170,
|
||||
height: 135,
|
||||
child: ToggleWidget(
|
||||
value: isLowBatteryNotificationEnabled,
|
||||
code: 'notification',
|
||||
deviceId: '',
|
||||
label: 'Low Battery',
|
||||
@ -81,18 +85,23 @@ class _WaterLeakNotificationDialogState extends State<WaterLeakNotificationDialo
|
||||
},
|
||||
icon: '-1',
|
||||
),
|
||||
ToggleWidget(
|
||||
value: true,
|
||||
),
|
||||
SizedBox(
|
||||
width: 170,
|
||||
height: 135,
|
||||
child: ToggleWidget(
|
||||
value: isWaterLeakage,
|
||||
code: 'notification',
|
||||
deviceId: '',
|
||||
label: 'Water Leakage',
|
||||
onChange: (v) {
|
||||
setState(() {
|
||||
isWaterLeakageNotificationEnabled = v;
|
||||
isWaterLeakage = v;
|
||||
});
|
||||
},
|
||||
icon: '-1',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
Reference in New Issue
Block a user