diff --git a/assets/icons/linkageIcons/doorLockAlarm.svg b/assets/icons/linkageIcons/doorLockAlarm.svg new file mode 100644 index 0000000..3452356 --- /dev/null +++ b/assets/icons/linkageIcons/doorLockAlarm.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/icons/linkageIcons/familyHome.svg b/assets/icons/linkageIcons/familyHome.svg new file mode 100644 index 0000000..d4b0a95 --- /dev/null +++ b/assets/icons/linkageIcons/familyHome.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/unlockingMethodsIcons/face.svg b/assets/icons/unlockingMethodsIcons/face.svg new file mode 100644 index 0000000..2a317e4 --- /dev/null +++ b/assets/icons/unlockingMethodsIcons/face.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/unlockingMethodsIcons/fingerprint.svg b/assets/icons/unlockingMethodsIcons/fingerprint.svg new file mode 100644 index 0000000..f9f55c5 --- /dev/null +++ b/assets/icons/unlockingMethodsIcons/fingerprint.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/icons/unlockingMethodsIcons/remote.svg b/assets/icons/unlockingMethodsIcons/remote.svg new file mode 100644 index 0000000..da59643 --- /dev/null +++ b/assets/icons/unlockingMethodsIcons/remote.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/lib/features/app_layout/view/app_layout.dart b/lib/features/app_layout/view/app_layout.dart index cdb1725..93e486d 100644 --- a/lib/features/app_layout/view/app_layout.dart +++ b/lib/features/app_layout/view/app_layout.dart @@ -1,12 +1,11 @@ import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart'; import 'package:syncrow_app/features/app_layout/view/widgets/app_body.dart'; import 'package:syncrow_app/features/app_layout/view/widgets/default_app_bar.dart'; import 'package:syncrow_app/features/app_layout/view/widgets/default_nav_bar.dart'; -import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; class AppLayout extends StatelessWidget { const AppLayout({super.key}); @@ -17,23 +16,12 @@ class AppLayout extends StatelessWidget { create: (context) => HomeCubit.getInstance(), child: BlocBuilder( builder: (context, state) { - return AnnotatedRegion( - value: SystemUiOverlayStyle( - statusBarColor: ColorsManager.primaryColor.withOpacity(0.5), - statusBarIconBrightness: Brightness.light, - ), - child: SafeArea( - child: Scaffold( - backgroundColor: ColorsManager.backgroundColor, - extendBodyBehindAppBar: true, - extendBody: true, - appBar: HomeCubit.getInstance().spaces != null - ? const DefaultAppBar() - : null, - body: const AppBody(), - bottomNavigationBar: const DefaultNavBar(), - ), - ), + return DefaultScaffold( + appBar: HomeCubit.getInstance().spaces != null + ? const DefaultAppBar() + : null, + bottomNavBar: const DefaultNavBar(), + child: const AppBody(), ); }, ), diff --git a/lib/features/app_layout/view/widgets/app_body.dart b/lib/features/app_layout/view/widgets/app_body.dart index 6e80454..a8693f2 100644 --- a/lib/features/app_layout/view/widgets/app_body.dart +++ b/lib/features/app_layout/view/widgets/app_body.dart @@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart'; -import 'package:syncrow_app/generated/assets.dart'; class AppBody extends StatelessWidget { const AppBody({ @@ -15,32 +14,20 @@ class AppBody extends StatelessWidget { return BlocConsumer( listener: (context, state) { if (state is GetSpacesError) { - // ScaffoldMessenger.of(context).showSnackBar( - // SnackBar( - // content: Text(state.errMessage), - // ), - // ); + ScaffoldMessenger.of(context).removeCurrentSnackBar(); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(state.errMessage), + ), + ); } }, builder: (context, state) { - return Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - Assets.imagesBackground, - ), - fit: BoxFit.cover, - opacity: 0.4, - ), - ), - child: state is! GetSpacesLoading - ? state is! GetSpaceRoomsLoading - ? HomeCubit.getInstance().pages[HomeCubit.pageIndex] - : const Center(child: CircularProgressIndicator()) - : const Center(child: CircularProgressIndicator()), - ); + return state is! GetSpacesLoading + ? state is! GetSpaceRoomsLoading + ? HomeCubit.getInstance().pages[HomeCubit.pageIndex] + : const Center(child: CircularProgressIndicator()) + : const Center(child: CircularProgressIndicator()); }, ); } diff --git a/lib/features/app_layout/view/widgets/default_nav_bar.dart b/lib/features/app_layout/view/widgets/default_nav_bar.dart index 178faa5..79754a6 100644 --- a/lib/features/app_layout/view/widgets/default_nav_bar.dart +++ b/lib/features/app_layout/view/widgets/default_nav_bar.dart @@ -3,7 +3,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart'; import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; -import 'package:syncrow_app/utils/resource_manager/constants.dart'; class DefaultNavBar extends StatelessWidget { const DefaultNavBar({ @@ -15,34 +14,23 @@ class DefaultNavBar extends StatelessWidget { return BlocBuilder( builder: (context, state) { var cubit = HomeCubit.getInstance(); - return SizedBox( - height: Constants.bottomNavBarHeight, - child: BottomNavigationBar( - backgroundColor: Colors.transparent, - onTap: (int index) { - cubit.updatePageIndex(index); - // if (DevicesCubit.getInstance().chosenCategoryView != null) { - // DevicesCubit.getInstance() - // .clearCategoriesSelection(context); - // } - // if (HomeCubit.getInstance().selectedRoom != null) { - // HomeCubit.getInstance().unselectRoom(); - // } - - HomeCubit.getInstance().updatePageIndex(index); - }, - currentIndex: HomeCubit.pageIndex, - selectedItemColor: ColorsManager.primaryColor, - selectedLabelStyle: const TextStyle( - color: ColorsManager.primaryColor, - fontSize: 10, - ), - showUnselectedLabels: true, - unselectedItemColor: Colors.grey, - type: BottomNavigationBarType.fixed, - elevation: 0, - items: HomeCubit.bottomNavItems, + return BottomNavigationBar( + backgroundColor: Colors.transparent, + onTap: (int index) { + cubit.updatePageIndex(index); + HomeCubit.getInstance().updatePageIndex(index); + }, + currentIndex: HomeCubit.pageIndex, + selectedItemColor: ColorsManager.primaryColor, + selectedLabelStyle: const TextStyle( + color: ColorsManager.primaryColor, + fontSize: 10, ), + showUnselectedLabels: true, + unselectedItemColor: Colors.grey, + type: BottomNavigationBarType.fixed, + elevation: 0, + items: HomeCubit.bottomNavItems, ); }, ); diff --git a/lib/features/auth/bloc/auth_cubit.dart b/lib/features/auth/bloc/auth_cubit.dart index 4e10a42..daa909a 100644 --- a/lib/features/auth/bloc/auth_cubit.dart +++ b/lib/features/auth/bloc/auth_cubit.dart @@ -140,7 +140,7 @@ class AuthCubit extends Cubit { final value = await const FlutterSecureStorage().read(key: Token.loginAccessTokenKey); - if (value == null) { + if (value == null || value.isEmpty) { emit(AuthTokenError(message: "Token not found")); return; } diff --git a/lib/features/dashboard/view/dashboard_view.dart b/lib/features/dashboard/view/dashboard_view.dart index 9977200..3e7346d 100644 --- a/lib/features/dashboard/view/dashboard_view.dart +++ b/lib/features/dashboard/view/dashboard_view.dart @@ -5,7 +5,6 @@ import 'package:syncrow_app/features/dashboard/view/widgets/carbon_emission.dart import 'package:syncrow_app/features/dashboard/view/widgets/consumption.dart'; import 'package:syncrow_app/features/dashboard/view/widgets/live_monitor_tab.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart'; -import 'package:syncrow_app/utils/resource_manager/constants.dart'; import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; import 'widgets/energy_usage.dart'; @@ -15,45 +14,36 @@ class DashboardView extends StatelessWidget { @override Widget build(BuildContext context) { - return Padding( - padding: EdgeInsets.only( - top: Constants.appBarHeight, - left: Constants.defaultPadding, - right: Constants.defaultPadding, - bottom: Constants.bottomNavBarHeight, - ), - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const TitleMedium( - text: StringsManager.dashboard, - style: TextStyle( - fontSize: 32, - fontWeight: FontWeight.bold, - ), + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const TitleMedium( + text: StringsManager.dashboard, + style: TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, ), - const LiveMonitorTab(), - const SizedBox(height: 10), - const EnergyUsage(), - Container( - padding: const EdgeInsets.only(top: 20), - constraints: const BoxConstraints( - minHeight: 220, - maxHeight: 240, - ), - child: const Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Consumption(), - SizedBox(height: 20), - CarbonEmission(), - ], - ), + ), + const LiveMonitorTab(), + const SizedBox(height: 10), + const EnergyUsage(), + Container( + padding: const EdgeInsets.only(top: 20), + constraints: const BoxConstraints( + minHeight: 220, + maxHeight: 240, ), - ], - ), + child: const Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Consumption(), + SizedBox(height: 20), + CarbonEmission(), + ], + ), + ), + ], ), ); } diff --git a/lib/features/devices/view/devices_view.dart b/lib/features/devices/view/devices_view.dart deleted file mode 100644 index 6793026..0000000 --- a/lib/features/devices/view/devices_view.dart +++ /dev/null @@ -1,17 +0,0 @@ -// import 'package:flutter/material.dart'; -// import 'package:syncrow_app/features/devices/view/widgets/devices_view_body.dart'; - -// class DevicesView extends StatelessWidget { -// const DevicesView({super.key}); - -// @override -// Widget build(BuildContext context) { -// print('built DevicesView'); -// return Container( -// padding: const EdgeInsets.all(8), -// width: MediaQuery.of(context).size.width, -// height: MediaQuery.of(context).size.height, -// child: const DevicesViewBody(), -// ); -// } -// } diff --git a/lib/features/devices/view/widgets/presence_sensors/parameter_control_dialog.dart b/lib/features/devices/view/widgets/presence_sensors/parameter_control_dialog.dart index 1d22095..e8776aa 100644 --- a/lib/features/devices/view/widgets/presence_sensors/parameter_control_dialog.dart +++ b/lib/features/devices/view/widgets/presence_sensors/parameter_control_dialog.dart @@ -144,7 +144,6 @@ class ParameterControlDialogState extends State { return; } if (!widget.sensor.isOnline!) { - debugPrint('Device is offline'); return; } diff --git a/lib/features/devices/view/widgets/smart_door/add_member_interface.dart b/lib/features/devices/view/widgets/smart_door/add_member_interface.dart new file mode 100644 index 0000000..3622ad9 --- /dev/null +++ b/lib/features/devices/view/widgets/smart_door/add_member_interface.dart @@ -0,0 +1,231 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.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_large.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/constants.dart'; + +class AddMemberInterface extends StatelessWidget { + const AddMemberInterface({super.key, required this.memberRole}); + final MemberRole memberRole; + @override + Widget build(BuildContext context) { + return DefaultScaffold( + title: 'Add Member', + actions: [ + Padding( + padding: const EdgeInsets.only(right: 10), + child: TextButton( + onPressed: () {}, + child: const BodyMedium( + text: 'SAVE', + fontWeight: FontWeight.bold, + ), + ), + ), + ], + child: Column( + children: [ + SizedBox.square( + dimension: 120, + child: CircleAvatar( + backgroundColor: Colors.white, + child: SizedBox.square( + dimension: 117, + child: CircleAvatar( + backgroundColor: Colors.grey, + child: Icon( + memberRole == MemberRole.FamilyMember + ? Icons.family_restroom + : Icons.person, + size: 25, + color: Colors.white, + ), + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 20), + child: Row( + children: [ + const Expanded( + child: SizedBox.shrink(), + ), + BodyLarge( + text: memberRole == MemberRole.FamilyMember + ? 'Family Member' + : 'Guest', + fontWeight: FontWeight.bold, + ), + Expanded( + child: Row( + children: [ + IconButton( + onPressed: () {}, + icon: const Icon( + Icons.edit_outlined, + size: 20, + ), + ), + ], + ), + ), + ], + ), + ), + memberRole == MemberRole.FamilyMember + ? DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 25, + vertical: 5, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Region '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'United Arab Emirates', + hintStyle: context.bodyMedium + .copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + Container( + height: 1, + color: ColorsManager.greyColor, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Account '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'Account Name', + hintStyle: context.bodyMedium + .copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + Container( + height: 1, + color: ColorsManager.greyColor, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Family Role'), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'Common Member', + hintStyle: context.bodyMedium + .copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + ], + ), + ) + : DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 25, + vertical: 5, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Unlock with Mobile phone '), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Transform.scale( + scale: .8, + child: CupertinoSwitch( + value: false, + onChanged: (value) {}, + applyTheme: true, + ), + ), + ], + ), + ), + ], + ), + Container( + height: 1, + color: ColorsManager.greyColor, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Set Validity Period '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'Start and End Date', + hintStyle: context.bodyMedium + .copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + Container( + height: 1, + color: ColorsManager.greyColor, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const BodyMedium(text: 'Effictive Period '), + Flexible( + child: TextField( + textAlign: TextAlign.end, + decoration: InputDecoration( + hintText: 'Start and End Time', + hintStyle: context.bodyMedium + .copyWith(color: Colors.grey), + border: InputBorder.none, + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/features/devices/view/widgets/smart_door/add_member_view.dart b/lib/features/devices/view/widgets/smart_door/add_member_view.dart new file mode 100644 index 0000000..cd039f2 --- /dev/null +++ b/lib/features/devices/view/widgets/smart_door/add_member_view.dart @@ -0,0 +1,129 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/devices/view/widgets/smart_door/add_member_interface.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'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/constants.dart'; + +class AddMemberView extends StatelessWidget { + const AddMemberView({super.key}); + @override + Widget build(BuildContext context) { + return DefaultScaffold( + title: 'Add Member', + child: Column( + children: [ + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 15, + vertical: 20, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const BodyMedium( + text: 'Family Members', fontWeight: FontWeight.bold), + const Padding( + padding: EdgeInsets.symmetric(vertical: 13), + child: BodySmall( + text: + 'After adding:\n\n\t\t1.The user will join the family.\n\n\t\t2.The user will be able to control and use all devices in the family.', + fontColor: ColorsManager.greyColor, + fontSize: 10, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all( + ColorsManager.primaryColorWithOpacity, + ), + ), + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const AddMemberInterface( + memberRole: MemberRole.FamilyMember, + ), + ), + ); + }, + child: const Padding( + padding: EdgeInsets.symmetric(horizontal: 50), + child: BodyMedium( + text: 'ADD', + fontColor: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ) + ], + ), + ), + const SizedBox( + height: 10, + ), + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 15, + vertical: 20, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const BodyMedium( + text: 'Other Member', fontWeight: FontWeight.bold), + const Padding( + padding: EdgeInsets.symmetric(vertical: 13), + child: BodySmall( + text: + 'After adding:\n\n\t\t1.The user only appears in the member list of the current lock and can only view their own unlocking records.\n\n\t\t2.The user cannot obtain the permissions to operate or manage the lock.\n\n\t\t3.To grant the user operation permissions on the lock, you must use the device sharing functions.', + fontColor: ColorsManager.greyColor, + fontSize: 10, + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextButton( + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const AddMemberInterface( + memberRole: MemberRole.OtherMember, + ), + ), + ); + }, + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all( + ColorsManager.primaryColorWithOpacity, + ), + ), + child: const Padding( + padding: EdgeInsets.symmetric(horizontal: 50), + child: BodyMedium( + text: 'ADD', + fontColor: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ) + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/features/devices/view/widgets/smart_door/door_button.dart b/lib/features/devices/view/widgets/smart_door/door_button.dart index 610ffad..cfc91c1 100644 --- a/lib/features/devices/view/widgets/smart_door/door_button.dart +++ b/lib/features/devices/view/widgets/smart_door/door_button.dart @@ -1,5 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart'; +import 'package:syncrow_app/features/devices/model/device_control_model.dart'; +import 'package:syncrow_app/features/devices/model/device_model.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'; @@ -7,8 +11,10 @@ import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; class DoorLockButton extends StatefulWidget { const DoorLockButton({ super.key, + required this.doorLock, }); + final DeviceModel doorLock; @override State createState() => _DoorLockButtonState(); } @@ -28,9 +34,29 @@ class _DoorLockButtonState extends State _animation = Tween(begin: 0, end: 1.0).animate(_animationController) ..addListener(() { if (_animation.status == AnimationStatus.completed) { - //TODO send a request to lock the door but check if the door is already locked + if (widget.doorLock.status + .firstWhere((element) => element.code == 'normal_open_switch') + .value != + true) { + DevicesCubit.getInstance().deviceControl( + DeviceControlModel( + deviceId: widget.doorLock.uuid, + code: 'normal_open_switch', + value: true), + widget.doorLock.uuid ?? ""); + } } else if (_animation.status == AnimationStatus.dismissed) { - //TODO send a request to unlock the door but check if the door is already unlocked + if (widget.doorLock.status + .firstWhere((element) => element.code == 'normal_open_switch') + .value != + false) { + DevicesCubit.getInstance().deviceControl( + DeviceControlModel( + deviceId: widget.doorLock.uuid, + code: 'normal_open_switch', + value: false), + widget.doorLock.uuid ?? ""); + } } setState(() {}); }); @@ -44,101 +70,119 @@ class _DoorLockButtonState extends State @override Widget build(BuildContext context) { - return Padding( - padding: EdgeInsets.only( - right: context.width * 0.25 / 2, - left: context.width * 0.25 / 2, - bottom: context.width * 0.2 / 2, - ), - child: InkWell( - overlayColor: MaterialStateProperty.all( - ColorsManager.primaryColorWithOpacity.withOpacity(0.1)), - borderRadius: BorderRadius.circular(999), - onTapDown: (details) { - if (_animationController.status == AnimationStatus.dismissed) { - _animationController.forward(); - } else if (_animationController.status == AnimationStatus.completed) { - _animationController.reverse(); - } else if (_animationController.status == AnimationStatus.forward) { - _animationController.reverse(); - } else if (_animationController.status == AnimationStatus.reverse) { - _animationController.forward(); - } - }, - onTapUp: (details) { - if (_animationController.status == AnimationStatus.forward) { - _animationController.reverse(); - } else if (_animationController.status == AnimationStatus.reverse) { - _animationController.forward(); - } - }, - child: Container( - width: context.width * 06, - height: context.width * 0.6, - margin: const EdgeInsets.all(10), - decoration: const BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey, - blurRadius: 18, - offset: Offset(6, 7), - blurStyle: BlurStyle.outer, - ), - ], - color: Color(0xFFEBECED), - borderRadius: BorderRadius.all(Radius.circular(999)), + return BlocConsumer( + listener: (context, state) { + if (state is GetDeviceStatusError) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(state.errorMsg), + backgroundColor: Colors.red, + ), + ); + } + }, + builder: (context, state) { + return Padding( + padding: EdgeInsets.only( + right: context.width * 0.25 / 2, + left: context.width * 0.25 / 2, + bottom: context.width * 0.2 / 2, ), - child: Padding( - padding: const EdgeInsets.all(25), - child: Stack( - alignment: Alignment.center, - children: [ - Container( - margin: const EdgeInsets.all(8), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(999), - boxShadow: [ - BoxShadow( - color: Colors.white.withOpacity(0.5), - blurRadius: 30, - offset: const Offset(-5, -5), - blurStyle: BlurStyle.outer, - ), - BoxShadow( - color: Colors.black.withOpacity(0.14), - blurRadius: 25, - offset: const Offset(5, 5), - blurStyle: BlurStyle.outer, - ), - BoxShadow( - color: Colors.black.withOpacity(0.14), - blurRadius: 30, - offset: const Offset(5, 5), - blurStyle: BlurStyle.inner, - ), - ], + child: InkWell( + overlayColor: MaterialStateProperty.all( + ColorsManager.primaryColorWithOpacity.withOpacity(0.1)), + borderRadius: BorderRadius.circular(999), + onTapDown: (details) { + if (_animationController.status == AnimationStatus.dismissed) { + _animationController.forward(); + } else if (_animationController.status == + AnimationStatus.completed) { + _animationController.reverse(); + } else if (_animationController.status == + AnimationStatus.forward) { + _animationController.reverse(); + } else if (_animationController.status == + AnimationStatus.reverse) { + _animationController.forward(); + } + }, + onTapUp: (details) { + if (_animationController.status == AnimationStatus.forward) { + _animationController.reverse(); + } else if (_animationController.status == + AnimationStatus.reverse) { + _animationController.forward(); + } + }, + child: Container( + width: context.width * 06, + height: context.width * 0.6, + margin: const EdgeInsets.all(10), + decoration: const BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey, + blurRadius: 18, + offset: Offset(6, 7), + blurStyle: BlurStyle.outer, ), - child: Center( - child: SvgPicture.asset( - Assets.doorlockAssetsLockIcon, + ], + color: Color(0xFFEBECED), + borderRadius: BorderRadius.all(Radius.circular(999)), + ), + child: Padding( + padding: const EdgeInsets.all(25), + child: Stack( + alignment: Alignment.center, + children: [ + Container( + margin: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(999), + boxShadow: [ + BoxShadow( + color: Colors.white.withOpacity(0.5), + blurRadius: 30, + offset: const Offset(-5, -5), + blurStyle: BlurStyle.outer, + ), + BoxShadow( + color: Colors.black.withOpacity(0.14), + blurRadius: 25, + offset: const Offset(5, 5), + blurStyle: BlurStyle.outer, + ), + BoxShadow( + color: Colors.black.withOpacity(0.14), + blurRadius: 30, + offset: const Offset(5, 5), + blurStyle: BlurStyle.inner, + ), + ], + ), + child: Center( + child: SvgPicture.asset( + Assets.doorlockAssetsLockIcon, + ), + ), ), - ), + SizedBox.expand( + child: CircularProgressIndicator( + value: _animation.value, + strokeWidth: 15, + backgroundColor: Colors.transparent, + valueColor: const AlwaysStoppedAnimation( + ColorsManager.primaryColor), + ), + ) + ], ), - SizedBox.expand( - child: CircularProgressIndicator( - value: _animation.value, - strokeWidth: 15, - backgroundColor: Colors.transparent, - valueColor: const AlwaysStoppedAnimation( - ColorsManager.primaryColor), - ), - ) - ], + ), ), ), - ), - ), + ); + }, ); } } diff --git a/lib/features/devices/view/widgets/smart_door/door_grid.dart b/lib/features/devices/view/widgets/smart_door/door_grid.dart index f739291..425778a 100644 --- a/lib/features/devices/view/widgets/smart_door/door_grid.dart +++ b/lib/features/devices/view/widgets/smart_door/door_grid.dart @@ -1,5 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:syncrow_app/features/devices/view/widgets/smart_door/members_management_view.dart'; +import 'package:syncrow_app/features/devices/view/widgets/smart_door/smart_linkage_view.dart'; +import 'package:syncrow_app/features/devices/view/widgets/smart_door/unlocking_records_view.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; import 'package:syncrow_app/generated/assets.dart'; @@ -67,12 +70,12 @@ List> doorLockButtons = [ { 'title': 'Unlocking Records', 'image': Assets.doorlockAssetsUnlockingRecords, - 'page': null, + 'page': const UnlockingRecordsView(), }, { 'title': 'Memebers Managment', 'image': Assets.doorlockAssetsMembersManagement, - 'page': null, + 'page': const MembersManagementView(), }, { 'title': 'Temporary Password', @@ -82,6 +85,6 @@ List> doorLockButtons = [ { 'title': 'Smart Linkage', 'image': Assets.doorlockAssetsSmartLinkage, - 'page': null, + 'page': const SmartLinkgeView() }, ]; diff --git a/lib/features/devices/view/widgets/smart_door/door_interface.dart b/lib/features/devices/view/widgets/smart_door/door_interface.dart index cc5bcb2..905d45d 100644 --- a/lib/features/devices/view/widgets/smart_door/door_interface.dart +++ b/lib/features/devices/view/widgets/smart_door/door_interface.dart @@ -54,15 +54,15 @@ class DoorInterface extends StatelessWidget { left: Constants.defaultPadding, right: Constants.defaultPadding, ), - child: const Column( + child: Column( children: [ - DoorLockStatusBar(), + const DoorLockStatusBar(), Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - DoorLockButton(), - DoorLockGrid(), + DoorLockButton(doorLock: doorlock), + const DoorLockGrid(), ], ) ], diff --git a/lib/features/devices/view/widgets/smart_door/members_management_view.dart b/lib/features/devices/view/widgets/smart_door/members_management_view.dart new file mode 100644 index 0000000..3266b6e --- /dev/null +++ b/lib/features/devices/view/widgets/smart_door/members_management_view.dart @@ -0,0 +1,180 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/devices/view/widgets/smart_door/add_member_view.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/helpers/custom_page_route.dart'; +import 'package:syncrow_app/utils/helpers/misc_string_helpers.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/constants.dart'; + +class MembersManagementView extends StatefulWidget { + const MembersManagementView({super.key}); + + @override + State createState() => _MembersManagementViewState(); +} + +class _MembersManagementViewState extends State { + bool showFamilyMembers = true; + @override + Widget build(BuildContext context) { + return DefaultScaffold( + title: 'Manage Members', + actions: [ + Padding( + padding: const EdgeInsets.only(right: 10), + child: IconButton( + onPressed: () { + Navigator.of(context).push( + CustomPageRoute( + builder: (context) => const AddMemberView(), + ), + ); + }, + icon: const Icon( + Icons.add, + size: 30, + ), + ), + ), + ], + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + InkWell( + onTap: () { + setState(() { + showFamilyMembers = true; + }); + }, + child: BodyMedium( + text: 'Family Members', + fontWeight: + showFamilyMembers ? FontWeight.bold : FontWeight.normal, + ), + ), + const SizedBox(width: 10), + InkWell( + onTap: () { + setState(() { + showFamilyMembers = false; + }); + }, + child: BodyMedium( + text: 'Other Members', + fontWeight: !showFamilyMembers + ? FontWeight.bold + : FontWeight.normal, + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 20), + child: BodySmall( + text: + 'Administrators can set passwords for themselves or other users. Family members can set passwords only when they are granted the permission to set passwords.', + style: context.bodySmall.copyWith(fontSize: 8), + ), + ), + DefaultContainer( + padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10), + child: Column( + mainAxisSize: MainAxisSize.min, + children: List.generate( + members.length, + (index) { + if (showFamilyMembers) { + if (members[index]['role'] == MemberRole.FamilyMember) { + return Column( + children: [ + Row( + children: [ + const SizedBox.square( + dimension: 35, + child: CircleAvatar( + backgroundColor: Colors.grey, + ), + ), + const SizedBox( + width: 10, + ), + BodyMedium( + text: StringHelpers.toTitleCase( + members[index]['name'] as String)), + const Spacer(), + const BodyMedium( + text: 'Family Member', + fontColor: Colors.grey, + ) + ], + ), + index != members.length - 1 + ? Container( + margin: const EdgeInsets.only( + left: 45, top: 8, bottom: 8), + height: 1, + color: ColorsManager.greyColor, + ) + : const SizedBox(), + ], + ); + } else { + return const SizedBox(); + } + } else { + if (members[index]['role'] == MemberRole.OtherMember) { + return Column( + children: [ + Row( + children: [ + const SizedBox.square( + dimension: 35, + child: CircleAvatar( + backgroundColor: Colors.grey, + ), + ), + const SizedBox( + width: 10, + ), + BodyMedium( + text: StringHelpers.toTitleCase( + members[index]['name'] as String)), + const Spacer(), + const BodyMedium( + text: 'Other Member', + fontColor: Colors.grey, + ) + ], + ), + index != members.length - 1 + ? Container( + margin: const EdgeInsets.only( + left: 45, top: 8, bottom: 8), + height: 1, + color: ColorsManager.greyColor, + ) + : const SizedBox(), + ], + ); + } else { + return const SizedBox(); + } + } + }, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/features/devices/view/widgets/smart_door/smart_linkage_view.dart b/lib/features/devices/view/widgets/smart_door/smart_linkage_view.dart new file mode 100644 index 0000000..e50aeba --- /dev/null +++ b/lib/features/devices/view/widgets/smart_door/smart_linkage_view.dart @@ -0,0 +1,108 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.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_large.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.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/resource_manager/color_manager.dart'; + +class SmartLinkgeView extends StatelessWidget { + const SmartLinkgeView({super.key}); + + @override + Widget build(BuildContext context) { + return DefaultScaffold( + title: 'Scene', + child: Column( + children: [ + DefaultContainer( + padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 20), + child: Row( + children: [ + SizedBox( + width: 45, + height: 40, + child: SvgPicture.asset(Assets.linkageIconsFamilyHome), + ), + const SizedBox(width: 15), + const Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BodyLarge( + text: 'Family go home', + fontWeight: FontWeight.bold, + ), + BodySmall( + text: 'Trigger linkage when family member go home.', + ) + ], + ), + ), + const SizedBox(width: 10), + Transform.scale( + scale: 1, + child: CupertinoSwitch( + value: false, + onChanged: (value) {}, + applyTheme: true, + ), + ), + ], + ), + ), + const SizedBox(height: 10), + DefaultContainer( + padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 20), + child: Row( + children: [ + SizedBox( + width: 45, + height: 40, + child: SvgPicture.asset(Assets.linkageIconsDoorLockAlarm), + ), + const SizedBox(width: 15), + const Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BodyLarge( + text: 'Door Lock Alarm', + fontWeight: FontWeight.bold, + ), + BodySmall( + text: 'When door lock alarms, trigger linkage.', + ) + ], + ), + ), + const SizedBox(width: 10), + Transform.scale( + scale: 1, + child: CupertinoSwitch( + value: false, + onChanged: (value) {}, + applyTheme: true, + ), + ), + ], + ), + ), + const Spacer(), + DefaultContainer( + onTap: () {}, + padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 10), + color: ColorsManager.primaryColorWithOpacity, + child: const BodyMedium( + text: 'Custom linkage Type', + fontColor: Colors.white, + ), + ), + ], + ), + ); + } +} diff --git a/lib/features/devices/view/widgets/smart_door/unlocking_records_view.dart b/lib/features/devices/view/widgets/smart_door/unlocking_records_view.dart new file mode 100644 index 0000000..9eb2061 --- /dev/null +++ b/lib/features/devices/view/widgets/smart_door/unlocking_records_view.dart @@ -0,0 +1,316 @@ +// ignore_for_file: constant_identifier_names + +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.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/resource_manager/color_manager.dart'; + +class UnlockingRecordsView extends StatelessWidget { + const UnlockingRecordsView({super.key}); + + @override + Widget build(BuildContext context) { + List>> sortedRecords = + sortRecordsByDate(unlockingRecords); + return DefaultScaffold( + title: 'Unlocking Records', + child: SingleChildScrollView( + child: Column( + children: [ + for (var records in sortedRecords) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 10), + child: BodyMedium( + fontWeight: FontWeight.bold, + fontColor: Colors.grey, + text: + '${records[0]['day']} ${formatDate(DateTime.parse(records[0]['date'].toString()))}'), + ), + DefaultContainer( + padding: const EdgeInsets.symmetric( + horizontal: 20, vertical: 10), + child: Column( + children: [ + for (int i = 0; i < records.length; i++) + Column( + children: [ + Row( + children: [ + SizedBox.square( + dimension: 30, + child: records[i]['method'] == + UnlockingMethod.Fingerprint + ? SvgPicture.asset(Assets + .unlockingMethodsIconsFingerprint) + : records[i]['method'] == + UnlockingMethod.Remote + ? SvgPicture.asset(Assets + .unlockingMethodsIconsRemote) + : SvgPicture.asset(Assets + .unlockingMethodsIconsFace), + ), + const SizedBox( + width: 13, + ), + Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + BodyMedium( + text: records[i]['title'], + ), + BodySmall( + fontColor: Colors.grey, + text: formatTime( + records[i]['time'], + ), + ), + ], + ) + ], + ), + i != records.length - 1 + ? Padding( + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + right: 15, + left: 40), + child: Container( + height: 1, + color: ColorsManager.greyColor, + ), + ) + : const SizedBox.shrink(), + ], + ), + ], + )) + ], + ), + ], + ), + ), + ); + } + + String formatDate(DateTime date) { + return '${date.year}/${date.month.toString().padLeft(2, '0')}/${date.day.toString().padLeft(2, '0')}'; + } + + //time from 1200 to 12:00 + String formatTime(int time) { + return '${(time / 100).floor()}:${(time % 100).toString().padLeft(2, '0')}'; + } + + /// Sorts the given [records] by date and returns a nested list of records grouped by date. + /// + /// The [records] parameter is a list of maps, where each map represents a record with a 'date' key. + /// The records are sorted in ascending order based on the 'date' value. + /// The returned nested list contains sublists, where each sublist represents records for a specific date. + /// + /// Example usage: + /// ```dart + /// List> records = [ + /// {'date': '2022-01-01', 'data': 'Record 1'}, + /// {'date': '2022-01-02', 'data': 'Record 2'}, + /// {'date': '2022-01-01', 'data': 'Record 3'}, + /// ]; + /// + /// List>> sortedRecords = sortRecordsByDate(records); + /// print(sortedRecords); + /// ``` + /// This Dart function, sortRecordsByDate, takes a list of records as input, + /// where each record is a map with string keys and dynamic values. The + /// function's purpose is to sort these records by date and return a list of + /// lists, where each sublist contains records for a specific date. +// The function begins by initializing two empty lists: sortedRecords and dates. +// The sortedRecords list will eventually hold the sorted records, while the +//dates list will hold all unique dates present in the records. + +// The first for loop iterates over each record in the input list. For each +//record, it parses the 'date' field into a DateTime object and checks if this +//date is already in the dates list. If the date is not already in the list, it +// is added. This way, the dates list ends up holding all unique dates present +//in the records. + +// Next, the dates list is sorted in ascending order using the sort method with +// a comparator function that compares two DateTime objects. + +// The second for loop iterates over each unique date. For each date, it +//initializes an empty list recordsForDate to hold all records for that date. +// It then iterates over each record in the input list again. If a record's +//ate matches the current date (i.e., their comparison result is 0), the record +// is added to recordsForDate. After all records have been checked, r +//ecordsForDate is added to sortedRecords. + +// Finally, the function returns sortedRecords, which is a list of lists of +//records, where each sublist contains all records for a specific date, and the +//sublists are sorted in ascending order of date. + List>> sortRecordsByDate( + List> records) { + List>> sortedRecords = []; + List dates = []; + for (var record in records) { + if (!dates.contains(DateTime.parse(record['date'].toString()))) { + dates.add(DateTime.parse(record['date'].toString())); + } + } + dates.sort((a, b) => a.compareTo(b)); + for (var date in dates) { + List> recordsForDate = []; + for (var record in records) { + if (DateTime.parse(record['date'].toString()).compareTo(date) == 0) { + recordsForDate.add(record); + } + } + sortedRecords.add(recordsForDate); + } + return sortedRecords; + } +} + +enum UnlockingMethod { + Fingerprint, + Password, + Card, + Face, + Remote, +} + +List> unlockingRecords = [ + { + 'title': "XXX Fingerprint", + 'time': 1200, + 'date': 20240305, + 'day': 'Tuesday', + 'method': UnlockingMethod.Fingerprint, + }, + { + 'title': "XXX Face", + 'time': 1200, + 'date': 20240305, + 'day': 'Tuesday', + 'method': UnlockingMethod.Face, + }, + { + 'title': "XXX Remote", + 'time': 1200, + 'date': 20240305, + 'day': 'Tuesday', + 'method': UnlockingMethod.Remote, + }, + { + 'title': "XXX Face", + 'time': 1200, + 'date': 20240405, + 'day': 'Wednesday', + 'method': UnlockingMethod.Face, + }, + { + 'title': "XXX Fingerprint", + 'time': 1200, + 'date': 20240405, + 'day': 'Wednesday', + 'method': UnlockingMethod.Fingerprint, + }, + { + 'title': "XXX Fingerprint", + 'time': 1200, + 'date': 20240405, + 'day': 'Wednesday', + 'method': UnlockingMethod.Fingerprint, + }, + { + 'title': "XXX Remote", + 'time': 1500, + 'date': 20240505, + 'day': 'Thursday', + 'method': UnlockingMethod.Remote, + }, + { + 'title': "XXX Face", + 'time': 1200, + 'date': 20240505, + 'day': 'Thursday', + 'method': UnlockingMethod.Face, + }, + { + 'title': "XXX Fingerprint", + 'time': 1200, + 'date': 20240505, + 'day': 'Thursday', + 'method': UnlockingMethod.Fingerprint, + }, + { + 'title': "XXX Fingerprint", + 'time': 1200, + 'date': 20240505, + 'day': 'Thursday', + 'method': UnlockingMethod.Fingerprint, + }, + { + 'title': "XXX Remote", + 'time': 1500, + 'date': 20240505, + 'day': 'Thursday', + 'method': UnlockingMethod.Remote, + }, + { + 'title': "XXX Face", + 'time': 1200, + 'date': 20240605, + 'day': 'Friday', + 'method': UnlockingMethod.Face, + }, + { + 'title': "XXX Fingerprint", + 'time': 1200, + 'date': 20240605, + 'day': 'Friday', + 'method': UnlockingMethod.Fingerprint, + }, + { + 'title': "XXX Fingerprint", + 'time': 1200, + 'date': 20240605, + 'day': 'Friday', + 'method': UnlockingMethod.Fingerprint, + }, + { + 'title': "XXX Remote", + 'time': 1500, + 'date': 20240705, + 'day': 'Saturday', + 'method': UnlockingMethod.Remote, + }, + { + 'title': "XXX Face", + 'time': 1200, + 'date': 20240705, + 'day': 'Saturday', + 'method': UnlockingMethod.Face, + }, + { + 'title': "XXX Fingerprint", + 'time': 1200, + 'date': 20240705, + 'day': 'Saturday', + 'method': UnlockingMethod.Fingerprint, + }, + { + 'title': "XXX Fingerprint", + 'time': 1200, + 'date': 20240705, + 'day': 'Saturday', + 'method': UnlockingMethod.Fingerprint, + } +]; diff --git a/lib/features/menu/view/menu_view.dart b/lib/features/menu/view/menu_view.dart index ff7e9ca..a6bfb9d 100644 --- a/lib/features/menu/view/menu_view.dart +++ b/lib/features/menu/view/menu_view.dart @@ -2,19 +2,14 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart'; import 'package:syncrow_app/features/menu/bloc/menu_cubit.dart'; -import 'package:syncrow_app/features/menu/view/widgets/home%20management/create_home_view.dart'; -import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view.dart'; -import 'package:syncrow_app/features/menu/view/widgets/manage_home/manage_home_view.dart'; + import 'package:syncrow_app/features/menu/view/widgets/menu_list.dart'; -import 'package:syncrow_app/features/menu/view/widgets/privacy/privacy_view.dart'; import 'package:syncrow_app/features/menu/view/widgets/profile/profile_tab.dart'; -import 'package:syncrow_app/features/menu/view/widgets/securty/securty_view.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; -import 'package:syncrow_app/generated/assets.dart'; + import 'package:syncrow_app/navigation/routing_constants.dart'; import 'package:syncrow_app/utils/context_extension.dart'; -import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; import 'package:syncrow_app/utils/resource_manager/constants.dart'; class MenuView extends StatelessWidget { @@ -28,50 +23,42 @@ class MenuView extends StatelessWidget { builder: (context, state) { return BlocBuilder( builder: (context, state) { - return Padding( - padding: EdgeInsets.only( - top: Constants.appBarHeight, - bottom: Constants.bottomNavBarHeight, - left: Constants.defaultPadding, - right: Constants.defaultPadding, - ), - child: SingleChildScrollView( - physics: const BouncingScrollPhysics(), - child: Column( - children: [ - const ProfileTab(), - for (var section in menuSections) - MenuList( - section: section, - ), - const SizedBox( - height: 15, + return SingleChildScrollView( + physics: const BouncingScrollPhysics(), + child: Column( + children: [ + const ProfileTab(), + for (var section in menuSections) + MenuList( + section: section, ), - InkWell( - onTap: () { - AuthCubit.get(context).logout(); - Navigator.of(context).pushNamedAndRemoveUntil( - Routes.authLogin, (route) => false); - }, - child: Row( - children: [ - Expanded( - child: DefaultContainer( - child: Center( - child: BodyLarge( - text: 'Logout', - style: context.bodyLarge.copyWith( - color: Colors.red, - ), + const SizedBox( + height: 15, + ), + InkWell( + onTap: () { + AuthCubit.get(context).logout(); + Navigator.of(context).pushNamedAndRemoveUntil( + Routes.authLogin, (route) => false); + }, + child: Row( + children: [ + Expanded( + child: DefaultContainer( + child: Center( + child: BodyLarge( + text: 'Logout', + style: context.bodyLarge.copyWith( + color: Colors.red, ), ), ), ), - ], - ), - ) - ], - ), + ), + ], + ), + ) + ], ), ); }, @@ -81,123 +68,3 @@ class MenuView extends StatelessWidget { ); } } - -List> menuSections = [ - //Home Management - { - 'title': 'Home Management', - 'color': ColorsManager.primaryColor, - 'buttons': [ - { - 'title': 'Create a Home', - 'Icon': Assets.homeManagementIconsCreateHome, - 'page': const CreateHomeView() - }, - { - 'title': 'Join a Home', - 'Icon': Assets.homeManagementIconsJoinAHome, - 'page': const JoinHomeView() - }, - { - 'title': 'Manage Your Home', - 'Icon': Assets.homeManagementIconsManageYourHome, - 'page': const ManageHomeView() - }, - ], - }, - //General Settings - { - 'title': 'General Settings', - 'color': const Color(0xFF023DFE), - 'buttons': [ - { - 'title': 'Voice Assistant', - 'Icon': Assets.generalSettingsIconsVoiceAssistant, - 'page': null - }, - { - 'title': 'Temperature unit', - 'Icon': Assets.generalSettingsIconsTemperatureUnit, - 'page': null - }, - { - 'title': 'Touch tone on panel', - 'Icon': Assets.generalSettingsIconsTouchTone, - 'page': null - }, - { - 'title': 'Language', - 'Icon': Assets.generalSettingsIconsLanguage, - 'page': null - }, - { - 'title': 'Network Diagnosis', - 'Icon': Assets.generalSettingsIconsNetworkDiagnosis, - 'page': null - }, - { - 'title': 'Clear Cache', - 'Icon': Assets.generalSettingsIconsClearCache, - 'page': null - }, - ], - }, - //Messages Center - { - 'title': 'Messages Center', - 'color': const Color(0xFF0088FF), - 'buttons': [ - { - 'title': 'Alerts', - 'Icon': Assets.messagesCenterIconsAlerts, - 'page': null - }, - { - 'title': 'Messages', - 'Icon': Assets.messagesCenterIconsMessages, - 'page': null - }, - {'title': 'FAQs', 'Icon': Assets.messagesCenterIconsFAQs, 'page': null}, - { - 'title': 'Help & Feedback', - 'Icon': Assets.messagesCenterIconsHelpAndFeedbacks, - 'page': null - }, - ], - }, - //Security And Privacy - { - 'title': 'Security And Privacy', - 'color': const Color(0xFF8AB9FF), - 'buttons': [ - { - 'title': 'Security', - 'Icon': Assets.securityAndPrivacyIconsSecurty, - 'page': const SecurtyView() - }, - { - 'title': 'Privacy', - 'Icon': Assets.securityAndPrivacyIconsPrivacy, - 'page': const PrivacyView() - }, - ], - }, - //Legal Information - { - 'title': 'Legal Information', - 'color': const Color(0xFF001B72), - 'buttons': [ - {'title': 'About', 'Icon': Assets.leagalInfoIconsAbout, 'page': null}, - { - 'title': 'Privacy Policy', - 'Icon': Assets.leagalInfoIconsPrivacyPolicy, - 'page': null - }, - { - 'title': 'User Agreement', - 'Icon': Assets.leagalInfoIconsUserAgreement, - 'page': null - }, - ], - }, -]; diff --git a/lib/features/menu/view/widgets/join_home/join_home_view.dart b/lib/features/menu/view/widgets/join_home/join_home_view.dart index 25b6e14..2be31b2 100644 --- a/lib/features/menu/view/widgets/join_home/join_home_view.dart +++ b/lib/features/menu/view/widgets/join_home/join_home_view.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; diff --git a/lib/features/menu/view/widgets/manage_home/home_settings.dart b/lib/features/menu/view/widgets/manage_home/home_settings.dart index ea9aa46..cb6373d 100644 --- a/lib/features/menu/view/widgets/manage_home/home_settings.dart +++ b/lib/features/menu/view/widgets/manage_home/home_settings.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:syncrow_app/features/app_layout/model/space_model.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; diff --git a/lib/features/menu/view/widgets/manage_home/manage_home_view.dart b/lib/features/menu/view/widgets/manage_home/manage_home_view.dart index d6eab2a..eeb59ce 100644 --- a/lib/features/menu/view/widgets/manage_home/manage_home_view.dart +++ b/lib/features/menu/view/widgets/manage_home/manage_home_view.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:syncrow_app/features/app_layout/bloc/home_cubit.dart'; import 'package:syncrow_app/features/menu/view/widgets/manage_home/home_settings.dart'; diff --git a/lib/features/menu/view/widgets/menu_list_item.dart b/lib/features/menu/view/widgets/menu_list_item.dart index 8f8d94b..264e2b8 100644 --- a/lib/features/menu/view/widgets/menu_list_item.dart +++ b/lib/features/menu/view/widgets/menu_list_item.dart @@ -19,7 +19,6 @@ class MenuListItem extends StatelessWidget { Widget build(BuildContext context) { return InkWell( onTap: () { - debugPrint('clicked $title page: $page'); if (page == null) { return; } diff --git a/lib/features/menu/view/widgets/privacy/privacy_view.dart b/lib/features/menu/view/widgets/privacy/privacy_view.dart index 4dd9340..e2e4c37 100644 --- a/lib/features/menu/view/widgets/privacy/privacy_view.dart +++ b/lib/features/menu/view/widgets/privacy/privacy_view.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; diff --git a/lib/features/menu/view/widgets/securty/securty_view.dart b/lib/features/menu/view/widgets/securty/securty_view.dart index 65e1d94..b20029c 100644 --- a/lib/features/menu/view/widgets/securty/securty_view.dart +++ b/lib/features/menu/view/widgets/securty/securty_view.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:syncrow_app/features/shared_widgets/default_container.dart'; import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart'; diff --git a/lib/features/scene/view/scene_view.dart b/lib/features/scene/view/scene_view.dart index 6eb434d..28e87bd 100644 --- a/lib/features/scene/view/scene_view.dart +++ b/lib/features/scene/view/scene_view.dart @@ -6,7 +6,6 @@ import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dar import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart'; import 'package:syncrow_app/generated/assets.dart'; -import 'package:syncrow_app/utils/resource_manager/constants.dart'; import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; class SceneView extends StatelessWidget { @@ -18,109 +17,99 @@ class SceneView extends StatelessWidget { create: (BuildContext context) => SceneCubit(), child: BlocBuilder( builder: (context, state) { - return Padding( - padding: EdgeInsets.only( - top: Constants.appBarHeight, - bottom: Constants.bottomNavBarHeight, - left: Constants.defaultPadding, - right: Constants.defaultPadding, - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const TitleMedium( - text: StringsManager.routine, - style: TextStyle( - fontSize: 32, - fontWeight: FontWeight.bold, + return Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const TitleMedium( + text: StringsManager.routine, + style: TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 20), + const BodySmall( + text: StringsManager.tapToRunRoutine, + ), + Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 10, + ), + child: DefaultContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + height: 50, + width: 50, + Assets.iconsHot1, + fit: BoxFit.contain, + ), + const Icon( + Icons.play_circle, + size: 40, + color: Colors.grey, + ) + ], + ), + const BodyMedium( + text: StringsManager.summerMode, + fontWeight: FontWeight.bold, + fontSize: 16, + ) + ], + ), + ), + ), ), - ), - const SizedBox(height: 20), - const BodySmall( - text: StringsManager.tapToRunRoutine, - ), - Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 10, - ), - child: DefaultContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Image.asset( - height: 50, - width: 50, - Assets.iconsHot1, - fit: BoxFit.contain, - ), - const Icon( - Icons.play_circle, - size: 40, - color: Colors.grey, - ) - ], - ), - const BodyMedium( - text: StringsManager.summerMode, - fontWeight: FontWeight.bold, - fontSize: 16, - ) - ], - ), + const SizedBox(width: 10), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 10, + ), + child: DefaultContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + height: 50, + width: 50, + Assets.iconsWinter1, + fit: BoxFit.contain, + ), + const Icon( + Icons.play_circle, + size: 40, + color: Colors.grey, + ) + ], + ), + const BodyMedium( + text: StringsManager.winterMode, + fontWeight: FontWeight.bold, + fontSize: 16, + ) + ], ), ), ), - const SizedBox(width: 10), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - vertical: 10, - ), - child: DefaultContainer( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Image.asset( - height: 50, - width: 50, - Assets.iconsWinter1, - fit: BoxFit.contain, - ), - const Icon( - Icons.play_circle, - size: 40, - color: Colors.grey, - ) - ], - ), - const BodyMedium( - text: StringsManager.winterMode, - fontWeight: FontWeight.bold, - fontSize: 16, - ) - ], - ), - ), - ), - ), - ], - ) - ], - ), + ), + ], + ) + ], ); }, ), diff --git a/lib/features/shared_widgets/default_button.dart b/lib/features/shared_widgets/default_button.dart index 05bcf7d..09ad431 100644 --- a/lib/features/shared_widgets/default_button.dart +++ b/lib/features/shared_widgets/default_button.dart @@ -15,15 +15,18 @@ class DefaultButton extends StatelessWidget { this.customButtonStyle, this.backgroundColor, this.foregroundColor, + this.borderRadius, + this.height, + this.padding, }); final void Function()? onPressed; final Widget child; - + final double? height; final bool isSecondary; - + final double? borderRadius; final bool enabled; - + final double? padding; final bool isDone; final bool isLoading; @@ -65,21 +68,21 @@ class DefaultButton extends StatelessWidget { }), shape: MaterialStateProperty.all( RoundedRectangleBorder( - borderRadius: BorderRadius.circular(20), + borderRadius: BorderRadius.circular(borderRadius ?? 20), ), ), fixedSize: MaterialStateProperty.all( const Size.fromHeight(50), ), padding: MaterialStateProperty.all( - const EdgeInsets.all(10), + EdgeInsets.all(padding ?? 10), ), minimumSize: MaterialStateProperty.all( const Size.fromHeight(50), ), ), child: SizedBox( - height: 50, + height: height ?? 50, child: Center( child: isLoading ? const SizedBox.square( diff --git a/lib/features/shared_widgets/default_scaffold.dart b/lib/features/shared_widgets/default_scaffold.dart index 1a1f0df..4dcc674 100644 --- a/lib/features/shared_widgets/default_scaffold.dart +++ b/lib/features/shared_widgets/default_scaffold.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; @@ -9,11 +8,18 @@ import 'package:syncrow_app/utils/resource_manager/font_manager.dart'; class DefaultScaffold extends StatelessWidget { const DefaultScaffold( - {super.key, required this.child, this.title, this.actions}); + {super.key, + required this.child, + this.title, + this.actions, + this.appBar, + this.bottomNavBar}); final Widget child; final String? title; final List? actions; + final PreferredSizeWidget? appBar; + final Widget? bottomNavBar; @override Widget build(BuildContext context) { return AnnotatedRegion( @@ -26,20 +32,22 @@ class DefaultScaffold extends StatelessWidget { backgroundColor: ColorsManager.backgroundColor, extendBodyBehindAppBar: true, extendBody: true, - appBar: AppBar( - backgroundColor: Colors.transparent, - centerTitle: true, - title: BodyLarge( - text: title ?? "", - fontColor: ColorsManager.primaryColor, - fontWeight: FontsManager.bold, - ), - actions: actions, - ), + appBar: appBar ?? + AppBar( + backgroundColor: Colors.transparent, + centerTitle: true, + title: BodyLarge( + text: title ?? "", + fontColor: ColorsManager.primaryColor, + fontWeight: FontsManager.bold, + ), + actions: actions, + ), body: Container( width: MediaQuery.sizeOf(context).width, height: MediaQuery.sizeOf(context).height, - padding: const EdgeInsets.all(Constants.defaultPadding), + padding: + const EdgeInsets.symmetric(horizontal: Constants.defaultPadding), decoration: const BoxDecoration( image: DecorationImage( image: AssetImage( @@ -51,6 +59,7 @@ class DefaultScaffold extends StatelessWidget { ), child: SafeArea(child: child), ), + bottomNavigationBar: bottomNavBar, ), ); } diff --git a/lib/features/shared_widgets/text_widgets/custom_text_widget.dart b/lib/features/shared_widgets/text_widgets/custom_text_widget.dart index 2feb415..90d1faf 100644 --- a/lib/features/shared_widgets/text_widgets/custom_text_widget.dart +++ b/lib/features/shared_widgets/text_widgets/custom_text_widget.dart @@ -30,6 +30,7 @@ class CustomText extends StatelessWidget { Widget build(BuildContext context) { //was SelectableText return Text( + softWrap: true, text, style: style, textAlign: textAlign, diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index 5d12d79..bd503a5 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -176,6 +176,10 @@ class Assets { static const String imagesTestDash2 = 'assets/images/test_dash2.png'; static const String imagesVector = 'assets/images/Vector.png'; static const String imagesWhiteLogo = 'assets/images/white-logo.png'; + static const String linkageIconsDoorLockAlarm = + 'assets/icons/linkageIcons/doorLockAlarm.svg'; + static const String linkageIconsFamilyHome = + 'assets/icons/linkageIcons/familyHome.svg'; static const String leagalInfoIconsAbout = 'assets/icons/MenuIcons/LeagalInfoIcons/About.svg'; static const String leagalInfoIconsPrivacyPolicy = @@ -214,6 +218,12 @@ class Assets { 'assets/icons/presence-sensor-assets/Record.svg'; static const String presenceSensorAssetsTime = 'assets/icons/presence-sensor-assets/Time.svg'; + static const String unlockingMethodsIconsFace = + 'assets/icons/unlockingMethodsIcons/face.svg'; + static const String unlockingMethodsIconsFingerprint = + 'assets/icons/unlockingMethodsIcons/fingerprint.svg'; + static const String unlockingMethodsIconsRemote = + 'assets/icons/unlockingMethodsIcons/remote.svg'; static const String securityAndPrivacyIconsPrivacy = 'assets/icons/MenuIcons/SecurityAndPrivacyIcons/Privacy.svg'; static const String securityAndPrivacyIconsSecurty = diff --git a/lib/utils/resource_manager/constants.dart b/lib/utils/resource_manager/constants.dart index e1748dd..1a4a2db 100644 --- a/lib/utils/resource_manager/constants.dart +++ b/lib/utils/resource_manager/constants.dart @@ -1,6 +1,14 @@ //ignore_for_file: constant_identifier_names +import 'dart:ui'; + import 'package:syncrow_app/features/devices/model/function_model.dart'; +import 'package:syncrow_app/features/menu/view/widgets/home%20management/create_home_view.dart'; +import 'package:syncrow_app/features/menu/view/widgets/join_home/join_home_view.dart'; +import 'package:syncrow_app/features/menu/view/widgets/manage_home/manage_home_view.dart'; +import 'package:syncrow_app/features/menu/view/widgets/privacy/privacy_view.dart'; +import 'package:syncrow_app/features/menu/view/widgets/securty/securty_view.dart'; import 'package:syncrow_app/generated/assets.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; abstract class Constants { static const String appName = "Syncrow App"; @@ -9,8 +17,8 @@ abstract class Constants { static const String countryCode = "US"; - static const double appBarHeightPercentage = 0.12; - static const double bottomNavBarHeightPercentage = 0.1175; + static const double appBarHeightPercentage = 0.1; + static const double bottomNavBarHeightPercentage = 0.1; static late double appBarHeight; static late double bottomNavBarHeight; @@ -32,24 +40,6 @@ enum DeviceType { Other, } -// Map devicesTypesMap = { -// "AC": DeviceType.AC, -// "LB": DeviceType.LightBulb, -// "DL": DeviceType.DoorLock, -// "WC": DeviceType.Curtain, -// "WB": DeviceType.Blind, -// "3G": DeviceType.ThreeGang, -// "GW": DeviceType.Gateway, -// "CPS": DeviceType.CeilingSensor, -// "WPS": DeviceType.WallSensor, -// "Other": DeviceType.Other, -// }; -//AC wzdcrqh0 -// GW wp8ticoo2bhumwgb -// CPS d3ci7gcn -// DL awu7anehyu5q1iu8 -// WPS awarhusb -// 3G 1a6vgvyi enum FunctionType { Boolean, Enum, Integer, Raw, String } Map functionTypesMap = { @@ -260,3 +250,224 @@ K? getNextItem(Map map, V value) { // If the value is not found, return null return null; } + +List> menuSections = [ + //Home Management + { + 'title': 'Home Management', + 'color': ColorsManager.primaryColor, + 'buttons': [ + { + 'title': 'Create a Home', + 'Icon': Assets.homeManagementIconsCreateHome, + 'page': const CreateHomeView() + }, + { + 'title': 'Join a Home', + 'Icon': Assets.homeManagementIconsJoinAHome, + 'page': const JoinHomeView() + }, + { + 'title': 'Manage Your Home', + 'Icon': Assets.homeManagementIconsManageYourHome, + 'page': const ManageHomeView() + }, + ], + }, + //General Settings + { + 'title': 'General Settings', + 'color': const Color(0xFF023DFE), + 'buttons': [ + { + 'title': 'Voice Assistant', + 'Icon': Assets.generalSettingsIconsVoiceAssistant, + 'page': null + }, + { + 'title': 'Temperature unit', + 'Icon': Assets.generalSettingsIconsTemperatureUnit, + 'page': null + }, + { + 'title': 'Touch tone on panel', + 'Icon': Assets.generalSettingsIconsTouchTone, + 'page': null + }, + { + 'title': 'Language', + 'Icon': Assets.generalSettingsIconsLanguage, + 'page': null + }, + { + 'title': 'Network Diagnosis', + 'Icon': Assets.generalSettingsIconsNetworkDiagnosis, + 'page': null + }, + { + 'title': 'Clear Cache', + 'Icon': Assets.generalSettingsIconsClearCache, + 'page': null + }, + ], + }, + //Messages Center + { + 'title': 'Messages Center', + 'color': const Color(0xFF0088FF), + 'buttons': [ + { + 'title': 'Alerts', + 'Icon': Assets.messagesCenterIconsAlerts, + 'page': null + }, + { + 'title': 'Messages', + 'Icon': Assets.messagesCenterIconsMessages, + 'page': null + }, + {'title': 'FAQs', 'Icon': Assets.messagesCenterIconsFAQs, 'page': null}, + { + 'title': 'Help & Feedback', + 'Icon': Assets.messagesCenterIconsHelpAndFeedbacks, + 'page': null + }, + ], + }, + //Security And Privacy + { + 'title': 'Security And Privacy', + 'color': const Color(0xFF8AB9FF), + 'buttons': [ + { + 'title': 'Security', + 'Icon': Assets.securityAndPrivacyIconsSecurty, + 'page': const SecurtyView() + }, + { + 'title': 'Privacy', + 'Icon': Assets.securityAndPrivacyIconsPrivacy, + 'page': const PrivacyView() + }, + ], + }, + //Legal Information + { + 'title': 'Legal Information', + 'color': const Color(0xFF001B72), + 'buttons': [ + {'title': 'About', 'Icon': Assets.leagalInfoIconsAbout, 'page': null}, + { + 'title': 'Privacy Policy', + 'Icon': Assets.leagalInfoIconsPrivacyPolicy, + 'page': null + }, + { + 'title': 'User Agreement', + 'Icon': Assets.leagalInfoIconsUserAgreement, + 'page': null + }, + ], + }, +]; + +enum MemberRole { + FamilyMember, + OtherMember, +} + +//TODO sort memebers by role +List> members = [ + { + 'name': 'member 1', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 2', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 3', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 4', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 5', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 6', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 7', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 8', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 9', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 10', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 11', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 12', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 13', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 14', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 15', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 16', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 17', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 18', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 19', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 20', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 21', + 'role': MemberRole.FamilyMember, + }, + { + 'name': 'member 22', + 'role': MemberRole.OtherMember, + }, + { + 'name': 'member 23', + 'role': MemberRole.FamilyMember, + }, +]; diff --git a/pubspec.yaml b/pubspec.yaml index 472e4bc..6882bba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -54,6 +54,8 @@ flutter: - assets/icons/presence-sensor-assets/ - assets/icons/battery/dmOff/ - assets/icons/battery/dmOn/ + - assets/icons/unlockingMethodsIcons/ + - assets/icons/linkageIcons/ - assets/icons/MenuIcons/GeneralSettingsIcons/ - assets/icons/MenuIcons/HomeManagementIcons/ - assets/icons/MenuIcons/LeagalInfoIcons/