Hide nonfunctional widgets

This commit is contained in:
Abdullah Alassaf
2024-12-15 02:22:11 +03:00
parent fc3f215dba
commit f81880a704
12 changed files with 735 additions and 920 deletions

View File

@ -55,7 +55,7 @@ class HomeCubit extends Cubit<HomeState> {
Future fetchUserInfo() async {
try {
var uuid=await const FlutterSecureStorage().read(key: UserModel.userUuidKey);
var uuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey);
user = await ProfileApi().fetchUserInfo(uuid);
emit(HomeUserInfoLoaded(user!)); // Emit state after fetching user info
} catch (e) {
@ -123,9 +123,7 @@ class HomeCubit extends Cubit<HomeState> {
return;
}
var userUuid =
await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ??
'';
var userUuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ?? '';
if (userUuid.isNotEmpty) {
await OneSignal.login(userUuid);
}
@ -221,8 +219,7 @@ class HomeCubit extends Cubit<HomeState> {
//////////////////////////////////////// API ////////////////////////////////////////
generateInvitation(SpaceModel unit) async {
try {
final invitationCode =
await SpacesAPI.generateInvitationCode(unit.id, unit.community.uuid);
final invitationCode = await SpacesAPI.generateInvitationCode(unit.id, unit.community.uuid);
if (invitationCode.isNotEmpty) {
Share.share('The invitation code is $invitationCode');
CustomSnackBar.displaySnackBar(
@ -238,9 +235,7 @@ class HomeCubit extends Cubit<HomeState> {
Future<bool> joinAUnit(String code) async {
try {
var userUuid =
await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ??
'';
var userUuid = await const FlutterSecureStorage().read(key: UserModel.userUuidKey) ?? '';
Map<String, String> body = {'inviteCode': code};
final success = await SpacesAPI.joinUnit(userUuid, body);
@ -276,8 +271,7 @@ class HomeCubit extends Cubit<HomeState> {
fetchRoomsByUnitId(SpaceModel space) async {
emitSafe(GetSpaceRoomsLoading());
try {
space.subspaces =
await SpacesAPI.getSubSpaceBySpaceId(space.community.uuid, space.id);
space.subspaces = await SpacesAPI.getSubSpaceBySpaceId(space.community.uuid, space.id);
} catch (failure) {
emitSafe(GetSpaceRoomsError(failure.toString()));
return;
@ -359,8 +353,7 @@ class HomeCubit extends Cubit<HomeState> {
size: 32,
),
style: ButtonStyle(
foregroundColor:
WidgetStateProperty.all(ColorsManager.textPrimaryColor),
foregroundColor: WidgetStateProperty.all(ColorsManager.textPrimaryColor),
),
onPressed: () {
Navigator.pushNamed(
@ -381,35 +374,34 @@ class HomeCubit extends Cubit<HomeState> {
NavigationService.navigatorKey.currentContext!
.read<SmartSceneSelectBloc>()
.add(const SmartSceneClearEvent());
BlocProvider.of<EffectPeriodBloc>(
NavigationService.navigatorKey.currentState!.context)
BlocProvider.of<EffectPeriodBloc>(NavigationService.navigatorKey.currentState!.context)
.add(ResetEffectivePeriod());
NavigationService.navigatorKey.currentContext!
.read<CreateSceneBloc>()
.add(const ClearTabToRunSetting());
},
),
IconButton(
icon: const Icon(
Icons.more_vert,
size: 28,
),
style: ButtonStyle(
foregroundColor:
WidgetStateProperty.all(ColorsManager.textPrimaryColor),
),
onPressed: () {},
),
// IconButton(
// icon: const Icon(
// Icons.more_vert,
// size: 28,
// ),
// style: ButtonStyle(
// foregroundColor:
// WidgetStateProperty.all(ColorsManager.textPrimaryColor),
// ),
// onPressed: () {},
// ),
],
'Menu': [
IconButton(
icon: SvgPicture.asset(
Assets.assetsIconsScan,
height: 20,
width: 20,
),
onPressed: () {},
),
// IconButton(
// icon: SvgPicture.asset(
// Assets.assetsIconsScan,
// height: 20,
// width: 20,
// ),
// onPressed: () {},
// ),
],
};
@ -429,8 +421,7 @@ class HomeCubit extends Cubit<HomeState> {
};
static var bottomNavItems = [
defaultBottomNavBarItem(
icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
defaultBottomNavBarItem(icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
// defaultBottomNavBarItem(icon: Assets.assetsIconslayout, label: 'Layout'),
defaultBottomNavBarItem(icon: Assets.assetsIconsDevices, label: 'Devices'),
defaultBottomNavBarItem(icon: Assets.assetsIconsRoutines, label: 'Routine'),
@ -456,8 +447,7 @@ class HomeCubit extends Cubit<HomeState> {
void updateDevice(String deviceId) async {
try {
final response = await DevicesAPI.firmwareDevice(
deviceId: deviceId, firmwareVersion: '0');
final response = await DevicesAPI.firmwareDevice(deviceId: deviceId, firmwareVersion: '0');
if (response['success'] ?? false) {
CustomSnackBar.displaySnackBar('No updates available');
}
@ -465,8 +455,7 @@ class HomeCubit extends Cubit<HomeState> {
}
}
BottomNavigationBarItem defaultBottomNavBarItem(
{required String icon, required String label}) {
BottomNavigationBarItem defaultBottomNavBarItem({required String icon, required String label}) {
return BottomNavigationBarItem(
icon: SvgPicture.asset(icon),
activeIcon: SvgPicture.asset(

View File

@ -31,8 +31,7 @@ class LoginView extends StatelessWidget {
// content: Text(state.message),
// ),
// );
}
else if (state is AuthLoginSuccess) {
} else if (state is AuthLoginSuccess) {
Navigator.popAndPushNamed(context, Routes.homeRoute);
}
},
@ -96,8 +95,8 @@ class LoginView extends StatelessWidget {
height: 20,
),
const LoginForm(),
const LoginDivider(),
const LoginWithGoogleFacebook(),
// const LoginDivider(),
// const LoginWithGoogleFacebook(),
const DontHaveAnAccount(),
],
),

View File

@ -38,10 +38,8 @@ class SettingProfilePage extends StatelessWidget {
final _bloc = BlocProvider.of<DeviceSettingBloc>(context);
return state is DeviceSettingLoadingState
? const Center(
child: DefaultContainer(
width: 50,
height: 50,
child: CircularProgressIndicator()),
child:
DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
)
: RefreshIndicator(
onRefresh: () async {
@ -57,18 +55,15 @@ class SettingProfilePage extends StatelessWidget {
child: SvgPicture.asset(
Assets.sosHomeIcon,
fit: BoxFit.fitHeight,
height:
MediaQuery.of(context).size.height * 0.13,
height: MediaQuery.of(context).size.height * 0.13,
))
: CircleAvatar(
radius: 55,
backgroundColor: ColorsManager.graysColor,
child: ClipOval(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: SvgPicture.asset(
@ -76,10 +71,7 @@ class SettingProfilePage extends StatelessWidget {
? Assets.fourSceneIcon
: Assets.sixSceneIcon,
fit: BoxFit.contain,
height: MediaQuery.of(context)
.size
.height *
0.08,
height: MediaQuery.of(context).size.height * 0.08,
),
),
],
@ -97,8 +89,7 @@ class SettingProfilePage extends StatelessWidget {
children: [
IntrinsicWidth(
child: ConstrainedBox(
constraints:
const BoxConstraints(maxWidth: 200),
constraints: const BoxConstraints(maxWidth: 200),
child: TextFormField(
maxLength: 30,
style: const TextStyle(
@ -131,8 +122,7 @@ class SettingProfilePage extends StatelessWidget {
Assets.sosEditProfile,
color: Colors.grey,
fit: BoxFit.contain,
height: MediaQuery.of(context).size.height *
0.02,
height: MediaQuery.of(context).size.height * 0.02,
),
),
),
@ -151,14 +141,14 @@ class SettingProfilePage extends StatelessWidget {
padding: const EdgeInsets.all(20),
child: InkWell(
onTap: () async {
bool val = await Navigator.of(context).push(
bool? val = await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => LocationSettingPage(
space: spaces!.first,
deviceId: device?.uuid ?? '',
)),
);
if (val == true) {
if (val != null && val == true) {
_bloc.add(const DeviceSettingInitialInfo());
}
},
@ -172,8 +162,7 @@ class SettingProfilePage extends StatelessWidget {
children: [
SizedBox(
child: BodyMedium(
text: _bloc
.deviceInfo.subspace.subspaceName,
text: _bloc.deviceInfo.subspace.subspaceName,
fontColor: ColorsManager.textGray,
),
),

View File

@ -40,10 +40,8 @@ class SettingsPage extends StatelessWidget {
return state is DeviceSettingLoadingState
? const Center(
child: DefaultContainer(
width: 50,
height: 50,
child: CircularProgressIndicator()),
child:
DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
)
: ListView(
children: [
@ -71,31 +69,25 @@ class SettingsPage extends StatelessWidget {
children: [
const SizedBox(height: 20),
DefaultContainer(
borderRadius: const BorderRadius.all(
Radius.circular(30)),
borderRadius: const BorderRadius.all(Radius.circular(30)),
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Padding(
padding:
const EdgeInsets.only(left: 90),
padding: const EdgeInsets.only(left: 90),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
child: Text(
_bloc.deviceInfo.name,
style: const TextStyle(
fontSize: 16,
fontWeight:
FontWeight.w700,
color: ColorsManager
.grayColor,
fontWeight: FontWeight.w700,
color: ColorsManager.grayColor,
),
overflow: TextOverflow
.ellipsis, // Adds ellipsis (...) when the text overflows.
@ -106,10 +98,7 @@ class SettingsPage extends StatelessWidget {
height: 5,
),
BodySmall(
text: _bloc
.deviceInfo
.subspace
.subspaceName),
text: _bloc.deviceInfo.subspace.subspaceName),
],
),
),
@ -136,13 +125,10 @@ class SettingsPage extends StatelessWidget {
backgroundColor: Colors.white,
child: CircleAvatar(
radius: 40,
backgroundColor:
ColorsManager.backgroundColor,
backgroundColor: ColorsManager.backgroundColor,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
device!.type == "SOS"
? ClipOval(
@ -153,20 +139,15 @@ class SettingsPage extends StatelessWidget {
),
)
: Padding(
padding: device!.type ==
"4S"
? const EdgeInsets.only(
top: 5)
: const EdgeInsets.only(
top: 0),
padding: device!.type == "4S"
? const EdgeInsets.only(top: 5)
: const EdgeInsets.only(top: 0),
child: SizedBox(
height: 70,
child: SvgPicture.asset(
device!.type == "4S"
? Assets
.fourSceneIcon
: Assets
.sixSceneIcon,
? Assets.fourSceneIcon
: Assets.sixSceneIcon,
fit: BoxFit.contain,
),
),
@ -221,114 +202,114 @@ class SettingsPage extends StatelessWidget {
),
),
const SizedBox(height: 20),
const BodyMedium(
text: 'Device Offline Notification',
fontWeight: FontWeight.w700,
fontSize: 12,
fontColor: ColorsManager.grayColor,
),
DefaultContainer(
child: Column(
children: [
SettingWidget(
value: _bloc.enableAlarm,
onChanged: (p0) {
context
.read<DeviceSettingBloc>()
.add(ToggleEnableAlarmEvent(p0));
},
isNotification: true,
onTap: () {},
text: 'Offline Notification',
icon: Assets.notificationIcon,
),
],
),
),
const SizedBox(height: 20),
const BodyMedium(
text: 'Others',
fontWeight: FontWeight.w700,
fontSize: 12,
fontColor: ColorsManager.grayColor,
),
const SizedBox(height: 5),
DefaultContainer(
child: Column(
children: [
SettingWidget(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
ShareDevicePage(device: device!)),
);
},
text: 'Share Device',
icon: Assets.shareIcon,
),
// const Divider(
// color: ColorsManager.dividerColor,
// ),
// SettingWidget(
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// FourSceneCreateGroup(
// device: device!)),
// );
// },
// text: 'Create Group',
// icon: Assets.createGroupIcon,
// ),
const Divider(
color: ColorsManager.dividerColor,
),
SettingWidget(
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
FaqSettingPage(device: device!)),
);
},
text: 'Device FAQ',
icon: Assets.faqIcon,
),
const Divider(
color: ColorsManager.dividerColor,
),
SettingWidget(
onTapUpdate: () {
showDialog(
context: context,
builder: (context) {
return UpdateInfoDialog(
cancelTab: () {
Navigator.of(context).pop();
},
confirmTab: () {
Navigator.of(context).pop();
},
);
},
);
},
isUpdate: true,
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
const UpdatePageSetting()),
);
},
text: 'Device Update',
icon: Assets.updateIcon,
),
],
),
),
// const BodyMedium(
// text: 'Device Offline Notification',
// fontWeight: FontWeight.w700,
// fontSize: 12,
// fontColor: ColorsManager.grayColor,
// ),
// DefaultContainer(
// child: Column(
// children: [
// SettingWidget(
// value: _bloc.enableAlarm,
// onChanged: (p0) {
// context
// .read<DeviceSettingBloc>()
// .add(ToggleEnableAlarmEvent(p0));
// },
// isNotification: true,
// onTap: () {},
// text: 'Offline Notification',
// icon: Assets.notificationIcon,
// ),
// ],
// ),
// ),
// const SizedBox(height: 20),
// const BodyMedium(
// text: 'Others',
// fontWeight: FontWeight.w700,
// fontSize: 12,
// fontColor: ColorsManager.grayColor,
// ),
// const SizedBox(height: 5),
// DefaultContainer(
// child: Column(
// children: [
// SettingWidget(
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// ShareDevicePage(device: device!)),
// );
// },
// text: 'Share Device',
// icon: Assets.shareIcon,
// ),
// // const Divider(
// // color: ColorsManager.dividerColor,
// // ),
// // SettingWidget(
// // onTap: () {
// // Navigator.of(context).push(
// // MaterialPageRoute(
// // builder: (context) =>
// // FourSceneCreateGroup(
// // device: device!)),
// // );
// // },
// // text: 'Create Group',
// // icon: Assets.createGroupIcon,
// // ),
// const Divider(
// color: ColorsManager.dividerColor,
// ),
// SettingWidget(
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// FaqSettingPage(device: device!)),
// );
// },
// text: 'Device FAQ',
// icon: Assets.faqIcon,
// ),
// const Divider(
// color: ColorsManager.dividerColor,
// ),
// SettingWidget(
// onTapUpdate: () {
// showDialog(
// context: context,
// builder: (context) {
// return UpdateInfoDialog(
// cancelTab: () {
// Navigator.of(context).pop();
// },
// confirmTab: () {
// Navigator.of(context).pop();
// },
// );
// },
// );
// },
// isUpdate: true,
// onTap: () {
// Navigator.of(context).push(
// MaterialPageRoute(
// builder: (context) =>
// const UpdatePageSetting()),
// );
// },
// text: 'Device Update',
// icon: Assets.updateIcon,
// ),
// ],
// ),
// ),
const SizedBox(height: 20),
InkWell(
onTap: () {
@ -356,8 +337,7 @@ class SettingsPage extends StatelessWidget {
),
const SizedBox(height: 10),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
@ -379,8 +359,7 @@ class SettingsPage extends StatelessWidget {
text: 'Disconnect Device',
fontWeight: FontWeight.w400,
fontSize: 15,
fontColor:
ColorsManager.textPrimaryColor,
fontColor: ColorsManager.textPrimaryColor,
),
),
const Icon(
@ -391,8 +370,7 @@ class SettingsPage extends StatelessWidget {
),
const SizedBox(height: 20),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
@ -404,20 +382,17 @@ class SettingsPage extends StatelessWidget {
Navigator.of(context).pop();
},
confirmTab: () {
_bloc.add(
DeleteDeviceEvent());
_bloc.add(DeleteDeviceEvent());
},
);
},
);
},
child: const BodyMedium(
text:
'Disconnect Device and Wipe Data',
text: 'Disconnect Device and Wipe Data',
fontWeight: FontWeight.w400,
fontSize: 15,
fontColor:
ColorsManager.textPrimaryColor,
fontColor: ColorsManager.textPrimaryColor,
),
),
const Icon(

View File

@ -1,6 +1,4 @@
import 'package:flutter/material.dart';
import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/features/devices/view/widgets/popup_menu_widget.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/utils/resource_manager/font_manager.dart';
@ -24,19 +22,19 @@ class DeviceAppbar extends StatelessWidget implements PreferredSizeWidget {
fontWeight: FontsManager.bold,
),
actions: [
IconButton(
onPressed: () {
showPopupMenu(context: context, items: [
PopupMenuItem(
onTap: () async {
HomeCubit.getInstance().updateDevice(deviceUuid);
},
value: 'Update',
child: const Text('Update'),
)
]);
},
icon: Icon(Icons.edit))
// IconButton(
// onPressed: () {
// showPopupMenu(context: context, items: [
// PopupMenuItem(
// onTap: () async {
// HomeCubit.getInstance().updateDevice(deviceUuid);
// },
// value: 'Update',
// child: const Text('Update'),
// )
// ]);
// },
// icon: Icon(Icons.edit))
],
);
}

View File

@ -8,9 +8,7 @@ import 'package:syncrow_app/features/devices/bloc/sos_bloc/sos_state.dart';
import 'package:syncrow_app/features/devices/model/device_report_model.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class SosRecordsScreen extends StatefulWidget {
@ -22,14 +20,13 @@ class SosRecordsScreen extends StatefulWidget {
}
class _SosRecordsScreenState extends State<SosRecordsScreen> {
int _selectedIndex = 0;
// int _selectedIndex = 0;
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Records',
child: BlocProvider(
create: (context) =>
SosBloc(sosId: widget.sosId)..add(const ReportLogsInitial()),
create: (context) => SosBloc(sosId: widget.sosId)..add(const ReportLogsInitial()),
child: BlocBuilder<SosBloc, SosState>(
builder: (context, state) {
final waterSensorBloc = BlocProvider.of<SosBloc>(context);
@ -37,15 +34,13 @@ class _SosRecordsScreenState extends State<SosRecordsScreen> {
if (state is LoadingNewSate) {
return const Center(
child: DefaultContainer(
width: 50, height: 50, child: CircularProgressIndicator()),
child: DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
);
} else if (state is UpdateState) {
for (var record in waterSensorBloc.recordGroups.data!) {
final DateTime eventDateTime =
DateTime.fromMillisecondsSinceEpoch(record.eventTime!);
final String formattedDate =
DateFormat('EEEE, dd/MM/yyyy').format(eventDateTime);
final String formattedDate = DateFormat('EEEE, dd/MM/yyyy').format(eventDateTime);
if (groupedRecords.containsKey(formattedDate)) {
groupedRecords[formattedDate]!.add(record);
} else {
@ -58,63 +53,61 @@ class _SosRecordsScreenState extends State<SosRecordsScreen> {
length: 2,
child: Column(
children: [
Container(
width: MediaQuery.of(context).size.width,
decoration: const ShapeDecoration(
color: ColorsManager.onPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(30)),
),
),
child: TabBar(
onTap: (value) {
setState(() {
_selectedIndex = value;
});
},
indicatorColor: Colors.white,
dividerHeight: 0,
indicatorSize: TabBarIndicatorSize.tab,
indicator: const ShapeDecoration(
color: ColorsManager.slidingBlueColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
),
),
tabs: [
Tab(
child: Container(
padding: const EdgeInsets.symmetric(vertical: 10),
child: BodySmall(
text: 'Record',
style: context.bodySmall.copyWith(
color: _selectedIndex == 0
? Colors.white
: ColorsManager.blackColor,
fontSize: 12,
fontWeight: FontWeight.w400,
),
),
),
),
Tab(
child: Container(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Text(
'Automation Log',
style: context.bodySmall.copyWith(
color: _selectedIndex == 1
? Colors.white
: ColorsManager.blackColor,
fontSize: 12,
fontWeight: FontWeight.w400,
),
),
),
),
],
),
),
// Container(
// width: MediaQuery.of(context).size.width,
// decoration: const ShapeDecoration(
// color: ColorsManager.onPrimaryColor,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.all(Radius.circular(30)),
// ),
// ),
// child: TabBar(
// onTap: (value) {
// setState(() {
// _selectedIndex = value;
// });
// },
// indicatorColor: Colors.white,
// dividerHeight: 0,
// indicatorSize: TabBarIndicatorSize.tab,
// indicator: const ShapeDecoration(
// color: ColorsManager.slidingBlueColor,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.all(Radius.circular(20)),
// ),
// ),
// tabs: [
// Tab(
// child: Container(
// padding: const EdgeInsets.symmetric(vertical: 10),
// child: BodySmall(
// text: 'Record',
// style: context.bodySmall.copyWith(
// color:
// _selectedIndex == 0 ? Colors.white : ColorsManager.blackColor,
// fontSize: 12,
// fontWeight: FontWeight.w400,
// ),
// ),
// ),
// ),
// Tab(
// child: Container(
// padding: const EdgeInsets.symmetric(vertical: 10),
// child: Text(
// 'Automation Log',
// style: context.bodySmall.copyWith(
// color:
// _selectedIndex == 1 ? Colors.white : ColorsManager.blackColor,
// fontSize: 12,
// fontWeight: FontWeight.w400,
// ),
// ),
// ),
// ),
// ],
// ),
// ),
Expanded(
child: TabBarView(
physics: const NeverScrollableScrollPhysics(),
@ -129,14 +122,11 @@ class _SosRecordsScreenState extends State<SosRecordsScreen> {
: ListView.builder(
itemCount: groupedRecords.length,
itemBuilder: (context, index) {
final String date =
groupedRecords.keys.elementAt(index);
final List<DeviceEvent> recordsForDate =
groupedRecords[date]!;
final String date = groupedRecords.keys.elementAt(index);
final List<DeviceEvent> recordsForDate = groupedRecords[date]!;
return Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(16.0),
@ -152,49 +142,37 @@ class _SosRecordsScreenState extends State<SosRecordsScreen> {
DefaultContainer(
child: Column(
children: [
...recordsForDate
.asMap()
.entries
.map((entry) {
...recordsForDate.asMap().entries.map((entry) {
final int idx = entry.key;
final DeviceEvent record =
entry.value;
final DeviceEvent record = entry.value;
final DateTime eventDateTime =
DateTime
.fromMillisecondsSinceEpoch(
record.eventTime!);
DateTime.fromMillisecondsSinceEpoch(
record.eventTime!);
final String formattedTime =
DateFormat('HH:mm:ss')
.format(eventDateTime);
DateFormat('HH:mm:ss').format(eventDateTime);
return Column(
children: [
ListTile(
leading: SvgPicture.asset(
record.value == 'true'
? Assets
.leakDetectedIcon
: Assets
.leakNormalIcon,
? Assets.leakDetectedIcon
: Assets.leakNormalIcon,
height: 25,
width: 25,
),
title: const Text(
"SOS Alert Triggered",
style: const TextStyle(
fontWeight:
FontWeight.bold,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
subtitle:
Text(formattedTime),
subtitle: Text(formattedTime),
),
if (idx !=
recordsForDate.length - 1)
if (idx != recordsForDate.length - 1)
const Divider(
color: ColorsManager
.graysColor,
color: ColorsManager.graysColor,
),
],
);

View File

@ -8,9 +8,7 @@ import 'package:syncrow_app/features/devices/bloc/water_leak_bloc/water_leak_sta
import 'package:syncrow_app/features/devices/model/device_report_model.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/context_extension.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
class WaterLeakRecordsScreen extends StatefulWidget {
@ -22,14 +20,13 @@ class WaterLeakRecordsScreen extends StatefulWidget {
}
class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
int _selectedIndex = 0;
// int _selectedIndex = 0;
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Records',
child: BlocProvider(
create: (context) =>
WaterLeakBloc(WLId: widget.WLId)..add(const ReportLogsInitial()),
create: (context) => WaterLeakBloc(WLId: widget.WLId)..add(const ReportLogsInitial()),
child: BlocBuilder<WaterLeakBloc, WaterLeakState>(
builder: (context, state) {
final waterSensorBloc = BlocProvider.of<WaterLeakBloc>(context);
@ -37,15 +34,13 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
if (state is WaterLeakLoadingState) {
return const Center(
child: DefaultContainer(
width: 50, height: 50, child: CircularProgressIndicator()),
child: DefaultContainer(width: 50, height: 50, child: CircularProgressIndicator()),
);
} else if (state is UpdateState) {
for (var record in waterSensorBloc.recordGroups.data!) {
final DateTime eventDateTime =
DateTime.fromMillisecondsSinceEpoch(record.eventTime!);
final String formattedDate =
DateFormat('EEEE, dd/MM/yyyy').format(eventDateTime);
final String formattedDate = DateFormat('EEEE, dd/MM/yyyy').format(eventDateTime);
if (groupedRecords.containsKey(formattedDate)) {
groupedRecords[formattedDate]!.add(record);
@ -59,63 +54,63 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
length: 2,
child: Column(
children: [
Container(
width: MediaQuery.of(context).size.width,
decoration: const ShapeDecoration(
color: ColorsManager.onPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(30)),
),
),
child: TabBar(
onTap: (value) {
setState(() {
_selectedIndex = value;
});
},
indicatorColor: Colors.white,
dividerHeight: 0,
indicatorSize: TabBarIndicatorSize.tab,
indicator: const ShapeDecoration(
color: ColorsManager.slidingBlueColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20)),
),
),
tabs: [
Tab(
child: Container(
padding: const EdgeInsets.symmetric(vertical: 10),
child: BodySmall(
text: 'Record',
style: context.bodySmall.copyWith(
color: _selectedIndex == 0
? Colors.white
: ColorsManager.blackColor,
fontSize: 12,
fontWeight: FontWeight.w400,
),
),
),
),
Tab(
child: Container(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Text(
'Automation Record',
style: context.bodySmall.copyWith(
color: _selectedIndex == 1
? Colors.white
: ColorsManager.blackColor,
fontSize: 12,
fontWeight: FontWeight.w400,
),
),
),
),
],
),
),
// Container(
// width: MediaQuery.of(context).size.width,
// decoration: const ShapeDecoration(
// color: ColorsManager.onPrimaryColor,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.all(Radius.circular(30)),
// ),
// ),
// child: TabBar(
// onTap: (value) {
// setState(() {
// _selectedIndex = value;
// });
// },
// indicatorColor: Colors.white,
// dividerHeight: 0,
// indicatorSize: TabBarIndicatorSize.tab,
// indicator: const ShapeDecoration(
// color: ColorsManager.slidingBlueColor,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.all(Radius.circular(20)),
// ),
// ),
// tabs: [
// Tab(
// child: Container(
// padding: const EdgeInsets.symmetric(vertical: 10),
// child: BodySmall(
// text: 'Record',
// style: context.bodySmall.copyWith(
// color: _selectedIndex == 0
// ? Colors.white
// : ColorsManager.blackColor,
// fontSize: 12,
// fontWeight: FontWeight.w400,
// ),
// ),
// ),
// ),
// Tab(
// child: Container(
// padding: const EdgeInsets.symmetric(vertical: 10),
// child: Text(
// 'Automation Record',
// style: context.bodySmall.copyWith(
// color: _selectedIndex == 1
// ? Colors.white
// : ColorsManager.blackColor,
// fontSize: 12,
// fontWeight: FontWeight.w400,
// ),
// ),
// ),
// ),
// ],
// ),
// ),
Expanded(
child: TabBarView(
physics: const NeverScrollableScrollPhysics(),
@ -125,14 +120,11 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
: ListView.builder(
itemCount: groupedRecords.length,
itemBuilder: (context, index) {
final String date =
groupedRecords.keys.elementAt(index);
final List<DeviceEvent> recordsForDate =
groupedRecords[date]!;
final String date = groupedRecords.keys.elementAt(index);
final List<DeviceEvent> recordsForDate = groupedRecords[date]!;
return Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(16.0),
@ -148,30 +140,22 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
DefaultContainer(
child: Column(
children: [
...recordsForDate
.asMap()
.entries
.map((entry) {
...recordsForDate.asMap().entries.map((entry) {
final int idx = entry.key;
final DeviceEvent record =
entry.value;
final DeviceEvent record = entry.value;
final DateTime eventDateTime =
DateTime
.fromMillisecondsSinceEpoch(
record.eventTime!);
DateTime.fromMillisecondsSinceEpoch(
record.eventTime!);
final String formattedTime =
DateFormat('HH:mm:ss')
.format(eventDateTime);
DateFormat('HH:mm:ss').format(eventDateTime);
return Column(
children: [
ListTile(
leading: SvgPicture.asset(
record.value == 'true'
? Assets
.leakDetectedIcon
: Assets
.leakNormalIcon,
? Assets.leakDetectedIcon
: Assets.leakNormalIcon,
height: 25,
width: 25,
),
@ -180,19 +164,15 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
? "Leak Detected"
: "Normal",
style: const TextStyle(
fontWeight:
FontWeight.bold,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
subtitle:
Text('$formattedTime'),
subtitle: Text('$formattedTime'),
),
if (idx !=
recordsForDate.length - 1)
if (idx != recordsForDate.length - 1)
const Divider(
color: ColorsManager
.graysColor,
color: ColorsManager.graysColor,
),
],
);
@ -207,8 +187,7 @@ class _WaterLeakRecordsScreenState extends State<WaterLeakRecordsScreen> {
Container(
height: 10,
width: 20,
child:
const Center(child: Text('No data available.')),
child: const Center(child: Text('No data available.')),
),
],
),

View File

@ -80,30 +80,30 @@ class HomeSettingsView extends StatelessWidget {
),
),
//Divider
Container(
height: 1,
margin: const EdgeInsets.only(top: 10),
color: ColorsManager.greyColor,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const BodyMedium(text: 'Location'),
Flexible(
child: TextField(
textAlign: TextAlign.end,
decoration: InputDecoration(
hintText: 'Set',
hintStyle: context.bodyMedium.copyWith(color: Colors.grey),
border: InputBorder.none,
),
),
),
],
),
// Container(
// height: 1,
// margin: const EdgeInsets.only(top: 10),
// color: ColorsManager.greyColor,
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// const BodyMedium(text: 'Location'),
// Flexible(
// child: TextField(
// textAlign: TextAlign.end,
// decoration: InputDecoration(
// hintText: 'Set',
// hintStyle: context.bodyMedium.copyWith(color: Colors.grey),
// border: InputBorder.none,
// ),
// ),
// ),
// ],
// ),
//Divider
Container(
margin: const EdgeInsets.only(bottom: 10),
margin: const EdgeInsets.symmetric(vertical: 10),
height: 1,
color: ColorsManager.greyColor,
),
@ -135,77 +135,77 @@ class HomeSettingsView extends StatelessWidget {
height: 10,
),
//TODO connect the members to this GridView
const BodySmall(
text: "Members",
fontWeight: FontWeight.bold,
),
GridView.builder(
shrinkWrap: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10,
),
itemCount: 2,
itemBuilder: (context, index) => Stack(
alignment: Alignment.topCenter,
children: [
DefaultContainer(
margin: const EdgeInsets.only(top: 20),
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 40),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(
height: 50,
),
BodyMedium(
text: 'Member ${index + 1}',
fontWeight: FontWeight.bold,
),
const SizedBox(height: 3),
const BodySmall(
text: 'Syncrow Account',
textAlign: TextAlign.center,
),
],
),
),
const SizedBox.square(
dimension: 80,
child: CircleAvatar(
backgroundColor: Colors.white,
child: SizedBox.square(
dimension: 77,
child: CircleAvatar(
backgroundColor: ColorsManager.greyColor,
child: Icon(Icons.person),
),
),
),
)
],
),
),
const Spacer(),
InkWell(
onTap: () {},
child: Row(
children: [
Expanded(
child: DefaultContainer(
child: Center(
child: BodyLarge(
text: 'Leave Home',
style: context.bodyLarge.copyWith(
color: Colors.red,
),
),
),
),
),
],
),
)
// const BodySmall(
// text: "Members",
// fontWeight: FontWeight.bold,
// ),
// GridView.builder(
// shrinkWrap: true,
// gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2,
// crossAxisSpacing: 10,
// ),
// itemCount: 2,
// itemBuilder: (context, index) => Stack(
// alignment: Alignment.topCenter,
// children: [
// DefaultContainer(
// margin: const EdgeInsets.only(top: 20),
// padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 40),
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// const SizedBox(
// height: 50,
// ),
// BodyMedium(
// text: 'Member ${index + 1}',
// fontWeight: FontWeight.bold,
// ),
// const SizedBox(height: 3),
// const BodySmall(
// text: 'Syncrow Account',
// textAlign: TextAlign.center,
// ),
// ],
// ),
// ),
// const SizedBox.square(
// dimension: 80,
// child: CircleAvatar(
// backgroundColor: Colors.white,
// child: SizedBox.square(
// dimension: 77,
// child: CircleAvatar(
// backgroundColor: ColorsManager.greyColor,
// child: Icon(Icons.person),
// ),
// ),
// ),
// )
// ],
// ),
// ),
// const Spacer(),
// InkWell(
// onTap: () {},
// child: Row(
// children: [
// Expanded(
// child: DefaultContainer(
// child: Center(
// child: BodyLarge(
// text: 'Leave Home',
// style: context.bodyLarge.copyWith(
// color: Colors.red,
// ),
// ),
// ),
// ),
// ),
// ],
// ),
// )
],
),
);

View File

@ -4,8 +4,8 @@ import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart';
import 'package:syncrow_app/features/menu/bloc/profile_bloc/profile_bloc.dart';
import 'package:syncrow_app/features/menu/bloc/profile_bloc/profile_event.dart';
import 'package:syncrow_app/features/menu/bloc/profile_bloc/profile_state.dart';
import 'package:syncrow_app/features/menu/view/widgets/profile/region_page.dart';
import 'package:syncrow_app/features/menu/view/widgets/profile/time_zone_screen_page.dart';
// import 'package:syncrow_app/features/menu/view/widgets/profile/region_page.dart';
// import 'package:syncrow_app/features/menu/view/widgets/profile/time_zone_screen_page.dart';
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
@ -134,65 +134,65 @@ class ProfileView extends StatelessWidget {
],
),
),
Container(
height: 1,
color: ColorsManager.greyColor,
),
InkWell(
onTap: () {
profileBloc.add(const ChangeNameEvent(value: false));
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const RegionPage(),
),
).then((result) {
profileBloc.add(InitialProfileEvent());
});
},
child: Padding(
padding: const EdgeInsets.only(top: 20, bottom: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const BodyMedium(text: 'Region '),
Flexible(
child: BodyMedium(
text: HomeCubit.user!.regionName ?? 'No Region')),
],
),
),
),
Container(
height: 1,
color: ColorsManager.greyColor,
),
InkWell(
onTap: () {
profileBloc.add(const ChangeNameEvent(value: false));
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const TimeZoneScreenPage(),
),
).then((result) {
profileBloc.add(InitialProfileEvent());
});
},
child: Padding(
padding: const EdgeInsets.only(top: 15, bottom: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const BodyMedium(text: 'Time Zone '),
Flexible(
child: BodyMedium(
text: HomeCubit.user!.timeZone ?? "No Time Zone"),
),
],
),
),
),
// Container(
// height: 1,
// color: ColorsManager.greyColor,
// ),
// InkWell(
// onTap: () {
// profileBloc.add(const ChangeNameEvent(value: false));
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => const RegionPage(),
// ),
// ).then((result) {
// profileBloc.add(InitialProfileEvent());
// });
// },
// child: Padding(
// padding: const EdgeInsets.only(top: 20, bottom: 20),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// const BodyMedium(text: 'Region '),
// Flexible(
// child: BodyMedium(
// text: HomeCubit.user!.regionName ?? 'No Region')),
// ],
// ),
// ),
// ),
// Container(
// height: 1,
// color: ColorsManager.greyColor,
// ),
// InkWell(
// onTap: () {
// profileBloc.add(const ChangeNameEvent(value: false));
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => const TimeZoneScreenPage(),
// ),
// ).then((result) {
// profileBloc.add(InitialProfileEvent());
// });
// },
// child: Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 15),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// const BodyMedium(text: 'Time Zone '),
// Flexible(
// child: BodyMedium(
// text: HomeCubit.user!.timeZone ?? "No Time Zone"),
// ),
// ],
// ),
// ),
// ),
],
)),
],

View File

@ -10,7 +10,7 @@ class SecurtyView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultScaffold(
title: 'Securty',
title: 'Security',
child: Column(
children: [
DefaultContainer(
@ -24,11 +24,11 @@ class SecurtyView extends StatelessWidget {
children: [
InkWell(
onTap: () {},
child: Column(
child: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Row(
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(
@ -41,111 +41,111 @@ class SecurtyView extends StatelessWidget {
)
],
),
Container(
margin: const EdgeInsets.symmetric(vertical: 15),
height: 1,
color: ColorsManager.greyColor,
),
],
),
),
InkWell(
onTap: () {},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(
text: 'App Lock',
),
Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
],
),
Container(
margin: const EdgeInsets.symmetric(vertical: 15),
height: 1,
color: ColorsManager.greyColor,
),
],
),
),
InkWell(
onTap: () {},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(
text: 'User Code',
),
Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
],
),
Container(
margin: const EdgeInsets.symmetric(vertical: 15),
height: 1,
color: ColorsManager.greyColor,
),
],
),
),
InkWell(
onTap: () {},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(
text: 'Delete Account',
),
Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
],
),
Container(
margin: const EdgeInsets.symmetric(vertical: 15),
height: 1,
color: ColorsManager.greyColor,
),
],
),
),
InkWell(
onTap: () {},
child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
BodyMedium(
text: 'Device Update',
),
Icon(
Icons.arrow_forward_ios,
color: ColorsManager.greyColor,
size: 15,
)
// Container(
// margin: const EdgeInsets.symmetric(vertical: 15),
// height: 1,
// color: ColorsManager.greyColor,
// ),
],
),
),
// InkWell(
// onTap: () {},
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// const Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// BodyMedium(
// text: 'App Lock',
// ),
// Icon(
// Icons.arrow_forward_ios,
// color: ColorsManager.greyColor,
// size: 15,
// )
// ],
// ),
// Container(
// margin: const EdgeInsets.symmetric(vertical: 15),
// height: 1,
// color: ColorsManager.greyColor,
// ),
// ],
// ),
// ),
// InkWell(
// onTap: () {},
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// const Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// BodyMedium(
// text: 'User Code',
// ),
// Icon(
// Icons.arrow_forward_ios,
// color: ColorsManager.greyColor,
// size: 15,
// )
// ],
// ),
// Container(
// margin: const EdgeInsets.symmetric(vertical: 15),
// height: 1,
// color: ColorsManager.greyColor,
// ),
// ],
// ),
// ),
// InkWell(
// onTap: () {},
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// const Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// BodyMedium(
// text: 'Delete Account',
// ),
// Icon(
// Icons.arrow_forward_ios,
// color: ColorsManager.greyColor,
// size: 15,
// )
// ],
// ),
// Container(
// margin: const EdgeInsets.symmetric(vertical: 15),
// height: 1,
// color: ColorsManager.greyColor,
// ),
// ],
// ),
// ),
// InkWell(
// onTap: () {},
// child: const Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// BodyMedium(
// text: 'Device Update',
// ),
// Icon(
// Icons.arrow_forward_ios,
// color: ColorsManager.greyColor,
// size: 15,
// )
// ],
// ),
// ),
],
),
),

View File

@ -53,17 +53,16 @@ abstract class ApiEndpoints {
//POST
static const String addUnit = '/unit';
static const String addUnitToUser = '/unit/user';
static const String verifyInvitationCode =
'/user/{userUuid}/spaces/verify-code';
static const String verifyInvitationCode = '/user/{userUuid}/spaces/verify-code';
//GET
static const String unitByUuid = '/unit/';
static const String listSubspace =
'projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces';
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces';
static const String unitParent = '/unit/parent/{unitUuid}';
static const String unitUser = '/unit/user/';
static const String invitationCode =
'projects/{projectUuid}/communities/{communityUuid}/spaces/{unitUuid}/invitation-code';
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{unitUuid}/invitation-code';
//PUT
static const String renameUnit = '/unit/{unitUuid}';
@ -71,7 +70,7 @@ abstract class ApiEndpoints {
//Subspace Module
//POST
static const String addSubSpace =
'projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces';
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces';
///Room Module
//POST
@ -88,7 +87,7 @@ abstract class ApiEndpoints {
//GET
static const String userSpaces = '/user/{userUuid}/spaces';
static const String spaceDevices =
'projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/devices';
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/devices';
///Group Module
//POST
@ -96,8 +95,7 @@ abstract class ApiEndpoints {
static const String controlGroup = '/group/control';
//GET
static const String groupBySpace = '/group/{unitUuid}';
static const String devicesByGroupName =
'/group/{unitUuid}/devices/{groupName}';
static const String devicesByGroupName = '/group/{unitUuid}/devices/{groupName}';
static const String groupByUuid = '/group/{groupUuid}';
//DELETE
@ -109,22 +107,19 @@ abstract class ApiEndpoints {
static const String addDeviceToRoom = '/device/room';
static const String addDeviceToGroup = '/device/group';
static const String controlDevice = '/device/{deviceUuid}/control';
static const String firmwareDevice =
'/device/{deviceUuid}/firmware/{firmwareVersion}';
static const String firmwareDevice = '/device/{deviceUuid}/firmware/{firmwareVersion}';
static const String getDevicesByUserId = '/device/user/{userId}';
static const String getDevicesByUnitId = '/device/unit/{unitUuid}';
static const String openDoorLock = '/door-lock/open/{doorLockUuid}';
//GET
static const String deviceByRoom =
'projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces/{subSpaceUuid}/devices';
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces/{subSpaceUuid}/devices';
static const String deviceByUuid = '/device/{deviceUuid}';
static const String deviceFunctions = '/device/{deviceUuid}/functions';
static const String gatewayApi = '/device/gateway/{gatewayUuid}/devices';
static const String deviceFunctionsStatus =
'/device/{deviceUuid}/functions/status';
static const String powerClamp =
'/device/{powerClampUuid}/power-clamp/status';
static const String deviceFunctionsStatus = '/device/{deviceUuid}/functions/status';
static const String powerClamp = '/device/{powerClampUuid}/power-clamp/status';
///Device Permission Module
//POST
@ -135,7 +130,7 @@ abstract class ApiEndpoints {
static const String editDevicePermission = '/device-permission/edit/{userId}';
static const String assignDeviceToRoom =
'projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces/{subSpaceUuid}/devices/{deviceUuid}';
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces/{subSpaceUuid}/devices/{deviceUuid}';
/// Scene & Automation API ////////////////////
/// POST
@ -145,23 +140,21 @@ abstract class ApiEndpoints {
/// GET
static const String getUnitScenes =
'projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/scenes';
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/scenes';
static const String getScene = '/scene/tap-to-run/{sceneId}';
static const String getIconScene = '/scene/icon';
static const String getUnitAutomation = '/automation/{unitUuid}';
static const String getAutomationDetails =
'/automation/details/{automationId}';
static const String getAutomationDetails = '/automation/details/{automationId}';
/// PUT
static const String updateScene = '/scene/tap-to-run/{sceneId}';
static const String updateAutomation = '/automation/{automationId}';
static const String updateAutomationStatus =
'/automation/status/{automationId}';
static const String updateAutomationStatus = '/automation/status/{automationId}';
/// DELETE
static const String deleteScene = '/scene/tap-to-run/{sceneId}';
@ -170,10 +163,8 @@ abstract class ApiEndpoints {
//////////////////////Door Lock //////////////////////
//online
static const String addTemporaryPassword =
'/door-lock/temporary-password/online/{doorLockUuid}';
static const String getTemporaryPassword =
'/door-lock/temporary-password/online/{doorLockUuid}';
static const String addTemporaryPassword = '/door-lock/temporary-password/online/{doorLockUuid}';
static const String getTemporaryPassword = '/door-lock/temporary-password/online/{doorLockUuid}';
//one-time offline
static const String addOneTimeTemporaryPassword =
@ -205,8 +196,7 @@ abstract class ApiEndpoints {
'/door-lock/temporary-password/online/{doorLockUuid}/{passwordId}';
static const String saveSchedule = '/schedule/{deviceUuid}';
static const String getSchedule =
'/schedule/{deviceUuid}?category={category}';
static const String getSchedule = '/schedule/{deviceUuid}?category={category}';
static const String changeSchedule = '/schedule/enable/{deviceUuid}';
static const String deleteSchedule = '/schedule/{deviceUuid}/{scheduleId}';
static const String reportLogs =
@ -215,10 +205,8 @@ abstract class ApiEndpoints {
static const String statusBatch = '/device/status/batch';
static const String deviceScene = '/device/{deviceUuid}/scenes';
static const String fourSceneByName =
'/device/{deviceUuid}/scenes?switchName={switchName}';
static const String fourSceneByName = '/device/{deviceUuid}/scenes?switchName={switchName}';
static const String resetDevice = '/factory/reset/{deviceUuid}';
static const String unAssignScenesDevice =
'/device/{deviceUuid}/scenes?switchName={switchName}';
static const String unAssignScenesDevice = '/device/{deviceUuid}/scenes?switchName={switchName}';
}

View File

@ -99,9 +99,7 @@ Map<String, DeviceType> devicesTypesMap = {
Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
DeviceType.AC: [
FunctionModel(
code: 'switch',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'mode',
type: functionTypesMap['Enum'],
@ -124,9 +122,7 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
// "range": ["low", "middle", "high", "auto"]
})),
FunctionModel(
code: 'child_lock',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'child_lock', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
],
DeviceType.Gateway: [
FunctionModel(
@ -140,9 +136,7 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
"range": ["normal", "alarm"]
})),
FunctionModel(
code: 'factory_reset',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'factory_reset', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'alarm_active',
type: functionTypesMap['String'],
@ -152,8 +146,7 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
FunctionModel(
code: 'sensitivity',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "", "min": 1, "max": 10, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "", "min": 1, "max": 10, "scale": 0, "step": 1})),
],
DeviceType.DoorLock: [
FunctionModel(
@ -161,9 +154,7 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
type: functionTypesMap['Raw'],
values: ValueModel.fromJson({})),
FunctionModel(
code: 'remote_no_dp_key',
type: functionTypesMap['Raw'],
values: ValueModel.fromJson({})),
code: 'remote_no_dp_key', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'normal_open_switch',
type: functionTypesMap['Boolean'],
@ -173,87 +164,64 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
FunctionModel(
code: 'far_detection',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "cm", "min": 75, "max": 600, "scale": 0, "step": 75})),
values: ValueModel.fromJson({"unit": "cm", "min": 75, "max": 600, "scale": 0, "step": 75})),
FunctionModel(
code: 'presence_time',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "Min", "min": 0, "max": 65535, "scale": 0, "step": 1})),
values:
ValueModel.fromJson({"unit": "Min", "min": 0, "max": 65535, "scale": 0, "step": 1})),
FunctionModel(
code: 'motion_sensitivity_value',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
FunctionModel(
code: 'motionless_sensitivity',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "", "min": 1, "max": 5, "scale": 0, "step": 1})),
FunctionModel(
code: 'indicator',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'indicator', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
],
DeviceType.OneGang: [
FunctionModel(
code: 'switch_1',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'countdown_1',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
],
DeviceType.TwoGang: [
FunctionModel(
code: 'switch_1',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'switch_2',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_2', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'countdown_1',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'countdown_2',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
],
DeviceType.ThreeGang: [
FunctionModel(
code: 'switch_1',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'switch_2',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_2', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'switch_3',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_3', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'countdown_1',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'countdown_2',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'countdown_3',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
],
DeviceType.Curtain: [
FunctionModel(
@ -265,19 +233,15 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
FunctionModel(
code: 'percent_control',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "%", "min": 0, "max": 100, "scale": 0, "step": 1})),
],
DeviceType.WH: [
FunctionModel(
code: 'switch_1',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'countdown_1',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'relay_status',
type: functionTypesMap['Enum'],
@ -301,9 +265,7 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
],
DeviceType.DS: [
FunctionModel(
code: 'doorcontact_state',
type: functionTypesMap['Raw'],
values: ValueModel.fromJson({})),
code: 'doorcontact_state', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'battery_percentage',
type: functionTypesMap['Integer'],
@ -311,14 +273,11 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
],
DeviceType.OneTouch: [
FunctionModel(
code: 'switch_1',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'countdown_1',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'relay_status',
type: functionTypesMap['Enum'],
@ -340,23 +299,17 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
],
DeviceType.TowTouch: [
FunctionModel(
code: 'switch_1',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'switch_2',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_2', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'countdown_1',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'countdown_2',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'relay_status',
type: functionTypesMap['Enum'],
@ -384,32 +337,23 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
],
DeviceType.ThreeTouch: [
FunctionModel(
code: 'switch_1',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'switch_2',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_2', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'switch_3',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_3', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'countdown_1',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'countdown_2',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'countdown_3',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 43200, "scale": 0, "step": 1})),
FunctionModel(
code: 'relay_status',
type: functionTypesMap['Enum'],
@ -443,24 +387,19 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
],
DeviceType.GarageDoor: [
FunctionModel(
code: 'switch_1',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'countdown_1',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
FunctionModel(
code: 'tr_timecon',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 120, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 120, "scale": 0, "step": 1})),
FunctionModel(
code: 'countdown_alarm',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
FunctionModel(
code: 'door_control_1',
type: functionTypesMap['Enum'],
@ -481,24 +420,19 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
DeviceType.WaterLeak: [],
DeviceType.PC: [
FunctionModel(
code: 'switch_1',
type: functionTypesMap['Boolean'],
values: ValueModel.fromJson({})),
code: 'switch_1', type: functionTypesMap['Boolean'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'countdown_1',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
FunctionModel(
code: 'tr_timecon',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 120, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 120, "scale": 0, "step": 1})),
FunctionModel(
code: 'countdown_alarm',
type: functionTypesMap['Integer'],
values: ValueModel.fromJson(
{"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
values: ValueModel.fromJson({"unit": "s", "min": 0, "max": 86400, "scale": 0, "step": 1})),
FunctionModel(
code: 'door_control_1',
type: functionTypesMap['Enum'],
@ -542,13 +476,9 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
"range": ["scene"]
})),
FunctionModel(
code: 'scene_id_group_id',
type: functionTypesMap['Raw'],
values: ValueModel.fromJson({})),
code: 'scene_id_group_id', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'switch_backlight',
type: functionTypesMap['Enum'],
values: ValueModel.fromJson({})),
code: 'switch_backlight', type: functionTypesMap['Enum'], values: ValueModel.fromJson({})),
],
DeviceType.SixScene: [
FunctionModel(
@ -588,19 +518,13 @@ Map<DeviceType, List<FunctionModel>> devicesFunctionsMap = {
"range": ["scene"]
})),
FunctionModel(
code: 'scene_id_group_id',
type: functionTypesMap['Raw'],
values: ValueModel.fromJson({})),
code: 'scene_id_group_id', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'switch_backlight',
type: functionTypesMap['Enum'],
values: ValueModel.fromJson({})),
code: 'switch_backlight', type: functionTypesMap['Enum'], values: ValueModel.fromJson({})),
],
DeviceType.SOS: [
FunctionModel(
code: 'contact_state',
type: functionTypesMap['Raw'],
values: ValueModel.fromJson({})),
code: 'contact_state', type: functionTypesMap['Raw'], values: ValueModel.fromJson({})),
FunctionModel(
code: 'battery_percentage',
type: functionTypesMap['Integer'],
@ -700,69 +624,69 @@ List<Map<String, Object>> menuSections = [
],
},
//General Settings
{
'title': 'General Settings',
'color': const Color(0xFF023DFE),
'buttons': [
{
'title': 'Voice Assistant',
'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsVoiceAssistant,
'page': null
},
{
'title': 'Temperature unit',
'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsTemperatureUnit,
'page': null
},
{
'title': 'Touch tone on panel',
'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsTouchTone,
'page': null
},
{
'title': 'Language',
'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsLanguage,
'page': null
},
{
'title': 'Network Diagnosis',
'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsNetworkDiagnosis,
'page': null
},
{
'title': 'Clear Cache',
'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsClearCach,
'page': null
},
],
},
//Messages Center
{
'title': 'Messages Center',
'color': const Color(0xFF0088FF),
'buttons': [
{
'title': 'Alerts',
'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsAlerts,
'page': null
},
{
'title': 'Messages',
'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsMessages,
'page': null
},
{
'title': 'FAQs',
'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsFAQs,
'page': null
},
{
'title': 'Help & Feedback',
'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsHelpAndFeedback,
'page': null
},
],
},
// {
// 'title': 'General Settings',
// 'color': const Color(0xFF023DFE),
// 'buttons': [
// {
// 'title': 'Voice Assistant',
// 'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsVoiceAssistant,
// 'page': null
// },
// {
// 'title': 'Temperature unit',
// 'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsTemperatureUnit,
// 'page': null
// },
// {
// 'title': 'Touch tone on panel',
// 'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsTouchTone,
// 'page': null
// },
// {
// 'title': 'Language',
// 'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsLanguage,
// 'page': null
// },
// {
// 'title': 'Network Diagnosis',
// 'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsNetworkDiagnosis,
// 'page': null
// },
// {
// 'title': 'Clear Cache',
// 'Icon': Assets.assetsIconsMenuIconsGeneralSettingsIconsClearCach,
// 'page': null
// },
// ],
// },
// //Messages Center
// {
// 'title': 'Messages Center',
// 'color': const Color(0xFF0088FF),
// 'buttons': [
// {
// 'title': 'Alerts',
// 'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsAlerts,
// 'page': null
// },
// {
// 'title': 'Messages',
// 'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsMessages,
// 'page': null
// },
// {
// 'title': 'FAQs',
// 'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsFAQs,
// 'page': null
// },
// {
// 'title': 'Help & Feedback',
// 'Icon': Assets.assetsIconsMenuIconsMessagesCenterIconsHelpAndFeedback,
// 'page': null
// },
// ],
// },
//Security And Privacy
{
'title': 'Security And Privacy',
@ -773,11 +697,11 @@ List<Map<String, Object>> menuSections = [
'Icon': Assets.assetsIconsMenuIconsSecurityAndPrivacyIconsSecurty,
'page': const SecurtyView()
},
{
'title': 'Privacy',
'Icon': Assets.assetsIconsMenuIconsSecurityAndPrivacyIconsPrivacy,
'page': const PrivacyView()
},
// {
// 'title': 'Privacy',
// 'Icon': Assets.assetsIconsMenuIconsSecurityAndPrivacyIconsPrivacy,
// 'page': const PrivacyView()
// },
],
},
//Legal Information
@ -785,11 +709,7 @@ List<Map<String, Object>> menuSections = [
'title': 'Legal Information',
'color': const Color(0xFF001B72),
'buttons': [
{
'title': 'About',
'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsAbout,
'page': null
},
{'title': 'About', 'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsAbout, 'page': null},
{
'title': 'Privacy Policy',
'Icon': Assets.assetsIconsMenuIconsLeagalInfoIconsPrivacyPolicy,