|
|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
|
|
|
|
|
import 'package:car_provider_app/api/client/user_api_client.dart';
|
|
|
|
|
import 'package:car_provider_app/classes/utils.dart';
|
|
|
|
|
import 'package:car_provider_app/config/routes.dart';
|
|
|
|
|
@ -13,6 +12,7 @@ import 'package:car_provider_app/widgets/dialog/dialogs.dart';
|
|
|
|
|
import 'package:car_provider_app/widgets/dialog/message_dialog.dart';
|
|
|
|
|
import 'package:car_provider_app/widgets/dialog/otp_dialog.dart';
|
|
|
|
|
import 'package:car_provider_app/widgets/button/show_fill_button.dart';
|
|
|
|
|
import 'package:car_provider_app/widgets/txt_field.dart';
|
|
|
|
|
import 'package:easy_localization/src/public_ext.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
@ -20,57 +20,39 @@ import 'dart:convert';
|
|
|
|
|
import 'package:http/http.dart';
|
|
|
|
|
|
|
|
|
|
class ChangeMobilePage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<ChangeMobilePage> createState() => _ChangeMobilePageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ChangeMobilePageState extends State<ChangeMobilePage> {
|
|
|
|
|
int countryID=1 ;
|
|
|
|
|
int countryID = 1;
|
|
|
|
|
|
|
|
|
|
String mobileNo = '';
|
|
|
|
|
String password = '';
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: appBar(context,title: LocaleKeys.changeMobile.tr()),
|
|
|
|
|
appBar: appBar(context, title: LocaleKeys.changeMobile.tr()),
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: Container(
|
|
|
|
|
// width: double.infinity,
|
|
|
|
|
// height: double.infinity,
|
|
|
|
|
padding: EdgeInsets.all(40),
|
|
|
|
|
padding: EdgeInsets.all(20),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.enterNewPhoneNumber.tr().toText24(),
|
|
|
|
|
12.height,
|
|
|
|
|
TextFormField(
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
hintText: LocaleKeys.enterNewPhoneNumber.tr(),
|
|
|
|
|
hintStyle: TextStyle(color: Colors.grey),
|
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
|
borderRadius: const BorderRadius.all(
|
|
|
|
|
const Radius.circular(5.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
obscureText: false,
|
|
|
|
|
TxtField(
|
|
|
|
|
hint: LocaleKeys.enterNewPhoneNumber.tr(),
|
|
|
|
|
onChanged: (v) => mobileNo = v,
|
|
|
|
|
),
|
|
|
|
|
12.height,
|
|
|
|
|
TextFormField(
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
hintText: LocaleKeys.enterCurrentPassword.tr(),
|
|
|
|
|
hintStyle: TextStyle(color: Colors.grey),
|
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
|
borderRadius: const BorderRadius.all(
|
|
|
|
|
const Radius.circular(5.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
obscureText: true,
|
|
|
|
|
TxtField(
|
|
|
|
|
hint: LocaleKeys.enterCurrentPassword.tr(),
|
|
|
|
|
onChanged: (v) => password = v,
|
|
|
|
|
),
|
|
|
|
|
40.height,
|
|
|
|
|
20.height,
|
|
|
|
|
ShowFillButton(
|
|
|
|
|
title: LocaleKeys.confirm.tr(),
|
|
|
|
|
maxWidth: double.infinity,
|
|
|
|
|
@ -100,7 +82,7 @@ class _ChangeMobilePageState extends State<ChangeMobilePage> {
|
|
|
|
|
showMDialog(
|
|
|
|
|
context,
|
|
|
|
|
child: MessageDialog(
|
|
|
|
|
title:LocaleKeys.phoneNumberVerified.tr(),
|
|
|
|
|
title: LocaleKeys.phoneNumberVerified.tr(),
|
|
|
|
|
onClick: () {
|
|
|
|
|
Navigator.of(context).pushNamedAndRemoveUntil(AppRoutes.loginWithPassword, (Route<dynamic> route) => false);
|
|
|
|
|
},
|
|
|
|
|
@ -115,7 +97,4 @@ class _ChangeMobilePageState extends State<ChangeMobilePage> {
|
|
|
|
|
Utils.showToast(otpRequest.message ?? "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|