4/3/10
This commit is contained in:
@@ -18,83 +18,78 @@ class HistoryCaptain extends StatelessWidget {
|
||||
title: 'History Page'.tr,
|
||||
body: [
|
||||
GetBuilder<HistoryCaptainController>(
|
||||
builder: (historyCaptainController) => Expanded(
|
||||
child: historyCaptainController.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: ListView.builder(
|
||||
itemCount: historyCaptainController
|
||||
.historyData['message'].length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var list = historyCaptainController
|
||||
.historyData['message'][index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
list['status'] != 'Cancel'
|
||||
? historyCaptainController
|
||||
.getHistoryDetails(list['order_id'])
|
||||
: Get.defaultDialog(
|
||||
title: 'This Trip Cancelled'.tr,
|
||||
middleText: '',
|
||||
titleStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr,
|
||||
onPressed: () => Get.back()));
|
||||
},
|
||||
child: Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'OrderId'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
list['order_id'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'created time'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
list['created_at'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
list['status'],
|
||||
style: list['status'] == 'Apply'
|
||||
? AppStyle.title.copyWith(
|
||||
color: AppColor.greenColor)
|
||||
: list['status'] == 'Refused'
|
||||
? AppStyle.title.copyWith(
|
||||
color: AppColor.redColor)
|
||||
: AppStyle.title.copyWith(
|
||||
color:
|
||||
AppColor.yellowColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
builder: (historyCaptainController) => historyCaptainController
|
||||
.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: ListView.builder(
|
||||
itemCount:
|
||||
historyCaptainController.historyData['message'].length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var list = historyCaptainController.historyData['message']
|
||||
[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
list['status'] != 'Cancel'
|
||||
? historyCaptainController
|
||||
.getHistoryDetails(list['order_id'])
|
||||
: Get.defaultDialog(
|
||||
title: 'This Trip Cancelled'.tr,
|
||||
middleText: '',
|
||||
titleStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr,
|
||||
onPressed: () => Get.back()));
|
||||
},
|
||||
child: Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'OrderId'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
list['order_id'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'created time'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
list['created_at'],
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
list['status'],
|
||||
style: list['status'] == 'Apply'
|
||||
? AppStyle.title
|
||||
.copyWith(color: AppColor.greenColor)
|
||||
: list['status'] == 'Refused'
|
||||
? AppStyle.title.copyWith(
|
||||
color: AppColor.redColor)
|
||||
: AppStyle.title.copyWith(
|
||||
color: AppColor.yellowColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
))
|
||||
);
|
||||
},
|
||||
))
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user