register & Exception bottom sheet, country dropdown.
parent
5e292544d7
commit
8f1e4500cc
@ -1,579 +1,211 @@
|
|||||||
// import'dart:convert';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
//
|
import 'package:flutter/gestures.dart';
|
||||||
// import 'package:easy_localization/easy_localization.dart';
|
import 'package:flutter/material.dart';
|
||||||
// import 'package:flutter/gestures.dart';
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||||
// import 'package:flutter_svg/flutter_svg.dart';
|
import 'package:hmg_patient_app_new/core/app_state.dart';
|
||||||
// import 'package:hijri_gregorian_calendar/hijri_gregorian_calendar.dart';
|
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
||||||
// import 'package:hmg_patient_app/config/config.dart';
|
import 'package:hmg_patient_app_new/core/enums.dart';
|
||||||
// import 'package:hmg_patient_app/config/shared_pref_kay.dart';
|
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
||||||
// import 'package:hmg_patient_app/config/size_config.dart';
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||||
// import 'package:hmg_patient_app/core/service/client/base_app_client.dart';
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
// import 'package:hmg_patient_app/core/viewModels/project_view_model.dart';
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||||
// import 'package:hmg_patient_app/models/Appointments/toDoCountProviderModel.dart';
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||||
// import 'package:hmg_patient_app/models/Authentication/check_activation_code_response.dart';
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
// import 'package:hmg_patient_app/models/Authentication/check_paitent_authentication_req.dart';
|
import 'package:hmg_patient_app_new/widgets/appbar/app_bar_widget.dart';
|
||||||
// import 'package:hmg_patient_app/models/Authentication/check_user_status_reponse.dart';
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart' show CustomButton;
|
||||||
// import 'package:hmg_patient_app/models/Authentication/check_user_status_req.dart';
|
import 'package:hmg_patient_app_new/widgets/dropdown/country_dropdown_widget.dart';
|
||||||
// import 'package:hmg_patient_app/models/Authentication/checkpatient_for_registration.dart';
|
import 'package:hmg_patient_app_new/widgets/dropdown/dropdown_widget.dart';
|
||||||
// import 'package:hmg_patient_app/models/Authentication/register_info_response.dart';
|
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
|
||||||
// import 'package:hmg_patient_app/models/Authentication/send_activation_request.dart';
|
|
||||||
// import 'package:hmg_patient_app/new_ui/new_ext.dart';
|
class RegisterNew extends StatefulWidget {
|
||||||
// import 'package:hmg_patient_app/new_ui/otp/otp_validation_bootmsheet_widget.dart';
|
@override
|
||||||
// import 'package:hmg_patient_app/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
|
_RegisterNew createState() => _RegisterNew();
|
||||||
// import 'package:hmg_patient_app/pages/login/login-type.dart';
|
}
|
||||||
// import 'package:hmg_patient_app/pages/login/register-info.dart';
|
|
||||||
// import 'package:hmg_patient_app/pages/login/register.dart';
|
class _RegisterNew extends State<RegisterNew> {
|
||||||
// import 'package:hmg_patient_app/pages/login/register_new_step_2.dart';
|
bool isTermsAccepted = true;
|
||||||
// import 'package:hmg_patient_app/pages/login/user-login-agreement-page.dart';
|
|
||||||
// import 'package:hmg_patient_app/pages/login/welcome.dart';
|
@override
|
||||||
// import 'package:hmg_patient_app/services/authentication/auth_provider.dart';
|
void initState() {
|
||||||
// import 'package:hmg_patient_app/theme/colors.dart';
|
super.initState();
|
||||||
// import 'package:hmg_patient_app/uitl/app_shared_preferences.dart';
|
}
|
||||||
// import 'package:hmg_patient_app/uitl/app_toast.dart';
|
|
||||||
// import 'package:hmg_patient_app/uitl/font_utils.dart';
|
@override
|
||||||
// import 'package:hmg_patient_app/uitl/gif_loader_dialog_utils.dart';
|
void dispose() {
|
||||||
// import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
|
super.dispose();
|
||||||
// import 'package:hmg_patient_app/uitl/utils.dart';
|
}
|
||||||
// import 'package:hmg_patient_app/uitl/utils_new.dart';
|
|
||||||
// import 'package:hmg_patient_app/widgets/drawer/langauge_picker.dart';
|
@override
|
||||||
// import 'package:hmg_patient_app/widgets/others/app_scaffold_widget.dart';
|
Widget build(BuildContext context) {
|
||||||
// import 'package:flutter/material.dart';
|
AppState appState = getIt.get<AppState>();
|
||||||
// import 'package:hmg_patient_app/widgets/otp/sms-popup.dart';
|
return Scaffold(
|
||||||
// import 'package:hmg_patient_app/widgets/text/app_texts_widget.dart';
|
backgroundColor: AppColors.bgScaffoldColor,
|
||||||
// import 'package:hmg_patient_app_new/core/app_state.dart';
|
appBar: CustomAppBar(
|
||||||
// import 'package:hmg_patient_app_new/core/enums.dart';
|
onBackPressed: () {
|
||||||
// import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
Navigator.of(context).pop();
|
||||||
// import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
},
|
||||||
// import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
onLanguageChanged: (String value) {
|
||||||
// import 'package:hmg_patient_app_new/widgets/dropdown_widget.dart';
|
// context.setLocale(value == 'en' ? Locale('ar', 'SA') : Locale('en', 'US'));
|
||||||
// import 'package:hmg_patient_app_new/widgets/input_widget.dart';
|
},
|
||||||
// import 'package:provider/provider.dart';
|
),
|
||||||
//
|
body: GestureDetector(
|
||||||
// import '../../core/viewModels/appointment_rate_view_model.dart';
|
onTap: () {
|
||||||
// import '../../locator.dart';
|
FocusScope.of(context).unfocus();
|
||||||
// import '../../models/Authentication/authenticated_user.dart';
|
},
|
||||||
// import '../../models/Authentication/select_device_imei_res.dart';
|
child: ScrollConfiguration(
|
||||||
// import '../../models/InPatientServices/get_admission_info_response_model.dart';
|
behavior: ScrollConfiguration.of(context).copyWith(overscroll: false, physics: const ClampingScrollPhysics()),
|
||||||
// import '../../models/InPatientServices/get_admission_request_info_response_model.dart';
|
child: NotificationListener<OverscrollIndicatorNotification>(
|
||||||
// import '../../new_ui/exception_widget/ExceptionBottomSheet.dart';
|
onNotification: (notification) {
|
||||||
// import '../../services/clinic_services/get_clinic_service.dart';
|
notification.disallowIndicator();
|
||||||
// import '../../widgets/dialogs/alert_dialog.dart';
|
return true;
|
||||||
// import '../../widgets/dialogs/confirm_dialog.dart';
|
},
|
||||||
// import '../../widgets/transitions/fade_page.dart';
|
child: SingleChildScrollView(
|
||||||
// import 'package:intl/intl.dart' as intl;
|
physics: ClampingScrollPhysics(),
|
||||||
//
|
padding: EdgeInsets.symmetric(horizontal: 24.h),
|
||||||
// import '../landing/landing_page.dart';
|
child: Column(
|
||||||
// import '../rateAppointment/rate_appointment_doctor.dart';
|
mainAxisSize: MainAxisSize.min,
|
||||||
//
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
// class RegisterNew extends StatefulWidget {
|
children: [
|
||||||
// @override
|
Utils.showLottie(context: context, assetPath: 'assets/animations/lottie/register.json', width: 200.h, height: 200.h, fit: BoxFit.cover, repeat: true),
|
||||||
// _RegisterNew createState() => _RegisterNew();
|
SizedBox(height: 16.h),
|
||||||
// }
|
LocaleKeys.prepareToElevate.tr().toText32(isBold: true),
|
||||||
//
|
SizedBox(height: 24.h),
|
||||||
// class _RegisterNew extends State<RegisterNew> {
|
Directionality(
|
||||||
// @override
|
textDirection: Directionality.of(context),
|
||||||
// void initState() {
|
child: Container(
|
||||||
// super.initState();
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(24)),
|
||||||
// }
|
padding: EdgeInsets.symmetric(horizontal: 16.h),
|
||||||
//
|
child: Column(
|
||||||
// @override
|
children: [
|
||||||
// void dispose() {
|
CustomCountryDropdown(
|
||||||
// super.dispose();
|
countryList: Country.values,
|
||||||
// }
|
onCountryChange: (Country? value) {},
|
||||||
//
|
isRtl: Directionality.of(context) == TextDirection.LTR,
|
||||||
// @override
|
).withVerticalPadding(8.h),
|
||||||
// Widget build(BuildContext context) {
|
|
||||||
//
|
// DropdownWidget(
|
||||||
// AppState appState = getIt.get<AppState>();
|
// labelText: LocaleKeys.country.tr(),
|
||||||
// return Scaffold(
|
// hintText: LocaleKeys.ksa.tr(),
|
||||||
// body: GestureDetector(
|
// isEnable: true,
|
||||||
// onTap: () {
|
// selectedValue: appState.getLanguageID(context) == "1" ? "selectedCountry.nameArabic" : "selectedCountry.displayName",
|
||||||
// FocusScope.of(context).unfocus();
|
// dropdownItems: Country.values.map((e) => appState.getLanguageID(context) == " 1" ? e.displayName : e.displayName).toList(),
|
||||||
// },
|
// onChange: (val) {
|
||||||
// child: ScrollConfiguration(
|
// if (val != null) {}
|
||||||
// behavior: ScrollConfiguration.of(context).copyWith(overscroll: false, physics: const ClampingScrollPhysics()),
|
// },
|
||||||
// child: NotificationListener<OverscrollIndicatorNotification>(
|
// isBorderAllowed: false,
|
||||||
// onNotification: (notification) {
|
// hasSelectionCustomIcon: true,
|
||||||
// notification.disallowIndicator();
|
// isAllowRadius: false,
|
||||||
// return true;
|
// padding: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
// },
|
// selectionCustomIcon: AppAssets.arrow_down,
|
||||||
// child: SingleChildScrollView(
|
// ).withVerticalPadding(8),
|
||||||
// physics: ClampingScrollPhysics(),
|
Divider(height: 1.h),
|
||||||
// padding: EdgeInsets.only(
|
TextInputWidget(
|
||||||
// left: 24,
|
labelText: LocaleKeys.nationalIdNumber.tr(),
|
||||||
// right: 24,
|
hintText: "xxxxxxxxx",
|
||||||
// ),
|
controller: TextEditingController(),
|
||||||
// child: Column(
|
isEnable: true,
|
||||||
// mainAxisSize: MainAxisSize.min,
|
prefix: null,
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
isAllowRadius: true,
|
||||||
// children: [
|
isBorderAllowed: false,
|
||||||
// Utils.showLottie(
|
isAllowLeadingIcon: true,
|
||||||
// context: context,
|
|
||||||
// assetPath: 'assets/animations/lottie/register.json',
|
autoFocus: true,
|
||||||
// width: MediaQuery
|
padding: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
// .of(context)
|
leadingIcon: AppAssets.student_card,
|
||||||
// .size
|
onChange: (value) {
|
||||||
// .width * 0.45,
|
print(value);
|
||||||
// height: MediaQuery
|
}).withVerticalPadding(8),
|
||||||
// .of(context)
|
Divider(height: 1),
|
||||||
// .size
|
TextInputWidget(
|
||||||
// .height * 0.22,
|
labelText: LocaleKeys.dob.tr(),
|
||||||
// fit: BoxFit.cover,
|
hintText: "11 July, 1994",
|
||||||
// repeat: true),
|
controller: TextEditingController(),
|
||||||
// SizedBox(height: 8),
|
isEnable: true,
|
||||||
// LocaleKeys.prepareToElevate.tr().toText28(
|
prefix: null,
|
||||||
// textScaler: TextScaler.linear(MediaQuery.textScalerOf(context).scale(1)),
|
isAllowRadius: true,
|
||||||
// ),
|
isBorderAllowed: false,
|
||||||
// SizedBox(height: 24),
|
isAllowLeadingIcon: true,
|
||||||
// Directionality(
|
padding: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
// textDirection: Directionality.of(context),
|
leadingIcon: AppAssets.birthday_cake,
|
||||||
// child: Container(
|
onChange: (value) {},
|
||||||
// decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(24)),
|
).withVerticalPadding(8),
|
||||||
// padding: EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 0),
|
],
|
||||||
// child: Column(
|
),
|
||||||
// children: [
|
),
|
||||||
// DropdownWidget(
|
),
|
||||||
// labelText: LocaleKeys.country.tr(),
|
SizedBox(height: 25.h),
|
||||||
// hintText: LocaleKeys.ksa.tr(),
|
GestureDetector(
|
||||||
// isEnable: true,
|
onTap: () {},
|
||||||
// selectedValue: AppStat.selectedLanguage == "ar" ? selectedCountry.nameArabic : selectedCountry.displayName,
|
child: Row(
|
||||||
// dropdownItems: Country.values.map((e) => "ar" ? e.displayName : e.displayName).toList(),
|
children: [
|
||||||
//
|
AnimatedContainer(
|
||||||
// // dropdownItems: Country.values.map((e) => (e.name).first).toList(),
|
duration: const Duration(milliseconds: 200),
|
||||||
// // dropdownItems: Country.values.map((e) => "ar" ? e.nameArabic : e.displayName).toList(),
|
height: 24.h,
|
||||||
// // selectedValue: context.selectedLanguage == "ar" ? selectedCountry.nameArabic : selectedCountry.displayName,
|
width: 24.h,
|
||||||
// // selectionType: SelectionType.dropdown,
|
decoration: BoxDecoration(
|
||||||
// onChange: (val) {
|
color: isTermsAccepted ? const Color(0xFFE92227) : Colors.transparent,
|
||||||
// if (val != null) {
|
borderRadius: BorderRadius.circular(6),
|
||||||
// }
|
border: Border.all(
|
||||||
// },
|
color: isTermsAccepted ? const Color(0xFFE92227) : Colors.grey,
|
||||||
// isBorderAllowed: false,
|
width: 2.h,
|
||||||
// isAllowLeadingIcon: true,
|
),
|
||||||
// hasSelectionCustomIcon: true,
|
),
|
||||||
// removePadding: true,
|
child: isTermsAccepted ? Icon(Icons.check, size: 16.fSize, color: Colors.white) : null,
|
||||||
// isLeadingCountry: true,
|
),
|
||||||
// isAllowRadius: false,
|
SizedBox(width: 12.h),
|
||||||
// padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
|
Expanded(
|
||||||
// selectionCustomIcon: "assets/images/svg/arrow-down.svg",
|
child: Text(
|
||||||
// leadingIcon: selectedCountry.iconPath,
|
LocaleKeys.iAcceptTermsConditions.tr(),
|
||||||
// ).withVerticalPadding(8),
|
style: context.dynamicTextStyle(fontSize: 14.fSize, fontWeight: FontWeight.w500, color: Color(0xFF2E3039)),
|
||||||
// Divider(height: 1),
|
),
|
||||||
// Directionality(
|
),
|
||||||
// textDirection: TextDirection.ltr,
|
],
|
||||||
// child: newInputWidget(TranslationBase
|
),
|
||||||
// .of(context)
|
),
|
||||||
// .nationalIdNumber, "xxxxxxxxx", nationalIDorFile,
|
SizedBox(height: 25.h),
|
||||||
// isEnable: true,
|
CustomButton(
|
||||||
// prefix: null,
|
text: "Register",
|
||||||
// removePadding: true,
|
icon: AppAssets.note_edit,
|
||||||
// isAllowRadius: false,
|
onPressed: () {},
|
||||||
// hasSelection: false,
|
),
|
||||||
// isBorderAllowed: false,
|
SizedBox(height: 14),
|
||||||
// isAllowLeadingIcon: true,
|
Center(
|
||||||
// autoFocus: true,
|
child: RichText(
|
||||||
// padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
|
textAlign: TextAlign.center,
|
||||||
// leadingIcon: "assets/images/svg/student-card.svg",
|
text: TextSpan(
|
||||||
// onChange: (value) {
|
style: context.dynamicTextStyle(
|
||||||
// print(value);
|
color: Colors.black,
|
||||||
// }).withVerticalPadding(8),
|
fontSize: 16.fSize,
|
||||||
// ),
|
height: 26 / 16,
|
||||||
// Divider(height: 1),
|
fontWeight: FontWeight.w500,
|
||||||
// Directionality(
|
),
|
||||||
// textDirection: TextDirection.ltr,
|
children: <TextSpan>[
|
||||||
// child: newInputWidget(TranslationBase
|
TextSpan(text: LocaleKeys.alreadyHaveAccount.tr(), style: context.dynamicTextStyle()),
|
||||||
// .of(context)
|
TextSpan(text: " "),
|
||||||
// .dob, "11 July, 1994", nationalIDorFile,
|
TextSpan(
|
||||||
// isEnable: true,
|
text: LocaleKeys.loginNow.tr(),
|
||||||
// prefix: null,
|
style: context.dynamicTextStyle(
|
||||||
// hasSelection: true,
|
color: AppColors.primaryRedColor,
|
||||||
// removePadding: true,
|
fontSize: 16.fSize,
|
||||||
// isBorderAllowed: false,
|
height: 26 / 16,
|
||||||
// isAllowLeadingIcon: true,
|
fontWeight: FontWeight.w500,
|
||||||
// hasSelectionCustomIcon: true,
|
),
|
||||||
// selectionType: SelectionType.calendar,
|
recognizer: TapGestureRecognizer()
|
||||||
// selectedValue: selectedDOB != null
|
..onTap = () {
|
||||||
// ? isHijri == 1
|
Navigator.of(context).pop();
|
||||||
// ? Utils.formatHijriDateToDisplay(selectedDOB!.toIso8601String())
|
},
|
||||||
// : Utils.formatDateToDisplay(selectedDOB.toString())
|
),
|
||||||
// : null,
|
],
|
||||||
// selectionCustomIcon: "assets/images/svg/calendar.svg",
|
),
|
||||||
// lang: context.selectedLanguage,
|
),
|
||||||
// padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
|
),
|
||||||
// leadingIcon: "assets/images/svg/birthday-cake.svg",
|
SizedBox(height: 30),
|
||||||
// onChange: (value) {
|
],
|
||||||
// selectedDOB = DateTime.parse(value!);
|
),
|
||||||
// if (isHijri == 1) {
|
),
|
||||||
// var hijriDate = HijriGregConverter.gregorianToHijri(DateTime.parse(value));
|
),)
|
||||||
// selectedDOB = DateTime(hijriDate.year, hijriDate.month, hijriDate.day);
|
,
|
||||||
// } else {
|
)
|
||||||
// selectedDOB = DateTime.parse(value);
|
);
|
||||||
// }
|
}
|
||||||
// print(selectedDOB!.toIso8601String());
|
}
|
||||||
// setState(() {});
|
|
||||||
// },
|
|
||||||
// onCalendarTypeChanged: (bool value) {
|
|
||||||
// if (value) {
|
|
||||||
// isHijri = 0;
|
|
||||||
// } else {
|
|
||||||
// isHijri = 1;
|
|
||||||
// }
|
|
||||||
// }).withVerticalPadding(8),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 25),
|
|
||||||
// GestureDetector(
|
|
||||||
// onTap: () {
|
|
||||||
// setState(() {
|
|
||||||
// isTermsAccepted = !isTermsAccepted;
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// child: Row(
|
|
||||||
// children: [
|
|
||||||
// AnimatedContainer(
|
|
||||||
// duration: const Duration(milliseconds: 200),
|
|
||||||
// height: 24,
|
|
||||||
// width: 24,
|
|
||||||
// decoration: BoxDecoration(
|
|
||||||
// color: isTermsAccepted ? const Color(0xFFE92227) : Colors.transparent,
|
|
||||||
// borderRadius: BorderRadius.circular(6),
|
|
||||||
// border: Border.all(
|
|
||||||
// color: isTermsAccepted ? const Color(0xFFE92227) : Colors.grey,
|
|
||||||
// width: 2,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// child: isTermsAccepted ? const Icon(Icons.check, size: 16, color: Colors.white) : null,
|
|
||||||
// ),
|
|
||||||
// SizedBox(width: 12),
|
|
||||||
// Expanded(
|
|
||||||
// child: Text(
|
|
||||||
// TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .iAcceptTermsConditions,
|
|
||||||
// style: context.dynamicTextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFF2E3039)),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 25),
|
|
||||||
// CustomButton(
|
|
||||||
// text: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .register,
|
|
||||||
// icon: "assets/images/svg/note-edit.svg",
|
|
||||||
// onPressed: () {
|
|
||||||
// // bool isValid = Utils.validateIqama(nationalIDorFile.text);
|
|
||||||
// if (nationalIDorFile == null || nationalIDorFile.text.isEmpty) {
|
|
||||||
// context.showBottomSheet(
|
|
||||||
// child: ExceptionBottomSheet(
|
|
||||||
// message: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .pleaseEnterNationalId,
|
|
||||||
// showCancel: false,
|
|
||||||
// onOkPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// // Utils.showErrorToast(TranslationBase.of(context).pleaseEnterNationalId);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if ((!Utils.validateIqama(nationalIDorFile.text) && selectedCountry.countryCode == '966') ||
|
|
||||||
// (!Utils.validateUaeNationalId(nationalIDorFile.text) && selectedCountry.countryCode == '971')) {
|
|
||||||
// context.showBottomSheet(
|
|
||||||
// child: ExceptionBottomSheet(
|
|
||||||
// message: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .incorrectNationalId,
|
|
||||||
// showCancel: false,
|
|
||||||
// onOkPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (selectedCountry == null || selectedCountry.countryCode.isEmpty) {
|
|
||||||
// context.showBottomSheet(
|
|
||||||
// child: ExceptionBottomSheet(
|
|
||||||
// message: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .pleaseSelectCountry,
|
|
||||||
// showCancel: false,
|
|
||||||
// onOkPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (selectedDOB == null) {
|
|
||||||
// context.showBottomSheet(
|
|
||||||
// child: ExceptionBottomSheet(
|
|
||||||
// message: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .pleaseSelectDOB,
|
|
||||||
// showCancel: false,
|
|
||||||
// onOkPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if (!isTermsAccepted) {
|
|
||||||
// context.showBottomSheet(
|
|
||||||
// child: ExceptionBottomSheet(
|
|
||||||
// message: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .pleaseAcceptTermsConditions,
|
|
||||||
// showCancel: false,
|
|
||||||
// onOkPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if (phoneController != null) {
|
|
||||||
// phoneController.clear();
|
|
||||||
// }
|
|
||||||
// showModalBottomSheet(
|
|
||||||
// context: context,
|
|
||||||
// isScrollControlled: true,
|
|
||||||
// isDismissible: false,
|
|
||||||
// backgroundColor: Colors.transparent,
|
|
||||||
// builder: (bottomSheetContext) =>
|
|
||||||
// Padding(
|
|
||||||
// padding: EdgeInsets.only(bottom: MediaQuery
|
|
||||||
// .of(bottomSheetContext)
|
|
||||||
// .viewInsets
|
|
||||||
// .bottom),
|
|
||||||
// child: SingleChildScrollView(
|
|
||||||
// child: GenericBottomSheet(
|
|
||||||
// countryCode: selectedCountry.countryCode,
|
|
||||||
// initialPhoneNumber: "",
|
|
||||||
// textController: phoneController,
|
|
||||||
// onChange: (String? value) {
|
|
||||||
// mobileNo = value!;
|
|
||||||
// },
|
|
||||||
// buttons: [
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.only(bottom: 10),
|
|
||||||
// child: CustomButton(
|
|
||||||
// text: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .sendOTPSMS,
|
|
||||||
// onPressed: () {
|
|
||||||
// if (mobileNo.isEmpty) {
|
|
||||||
// context.showBottomSheet(
|
|
||||||
// child: ExceptionBottomSheet(
|
|
||||||
// message: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .pleaseEnterMobile,
|
|
||||||
// showCancel: false,
|
|
||||||
// onOkPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// } else if (!Utils.validateMobileNumber(mobileNo)) {
|
|
||||||
// context.showBottomSheet(
|
|
||||||
// child: ExceptionBottomSheet(
|
|
||||||
// message: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .pleaseEnterValidMobile,
|
|
||||||
// showCancel: false,
|
|
||||||
// onOkPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// registerUser(1);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// backgroundColor: CustomColors.bgRedColor,
|
|
||||||
// borderColor: CustomColors.bgRedBorderColor,
|
|
||||||
// textColor: Colors.white,
|
|
||||||
// icon: "assets/images/svg/message.svg",
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Row(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
// children: [
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
||||||
// child: AppText(
|
|
||||||
// TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .oR,
|
|
||||||
// fontSize: 16,
|
|
||||||
// fontFamily: context.fontFamily,
|
|
||||||
// color: Color(0xFF2E3039),
|
|
||||||
// fontWeight: FontWeight.w500,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.only(bottom: 10, top: 10),
|
|
||||||
// child: CustomButton(
|
|
||||||
// text: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .sendOTPWHATSAPP,
|
|
||||||
// onPressed: () {
|
|
||||||
// if (mobileNo.isEmpty) {
|
|
||||||
// context.showBottomSheet(
|
|
||||||
// child: ExceptionBottomSheet(
|
|
||||||
// message: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .pleaseEnterMobile,
|
|
||||||
// showCancel: false,
|
|
||||||
// onOkPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// } else if (!Utils.validateMobileNumber(mobileNo)) {
|
|
||||||
// context.showBottomSheet(
|
|
||||||
// child: ExceptionBottomSheet(
|
|
||||||
// message: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .pleaseEnterValidMobile,
|
|
||||||
// showCancel: false,
|
|
||||||
// onOkPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// registerUser(4);
|
|
||||||
// }
|
|
||||||
// // int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, mobileNo, context);
|
|
||||||
// // registerUser(val);
|
|
||||||
// },
|
|
||||||
// backgroundColor: Colors.white,
|
|
||||||
// borderColor: Color(0xFF2E3039),
|
|
||||||
// textColor: Color(0xFF2E3039),
|
|
||||||
// icon: "assets/images/svg/whatsapp.svg",
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// myFocusNode: myFocusNode,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// Future.delayed(Duration(milliseconds: 500), () {
|
|
||||||
// myFocusNode.requestFocus();
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// fontFamily: context.fontFamily,
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 14),
|
|
||||||
// Center(
|
|
||||||
// child: RichText(
|
|
||||||
// textAlign: TextAlign.center,
|
|
||||||
// text: TextSpan(
|
|
||||||
// style: context.dynamicTextStyle(
|
|
||||||
// color: Colors.black,
|
|
||||||
// fontSize: 16,
|
|
||||||
// height: 26 / 16,
|
|
||||||
// fontWeight: FontWeight.w500,
|
|
||||||
// ),
|
|
||||||
// children: <TextSpan>[
|
|
||||||
// TextSpan(text: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .alreadyHaveAccount, style: context.dynamicTextStyle()),
|
|
||||||
// TextSpan(text: " "),
|
|
||||||
// TextSpan(
|
|
||||||
// text: TranslationBase
|
|
||||||
// .of(context)
|
|
||||||
// .loginNow,
|
|
||||||
// style: context.dynamicTextStyle(
|
|
||||||
// color: CustomColors.bgRedColor,
|
|
||||||
// fontSize: 16,
|
|
||||||
// height: 26 / 16,
|
|
||||||
// fontWeight: FontWeight.w500,
|
|
||||||
// ),
|
|
||||||
// recognizer: TapGestureRecognizer()
|
|
||||||
// ..onTap = () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// SizedBox(height: 30),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),)
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Widget showProgress({String? title, String? status, Color? color, bool isNeedBorder = true}) {
|
|
||||||
// return Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Column(
|
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
// children: [
|
|
||||||
// Row(
|
|
||||||
// children: [
|
|
||||||
// Container(
|
|
||||||
// width: 26,
|
|
||||||
// height: 26,
|
|
||||||
// decoration: containerRadius(color!, 200),
|
|
||||||
// child: Icon(
|
|
||||||
// Icons.done,
|
|
||||||
// color: Colors.white,
|
|
||||||
// size: 16,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// if (isNeedBorder)
|
|
||||||
// Expanded(
|
|
||||||
// child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: mDivider(Colors.grey),
|
|
||||||
// )),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// mHeight(8),
|
|
||||||
// Text(
|
|
||||||
// title!,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 11,
|
|
||||||
// fontWeight: FontWeight.w600,
|
|
||||||
// letterSpacing: -0.44,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// mHeight(2),
|
|
||||||
// Container(
|
|
||||||
// padding: EdgeInsets.all(5),
|
|
||||||
// decoration: containerRadius(color.withOpacity(0.2), 4),
|
|
||||||
// child: Text(
|
|
||||||
// status!,
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 8,
|
|
||||||
// fontWeight: FontWeight.w600,
|
|
||||||
// letterSpacing: -0.32,
|
|
||||||
// color: color,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// )
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:hmg_patient_app_new/core/app_state.dart';
|
|
||||||
class AuthenticationViewModel extends ChangeNotifier {
|
|
||||||
// Add properties and methods related to authentication here
|
|
||||||
}
|
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||||
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
||||||
|
|
||||||
|
class ExceptionBottomSheet extends StatelessWidget {
|
||||||
|
String message;
|
||||||
|
bool showOKButton;
|
||||||
|
bool showCancel;
|
||||||
|
Function() onOkPressed;
|
||||||
|
Function()? onCancelPressed;
|
||||||
|
|
||||||
|
ExceptionBottomSheet({Key? key, required this.message, this.showOKButton = true, this.showCancel = false, required this.onOkPressed, this.onCancelPressed}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SafeArea(
|
||||||
|
bottom: Platform.isIOS ? false : true, // Adjust for iOS to avoid bottom padding
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
FocusScope.of(context).unfocus(); // Dismiss the keyboard when tapping outside
|
||||||
|
},
|
||||||
|
child: Builder(builder: (context) {
|
||||||
|
return Directionality(
|
||||||
|
textDirection: Directionality.of(context),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.all(24.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xFFF8F8FA),
|
||||||
|
borderRadius: const BorderRadius.vertical(top: Radius.circular(16)),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
LocaleKeys.notice.tr().toText28(),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
child: Utils.buildSvgWithAssets(icon: AppAssets.cross_circle),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
(message ?? "").toText16(isBold: false, color: AppColors.textColor),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
SizedBox(height: 24.h),
|
||||||
|
if (showOKButton && showCancel)
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: CustomButton(
|
||||||
|
text: LocaleKeys.cancel.tr(),
|
||||||
|
onPressed: onCancelPressed != null
|
||||||
|
? onCancelPressed!
|
||||||
|
: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
backgroundColor: AppColors.secondaryLightRedColor,
|
||||||
|
borderColor: AppColors.secondaryLightRedColor,
|
||||||
|
textColor: AppColors.primaryRedColor,
|
||||||
|
icon: AppAssets.cancel,
|
||||||
|
iconColor: AppColors.primaryRedColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5.h),
|
||||||
|
Expanded(
|
||||||
|
child: CustomButton(
|
||||||
|
text: showCancel ? LocaleKeys.confirm.tr() : LocaleKeys.ok.tr(),
|
||||||
|
onPressed: onOkPressed,
|
||||||
|
backgroundColor: AppColors.bgGreenColor,
|
||||||
|
borderColor: AppColors.bgGreenColor,
|
||||||
|
textColor: Colors.white,
|
||||||
|
icon: AppAssets.confirm,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (showOKButton && !showCancel)
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(bottom: 10.h),
|
||||||
|
child: CustomButton(
|
||||||
|
text: LocaleKeys.ok.tr(),
|
||||||
|
onPressed: onOkPressed,
|
||||||
|
backgroundColor: AppColors.primaryRedColor,
|
||||||
|
borderColor: AppColors.primaryRedBorderColor,
|
||||||
|
textColor: Colors.white,
|
||||||
|
icon: AppAssets.confirm,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/enums.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||||
|
|
||||||
|
class CustomCountryDropdown extends StatefulWidget {
|
||||||
|
final List<Country> countryList;
|
||||||
|
final Function(Country)? onCountryChange;
|
||||||
|
final bool isRtl;
|
||||||
|
|
||||||
|
const CustomCountryDropdown({
|
||||||
|
Key? key,
|
||||||
|
required this.countryList,
|
||||||
|
this.onCountryChange,
|
||||||
|
required this.isRtl,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_CustomCountryDropdownState createState() => _CustomCountryDropdownState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CustomCountryDropdownState extends State<CustomCountryDropdown> {
|
||||||
|
Country? selectedCountry;
|
||||||
|
late OverlayEntry _overlayEntry;
|
||||||
|
bool _isDropdownOpen = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
selectedCountry = Country.saudiArabia;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if (_isDropdownOpen) {
|
||||||
|
_closeDropdown();
|
||||||
|
} else {
|
||||||
|
_openDropdown();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: 40.h,
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(borderRadius: 10.h),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Utils.buildSvgWithAssets(icon: selectedCountry != null ? selectedCountry!.iconPath : AppAssets.ksa, width: 40.h, height: 40.h),
|
||||||
|
SizedBox(width: 8.h),
|
||||||
|
Utils.buildSvgWithAssets(icon: _isDropdownOpen ? AppAssets.dropdow_icon : AppAssets.dropdow_icon),
|
||||||
|
SizedBox(width: 4.h),
|
||||||
|
Text(
|
||||||
|
selectedCountry != null ? selectedCountry!.displayName : "Select Country",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.fSize,
|
||||||
|
height: 21 / 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
letterSpacing: -0.2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _openDropdown() {
|
||||||
|
RenderBox renderBox = context.findRenderObject() as RenderBox;
|
||||||
|
Offset offset = renderBox.localToGlobal(Offset.zero);
|
||||||
|
|
||||||
|
_overlayEntry = OverlayEntry(
|
||||||
|
builder: (context) => Stack(
|
||||||
|
children: [
|
||||||
|
// Dismiss dropdown when tapping outside
|
||||||
|
Positioned.fill(
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: _closeDropdown,
|
||||||
|
behavior: HitTestBehavior.translucent,
|
||||||
|
child: Container(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: offset.dy + renderBox.size.height,
|
||||||
|
left: widget.isRtl ? offset.dx + 15.h : offset.dx - 15.h,
|
||||||
|
width: renderBox.size.width,
|
||||||
|
child: Material(
|
||||||
|
child: Container(
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: 12,
|
||||||
|
),
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// borderRadius: BorderRadius.circular(12),
|
||||||
|
// boxShadow: [
|
||||||
|
// BoxShadow(
|
||||||
|
// color: Color(0xFFF8F8FA),
|
||||||
|
// blurRadius: 8.h,
|
||||||
|
// offset: Offset(
|
||||||
|
// 0,
|
||||||
|
// 2,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
child: Column(
|
||||||
|
children: widget.countryList
|
||||||
|
.map(
|
||||||
|
(country) => GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
selectedCountry = country;
|
||||||
|
});
|
||||||
|
widget.onCountryChange?.call(country);
|
||||||
|
_closeDropdown();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 12.h, horizontal: 16.h),
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||||
|
borderRadius: 16.h,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Utils.buildSvgWithAssets(
|
||||||
|
icon: country.iconPath,
|
||||||
|
width: 38.h,
|
||||||
|
height: 38.h,
|
||||||
|
),
|
||||||
|
SizedBox(width: 12.h),
|
||||||
|
Text(country.displayName,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.fSize,
|
||||||
|
height: 21 / 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
letterSpacing: -0.2,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
Overlay.of(context)?.insert(_overlayEntry);
|
||||||
|
setState(() {
|
||||||
|
_isDropdownOpen = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void _closeDropdown() {
|
||||||
|
_overlayEntry.remove();
|
||||||
|
setState(() {
|
||||||
|
_isDropdownOpen = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue