diff --git a/lib/presentation/group/widgets/create_join_dialog.dart b/lib/presentation/group/widgets/create_join_dialog.dart index fe4baa8..21b107b 100644 --- a/lib/presentation/group/widgets/create_join_dialog.dart +++ b/lib/presentation/group/widgets/create_join_dialog.dart @@ -21,7 +21,6 @@ class CreateJoinGroupDialog { static Future createGroupDialog( BuildContext context, ) { - bool isSmallSized = 100.h < 800; return showDialog( context: context, builder: (context) => Dialog( @@ -31,61 +30,60 @@ class CreateJoinGroupDialog { child: SingleChildScrollView( child: Form( key: _groupKey, - child: Container( - height: isSmallSized ? 30.h : 25.h, - child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 32, vertical: 16), - child: Column( - children: [ - Container( - height: isSmallSized ? 12.h : 10.h, - child: Padding( - padding: const EdgeInsets.all(4.0), - child: TextFormField( - controller: _groupNameController, - style: TextStyle(fontSize: 22.0), - validator: (value) => - Validator.validateBeaconTitle(value!), - onChanged: (name) {}, - decoration: InputDecoration( - border: InputBorder.none, - hintText: 'Enter Title Here', - labelStyle: TextStyle( - fontSize: labelsize, color: kYellow), - hintStyle: TextStyle( - fontSize: hintsize, color: hintColor), - labelText: 'Title', - alignLabelWithHint: true, - floatingLabelBehavior: - FloatingLabelBehavior.always, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none), - ), - ), - color: kLightBlue, - ), - SizedBox( - height: 2.h, + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 32, vertical: 16), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: EdgeInsets.all(1.h), + decoration: BoxDecoration( + color: kLightBlue, + borderRadius: BorderRadius.circular(8) ), - Flexible( - flex: 2, - child: HikeButton( - text: 'Create Group', - textSize: 18.0, - textColor: Colors.white, - buttonColor: kYellow, - onTap: () { - if (!_groupKey.currentState!.validate()) return; - AutoRouter.of(context).maybePop(); - context - .read() - .createGroup(_groupNameController.text.trim()); - _groupNameController.clear(); - }), + child: TextFormField( + controller: _groupNameController, + style: TextStyle(fontSize: 22.0), + validator: (value) => + Validator.validateBeaconTitle(value!), + onChanged: (name) {}, + decoration: InputDecoration( + border: InputBorder.none, + hintText: 'Enter Title Here', + labelStyle: TextStyle( + fontSize: labelsize, color: kYellow), + hintStyle: TextStyle( + fontSize: hintsize, color: hintColor), + labelText: 'Title', + alignLabelWithHint: true, + floatingLabelBehavior: + FloatingLabelBehavior.always, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none), ), - ], - ), + color: kLightBlue, + ), + SizedBox( + height: 2.h, + ), + Flexible( + flex: 2, + child: HikeButton( + text: 'Create Group', + textSize: 18.0, + textColor: Colors.white, + buttonColor: kYellow, + onTap: () { + if (!_groupKey.currentState!.validate()) return; + AutoRouter.of(context).maybePop(); + context + .read() + .createGroup(_groupNameController.text.trim()); + _groupNameController.clear(); + }), + ), + ], ), ), ), @@ -100,7 +98,7 @@ class CreateJoinGroupDialog { TextEditingController(); static Future joinGroupDialog(BuildContext context) { - bool isSmallSized = MediaQuery.of(context).size.height < 800; + return showDialog( context: context, builder: (context) => Dialog( @@ -109,61 +107,60 @@ class CreateJoinGroupDialog { ), child: Form( key: _joinGroupKey, - child: Container( - height: isSmallSized ? 30.h : 25.h, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), - child: Column( - children: [ - Container( - height: isSmallSized ? 12.h : 10.h, - child: Padding( - padding: const EdgeInsets.all(4.0), - child: TextFormField( - controller: _joinGroupController, - keyboardType: TextInputType.text, - textCapitalization: TextCapitalization.characters, - style: TextStyle(fontSize: 22.0), - validator: (value) => Validator.validatePasskey(value!), - onChanged: (value) { - _joinGroupController.text = value.toUpperCase(); - }, - decoration: InputDecoration( - alignLabelWithHint: true, - floatingLabelBehavior: FloatingLabelBehavior.always, - hintText: 'Enter Group Code Here', - hintStyle: - TextStyle(fontSize: hintsize, color: hintColor), - labelText: 'Code', - labelStyle: - TextStyle(fontSize: labelsize, color: kYellow), - border: InputBorder.none, - ), - ), - ), - color: kLightBlue, - ), - SizedBox( - height: 2.h, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + padding: EdgeInsets.all(1.h), + decoration: BoxDecoration( + color: kLightBlue, + borderRadius: BorderRadius.circular(8) ), - Flexible( - child: HikeButton( - text: 'Join Group', - textSize: 18.0, - textColor: Colors.white, - buttonColor: kYellow, - onTap: () { - if (!_joinGroupKey.currentState!.validate()) return; - appRouter.maybePop(); - context - .read() - .joinGroup(_joinGroupController.text.trim()); - _joinGroupController.clear(); - }, + child: TextFormField( + controller: _joinGroupController, + keyboardType: TextInputType.text, + textCapitalization: TextCapitalization.characters, + style: TextStyle(fontSize: 22.0), + validator: (value) => Validator.validatePasskey(value!), + onChanged: (value) { + _joinGroupController.text = value.toUpperCase(); + }, + decoration: InputDecoration( + alignLabelWithHint: true, + floatingLabelBehavior: FloatingLabelBehavior.always, + hintText: 'Enter Group Code Here', + hintStyle: + TextStyle(fontSize: hintsize, color: hintColor), + labelText: 'Code', + labelStyle: + TextStyle(fontSize: labelsize, color: kYellow), + border: InputBorder.none, ), ), - ], - ), + color: kLightBlue, + ), + SizedBox( + height: 2.h, + ), + Flexible( + child: HikeButton( + text: 'Join Group', + textSize: 18.0, + textColor: Colors.white, + buttonColor: kYellow, + onTap: () { + if (!_joinGroupKey.currentState!.validate()) return; + appRouter.maybePop(); + context + .read() + .joinGroup(_joinGroupController.text.trim()); + _joinGroupController.clear(); + }, + ), + ), + ], ), ), ), diff --git a/lib/presentation/home/home_screen.dart b/lib/presentation/home/home_screen.dart index 300b54b..7fa1da8 100644 --- a/lib/presentation/home/home_screen.dart +++ b/lib/presentation/home/home_screen.dart @@ -135,6 +135,15 @@ class _HomeScreenState extends State { // size: Size(100.w, 100.h), // painter: DrawCircle(), // ), + if (localApi.userModel.isGuest == true) + Align( + alignment: Alignment(0.7, -0.8), + child: FloatingActionButton( + onPressed: () => appRouter.pushNamed('/auth'), + backgroundColor: kYellow, + child: Icon(Icons.login, color: Colors.white), + ), + ), Align( alignment: Alignment(0.9, -0.8), child: FloatingActionButton(