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..773ab7b --- /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/devices/view/widgets/smart_door/members_management_view.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'; + +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 index eba10f1..b835c0d 100644 --- a/lib/features/devices/view/widgets/smart_door/add_member_view.dart +++ b/lib/features/devices/view/widgets/smart_door/add_member_view.dart @@ -1,5 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/devices/view/widgets/smart_door/add_member_interface.dart'; +import 'package:syncrow_app/features/devices/view/widgets/smart_door/members_management_view.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'; @@ -8,7 +10,6 @@ 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( @@ -44,7 +45,15 @@ class AddMemberView extends StatelessWidget { ColorsManager.primaryColorWithOpacity, ), ), - onPressed: () {}, + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const AddMemberInterface( + memberRole: MemberRole.FamilyMember, + ), + ), + ); + }, child: const Padding( padding: EdgeInsets.symmetric(horizontal: 50), child: BodyMedium( @@ -86,7 +95,15 @@ class AddMemberView extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ TextButton( - onPressed: () {}, + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute( + builder: (context) => const AddMemberInterface( + memberRole: MemberRole.OtherMember, + ), + ), + ); + }, style: ButtonStyle( backgroundColor: MaterialStateProperty.all( ColorsManager.primaryColorWithOpacity, 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 805e776..a6df0e2 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 @@ -184,7 +184,7 @@ enum MemberRole { } //TODO sort memebers by role -var members = [ +List> members = [ { 'name': 'member 1', 'role': MemberRole.FamilyMember,