CMA #67 & #65 fixed

mirza_dev
devmirza121 4 years ago
parent 0aa90578ef
commit b385dccefd

@ -32,8 +32,8 @@ class BranchApiClent {
"branchDescription": branchDescription, "branchDescription": branchDescription,
"cityID": cityId, "cityID": cityId,
"address": address, "address": address,
"latitude": latitude, "latitude": latitude.substring(0,9)??0,
"longitude": longitude, "longitude": longitude.substring(0,9)??0,
"isActive": true "isActive": true
}; };
String t = AppState().getUser.data!.accessToken ?? ""; String t = AppState().getUser.data!.accessToken ?? "";

@ -122,7 +122,7 @@ class _DashboardPageState extends State<DashboardPage> {
if (response.messageStatus == 1) { if (response.messageStatus == 1) {
Utils.showToast("Image is Deleted"); Utils.showToast("Image is Deleted");
setState(() { setState(() {
AppState().getUser.data!.userInfo!.userImageUrl=response.data; AppState().getUser.data!.userInfo!.userImageUrl = response.data;
}); });
} }
Utils.hideLoading(context); Utils.hideLoading(context);
@ -272,7 +272,7 @@ class _DashboardPageState extends State<DashboardPage> {
Navigator.pop(context); Navigator.pop(context);
if (response.messageStatus == 1) { if (response.messageStatus == 1) {
Utils.showToast("Image is uploaded"); Utils.showToast("Image is uploaded");
AppState().getUser.data!.userInfo!.userImageUrl=response.data; AppState().getUser.data!.userInfo!.userImageUrl = response.data;
} else { } else {
Utils.showToast(response.message ?? ""); Utils.showToast(response.message ?? "");
} }
@ -302,7 +302,7 @@ class _DashboardPageState extends State<DashboardPage> {
Navigator.pop(context); Navigator.pop(context);
if (response.messageStatus == 1) { if (response.messageStatus == 1) {
Utils.showToast("Image is uploaded"); Utils.showToast("Image is uploaded");
AppState().getUser.data!.userInfo!.userImageUrl=response.data; AppState().getUser.data!.userInfo!.userImageUrl = response.data;
} else { } else {
Utils.showToast(response.message ?? ""); Utils.showToast(response.message ?? "");
} }
@ -311,6 +311,5 @@ class _DashboardPageState extends State<DashboardPage> {
imagePicked = pickedImageFile; imagePicked = pickedImageFile;
}); });
} }
} }
} }

