upload profile modifications

dev
Sneha 2 years ago
parent 6a3d1ce26b
commit ac1f1560aa

Before

Width:  |  Height:  |  Size: 412 KiB

After

Width:  |  Height:  |  Size: 412 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

@ -39,22 +39,23 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
final List<Tab> topTabs = <Tab>[
Tab(
Tab(
child: Column(
children: [Text('Conected Customers')],
children: [Text('Pending Customers')],
),
),
Tab(
child: Column(
children: [Text('Pending Customers')],
children: [Text('Conected Customers')],
),
),
];
Future<void> getConnectedSuppliersData() async {
isPendingDataLoading = true;
isConnectedDataLoading = true;
try {
var response = await AppSettings.getConnectedCustomers();
@ -64,13 +65,13 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
((jsonDecode(response)['data']) as List).map((dynamic model) {
return ConnectedCustomersModel.fromJson(model);
}).toList();
isPendingDataLoading = false;
isConnectedDataLoading = false;
});
} catch (e) {
setState(() {
isPendingDataLoading = false;
isConnectedDataLoading = false;
isSereverIssuePending = true;
});
}
@ -375,23 +376,24 @@ class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> wit
),*/
Container(
//color: Colors.lightBlueAccent,
child: isConnectedDataLoading?Center(
child: isPendingDataLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):connectedCustomers(),
):pendingCustomers(),
),
Container(
//color: Colors.lightBlueAccent,
child: isPendingDataLoading?Center(
child: isConnectedDataLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):pendingCustomers(),
):connectedCustomers(),
),
]),
);
}

@ -4,11 +4,8 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:watermanagement/adddeliveryboy.dart';
import 'package:watermanagement/addtankers.dart';
import 'package:watermanagement/conect_request_customers.dart';
import 'package:watermanagement/conected_customers.dart';
import 'package:watermanagement/getdeliveryboydata.dart';
import 'package:watermanagement/login.dart';
import 'package:watermanagement/place_picker.dart';
import 'package:watermanagement/request_customers.dart';
import 'package:watermanagement/settings.dart';
import 'package:image_picker/image_picker.dart';
import 'package:watermanagement/tankersview.dart';
@ -92,6 +89,17 @@ class _DashboardState extends State<Dashboard> {
});
}
Future<String> getStorageDirectory() async {
if (Platform.isAndroid) {
return (await getExternalStorageDirectory()).path;
} else {
return (await getApplicationDocumentsDirectory()).path;
}
}
Future pickImageFromGallery() async {
try {
final image = await _picker.pickImage(source: ImageSource.gallery);
@ -100,7 +108,7 @@ class _DashboardState extends State<Dashboard> {
setState(() {
AppSettings.updatedImage = imageTemp;
});
uploadProfileApi(AppSettings.updatedImage);
uploadProfileApi(image.path);
AppSettings.saveProfile(image.path);
@ -118,7 +126,7 @@ class _DashboardState extends State<Dashboard> {
AppSettings.updatedImage = imageTemp;
});
uploadProfileApi(AppSettings.updatedImage);
uploadProfileApi(image.path);
AppSettings.saveProfile(image.path);
} on PlatformException catch (e) {
@ -134,7 +142,7 @@ class _DashboardState extends State<Dashboard> {
child: Column(
children: <Widget>[
Container(
height: MediaQuery.of(context).size.height * .330,
height: MediaQuery.of(context).size.height * .250,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(0),
@ -142,7 +150,7 @@ class _DashboardState extends State<Dashboard> {
//color: Colors.red,
child: FittedBox(
child:Image(
image: const AssetImage('images/appbgsuplier.png'),
image: const AssetImage('images/appbgsupplier.png'),
),
fit: BoxFit.fill,

Loading…
Cancel
Save