fix changes

This commit is contained in:
mohammad
2024-09-09 13:15:35 +03:00
parent 2162c996ea
commit 6b2e0b1ce5

View File

@ -441,7 +441,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
return InputDecorator( return InputDecorator(
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: contentPadding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 10), const EdgeInsets.symmetric(horizontal: 2, vertical: 10),
errorText: field.errorText, errorText: field.errorText,
filled: filled:
true, // Ensure the dropdown is filled with the background color true, // Ensure the dropdown is filled with the background color
@ -493,6 +493,7 @@ class ForgetPasswordWebPage extends StatelessWidget {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: region.id, value: region.id,
child: Text( child: Text(
style: Theme.of(context).textTheme.bodyMedium,
region.name, region.name,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, 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<String>(
// validator: (value) {
// if (value == null || value.isEmpty) {
// return 'Please select a country/region';
// }
// return null;
// },
// builder: (FormFieldState<String> 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<String>(
// 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<String>(
// 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<String>(
// 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<String>(
// 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();
// }
// },
// ),
// ),
// ),
//
// ],
// );
// }
} }