diff --git a/lib/pages/livecare/livecare_call_type_select.dart b/lib/pages/livecare/livecare_call_type_select.dart index b850e397..5592ee34 100644 --- a/lib/pages/livecare/livecare_call_type_select.dart +++ b/lib/pages/livecare/livecare_call_type_select.dart @@ -118,6 +118,7 @@ class _LiveCareCallTypeSelectPageState extends State }, mobileNo: this.mobileNo, isLiveCareTypeSelect: true, + isEnable: false, ), ], ), diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index 2747e3a3..9b2c9ff5 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -14,7 +14,9 @@ class PhoneNumberSelectorWidget extends StatefulWidget { final Function? onCountryChange; final String? mobileNo; bool isLiveCareTypeSelect; - PhoneNumberSelectorWidget({Key? key, this.onNumberChange, this.onCountryChange, this.mobileNo, this.isLiveCareTypeSelect = false}) : super(key: key); + bool isEnable; + + PhoneNumberSelectorWidget({Key? key, this.onNumberChange, this.onCountryChange, this.mobileNo, this.isLiveCareTypeSelect = false, this.isEnable = true}) : super(key: key); @override _PhoneNumberSelectorWidgetState createState() { @@ -28,6 +30,7 @@ class _PhoneNumberSelectorWidgetState extends State { List counties = []; ProjectViewModel? projectProvider; TextEditingController textController = new TextEditingController(); + @override void initState() { for (var element in countriesData) counties.add(Countries.fromJson(element)); @@ -44,7 +47,7 @@ class _PhoneNumberSelectorWidgetState extends State { Widget build(BuildContext context) { projectProvider = Provider.of(context); String? countryName = ""; - if(widget.isLiveCareTypeSelect) { + if (widget.isLiveCareTypeSelect) { textController.text = Utils.getPhoneNumberWithoutZero(widget.mobileNo!); } for (var element in counties) { @@ -55,9 +58,9 @@ class _PhoneNumberSelectorWidgetState extends State { return Column( children: [ - inputWidget(TranslationBase.of(context).country, countryName!, isEnable: false, hasSelection: true), + inputWidget(TranslationBase.of(context).country, countryName!, isEnable: true, hasSelection: true), SizedBox(height: 12), - Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).phoneNumber, widget.mobileNo ?? "5xxxxxxxx", prefix: countryCode)), + Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).phoneNumber, isEnable: widget.isEnable, widget.mobileNo ?? "5xxxxxxxx", prefix: countryCode)), ], ); } @@ -178,6 +181,7 @@ class _MobileNo extends State { String countryCode = '+966'; List counties = []; ProjectViewModel? projectProvider; + @override void initState() { countriesData.forEach((element) {