@ -109,7 +109,9 @@ class _PickLocationPageState extends State<PickLocationPage> {
latitude = _position.target.latitude; latitude = _position.target.latitude;
longitude = _position.target.longitude; longitude = _position.target.longitude;
List<Placemark> placemarks = await placemarkFromCoordinates(latitude, longitude); List<Placemark> placemarks = await placemarkFromCoordinates(latitude, longitude);
_counter.value = (placemarks.first.name) ?? "" + " " + (placemarks.first.street ?? "") + " " + (placemarks.first.country ?? ""); _counter.value='${placemarks.first.street}, ${placemarks.first.subLocality}, ${placemarks.first.locality}, ${placemarks.first.postalCode}, ${placemarks.first.country}';
print("Address121: "+_counter.value);
// _counter.value = (placemarks.first.name) ?? "" + " " + (placemarks.first.street ?? "") + " " + (placemarks.first.country ?? "");
} }
void _getUserLocation() async { void _getUserLocation() async {

@ -45,6 +45,10 @@ class _DefineBranchPageState extends State<DefineBranchPage> {
} }
fetchCites() async { fetchCites() async {
print("objectfffffff");
citiesDropList.clear();
cities = null;
cityId = -1;
cities = await UserApiClent().getAllCites(countryId.toString()); cities = await UserApiClent().getAllCites(countryId.toString());
setState(() { setState(() {
cities!.data?.forEach((element) { cities!.data?.forEach((element) {
@ -84,12 +88,14 @@ class _DefineBranchPageState extends State<DefineBranchPage> {
12.height, 12.height,
if (countryId != -1) if (countryId != -1)
cities != null cities != null
? DropdownField((DropValue value) { ? citiesDropList.length == 0
setState(() { ? Text("No City Available for this country")
// countryCode = value.subValue; : DropdownField((DropValue value) {
cityId = value.id; setState(() {
}); // countryCode = value.subValue;
}, list: citiesDropList, hint: "Chosse City") cityId = value.id;
});
}, list: citiesDropList, hint: "Chosse City")
: CircularProgressIndicator(), : CircularProgressIndicator(),
12.height, 12.height,
if (cityId != -1) if (cityId != -1)

@ -1,5 +1,3 @@
import 'dart:convert'; import 'dart:convert';
import 'package:car_provider_app/api/client/user_api_client.dart'; import 'package:car_provider_app/api/client/user_api_client.dart';
@ -19,8 +17,6 @@ import 'package:car_provider_app/widgets/dialog/otp_dialog.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
class EditAccountPage extends StatefulWidget { class EditAccountPage extends StatefulWidget {
@override @override
State<EditAccountPage> createState() => _EditAccountPageState(); State<EditAccountPage> createState() => _EditAccountPageState();
@ -44,7 +40,7 @@ class _EditAccountPageState extends State<EditAccountPage> {
ListTile( ListTile(
leading: SvgPicture.asset("assets/images/ic_lock.svg"), leading: SvgPicture.asset("assets/images/ic_lock.svg"),
title: "Change Password".toText12(), title: "Change Password".toText12(),
onTap: (){ onTap: () {
navigateWithName(context, AppRoutes.changePassword); navigateWithName(context, AppRoutes.changePassword);
}, },
), ),
@ -56,46 +52,55 @@ class _EditAccountPageState extends State<EditAccountPage> {
"Change Mobile".toText12(), "Change Mobile".toText12(),
"Verify".toText12(), "Verify".toText12(),
RaisedButton( RaisedButton(
onPressed: (){ onPressed: () {
navigateWithName(context, AppRoutes.changeMobilePage); navigateWithName(context, AppRoutes.changeMobilePage);
}, },
child: Text("Change", child: Text(
style: TextStyle(fontSize: 14, "Change",
fontWeight: FontWeight.w600,),),color:Colors.blue, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
color: Colors.blue,
textColor: Colors.white, textColor: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8) padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8))
)
], ],
), ),
20.height, 20.height,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Icon(Icons.email, color: Colors.blue,), Icon(
Icons.email,
color: Colors.blue,
),
"Change Email".toText12(), "Change Email".toText12(),
InkWell( InkWell(
child:((AppState().getUser.data!.userInfo!.isEmailVerified??false)?"Verified" :"Verify").toText12(), child: ((AppState().getUser.data!.userInfo!.isEmailVerified ?? false) ? "Verified" : "Verify").toText12(),
onTap: onTap: (AppState().getUser.data!.userInfo!.isEmailVerified ?? false)
(AppState().getUser.data!.userInfo!.isEmailVerified??false) ? ? null
null : () {
:(){ verifyEmail(context);
verifyEmail(context); },
},
), ),
RaisedButton( RaisedButton(
onPressed: (){ onPressed: () {
navigateWithName(context, AppRoutes.changeEmailPage); navigateWithName(context, AppRoutes.changeEmailPage);
}, },
child: Text("Change", child: Text(
style: TextStyle(fontSize: 14, "Change",
fontWeight: FontWeight.w600,),),color:Colors.blue, style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
color: Colors.blue,
textColor: Colors.white, textColor: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8) padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8))
)
], ],
) )
// ListTile( // ListTile(
// leading: SvgPicture.asset("assets/images/ic_mobile.svg"), // leading: SvgPicture.asset("assets/images/ic_mobile.svg"),
// title: "Change Mobile".toText12(), // title: "Change Mobile".toText12(),
@ -128,11 +133,10 @@ class _EditAccountPageState extends State<EditAccountPage> {
MResponse otpCompare = await UserApiClent().EmailVerifyOTPVerify(otpRequest.data!.userToken ?? "", code); MResponse otpCompare = await UserApiClent().EmailVerifyOTPVerify(otpRequest.data!.userToken ?? "", code);
Utils.hideLoading(context); Utils.hideLoading(context);
if (otpCompare.messageStatus == 1) { if (otpCompare.messageStatus == 1) {
AppState().getUser.data!.userInfo!.isEmailVerified=true; AppState().getUser.data!.userInfo!.isEmailVerified = true;
setState(() { setState(() {});
});
Utils.showToast("Email is verified successfully"); Utils.showToast("Email is verified successfully");
// Navigator.of(context).pushNamedAndRemoveUntil(AppRoutes.dashboard, (Route<dynamic> route) => false); // Navigator.of(context).pushNamedAndRemoveUntil(AppRoutes.dashboard, (Route<dynamic> route) => false);
// showMDialog( // showMDialog(
// context, // context,
// child: MessageDialog( // child: MessageDialog(
@ -151,6 +155,4 @@ class _EditAccountPageState extends State<EditAccountPage> {
Utils.showToast(otpRequest.message ?? ""); Utils.showToast(otpRequest.message ?? "");
} }
} }
} }

@ -45,6 +45,7 @@ dependencies:
fluttertoast: ^8.0.8 fluttertoast: ^8.0.8
shared_preferences: ^2.0.6 shared_preferences: ^2.0.6
file_picker: ^4.4.0 file_picker: ^4.4.0
image_picker: ^0.8.4+4
@ -52,7 +53,7 @@ dependencies:
google_maps_flutter: ^2.1.1 google_maps_flutter: ^2.1.1
geolocator: any geolocator: any
geocoding: ^2.0.2 geocoding: ^2.0.2
image_picker: ^0.8.4+4

Loading…
Cancel
Save