Aidra Connect 10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
notification_enabler_dialog.dart
Go to the documentation of this file.
1import 'package:connect/core/localization/app_localizations.dart';
2import 'package:flutter/cupertino.dart';
3import 'package:flutter/material.dart';
4import 'package:flutter_screenutil/flutter_screenutil.dart';
5import 'package:hugeicons/hugeicons.dart';
6
7class NotificationEnablerDialog extends StatelessWidget {
8 const NotificationEnablerDialog({super.key});
9
10 @override
11 Widget build(BuildContext context) {
12 return Column(
13 mainAxisSize: MainAxisSize.min,
14 children: [
16 label: AppLocalizations.of(context).translate('Push Notifications'),
17 icon: HugeIcons.strokeRoundedSettings03,
18 isActive: false,
19 context: context,
20 isEnabled: false,
21 ),
23 label: AppLocalizations.of(context).translate('Email Notifications'),
24 icon: HugeIcons.strokeRoundedMoon02,
25 isActive: false,
26 context: context,
27 isEnabled: false,
28 ),
30 label: AppLocalizations.of(context).translate('SMS Notifications'),
31 icon: HugeIcons.strokeRoundedSettings03,
32 isActive: false,
33 context: context,
34 isEnabled: false,
35 ),
36 ],
37 );
38 }
39
41 required String label,
42 required IconData icon,
43 required bool isActive,
44 required BuildContext context,
45 required bool isEnabled,
46 }) {
47 return Opacity(
48 opacity: isEnabled ? .9 : .2,
49 child: ElevatedButton(
50 onPressed: () {},
51 style: ElevatedButton.styleFrom(
52 backgroundColor: Theme.of(context).colorScheme.surface,
53 overlayColor: Theme.of(context).primaryColor.withOpacity(0.11),
54 padding: EdgeInsets.all(15.sp),
55 ),
56 child: Row(
57 mainAxisAlignment: MainAxisAlignment.spaceBetween,
58 children: [
59 Text(
60 label,
61 style: Theme.of(context).textTheme.bodySmall,
62 ),
63 CupertinoSwitch(
64 value: isActive,
65 onChanged: (value) {},
66 activeColor: Theme.of(context).colorScheme.primary,
67 ),
68 ],
69 ),
70 ),
71 );
72 }
73}
String translate(String key)
static AppLocalizations of(BuildContext context)
final bool isActive
final IconData icon
_buildNotificationEnablerButton({ required String label, required IconData icon, required bool isActive, required BuildContext context, required bool isEnabled, })
override Widget build(BuildContext context)
final String label
const NotificationEnablerDialog({super.key})
final Widget child
final EdgeInsets padding
final Color backgroundColor
final String label
final double value