mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
@ -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,10 @@ class ForgetPasswordWebPage extends StatelessWidget {
|
||||
return DropdownMenuItem<String>(
|
||||
value: region.id,
|
||||
child: Text(
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
region.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
@ -567,252 +571,5 @@ 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();
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
//
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
}
|
||||
|
Reference in New Issue
Block a user