updated the code

dev
suresh 1 year ago
parent 6a3d1ce26b
commit 2d8a56ce2e

@ -23,8 +23,6 @@ class _AddTankersState extends State<AddTankers> {
TextEditingController tankerCapacityController = TextEditingController(); TextEditingController tankerCapacityController = TextEditingController();
TextEditingController tankerPriceController = TextEditingController(); TextEditingController tankerPriceController = TextEditingController();
bool isCapacityText = false; bool isCapacityText = false;
bool isLoading = false; bool isLoading = false;
bool isTankerDataLoading = false; bool isTankerDataLoading = false;
@ -37,7 +35,6 @@ class _AddTankersState extends State<AddTankers> {
bool isTenChecked = false; bool isTenChecked = false;
bool isFifteenChecked = false; bool isFifteenChecked = false;
bool isTwentyChecked = false; bool isTwentyChecked = false;
bool isUpdateDrinkingChecked = false; bool isUpdateDrinkingChecked = false;
bool isUpdateBoreChecked = false; bool isUpdateBoreChecked = false;
bool isUpdateFiveChecked = false; bool isUpdateFiveChecked = false;
@ -82,7 +79,7 @@ class _AddTankersState extends State<AddTankers> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
const SizedBox( const SizedBox(
height: 15, height: 55,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * .15, height: MediaQuery.of(context).size.height * .15,
@ -124,7 +121,7 @@ class _AddTankersState extends State<AddTankers> {
const SizedBox( const SizedBox(
height: 5, height: 5,
), ),
Container( /* Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
@ -184,7 +181,7 @@ class _AddTankersState extends State<AddTankers> {
), //alternative phone number ), //alternative phone number
const SizedBox( const SizedBox(
height: 5, height: 5,
), ),*/
Visibility( Visibility(
visible: true, visible: true,
child: Container( child: Container(
@ -488,8 +485,6 @@ class _AddTankersState extends State<AddTankers> {
onPressed: () async{ onPressed: () async{
if (tankerNameController.text != '' && if (tankerNameController.text != '' &&
tankerPhoneNumberController.text != '' &&
tankerAlternativePhoneNumberController.text != '' &&
tankerCapacityController.text != '' && tankerCapacityController.text != '' &&
tankerPriceController.text != '') { tankerPriceController.text != '') {
/* waterPrice=[]; /* waterPrice=[];
@ -510,8 +505,8 @@ class _AddTankersState extends State<AddTankers> {
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["tankerName"] = tankerNameController.text.toString(); payload["tankerName"] = tankerNameController.text.toString();
payload["phoneNumber"] = tankerPhoneNumberController.text.toString(); // payload["phoneNumber"] = tankerPhoneNumberController.text.toString();
payload["alternative_phoneNumber"] = tankerAlternativePhoneNumberController.text.toString(); // payload["alternative_phoneNumber"] = tankerAlternativePhoneNumberController.text.toString();
payload["capacity"] = tankerCapacityController.text.toString(); payload["capacity"] = tankerCapacityController.text.toString();
// payload["typeofwater"] = waterTypes; // payload["typeofwater"] = waterTypes;
payload["typeofwater"] =dropdownTypeOfWater.toString(); payload["typeofwater"] =dropdownTypeOfWater.toString();
@ -527,9 +522,9 @@ class _AddTankersState extends State<AddTankers> {
AppSettings.longSuccessToast( AppSettings.longSuccessToast(
"Tanker Created Successfully"); "Tanker Created Successfully");
tankerNameController.text = ''; tankerNameController.text = '';
tankerPhoneNumberController.text = ''; //tankerPhoneNumberController.text = '';
tankerCapacityController.text = ''; tankerCapacityController.text = '';
tankerAlternativePhoneNumberController.text=''; //tankerAlternativePhoneNumberController.text='';
tankerPriceController.text=''; tankerPriceController.text='';
//tankerDrinkingPriceController.text=''; //tankerDrinkingPriceController.text='';
//tankerBorePriceController.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 '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/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:watermanagement/keys.dart'; import 'package:watermanagement/keys.dart';
import 'package:url_launcher/url_launcher.dart';
class ConectedPendingCustomers extends StatefulWidget { class ConectedPendingCustomers extends StatefulWidget {
const ConectedPendingCustomers({Key? key}) : super(key: key); const ConectedPendingCustomers({Key? key}) : super(key: key);
@ -148,7 +149,7 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ /* children: [
Text( Text(
connectedCustomersList[index] connectedCustomersList[index]
.customer_name .customer_name
@ -172,9 +173,63 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
.customer_address .customer_address
.toUpperCase(), .toUpperCase(),
style: valuesTextStyle()) 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( TextButton(
child: Text( child: Text(
'Accept', 'Accept',
@ -315,9 +369,6 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
} }
}, },
), ),
], ],

@ -62,6 +62,7 @@ class AppSettings {
static String email = ''; static String email = '';
static String phoneNumber = ''; static String phoneNumber = '';
static String description = ''; static String description = '';
static String startingprice = '';
static String accessToken = ''; static String accessToken = '';
static String customerId = ''; static String customerId = '';
static String supplierId = ''; static String supplierId = '';
@ -311,8 +312,6 @@ class AppSettings {
} }
} }
static Future<bool> updateProfile(payload) async { static Future<bool> updateProfile(payload) async {
try { try {
var response = await http.put( var response = await http.put(
@ -327,6 +326,8 @@ class AppSettings {
phoneNumber = _response['phone']; phoneNumber = _response['phone'];
email = _response['emails'][0]['email']; email = _response['emails'][0]['email'];
description = _response['description']; description = _response['description'];
startingprice = _response['startingPrice'];
return true; return true;
} else { } 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'; import 'google_maps_place_picker_mb/src/place_picker.dart';
class SignIn extends StatefulWidget { class SignIn extends StatefulWidget {
const SignIn({super.key}); const SignIn({super.key});
@ -52,12 +48,10 @@ class _SignInState extends State<SignIn> {
double lng = 0; double lng = 0;
PickResult? selectedPlace; PickResult? selectedPlace;
bool _mapsInitialized = false; bool _mapsInitialized = false;
final String _mapsRenderer = "latest"; final String _mapsRenderer = "latest";
var kInitialPosition = const LatLng(15.462477, 78.717401); var kInitialPosition = const LatLng(15.462477, 78.717401);
locationmap.Location location = locationmap.Location(); locationmap.Location location = locationmap.Location();
final GoogleMapsFlutterPlatform mapsImplementation = final GoogleMapsFlutterPlatform mapsImplementation =
@ -500,7 +494,6 @@ class _SignInState extends State<SignIn> {
try { try {
if (signUpStatus) { if (signUpStatus) {
var phoneVerifyPayload = new Map<String, dynamic>(); var phoneVerifyPayload = new Map<String, dynamic>();
phoneVerifyPayload["phoneVerificationCode"] = phoneVerifyPayload["phoneVerificationCode"] =
"11111"; "11111";
phoneVerifyPayload["phone"] = phoneVerifyPayload["phone"] =
@ -512,13 +505,12 @@ class _SignInState extends State<SignIn> {
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast( AppSettings.longSuccessToast(
"User SignUp Successfully"); "User SignUp Successfully");
// showUserSignUSuccessDialog(); //showUserSignUSuccessDialog();
await Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const Login()), builder: (context) => const Login()),
); );
} else { } else {
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast( AppSettings.longFailedToast(

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

@ -24,6 +24,8 @@ class _UpdateprofileState extends State<UpdateProfile> {
TextEditingController mobileNumberController = TextEditingController(); TextEditingController mobileNumberController = TextEditingController();
TextEditingController emailController = TextEditingController(); TextEditingController emailController = TextEditingController();
TextEditingController descriptionController = TextEditingController(); TextEditingController descriptionController = TextEditingController();
TextEditingController startingPriceController = TextEditingController();
@ -36,6 +38,8 @@ class _UpdateprofileState extends State<UpdateProfile> {
mobileNumberController.text=AppSettings.phoneNumber; mobileNumberController.text=AppSettings.phoneNumber;
emailController.text=AppSettings.email; emailController.text=AppSettings.email;
descriptionController.text=AppSettings.description; descriptionController.text=AppSettings.description;
startingPriceController.text=AppSettings.startingprice;
// descriptionController.text=AppSettings.suppliername; // descriptionController.text=AppSettings.suppliername;
@ -251,6 +255,34 @@ class _UpdateprofileState extends State<UpdateProfile> {
SizedBox( SizedBox(
height: 10, 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( Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
@ -289,16 +321,16 @@ class _UpdateprofileState extends State<UpdateProfile> {
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: primaryColor, // background primary: primaryColor,// background
onPrimary: Colors.white, // foreground onPrimary: Colors.white,// foreground
), ),
onPressed: () async{ onPressed: () async{
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["suppliername"] = nameController.text.toString(); payload["suppliername"] = nameController.text.toString();
payload["phone"] = mobileNumberController.text.toString(); payload["phone"] = mobileNumberController.text.toString();
payload["emails"] = [{"email":emailController.text.toString()}]; payload["emails"] = [{"email":emailController.text.toString()}];
payload["description"] = descriptionController.text.toString(); payload["description"] = descriptionController.text.toString();
payload["startingPrice"] = startingPriceController.text.toString();
payload["status"] = "active"; payload["status"] = "active";
bool signUpStatus = await AppSettings.updateProfile(payload); bool signUpStatus = await AppSettings.updateProfile(payload);
@ -311,7 +343,6 @@ class _UpdateprofileState extends State<UpdateProfile> {
); );
AppSettings.longSuccessToast("profile updated"); AppSettings.longSuccessToast("profile updated");
} else { } else {
AppSettings.longFailedToast("profile not updated"); AppSettings.longFailedToast("profile not updated");
} }
} }
@ -319,12 +350,10 @@ class _UpdateprofileState extends State<UpdateProfile> {
print(exception); print(exception);
AppSettings.longFailedToast("Please enter valid details"); AppSettings.longFailedToast("Please enter valid details");
} }
}, },
child: Text('Update'), child: Text('Update'),
) )
), ),
], ],
), ),
)), )),

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

Loading…
Cancel
Save