From 6b2e0b1ce5eeec93c81f5da646031240a913146f Mon Sep 17 00:00:00 2001 From: mohammad Date: Mon, 9 Sep 2024 13:15:35 +0300 Subject: [PATCH] fix changes --- .../auth/view/forget_password_web_page.dart | 251 +----------------- 1 file changed, 2 insertions(+), 249 deletions(-) diff --git a/lib/pages/auth/view/forget_password_web_page.dart b/lib/pages/auth/view/forget_password_web_page.dart index 427e8b35..44f7e000 100644 --- a/lib/pages/auth/view/forget_password_web_page.dart +++ b/lib/pages/auth/view/forget_password_web_page.dart @@ -441,7 +441,7 @@ class ForgetPasswordWebPage extends StatelessWidget { return InputDecorator( decoration: InputDecoration( contentPadding: - const EdgeInsets.symmetric(horizontal: 16, vertical: 10), + const EdgeInsets.symmetric(horizontal: 2, vertical: 10), errorText: field.errorText, filled: true, // Ensure the dropdown is filled with the background color @@ -493,6 +493,7 @@ class ForgetPasswordWebPage extends StatelessWidget { return DropdownMenuItem( value: region.id, child: Text( + style: Theme.of(context).textTheme.bodyMedium, region.name, overflow: TextOverflow.ellipsis, maxLines: 1, @@ -567,252 +568,4 @@ class ForgetPasswordWebPage extends StatelessWidget { ); } -// Widget _buildDropdownField(BuildContext context, AuthBloc loginBloc, Size size) { - // final TextEditingController textEditingController = TextEditingController(); - // - // return Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Text( - // "Country/Region", - // style: Theme.of(context).textTheme.bodySmall!.copyWith( - // fontSize: 14, - // fontWeight: FontWeight.w400, - // ), - // ), - // const SizedBox(height: 10), - // Container( - // decoration: const BoxDecoration( - // color: ColorsManager.boxColor, - // borderRadius: BorderRadius.all(Radius.circular(8)), - // ), - // width: size.width * 0.9, - // child: FormField( - // validator: (value) { - // if (value == null || value.isEmpty) { - // return 'Please select a country/region'; - // } - // return null; - // }, - // builder: (FormFieldState field) { - // return InputDecorator( - // decoration: InputDecoration( - // contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10), - // errorText: field.errorText, - // border: OutlineInputBorder( - // borderRadius: BorderRadius.circular(8.0), - // borderSide: BorderSide( - // color: field.hasError ? Colors.red : Colors.transparent, - // width: 1.5, - // ), - // ), - // enabledBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(8.0), - // borderSide: BorderSide( - // color: field.hasError ? Colors.red : ColorsManager.grayColor, - // width: 1.5, - // ), - // ), - // focusedBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(8.0), - // borderSide: BorderSide( - // color: field.hasError ? Colors.red : ColorsManager.grayColor, - // width: 1.5, - // ), - // ), - // errorBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(8.0), - // borderSide: BorderSide( - // color: Colors.red, - // width: 1.5, - // ), - // ), - // ), - // child: DropdownButtonHideUnderline( - // child: DropdownButton2( - // isExpanded: true, - // hint: Text( - // 'Select your region/country', - // style: Theme.of(context).textTheme.bodySmall!.copyWith( - // color: ColorsManager.grayColor, - // fontWeight: FontWeight.w400, - // ), - // overflow: TextOverflow.ellipsis, - // ), - // items: loginBloc.regionList!.map((RegionModel region) { - // return DropdownMenuItem( - // value: region.id, - // child: Text( - // region.name, - // overflow: TextOverflow.ellipsis, - // maxLines: 1, - // ), - // ); - // }).toList(), - // value: loginBloc.regionList!.any((region) => region.id == loginBloc.regionUuid) - // ? loginBloc.regionUuid - // : null, - // onChanged: (String? value) { - // if (value != null) { - // loginBloc.add(SelectRegionEvent(val: value)); - // field.didChange(value); // Notify the form field of the change - // } - // }, - // buttonStyleData: const ButtonStyleData( - // padding: EdgeInsets.symmetric(horizontal: 16), - // height: 40, - // width: double.infinity, - // ), - // dropdownStyleData: DropdownStyleData( - // maxHeight: size.height * 0.70, - // ), - // menuItemStyleData: const MenuItemStyleData( - // height: 40, - // ), - // dropdownSearchData: DropdownSearchData( - // searchController: textEditingController, - // searchInnerWidgetHeight: 50, - // searchInnerWidget: Container( - // height: 50, - // padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - // child: TextFormField( - // style: const TextStyle(color: Colors.black), - // controller: textEditingController, - // decoration: textBoxDecoration()!.copyWith( - // errorStyle: const TextStyle(height: 0), - // contentPadding: const EdgeInsets.symmetric( - // vertical: 12, - // horizontal: 10, - // ), - // ), - // ), - // ), - // searchMatchFn: (item, searchValue) { - // final regionName = (item.child as Text).data?.toLowerCase() ?? ''; - // final search = searchValue.toLowerCase().trim(); - // return regionName.contains(search); - // }, - // ), - // onMenuStateChange: (isOpen) { - // if (!isOpen) { - // textEditingController.clear(); - // } - // }, - // ), - // ), - // ); - // }, - // ), - // ), - // ], - // ); - // } - -// Widget _buildDropdownField( - // BuildContext context, AuthBloc loginBloc, Size size) { - // final TextEditingController textEditingController = TextEditingController(); - // return Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Text( - // "Country/Region", - // style: Theme.of(context).textTheme.bodySmall!.copyWith( - // fontSize: 14, - // fontWeight: FontWeight.w400, - // ), - // ), - // const SizedBox(height: 10), - // Container( - // height: 50, - // decoration: const BoxDecoration( - // color: ColorsManager.boxColor, - // borderRadius: BorderRadius.all(Radius.circular(8)), - // ), - // width: size.width * 0.9, - // child: DropdownButtonHideUnderline( - // child: DropdownButton2( - // style: TextStyle(color: Colors.black), - // isExpanded: true, - // hint: Text( - // 'Select your region/country', - // style: Theme.of(context).textTheme.bodySmall!.copyWith( - // color: ColorsManager.grayColor, - // fontWeight: FontWeight.w400, - // ), - // overflow: TextOverflow.ellipsis, - // ), - // items: loginBloc.regionList!.map((RegionModel region) { - // return DropdownMenuItem( - // value: region.id, // Use region.id as the value - // child: Text( - // region.name, - // overflow: TextOverflow.ellipsis, - // maxLines: 1, - // ), - // ); - // }).toList(), - // value: loginBloc.regionList!.any( - // (region) => region.id == loginBloc.regionUuid,) - // ? loginBloc.regionUuid - // : null, - // onChanged: (String? value) { - // if (value != null) { - // - // loginBloc.add(SelectRegionEvent( - // val: value, - // )); - // } - // }, - // buttonStyleData: const ButtonStyleData( - // padding: EdgeInsets.symmetric(horizontal: 16), - // height: 40, - // width: double.infinity, - // ), - // dropdownStyleData: DropdownStyleData( - // maxHeight: size.height * 0.70, - // ), - // menuItemStyleData: const MenuItemStyleData( - // height: 40, - // ), - // dropdownSearchData: DropdownSearchData( - // searchController: textEditingController, - // searchInnerWidgetHeight: 50, - // searchInnerWidget: Container( - // height: 50, - // padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - // child: TextFormField( - // style: const TextStyle(color: Colors.black), - // controller: textEditingController, - // decoration: textBoxDecoration()!.copyWith( - // errorStyle: const TextStyle(height: 0), - // contentPadding: const EdgeInsets.symmetric( - // vertical: 12, - // horizontal: 10, - // ), - // ), - // ), - // ), - // searchMatchFn: (item, searchValue) { - // // Use the item's child text (region name) for searching. - // final regionName = (item.child as Text).data?.toLowerCase() ?? ''; - // final search = searchValue.toLowerCase().trim(); - // // Debugging print statement to ensure values are captured correctly. - // // Return true if the region name contains the search term. - // return regionName.contains(search); - // }, - // ), - // onMenuStateChange: (isOpen) { - // if (!isOpen) { - // textEditingController.clear(); - // } - // }, - // ), - // ), - // ), - // - // ], - // ); - // } }