|
|
|
@ -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'),
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|