12/8/1
This commit is contained in:
@@ -17,6 +17,21 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Color _parseColor(String colorHex) {
|
||||
if (colorHex.isEmpty) {
|
||||
return Colors.grey; // Fallback for empty color
|
||||
}
|
||||
|
||||
// Ensure the string starts with '0xff' for ARGB format
|
||||
String processedHex = colorHex.replaceFirst('#', '0xff').trim();
|
||||
|
||||
if (!processedHex.startsWith('0xff')) {
|
||||
processedHex = '0xff$processedHex'; // Add '0xff' if missing
|
||||
}
|
||||
|
||||
return Color(int.parse(processedHex));
|
||||
}
|
||||
|
||||
return GetBuilder<MapPassengerController>(builder: (controller) {
|
||||
if (controller.statusRide == 'Apply' &&
|
||||
controller.isSearchingWindow == false) {
|
||||
@@ -108,36 +123,43 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Image.asset(
|
||||
box.read(BoxName.carType) == 'Comfort'
|
||||
? 'assets/images/blob.png'
|
||||
: box.read(BoxName.carType) == 'Lady'
|
||||
? 'assets/images/lady.png' // Assuming there's an image for Lady
|
||||
: box.read(BoxName.carType) == 'Speed'
|
||||
? 'assets/images/carspeed.png'
|
||||
: box.read(BoxName.carType) ==
|
||||
'Scooter'
|
||||
? 'assets/images/moto.png'
|
||||
: box.read(BoxName.carType) ==
|
||||
'Mishwar Vip'
|
||||
? 'assets/images/freeRide.png'
|
||||
: box.read(BoxName
|
||||
.carType) ==
|
||||
'Awfar Car'
|
||||
? 'assets/images/balash.png'
|
||||
: box.read(BoxName
|
||||
.carType) ==
|
||||
'Pink Bike'
|
||||
? 'assets/images/pinkBike.png'
|
||||
: box.read(BoxName
|
||||
.carType) ==
|
||||
'Rayeh Gai'
|
||||
? 'assets/images/roundtrip.png'
|
||||
: 'assets/images/carspeed.png', // Default image if none of the above
|
||||
width: 80,
|
||||
),
|
||||
// ColorFiltered(
|
||||
// colorFilter: ColorFilter.mode(
|
||||
// _parseColor(controller.colorHex),
|
||||
// BlendMode.srcIn,
|
||||
// ),
|
||||
// child: Image.asset(
|
||||
// box.read(BoxName.carType) == 'Comfort'
|
||||
// ? 'assets/images/blob.png'
|
||||
// : box.read(BoxName.carType) == 'Lady'
|
||||
// ? 'assets/images/lady.png' // Assuming there's an image for Lady
|
||||
// : box.read(BoxName.carType) == 'Speed'
|
||||
// ? 'assets/images/carspeed.png'
|
||||
// : box.read(BoxName.carType) ==
|
||||
// 'Scooter'
|
||||
// ? 'assets/images/moto.png'
|
||||
// : box.read(BoxName.carType) ==
|
||||
// 'Mishwar Vip'
|
||||
// ? 'assets/images/freeRide.png'
|
||||
// : box.read(BoxName
|
||||
// .carType) ==
|
||||
// 'Awfar Car'
|
||||
// ? 'assets/images/balash.png'
|
||||
// : box.read(BoxName
|
||||
// .carType) ==
|
||||
// 'Pink Bike'
|
||||
// ? 'assets/images/pinkBike.png'
|
||||
// : box.read(BoxName
|
||||
// .carType) ==
|
||||
// 'Rayeh Gai'
|
||||
// ? 'assets/images/roundtrip.png'
|
||||
// : 'assets/images/carspeed.png', // Default image if none of the above
|
||||
// width: 80,
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
@@ -152,14 +174,31 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
// 'Black',
|
||||
controller.carColor,
|
||||
controller.carColor.toString(),
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
ColorFiltered(
|
||||
colorFilter: ColorFilter.mode(
|
||||
_parseColor(controller.colorHex),
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
child: Image.asset(
|
||||
box.read(BoxName.carType) == 'Scooter' ||
|
||||
box.read(BoxName.carType) ==
|
||||
'Pink Bike'
|
||||
? 'assets/images/moto.png'
|
||||
: 'assets/images/car3.png',
|
||||
width: 80,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(
|
||||
@@ -218,7 +257,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
// 'fadi ahmad',
|
||||
controller.firstName,
|
||||
controller.driverName,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
|
||||
Reference in New Issue
Block a user