diff --git a/lib/addtankers.dart b/lib/addtankers.dart index baf884c..79c37dc 100644 --- a/lib/addtankers.dart +++ b/lib/addtankers.dart @@ -23,8 +23,6 @@ class _AddTankersState extends State { TextEditingController tankerCapacityController = TextEditingController(); TextEditingController tankerPriceController = TextEditingController(); - - bool isCapacityText = false; bool isLoading = false; bool isTankerDataLoading = false; @@ -37,7 +35,6 @@ class _AddTankersState extends State { 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 { child: Column( children: [ const SizedBox( - height: 15, + height: 55, ), Container( height: MediaQuery.of(context).size.height * .15, @@ -124,7 +121,7 @@ class _AddTankersState extends State { const SizedBox( height: 5, ), - Container( + /* Container( padding: const EdgeInsets.all(10), child: TextFormField( cursorColor: greyColor, @@ -184,7 +181,7 @@ class _AddTankersState extends State { ), //alternative phone number const SizedBox( height: 5, - ), + ),*/ Visibility( visible: true, child: Container( @@ -488,8 +485,6 @@ class _AddTankersState extends State { onPressed: () async{ if (tankerNameController.text != '' && - tankerPhoneNumberController.text != '' && - tankerAlternativePhoneNumberController.text != '' && tankerCapacityController.text != '' && tankerPriceController.text != '') { /* waterPrice=[]; @@ -510,8 +505,8 @@ class _AddTankersState extends State { var payload = new Map(); 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 { AppSettings.longSuccessToast( "Tanker Created Successfully"); tankerNameController.text = ''; - tankerPhoneNumberController.text = ''; + //tankerPhoneNumberController.text = ''; tankerCapacityController.text = ''; - tankerAlternativePhoneNumberController.text=''; + //tankerAlternativePhoneNumberController.text=''; tankerPriceController.text=''; //tankerDrinkingPriceController.text=''; //tankerBorePriceController.text=''; diff --git a/lib/conect_request_customers.dart b/lib/conect_request_customers.dart index 19927f2..df7b144 100644 --- a/lib/conect_request_customers.dart +++ b/lib/conect_request_customers.dart @@ -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 wit mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, - children: [ + /* children: [ Text( connectedCustomersList[index] .customer_name @@ -172,9 +173,63 @@ class _ConectedPendingCustomersState extends State 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 wit ) ), - TextButton( child: Text( 'Accept', @@ -315,9 +369,6 @@ class _ConectedPendingCustomersState extends State wit } - - - }, ), ], diff --git a/lib/settings.dart b/lib/settings.dart index b800b03..382a1c9 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -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 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 { diff --git a/lib/signup.dart b/lib/signup.dart index 9176d94..d285067 100644 --- a/lib/signup.dart +++ b/lib/signup.dart @@ -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 { 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 { try { if (signUpStatus) { var phoneVerifyPayload = new Map(); - phoneVerifyPayload["phoneVerificationCode"] = "11111"; phoneVerifyPayload["phone"] = @@ -512,13 +505,12 @@ class _SignInState extends State { 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( diff --git a/lib/tankersview.dart b/lib/tankersview.dart index 1597e8f..cba1b99 100644 --- a/lib/tankersview.dart +++ b/lib/tankersview.dart @@ -127,7 +127,7 @@ class _TankersViewState extends State { 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 { )), //alternate phone number const SizedBox( height: 30, - ), + ),*/ Visibility( visible: true, child: Container( @@ -478,8 +478,7 @@ class _TankersViewState extends State { 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 { 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 { 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: () { diff --git a/lib/updateprofile.dart b/lib/updateprofile.dart index 510e9f8..d47ac6d 100644 --- a/lib/updateprofile.dart +++ b/lib/updateprofile.dart @@ -24,6 +24,8 @@ class _UpdateprofileState extends State { TextEditingController mobileNumberController = TextEditingController(); TextEditingController emailController = TextEditingController(); TextEditingController descriptionController = TextEditingController(); + TextEditingController startingPriceController = TextEditingController(); + @@ -36,6 +38,8 @@ class _UpdateprofileState extends State { 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 { 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 { 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(); 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 { ); AppSettings.longSuccessToast("profile updated"); } else { - AppSettings.longFailedToast("profile not updated"); } } @@ -319,12 +350,10 @@ class _UpdateprofileState extends State { print(exception); AppSettings.longFailedToast("Please enter valid details"); } - }, child: Text('Update'), ) ), - ], ), )), diff --git a/pubspec.yaml b/pubspec.yaml index e1ddba3..02c45ae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -71,7 +71,6 @@ flutter_launcher_name: flutter: - uses-material-design: true assets: - images/