import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ForgotPassword extends StatefulWidget { @override _ForgotPassword createState() => _ForgotPassword(); } class _ForgotPassword extends State { String selectedType = 'Saudi Arabia'; final TextEditingController nationalIDorFile = null; final TextEditingController mobileNo = TextEditingController(); @override Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).forgotFileNoTitle, isShowAppBar: true, isShowDecPage: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20), height: SizeConfig.realScreenHeight * .8, width: SizeConfig.realScreenWidth, child: Column(children: [ Expanded( flex: 1, child: AppText( TranslationBase.of(context).forgotDesc, fontSize: SizeConfig.textMultiplier * 3, textAlign: TextAlign.start, marginTop: 10.0, )), Expanded( flex: 2, child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Row( mainAxisAlignment: MainAxisAlignment.center, children: [ // Expanded( // // add Expanded to have your dropdown button fill remaining space // child: DropdownButtonHideUnderline( // child: DropdownButton( // isExpanded: true, // value: selectedType, // iconSize: 40, // elevation: 16, // onChanged: (String newValue) => { // setState(() { // selectedType = newValue; // }) // }, // items: [ // 'Saudi Arabia', // 'Dubai', // ].map>( // (String value) { // return DropdownMenuItem( // value: value, // child: Text(value), // ); // }).toList()))), ], ), MobileNo(controller: mobileNo), ], ), ), Expanded( flex: 2, child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ Row( children: [ Expanded( child: DefaultButton( TranslationBase.of(context).submit, () { sendPatientIDBySMS(); // print(mobileNo.text); }, )), ], ), ], )) ]), ))); } sendPatientIDBySMS() { GifLoaderDialogUtils.showMyDialog(context); final authService = new AuthProvider(); authService.sendPatientIDSMS(mobileNo.text, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() {}); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); }); } }