LiveCare Phone Call type Mobile number edit field disabled as per Mr Rwaid's instructions.

merge-update-with-lab-changes
haroon amjad 7 months ago
parent a0528da4cd
commit f7599a47e7

@ -118,6 +118,7 @@ class _LiveCareCallTypeSelectPageState extends State<LiveCareCallTypeSelectPage>
}, },
mobileNo: this.mobileNo, mobileNo: this.mobileNo,
isLiveCareTypeSelect: true, isLiveCareTypeSelect: true,
isEnable: false,
), ),
], ],
), ),

@ -14,7 +14,9 @@ class PhoneNumberSelectorWidget extends StatefulWidget {
final Function? onCountryChange; final Function? onCountryChange;
final String? mobileNo; final String? mobileNo;
bool isLiveCareTypeSelect; 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 @override
_PhoneNumberSelectorWidgetState createState() { _PhoneNumberSelectorWidgetState createState() {
@ -28,6 +30,7 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
List<Countries> counties = []; List<Countries> counties = [];
ProjectViewModel? projectProvider; ProjectViewModel? projectProvider;
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
@override @override
void initState() { void initState() {
for (var element in countriesData) counties.add(Countries.fromJson(element)); for (var element in countriesData) counties.add(Countries.fromJson(element));
@ -44,7 +47,7 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
String? countryName = ""; String? countryName = "";
if(widget.isLiveCareTypeSelect) { if (widget.isLiveCareTypeSelect) {
textController.text = Utils.getPhoneNumberWithoutZero(widget.mobileNo!); textController.text = Utils.getPhoneNumberWithoutZero(widget.mobileNo!);
} }
for (var element in counties) { for (var element in counties) {
@ -55,9 +58,9 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
return Column( return Column(
children: [ children: [
inputWidget(TranslationBase.of(context).country, countryName!, isEnable: false, hasSelection: true), inputWidget(TranslationBase.of(context).country, countryName!, isEnable: true, hasSelection: true),
SizedBox(height: 12), 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<MobileNo> {
String countryCode = '+966'; String countryCode = '+966';
List<Countries> counties = []; List<Countries> counties = [];
ProjectViewModel? projectProvider; ProjectViewModel? projectProvider;
@override @override
void initState() { void initState() {
countriesData.forEach((element) { countriesData.forEach((element) {

Loading…
Cancel
Save