|
|
|
|
@ -128,23 +128,37 @@ class _CMDetailPageState extends State<CMDetailPage> {
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
else ...[
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 6),
|
|
|
|
|
decoration: BoxDecoration(color: context.isDark ? AppColor.neutral50 : AppColor.neutral30, borderRadius: BorderRadius.circular(16)),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
const Icon(Icons.add, size: 20, color: AppColor.black1E),
|
|
|
|
|
Text(
|
|
|
|
|
"Loan",
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.black1E),
|
|
|
|
|
),
|
|
|
|
|
4.width,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
Navigator.push(context, MaterialPageRoute(builder: (context) => CreateLoanRequestPage(workOrderId: widget.requestId)));
|
|
|
|
|
}),
|
|
|
|
|
Selector<CMDetailProvider, bool>(
|
|
|
|
|
selector: (_, myModel) => myModel.isLoading, // Selects only the userName
|
|
|
|
|
builder: (_, isLoading, __) {
|
|
|
|
|
if (isLoading) {
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
} else {
|
|
|
|
|
CMDetailProvider provider = Provider.of<CMDetailProvider>(context, listen: false);
|
|
|
|
|
int? statusValue = provider.currentWorkOrder?.data?.status?.value;
|
|
|
|
|
if (statusValue == 2) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 6),
|
|
|
|
|
margin: const EdgeInsets.only(left: 2),
|
|
|
|
|
decoration: BoxDecoration(color: context.isDark ? AppColor.neutral50 : AppColor.neutral30, borderRadius: BorderRadius.circular(16)),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
const Icon(Icons.add, size: 20, color: AppColor.black1E),
|
|
|
|
|
Text(
|
|
|
|
|
"Loan",
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.black1E),
|
|
|
|
|
),
|
|
|
|
|
4.width,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
Navigator.push(context, MaterialPageRoute(builder: (context) => CreateLoanRequestPage(workOrderId: widget.requestId)));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: const Icon(Icons.home),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|