updated the code

dev
suresh 2 years ago
parent 6a3d1ce26b
commit 2d8a56ce2e

@ -23,8 +23,6 @@ class _AddTankersState extends State<AddTankers> {
TextEditingController tankerCapacityController = TextEditingController();
TextEditingController tankerPriceController = TextEditingController();
bool isCapacityText = false;
bool isLoading = false;
bool isTankerDataLoading = false;
@ -37,7 +35,6 @@ class _AddTankersState extends State<AddTankers> {
bool isTenChecked = false;
bool isFifteenChecked = false;
bool isTwentyChecked = false;
bool isUpdateDrinkingChecked = false;
bool isUpdateBoreChecked = false;
bool isUpdateFiveChecked = false;
@ -82,7 +79,7 @@ class _AddTankersState extends State<AddTankers> {
child: Column(
children: <Widget>[
const SizedBox(
height: 15,
height: 55,
),
Container(
height: MediaQuery.of(context).size.height * .15,
@ -124,7 +121,7 @@ class _AddTankersState extends State<AddTankers> {
const SizedBox(
height: 5,
),
Container(
/* Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
@ -184,7 +181,7 @@ class _AddTankersState extends State<AddTankers> {
), //alternative phone number
const SizedBox(
height: 5,
),
),*/
Visibility(
visible: true,
child: Container(
@ -488,8 +485,6 @@ class _AddTankersState extends State<AddTankers> {
onPressed: () async{
if (tankerNameController.text != '' &&
tankerPhoneNumberController.text != '' &&
tankerAlternativePhoneNumberController.text != '' &&
tankerCapacityController.text != '' &&
tankerPriceController.text != '') {
/* waterPrice=[];
@ -510,8 +505,8 @@ class _AddTankersState extends State<AddTankers> {
var payload = new Map<String, dynamic>();
payload["tankerName"] = tankerNameController.text.toString();
payload["phoneNumber"] = tankerPhoneNumberController.text.toString();
payload["alternative_phoneNumber"] = tankerAlternativePhoneNumberController.text.toString();
// payload["phoneNumber"] = tankerPhoneNumberController.text.toString();
// payload["alternative_phoneNumber"] = tankerAlternativePhoneNumberController.text.toString();
payload["capacity"] = tankerCapacityController.text.toString();
// payload["typeofwater"] = waterTypes;
payload["typeofwater"] =dropdownTypeOfWater.toString();
@ -527,9 +522,9 @@ class _AddTankersState extends State<AddTankers> {
AppSettings.longSuccessToast(
"Tanker Created Successfully");
tankerNameController.text = '';
tankerPhoneNumberController.text = '';
//tankerPhoneNumberController.text = '';
tankerCapacityController.text = '';
tankerAlternativePhoneNumberController.text='';
//tankerAlternativePhoneNumberController.text='';
tankerPriceController.text='';
//tankerDrinkingPriceController.text='';
//tankerBorePriceController.text='';

@ -14,6 +14,7 @@ import 'google_maps_place_picker_mb/src/models/pick_result.dart';
import 'google_maps_place_picker_mb/src/place_picker.dart';
import 'package:watermanagement/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:watermanagement/keys.dart';
import 'package:url_launcher/url_launcher.dart';
class ConectedPendingCustomers extends StatefulWidget {
const ConectedPendingCustomers({Key? key}) : super(key: key);
@ -148,7 +149,7 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
/* children: [
Text(
connectedCustomersList[index]
.customer_name
@ -172,9 +173,63 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
.customer_address
.toUpperCase(),
style: valuesTextStyle())
],*/
children: [
Text(
connectedCustomersList[index]
.customer_name
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(height: 10,),
Text(
connectedCustomersList[index]
.customer_phone_number
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(height: 10,),
Text(
connectedCustomersList[index]
.customer_building_name
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(height: 10,),
Text(
connectedCustomersList[index]
.customer_address
.toUpperCase(),
style: valuesTextStyle())
],
),)
),),
Column(
children: [
IconButton(
iconSize: 30,
icon: const Icon(
Icons.phone,
color: primaryColor,
),
onPressed: () async {
final Uri _phoneUri = Uri(
scheme: "tel",
path: connectedCustomersList[index]
.customer_phone_number);
try {
await launch(
_phoneUri.toString());
} catch (error) {
throw ("Cannot dial");
}
},
),
Text(
'Call now',
style: iconBelowTextStyle(),
),
],
),
],
)
),
),
@ -268,7 +323,6 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
)
),
TextButton(
child: Text(
'Accept',
@ -315,9 +369,6 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
}
},
),
],

@ -62,6 +62,7 @@ class AppSettings {
static String email = '';
static String phoneNumber = '';
static String description = '';
static String startingprice = '';
static String accessToken = '';
static String customerId = '';
static String supplierId = '';
@ -311,8 +312,6 @@ class AppSettings {
}
}
static Future<bool> updateProfile(payload) async {
try {
var response = await http.put(
@ -327,6 +326,8 @@ class AppSettings {
phoneNumber = _response['phone'];
email = _response['emails'][0]['email'];
description = _response['description'];
startingprice = _response['startingPrice'];
return true;
} else {

@ -16,10 +16,6 @@ import 'google_maps_place_picker_mb/src/models/pick_result.dart';
import 'google_maps_place_picker_mb/src/place_picker.dart';
class SignIn extends StatefulWidget {
const SignIn({super.key});
@ -52,12 +48,10 @@ class _SignInState extends State<SignIn> {
double lng = 0;
PickResult? selectedPlace;
bool _mapsInitialized = false;
final String _mapsRenderer = "latest";
var kInitialPosition = const LatLng(15.462477, 78.717401);
locationmap.Location location = locationmap.Location();
final GoogleMapsFlutterPlatform mapsImplementation =
@ -500,7 +494,6 @@ class _SignInState extends State<SignIn> {
try {
if (signUpStatus) {
var phoneVerifyPayload = new Map<String, dynamic>();
phoneVerifyPayload["phoneVerificationCode"] =
"11111";
phoneVerifyPayload["phone"] =
@ -512,13 +505,12 @@ class _SignInState extends State<SignIn> {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast(
"User SignUp Successfully");
// showUserSignUSuccessDialog();
//showUserSignUSuccessDialog();
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Login()),
);
} else {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast(

@ -127,7 +127,7 @@ class _TankersViewState extends State<TankersView> {
const SizedBox(
height: 30,
),
Container(
/* Container(
//padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
cursorColor: greyColor,
@ -187,7 +187,7 @@ class _TankersViewState extends State<TankersView> {
)), //alternate phone number
const SizedBox(
height: 30,
),
),*/
Visibility(
visible: true,
child: Container(
@ -478,8 +478,7 @@ class _TankersViewState extends State<TankersView> {
TextButton(
child: Text('Update', style: textButtonStyle()),
onPressed: () async {
if (updateTankerNameController.text != '' &&
updateTankerPhoneNumberController.text != '') {
if (updateTankerNameController.text != '' ) {
/*
waterPrice=[];
if(isDrinkingChecked){
@ -574,14 +573,9 @@ class _TankersViewState extends State<TankersView> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('tankerName :',style: labelTextStyle()),
Text('phoneNumber :',style: labelTextStyle()),
Text('alternative_phoneNumber :',style: labelTextStyle()),
Text('Capacity :',style: labelTextStyle()),
Text('Type Of Water :',style: labelTextStyle()),
Text('price :',style: labelTextStyle()),
],
),
SizedBox(width: 5,),
@ -590,23 +584,19 @@ class _TankersViewState extends State<TankersView> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(modelTanksViewList[index].tanker_name,style: valuesTextStyle()),
Text(modelTanksViewList[index].tanker_phone,style: valuesTextStyle()),
Text(modelTanksViewList[index].tanker_alterphone,style: valuesTextStyle()),
//Text(modelTanksViewList[index].tanker_phone,style: valuesTextStyle()),
// Text(modelTanksViewList[index].tanker_alterphone,style: valuesTextStyle()),
Text(modelTanksViewList[index].capacity+' Ltrs',style: valuesTextStyle()),
Text(modelTanksViewList[index].type_of_water,style: valuesTextStyle()),
Text(modelTanksViewList[index].waterprice,style: valuesTextStyle()),
],
),
],
),
],
),
),
Expanded(child:IconButton(
icon: const Icon(Icons.edit,color: primaryColor,),
onPressed: () {

@ -24,6 +24,8 @@ class _UpdateprofileState extends State<UpdateProfile> {
TextEditingController mobileNumberController = TextEditingController();
TextEditingController emailController = TextEditingController();
TextEditingController descriptionController = TextEditingController();
TextEditingController startingPriceController = TextEditingController();
@ -36,6 +38,8 @@ class _UpdateprofileState extends State<UpdateProfile> {
mobileNumberController.text=AppSettings.phoneNumber;
emailController.text=AppSettings.email;
descriptionController.text=AppSettings.description;
startingPriceController.text=AppSettings.startingprice;
// descriptionController.text=AppSettings.suppliername;
@ -251,6 +255,34 @@ class _UpdateprofileState extends State<UpdateProfile> {
SizedBox(
height: 10,
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: startingPriceController,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.currency_rupee,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Starting Price',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),//name
const SizedBox(
height: 15,
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
@ -289,16 +321,16 @@ class _UpdateprofileState extends State<UpdateProfile> {
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
primary: primaryColor,// background
onPrimary: Colors.white,// foreground
),
onPressed: () async{
var payload = new Map<String, dynamic>();
payload["suppliername"] = nameController.text.toString();
payload["phone"] = mobileNumberController.text.toString();
payload["emails"] = [{"email":emailController.text.toString()}];
payload["description"] = descriptionController.text.toString();
payload["startingPrice"] = startingPriceController.text.toString();
payload["status"] = "active";
bool signUpStatus = await AppSettings.updateProfile(payload);
@ -311,7 +343,6 @@ class _UpdateprofileState extends State<UpdateProfile> {
);
AppSettings.longSuccessToast("profile updated");
} else {
AppSettings.longFailedToast("profile not updated");
}
}
@ -319,12 +350,10 @@ class _UpdateprofileState extends State<UpdateProfile> {
print(exception);
AppSettings.longFailedToast("Please enter valid details");
}
},
child: Text('Update'),
)
),
],
),
)),

@ -71,7 +71,6 @@ flutter_launcher_name:
flutter:
uses-material-design: true
assets:
- images/

Loading…
Cancel
Save