updated the code

dev
suresh 2 years ago
parent 3d687526ad
commit 12dab14b6b

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 367 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

@ -187,16 +187,32 @@ class _BookingRequetsState extends State<BookingRequets> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Text( Container(
width: MediaQuery.of(context).size.width * .50,
child: Text(
BookingRequestsList[index] BookingRequestsList[index]
.customer_address .customer_address
.toUpperCase(), .toUpperCase(),
style: valuesTextStyle()) style: valuesTextStyle()),
)
], ],
), ),
], ],
)), )),
), ),
/*Row(
children: [
Text('Tanker Name:',
style: labelTextStyle()),
Text(
BookingRequestsList[index]
.tanker_name
.toUpperCase(),
style: valuesTextStyle()),
],
),*/
Visibility( Visibility(
visible:BookingRequestsList[index].orderStatus.toString().toLowerCase()=='pending', visible:BookingRequestsList[index].orderStatus.toString().toLowerCase()=='pending',
child: Column( child: Column(

@ -0,0 +1,410 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:watermanagement/models/connected_customers_model.dart';
import 'package:watermanagement/models/pending_suppliers_model.dart';
import 'package:watermanagement/settings.dart';
import 'package:google_maps_flutter_android/google_maps_flutter_android.dart';
import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart';
import 'package:location/location.dart' as locationmap;
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';
class ConectedPendingCustomers extends StatefulWidget {
const ConectedPendingCustomers({Key? key}) : super(key: key);
@override
State<ConectedPendingCustomers> createState() => _ConectedPendingCustomersState();
}
class _ConectedPendingCustomersState extends State<ConectedPendingCustomers> with TickerProviderStateMixin {
bool isSupplierDataLoading=false;
bool isSereverIssue = false;
bool isSereverIssueConnected = false;
bool isSereverIssuePending = false;
List<ConnectedCustomersModel> connectedCustomersList = [];
List<PendingSuppliersModel> pendingSuppliersList = [];
late TabController _controller;
bool isConnectedDataLoading=false;
bool isPendingDataLoading=false;
final List<Tab> topTabs = <Tab>[
Tab(
child: Column(
children: [Text('Conected Customers')],
),
),
Tab(
child: Column(
children: [Text('Pending Customers')],
),
),
];
Future<void> getConnectedSuppliersData() async {
isPendingDataLoading = true;
try {
var response = await AppSettings.getConnectedCustomers();
setState(() {
connectedCustomersList =
((jsonDecode(response)['data']) as List).map((dynamic model) {
return ConnectedCustomersModel.fromJson(model);
}).toList();
isPendingDataLoading = false;
});
} catch (e) {
setState(() {
isPendingDataLoading = false;
isSereverIssuePending = true;
});
}
}
Future<void> getPendingSuppliersData() async {
isPendingDataLoading = true;
try {
var response = await AppSettings.getPendingSuppliers();
setState(() {
pendingSuppliersList =
((jsonDecode(response)['data']) as List).map((dynamic model) {
return PendingSuppliersModel.fromJson(model);
}).toList();
isPendingDataLoading = false;
});
} catch (e) {
setState(() {
isPendingDataLoading = false;
isSereverIssuePending = true;
});
}
}
@override
void initState() {
// TODO: implement initState
_controller = TabController(vsync: this, length: 2);
getConnectedSuppliersData();
getPendingSuppliersData();
super.initState();
}
Widget connectedCustomers(){
if(connectedCustomersList.length!=0){
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child:ListView.builder(
padding: EdgeInsets.all(0),
itemCount: connectedCustomersList.length,
itemBuilder: (BuildContext context, int index) {
return Card(
child: Padding(
padding:EdgeInsets.all(8) ,
child: Container(
//width: MediaQuery.of(context).size.width * .50,
child: Row(
children: [
/* Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('username :',
style: labelTextStyle()),
SizedBox(height: 10,),
Text('phone:',
style: labelTextStyle()),
SizedBox(height: 10,),
Text('buildingname:',
style: labelTextStyle()),
SizedBox(height: 10,),
Text('address:',
style: labelTextStyle()),
],
),
SizedBox(width: 10,),*/
Expanded(child:Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
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(maxLines:3,
connectedCustomersList[index]
.customer_address
.toUpperCase(),
style: valuesTextStyle())
],
),)
],
)
),
),
);
}) ),
]);
}
else{
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
Text('No Data Found'),
SizedBox(
height: 20,
),
],
),
)
);
}
}
Widget pendingCustomers(){
if(pendingSuppliersList.length!=0){
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child:ListView.builder(
padding: EdgeInsets.all(0),
itemCount: pendingSuppliersList.length,
itemBuilder: (BuildContext context, int index) {
return Card(
child: Padding(
padding:EdgeInsets.all(8) ,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: MediaQuery.of(context).size.width * .50,
child: Row(
children: [
/* Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('username :',
style: labelTextStyle()),
SizedBox(height: 10,),
Text('contactNumber:',
style: labelTextStyle()),
SizedBox(height: 10,),
Text('address:',
style: labelTextStyle()),
],
),
SizedBox(width: 10,),*/
Expanded(child:Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
pendingSuppliersList[index]
.customer_name
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(height: 10,),
Text(
pendingSuppliersList[index]
.customer_phone_number
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(height: 10,),
Text(
pendingSuppliersList[index]
.customer_address
.toUpperCase(),
style: valuesTextStyle())
],
),)
],
)
),
TextButton(
child: Text(
'Accept',
style: TextStyle(fontSize: 15,
color:primaryColor/*FilteredList[index].text_color*/ ),
),
onPressed: () async{
var payload = new Map<String, dynamic>();
payload["supplierId"] =AppSettings.supplierId;
payload["customerId"] = pendingSuppliersList[index].customer_id;
bool requestStatus = await AppSettings.acceptRequest(payload);
if(requestStatus){
AppSettings.longSuccessToast("Request Accepted Successfully");
// await getConnectedSuppliersData();
await getPendingSuppliersData();
}
else{
}
},
),
TextButton(
child: Text(
'Reject',
style: TextStyle(fontSize: 15,
color:primaryColor/*FilteredList[index].text_color*/ ),
),
onPressed: () async{
var payload = new Map<String, dynamic>();
payload["supplierId"] =AppSettings.supplierId;
payload["customerId"] = pendingSuppliersList[index].customer_id;
bool requestStatus = await AppSettings.rejectRequest(payload);
if(requestStatus){
AppSettings.longSuccessToast("Request Sent Successfully");
await getPendingSuppliersData();
}
else{
}
},
),
],
),
),
);
}) ),
]);
}
else{
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
Text('No Data Found'),
SizedBox(
height: 20,
),
],
),
)
);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Costumers'),
backgroundColor: primaryColor,
bottom: TabBar(
controller: _controller,
tabs: topTabs,
indicatorColor: Colors.blue,
unselectedLabelColor: Colors.white60,
indicatorWeight: 2,
),),
/* body: */
body: TabBarView(controller: _controller, children: [
/*Container(
// color: Colors.lightGreenAccent,
child: isTankerDataLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):_tanker(),
),*/
Container(
//color: Colors.lightBlueAccent,
child: isConnectedDataLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):connectedCustomers(),
),
Container(
//color: Colors.lightBlueAccent,
child: isPendingDataLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):pendingCustomers(),
),
]),
);
}
}

