mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
117 lines
3.9 KiB
Dart
117 lines
3.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_web/pages/device_managment/shared/toggle_widget.dart';
|
|
import 'package:syncrow_web/utils/color_manager.dart';
|
|
|
|
class SosNotificationDialog extends StatefulWidget {
|
|
const SosNotificationDialog({super.key});
|
|
|
|
@override
|
|
State<SosNotificationDialog> createState() => _NotificationDialogState();
|
|
}
|
|
|
|
class _NotificationDialogState extends State<SosNotificationDialog> {
|
|
bool isLowBatteryNotificationEnabled = true;
|
|
bool isSosAlarmEnabled = true;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Dialog(
|
|
backgroundColor: Colors.white,
|
|
insetPadding: const EdgeInsets.all(20),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(20),
|
|
),
|
|
child: SizedBox(
|
|
width: 550,
|
|
child: SingleChildScrollView(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(20.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
const SizedBox(),
|
|
Text(
|
|
'Notification Settings',
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 22,
|
|
color: ColorsManager.dialogBlueTitle,
|
|
),
|
|
),
|
|
Container(
|
|
width: 25,
|
|
decoration: BoxDecoration(
|
|
color: Colors.transparent,
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: Colors.grey,
|
|
width: 1.0,
|
|
),
|
|
),
|
|
child: IconButton(
|
|
padding: EdgeInsets.all(1),
|
|
icon: const Icon(
|
|
Icons.close,
|
|
color: Colors.grey,
|
|
size: 18,
|
|
),
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 20),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
SizedBox(
|
|
width: 170,
|
|
height: 135,
|
|
child: ToggleWidget(
|
|
value: isSosAlarmEnabled,
|
|
code: 'notification',
|
|
deviceId: '',
|
|
label: 'SOS Alarm',
|
|
onChange: (v) {
|
|
setState(() {
|
|
isSosAlarmEnabled = v;
|
|
});
|
|
},
|
|
icon: '-1',
|
|
),
|
|
),
|
|
const SizedBox(
|
|
width: 16,
|
|
),
|
|
SizedBox(
|
|
width: 170,
|
|
height: 135,
|
|
child: ToggleWidget(
|
|
value: isLowBatteryNotificationEnabled,
|
|
code: 'notification',
|
|
deviceId: '',
|
|
label: 'Low Battery',
|
|
onChange: (v) {
|
|
setState(() {
|
|
isLowBatteryNotificationEnabled = v;
|
|
});
|
|
},
|
|
icon: '-1',
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|