You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
3.6 KiB
Dart
121 lines
3.6 KiB
Dart
|
2 years ago
|
import 'package:flutter/material.dart';
|
||
|
|
import 'package:mc_common_app/config/routes.dart';
|
||
|
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
||
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||
|
|
import 'package:mc_common_app/models/requests/request_model.dart';
|
||
|
|
import 'package:mc_common_app/theme/colors.dart';
|
||
|
|
import 'package:mc_common_app/utils/navigator.dart';
|
||
|
|
import 'package:mc_common_app/views/requests/widget/request_status_chip.dart';
|
||
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||
|
|
|
||
|
|
|
||
|
|
class RequestItem extends StatelessWidget {
|
||
|
|
RequestModel request;
|
||
|
|
|
||
|
|
RequestItem(this.request);
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Column(
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
||
|
|
children: [
|
||
|
|
Expanded(
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
|
children: [
|
||
|
|
RequestStatusChip(request),
|
||
|
|
6.height,
|
||
|
|
"${request.brand} ${request.model}".toText(fontSize: 16, isBold: true),
|
||
|
|
showItem("Model:", "${request.year}"),
|
||
|
|
showItem("Customer Name:", "${request.customerName}"),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
Column(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||
|
|
children: [
|
||
|
|
Center(
|
||
|
|
child: "${request.offerCount}".toText(
|
||
|
|
color: Colors.white,
|
||
|
|
isBold: true,
|
||
|
|
fontSize: 10,
|
||
|
|
),
|
||
|
|
).toContainer(
|
||
|
|
backgroundColor: MyColors.redColor,
|
||
|
|
borderRadius: 100,
|
||
|
|
paddingAll: 1,
|
||
|
|
width: 20,
|
||
|
|
height: 20,
|
||
|
|
),
|
||
|
|
2.height,
|
||
|
|
request.cityName.toText(
|
||
|
|
color: MyColors.lightTextColor,
|
||
|
|
),
|
||
|
|
"9 Hours Ago".toText(
|
||
|
|
color: MyColors.lightTextColor,
|
||
|
|
)
|
||
|
|
],
|
||
|
|
)
|
||
|
|
],
|
||
|
|
),
|
||
|
|
showItem("Description: ", request.description),
|
||
|
|
showItem("Price Range: ", ""),
|
||
|
|
Row(
|
||
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||
|
|
children: [
|
||
|
|
Row(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||
|
|
children: [
|
||
|
|
request.price.toString().toText(
|
||
|
|
fontSize: 20,
|
||
|
|
color: Colors.black,
|
||
|
|
isBold: true,
|
||
|
|
),
|
||
|
|
2.width,
|
||
|
|
"SAR"
|
||
|
|
.toText(
|
||
|
|
color: MyColors.lightTextColor,
|
||
|
|
fontSize: 10,
|
||
|
|
)
|
||
|
|
.paddingOnly(
|
||
|
|
bottom: 3,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
Icon(
|
||
|
|
Icons.arrow_forward,
|
||
|
|
color: MyColors.darkIconColor,
|
||
|
|
size: 18,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
],
|
||
|
|
)
|
||
|
|
.toContainer(
|
||
|
|
isShadowEnabled: true,
|
||
|
|
)
|
||
|
|
.onPress(() {
|
||
|
|
navigateWithName(context, AppRoutes.offersListPage);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
Widget showItem(String title, String value) {
|
||
|
|
return Row(
|
||
|
|
children: [
|
||
|
|
title.toText(
|
||
|
|
color: MyColors.lightTextColor,
|
||
|
|
),
|
||
|
|
2.width,
|
||
|
|
value.toText(
|
||
|
|
isBold: true,
|
||
|
|
),
|
||
|
|
],
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|