From bcc9e0c6c2bf67fd14fcbd04ab947b584fc7a87f Mon Sep 17 00:00:00 2001 From: Mohammad Salameh Date: Wed, 24 Apr 2024 12:07:39 +0300 Subject: [PATCH] Added AddMemebers Page --- .../widgets/smart_door/add_member_view.dart | 113 ++++++++++++++++++ .../smart_door/members_management_view.dart | 23 +++- .../smart_door/unlocking_records_view.dart | 2 +- 3 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 lib/features/devices/view/widgets/smart_door/add_member_view.dart 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..eba10f1 --- /dev/null +++ b/lib/features/devices/view/widgets/smart_door/add_member_view.dart @@ -0,0 +1,113 @@ +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_medium.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.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: () {}, + 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: () {}, + 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/members_management_view.dart b/lib/features/devices/view/widgets/smart_door/members_management_view.dart index ae473d5..805e776 100644 --- a/lib/features/devices/view/widgets/smart_door/members_management_view.dart +++ b/lib/features/devices/view/widgets/smart_door/members_management_view.dart @@ -1,9 +1,11 @@ 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'; @@ -20,14 +22,23 @@ class _MembersManagementViewState extends State { Widget build(BuildContext context) { return DefaultScaffold( title: 'Manage Members', - actions: const [ + actions: [ Padding( - padding: EdgeInsets.only(right: 10), - child: Icon( - Icons.add, - size: 30, + 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( 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 index 0548563..398fafa 100644 --- a/lib/features/devices/view/widgets/smart_door/unlocking_records_view.dart +++ b/lib/features/devices/view/widgets/smart_door/unlocking_records_view.dart @@ -4,7 +4,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:syncrow_app/features/shared_widgets/defaukt_scaffold.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';