@ -88,7 +88,7 @@ class _ConectedCustomersState extends State<ConectedCustomers> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * .50,
child: Row( child: Row(
children: [ children: [
Column( Column(

@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:watermanagement/adddeliveryboy.dart'; import 'package:watermanagement/adddeliveryboy.dart';
import 'package:watermanagement/addtankers.dart'; import 'package:watermanagement/addtankers.dart';
import 'package:watermanagement/conect_request_customers.dart';
import 'package:watermanagement/conected_customers.dart'; import 'package:watermanagement/conected_customers.dart';
import 'package:watermanagement/getdeliveryboydata.dart'; import 'package:watermanagement/getdeliveryboydata.dart';
import 'package:watermanagement/login.dart'; import 'package:watermanagement/login.dart';
@ -110,6 +111,165 @@ class _DashboardState extends State<Dashboard> {
SizedBox( SizedBox(
height: 5 height: 5
), ),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => TankersView()),
);
},
child: Container(
padding: EdgeInsets.all(05),
margin: EdgeInsets.only(left:15, top:10, right: 0, bottom:0),
//height: MediaQuery.of(context).size.height * .05,
//width: MediaQuery.of(context).size.width * .45,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
// Change button text when light changes state.
child: Column(
children: [
Container(
padding: EdgeInsets.fromLTRB(35, 10,0,0),
child: new SvgPicture.asset("assets/images/tanklevels.svg")
),
Text('Takers View',style: dashboardTextStyle(),),
],
),
),
)),
SizedBox(
width: MediaQuery.of(context).size.width * .03,
),
Expanded(
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => GetDeliveryboyData()),
);
},
child: Container(
padding: EdgeInsets.all(05),
margin: EdgeInsets.only(left:0, top:10, right: 15, bottom:0),
// height: MediaQuery.of(context).size.height * .16,
// width: MediaQuery.of(context).size.width * .40,
//color: Colors.white,
//margin: const EdgeInsets.all(15.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
// Change button text when light changes state.
child: Column(
children: [
Container(
padding: EdgeInsets.fromLTRB(0, 10,0,0),
child: new SvgPicture.asset("assets/images/watertanker.svg")
),
Text('Deliveryboys View',style: dashboardTextStyle(),)
],
),
),
),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ConectedPendingCustomers()),
);
},
child: Container(
padding: EdgeInsets.all(05),
margin: EdgeInsets.only(left:15, top:10, right: 0, bottom:0),
//height: MediaQuery.of(context).size.height * .05,
//width: MediaQuery.of(context).size.width * .45,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
// Change button text when light changes state.
child: Column(
children: [
Container(
padding: EdgeInsets.fromLTRB(35, 10,0,0),
child: new SvgPicture.asset("assets/images/resources.svg")
),
Text('Customers',style: dashboardTextStyle(),),
],
),
),
)),
SizedBox(
width: MediaQuery.of(context).size.width * .03,
),
Expanded(
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => BookingRequets()),
);
},
child: Container(
padding: EdgeInsets.all(05),
margin: EdgeInsets.only(left:0, top:10, right: 15, bottom:0),
// height: MediaQuery.of(context).size.height * .16,
// width: MediaQuery.of(context).size.width * .40,
//color: Colors.white,
//margin: const EdgeInsets.all(15.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
// Change button text when light changes state.
child: Column(
children: [
Container(
padding: EdgeInsets.fromLTRB(0, 10,0,0),
child: new SvgPicture.asset("assets/images/consumption.svg")
),
Text('Booking Requests',style: dashboardTextStyle(),)
],
),
),
),
)
],
),
//==============================list2
], ],
), ),
@ -301,7 +461,7 @@ class _DashboardState extends State<Dashboard> {
title: Row( title: Row(
children: const [ children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill), Image(image: const AssetImage('images/editprofileblue.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
@ -327,7 +487,7 @@ class _DashboardState extends State<Dashboard> {
ListTile( ListTile(
title: Row( title: Row(
children: const [ children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill), Image(image: const AssetImage('images/addtankerblue.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
@ -348,7 +508,7 @@ class _DashboardState extends State<Dashboard> {
ListTile( ListTile(
title: Row( title: Row(
children: const [ children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill), Image(image: const AssetImage('images/connectionsblue.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
@ -362,124 +522,13 @@ class _DashboardState extends State<Dashboard> {
); );
}, },
), ),
Divider(
color: Colors.grey,
),
// Add Tanks
ListTile(
title: Row(
children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox(
width: 10,
),
Text('Deliveryboys View',style: TextStyle(color:primaryColor)),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => GetDeliveryboyData()),
);
},
),
Divider(
color: Colors.grey,
),
// Add Tanks
ListTile(
title: Row(
children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox(
width: 10,
),
Text('Tankers View',style: TextStyle(color:primaryColor)),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => TankersView()),
);
},
),
Divider(
color: Colors.grey,
),
ListTile(
title: Row(
children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox(
width: 10,
),
Text('Pending Customers', style: TextStyle(color:primaryColor)),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => PendingCustomers()),
);
},
),
Divider(
color: Colors.grey,
),
ListTile(
title: Row(
children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox(
width: 10,
),
Text('Conected Customers', style: TextStyle(color:primaryColor)),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ConectedCustomers()),
);
},
),
Divider(
color: Colors.grey,
),
// Add Tanks
ListTile(
title: Row(
children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox(
width: 10,
),
Text('Booking Requests',style: TextStyle(color:primaryColor)),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => BookingRequets()),
);
},
),
Divider( Divider(
color: Colors.grey, color: Colors.grey,
), ),
ListTile( ListTile(
title: Row( title: Row(
children: const [ children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill), Image(image: const AssetImage('images/customercareblue.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
@ -494,7 +543,7 @@ class _DashboardState extends State<Dashboard> {
ListTile( ListTile(
title: Row( title: Row(
children: const [ children: const [
Image(image: const AssetImage('images/ic_launcher.png'),height: 25,width: 25,fit: BoxFit.fill), Image(image: const AssetImage('images/logoutblue.png'),height: 25,width: 25,fit: BoxFit.fill),
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),

@ -232,7 +232,6 @@ class _GetDeliveryboyDataState extends State<GetDeliveryboyData> {
Text('phone :',style: labelTextStyle()), Text('phone :',style: labelTextStyle()),
Text('alternativeContactNumber :',style: labelTextStyle()), Text('alternativeContactNumber :',style: labelTextStyle()),
// Text('address :',style: labelTextStyle()), // Text('address :',style: labelTextStyle()),
Text('status :',style: labelTextStyle()),
], ],
), ),
SizedBox(width: 5,), SizedBox(width: 5,),
@ -246,9 +245,6 @@ class _GetDeliveryboyDataState extends State<GetDeliveryboyData> {
/*Text(modeldeliveryboyList[index].deliveryboy_address,style: valuesTextStyle(), /*Text(modeldeliveryboyList[index].deliveryboy_address,style: valuesTextStyle(),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1),*/ maxLines: 1),*/
Text(modeldeliveryboyList[index].deliveryboy_status,style: valuesTextStyle()),
], ],
), ),
], ],

@ -165,22 +165,19 @@ class _PendingCustomersState extends State<PendingCustomers> {
color:primaryColor/*FilteredList[index].text_color*/ ), color:primaryColor/*FilteredList[index].text_color*/ ),
), ),
onPressed: () async{ onPressed: () async{
/* var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["customerId"] =AppSettings.customerId; payload["supplierId"] =AppSettings.supplierId;
payload["supplierId"] = FilteredList[index].supplier_id; payload["customerId"] = pendingSuppliersList[index].customer_id;
bool requestStatus = await AppSettings.connectRequest(payload);
bool requestStatus = await AppSettings.rejectRequest(payload);
if(requestStatus){ if(requestStatus){
AppSettings.longSuccessToast("Request Sent Successfully"); AppSettings.longSuccessToast("Request Sent Successfully");
await getAllSuppliersData();
await getConnectedSuppliersData();
await getPendingSuppliersData(); await getPendingSuppliersData();
} }
else{ else{
}*/ }

@ -90,20 +90,17 @@ class AppSettings {
static String deleteTankerUrl = host + 'deleteTanker'; static String deleteTankerUrl = host + 'deleteTanker';
static String UpdateTankerUrl = host + 'updateTankers'; static String UpdateTankerUrl = host + 'updateTankers';
static String addDeliveryboyUrl = host + 'addDeliveryboys'; static String addDeliveryboyUrl = host + 'addDeliveryboys';
static String getAllDeliverboyUrl = host + 'getActiveDeliveryboys'; static String getAllDeliverboyUrl = host + 'getalldeliveryboys';
static String updateDeliveryboyUrl = host + 'updatedeliveryboy'; static String updateDeliveryboyUrl = host + 'updatedeliveryboy';
static String deleteDeliveryboyUrl = host + 'deletedeliveryboy'; static String deleteDeliveryboyUrl = host + 'deletedeliveryboy';
static String pendingCustomersUrl = host + 'pendingCustomers'; static String pendingCustomersUrl = host + 'pendingCustomers';
static String connectedCustomersUrl = host + 'connectedCustomers'; static String connectedCustomersUrl = host + 'connectedCustomers';
static String bookingRequestsUrl = host + 'getAllTankersBookingdetails'; static String bookingRequestsUrl = host + 'getAllTankersBookingdetails';
static String acceptBookingRequestsUrl = host + 'ordernow'; static String acceptBookingRequestsUrl = host + 'ordernow';
static String acceptRequestUrl = host +"friend-request/accept";
static String rejectRequestUrl = host +"friend-request/reject";
String a="";
String b="";
static String acceptRequestUrl = host +"friend-request/"+ supplierId+"/accept";
@ -705,7 +702,36 @@ class AppSettings {
static Future<bool> acceptRequest( payload) async { static Future<bool> acceptRequest( payload) async {
var uri = Uri.parse(acceptRequestUrl ); var uri = Uri.parse(acceptRequestUrl );
try { try {
var response = await http.post(uri, var response = await http.put(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.put(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} catch (e) {
print(e);
return false;
}
}
static Future<bool> rejectRequest( payload) async {
var uri = Uri.parse(rejectRequestUrl );
try {
var response = await http.put(uri,
body: json.encode(payload), headers: await buildRequestHeaders()); body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) { if (response.statusCode == 200) {

@ -69,7 +69,7 @@ class _SplashScreenState extends State<SplashScreen> {
children: <Widget>[ children: <Widget>[
Container( Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage(image: AssetImage("images/final_splash_screen.png"), fit: BoxFit.cover,), image: DecorationImage(image: AssetImage("images/img.png"), fit: BoxFit.cover,),
), ),
), ),

@ -66,4 +66,6 @@ flutter:
uses-material-design: true uses-material-design: true
assets: assets:
- images/ - images/
- json/
- assets/images/

Loading…
Cancel
Save