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.
668 lines
28 KiB
Dart
668 lines
28 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:mc_common_app/classes/consts.dart';
|
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
import 'package:mc_common_app/utils/enums.dart';
|
|
import 'package:mc_common_app/utils/utils.dart';
|
|
import 'package:mc_common_app/view_models/ad_view_model.dart';
|
|
import 'package:mc_common_app/views/advertisement/picked_images_container.dart';
|
|
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
import 'package:mc_common_app/widgets/txt_field.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:mc_common_app/widgets/common_widgets/dotted_rect.dart';
|
|
|
|
class AttachImageContainer extends StatelessWidget {
|
|
final Function() onTap;
|
|
|
|
const AttachImageContainer({Key? key, required this.onTap}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: onTap,
|
|
child: Container(
|
|
height: 46,
|
|
width: double.infinity,
|
|
color: MyColors.white,
|
|
child: DashedRect(
|
|
color: MyColors.lightIconColor,
|
|
strokeWidth: 2.0,
|
|
gap: 4.0,
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
MyAssets.attachmentIcon.buildSvg(),
|
|
"Attach Image".toText(
|
|
fontSize: 15,
|
|
isBold: true,
|
|
color: MyColors.darkPrimaryColor,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class BuildAdStepContainer extends StatelessWidget {
|
|
final WidgetBuilder onVehicleDetails;
|
|
final WidgetBuilder onDamageParts;
|
|
final WidgetBuilder onAdDuration;
|
|
final WidgetBuilder onReviewAd;
|
|
final AdCreationStepsEnum adCreationStepsEnum;
|
|
|
|
const BuildAdStepContainer({
|
|
Key? key,
|
|
required this.onVehicleDetails,
|
|
required this.onDamageParts,
|
|
required this.onAdDuration,
|
|
required this.onReviewAd,
|
|
required this.adCreationStepsEnum,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
switch (adCreationStepsEnum) {
|
|
case AdCreationStepsEnum.vehicleDetails:
|
|
return onVehicleDetails(context);
|
|
|
|
case AdCreationStepsEnum.damageParts:
|
|
return onDamageParts(context);
|
|
|
|
case AdCreationStepsEnum.adDuration:
|
|
return onAdDuration(context);
|
|
|
|
case AdCreationStepsEnum.reviewAd:
|
|
return onReviewAd(context);
|
|
}
|
|
}
|
|
}
|
|
|
|
class VehicleDetails extends StatelessWidget {
|
|
const VehicleDetails({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Consumer(builder: (BuildContext context, AdVM adVM, Widget? child) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
"Vehicle Detail".toText(fontSize: 18, isBold: true),
|
|
8.height,
|
|
Builder(
|
|
builder: (BuildContext context) {
|
|
List<DropValue> vehicleTypesDrop = [];
|
|
for (var element in adVM.vehicleTypes) {
|
|
vehicleTypesDrop.add(DropValue(element.id?.toInt() ?? 0, element.vehicleTypeName ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleTypeId(SelectionModel(selectedId: value.id, selectedOption: value.value, errorValue: "")),
|
|
list: vehicleTypesDrop,
|
|
dropdownValue: adVM.vehicleTypeId.selectedId != -1 ? DropValue(adVM.vehicleTypeId.selectedId, adVM.vehicleTypeId.selectedOption, "") : null,
|
|
errorValue: adVM.vehicleTypeId.errorValue,
|
|
hint: "Vehicle Type",
|
|
);
|
|
},
|
|
),
|
|
if (adVM.vehicleTypeId.selectedId != -1) ...[
|
|
if (adVM.isFetchingLists) ...[
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: const [
|
|
CircularProgressIndicator(),
|
|
],
|
|
).paddingAll(10),
|
|
] else ...[
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleModelsDrop = [];
|
|
for (var element in adVM.vehicleModels) {
|
|
vehicleModelsDrop.add(DropValue(element.id?.toInt() ?? 0, element.model ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleModelId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleModelsDrop,
|
|
dropdownValue: adVM.vehicleModelId.selectedId != -1 ? DropValue(adVM.vehicleModelId.selectedId, adVM.vehicleModelId.selectedOption, "") : null,
|
|
|
|
hint: "Vehicle Model",
|
|
errorValue: adVM.vehicleModelId.errorValue,
|
|
);
|
|
}),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleYearModelsDrop = [];
|
|
for (var element in adVM.vehicleModelYears) {
|
|
vehicleYearModelsDrop.add(DropValue(element.id?.toInt() ?? 0, element.modelYear ?? "", ""));
|
|
}
|
|
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleModelYearId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleYearModelsDrop,
|
|
dropdownValue: adVM.vehicleModelYearId.selectedId != -1 ? DropValue(adVM.vehicleModelYearId.selectedId, adVM.vehicleModelYearId.selectedOption, "") : null,
|
|
hint: "Vehicle Model Year",
|
|
errorValue: adVM.vehicleModelYearId.errorValue,
|
|
);
|
|
}),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleColorsDrop = [];
|
|
for (var element in adVM.vehicleColors) {
|
|
vehicleColorsDrop.add(DropValue(element.id?.toInt() ?? 0, element.color ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleColorId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleColorsDrop,
|
|
hint: "Vehicle Color",
|
|
dropdownValue: adVM.vehicleColorId.selectedId != -1 ? DropValue(adVM.vehicleColorId.selectedId, adVM.vehicleColorId.selectedOption, "") : null,
|
|
|
|
errorValue: adVM.vehicleColorId.errorValue,
|
|
);
|
|
}),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleConditionsDrop = [];
|
|
for (var element in adVM.vehicleConditions) {
|
|
vehicleConditionsDrop.add(DropValue(element.id?.toInt() ?? 0, element.condition ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleConditionId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleConditionsDrop,
|
|
dropdownValue: adVM.vehicleConditionId.selectedId != -1 ? DropValue(adVM.vehicleConditionId.selectedId, adVM.vehicleConditionId.selectedOption, "") : null,
|
|
|
|
hint: "Vehicle Condition",
|
|
errorValue: adVM.vehicleConditionId.errorValue,
|
|
);
|
|
}),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleCategoriesDrop = [];
|
|
for (var element in adVM.vehicleCategories) {
|
|
vehicleCategoriesDrop.add(DropValue(element.id?.toInt() ?? 0, element.category ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleCategoryId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleCategoriesDrop,
|
|
hint: "Vehicle Category",
|
|
dropdownValue: adVM.vehicleCategoryId.selectedId != -1 ? DropValue(adVM.vehicleCategoryId.selectedId, adVM.vehicleCategoryId.selectedOption, "") : null,
|
|
|
|
errorValue: adVM.vehicleCategoryId.errorValue,
|
|
);
|
|
}),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleMileageDrop = [];
|
|
for (var element in adVM.vehicleMileages) {
|
|
vehicleMileageDrop.add(DropValue(element.id?.toInt() ?? 0, "${element.mileageStart ?? ""} - ${element.mileageEnd ?? ""}", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleMileageId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleMileageDrop,
|
|
dropdownValue: adVM.vehicleMileageId.selectedId != -1 ? DropValue(adVM.vehicleMileageId.selectedId, adVM.vehicleMileageId.selectedOption, "") : null,
|
|
hint: "Vehicle Mileage",
|
|
errorValue: adVM.vehicleMileageId.errorValue,
|
|
);
|
|
}),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleTransmissionsDrop = [];
|
|
for (var element in adVM.vehicleTransmissions) {
|
|
vehicleTransmissionsDrop.add(DropValue(element.id?.toInt() ?? 0, element.transmission ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleTransmissionId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleTransmissionsDrop,
|
|
hint: "Vehicle Transmission",
|
|
errorValue: adVM.vehicleTransmissionId.errorValue,
|
|
);
|
|
}),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleSellerTypesDrop = [];
|
|
for (var element in adVM.vehicleSellerTypes) {
|
|
vehicleSellerTypesDrop.add(DropValue(element.id?.toInt() ?? 0, element.sellerType ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleSellerTypeId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleSellerTypesDrop,
|
|
dropdownValue: adVM.vehicleSellerTypeId.selectedId != -1 ? DropValue(adVM.vehicleSellerTypeId.selectedId, adVM.vehicleSellerTypeId.selectedOption, "") : null,
|
|
|
|
hint: "Vehicle Seller Type",
|
|
errorValue: adVM.vehicleSellerTypeId.errorValue,
|
|
);
|
|
}),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleCountriesDrop = [];
|
|
for (var element in adVM.vehicleCountries) {
|
|
vehicleCountriesDrop.add(DropValue(element.id?.toInt() ?? 0, element.countryName ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleCountryId(SelectionModel(selectedOption: value.value, selectedId: value.id)),
|
|
list: vehicleCountriesDrop,
|
|
dropdownValue: adVM.vehicleCountryId.selectedId != -1 ? DropValue(adVM.vehicleCountryId.selectedId, adVM.vehicleCountryId.selectedOption, "") : null,
|
|
|
|
hint: "Vehicle Country",
|
|
errorValue: adVM.vehicleCountryId.errorValue,
|
|
);
|
|
}),
|
|
if (adVM.vehicleCountryId.selectedId != -1) ...[
|
|
if (adVM.isCountryFetching) ...[
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [const CircularProgressIndicator().paddingAll(10)],
|
|
),
|
|
] else ...[
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleCitiesDrop = [];
|
|
for (var element in adVM.vehicleCities) {
|
|
vehicleCitiesDrop.add(DropValue(element.id?.toInt() ?? 0, element.cityName ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateSelectionVehicleCityId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleCitiesDrop,
|
|
dropdownValue: adVM.vehicleCityId.selectedId != -1 ? DropValue(adVM.vehicleCityId.selectedId, adVM.vehicleCityId.selectedOption, "") : null,
|
|
hint: "Vehicle City",
|
|
errorValue: adVM.vehicleCityId.errorValue,
|
|
);
|
|
}),
|
|
],
|
|
],
|
|
8.height,
|
|
TxtField(
|
|
value: adVM.vehicleDemandAmount,
|
|
errorValue: adVM.demandAmountError,
|
|
hint: "Demand Amount",
|
|
onChanged: (v) => adVM.updateVehicleDemandAmount(v),
|
|
),
|
|
8.height,
|
|
TxtField(
|
|
value: adVM.vehicleVin,
|
|
errorValue: adVM.vehicleVinError,
|
|
hint: "Vehicle VIN",
|
|
onChanged: (v) => adVM.updateVehicleVin(v),
|
|
),
|
|
8.height,
|
|
TxtField(
|
|
value: adVM.vehicleTitle,
|
|
errorValue: adVM.vehicleTitleError,
|
|
hint: "Vehicle Title",
|
|
onChanged: (v) => adVM.updateVehicleTitle(v),
|
|
),
|
|
8.height,
|
|
TxtField(
|
|
value: adVM.warrantyDuration,
|
|
errorValue: adVM.warrantyError,
|
|
hint: "Warranty Available (No. of Years)",
|
|
onChanged: (v) => adVM.updateVehicleWarrantyDuration(v),
|
|
),
|
|
8.height,
|
|
TxtField(
|
|
value: adVM.vehicleDescription,
|
|
hint: "Vehicle Description",
|
|
maxLines: 5,
|
|
errorValue: adVM.vehicleDescError,
|
|
onChanged: (v) => adVM.updateVehicleDescription(v),
|
|
),
|
|
22.height,
|
|
"Finance Available".toText(fontSize: 16),
|
|
8.height,
|
|
Container(
|
|
width: 65,
|
|
height: 37,
|
|
decoration: BoxDecoration(
|
|
color: adVM.financeAvailableStatus ? MyColors.darkPrimaryColor : MyColors.white,
|
|
borderRadius: BorderRadius.circular(25.0),
|
|
border: Border.all(color: MyColors.black, width: 1.5),
|
|
),
|
|
child: CupertinoSwitch(
|
|
activeColor: MyColors.darkPrimaryColor,
|
|
trackColor: MyColors.white,
|
|
thumbColor: MyColors.grey98Color,
|
|
value: adVM.financeAvailableStatus,
|
|
onChanged: (value) {
|
|
adVM.updateFinanceAvailableStatus(value);
|
|
},
|
|
),
|
|
),
|
|
28.height,
|
|
"Vehicle Pictures".toText(fontSize: 18, isBold: true),
|
|
8.height,
|
|
AttachImageContainer(onTap: () {
|
|
context.read<AdVM>().pickMultipleImages();
|
|
}),
|
|
if (adVM.vehicleImageError != "") ...[
|
|
10.height,
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: [
|
|
adVM.vehicleImageError.toText(fontSize: 14, color: Colors.red),
|
|
],
|
|
).paddingOnly(right: 10)
|
|
],
|
|
if (adVM.pickedVehicleImages.isNotEmpty) ...[
|
|
16.height,
|
|
PickedImagesContainer(
|
|
pickedImages: adVM.pickedVehicleImages,
|
|
onCrossPressed: adVM.removeImageFromList,
|
|
),
|
|
],
|
|
15.height,
|
|
],
|
|
]
|
|
],
|
|
).toWhiteContainer(width: double.infinity, allPading: 12, margin: const EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
|
});
|
|
}
|
|
}
|
|
|
|
class DamageParts extends StatelessWidget {
|
|
const DamageParts({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Consumer(
|
|
builder: (BuildContext context, AdVM adVM, Widget? child) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
"Vehicle Damage Pictures".toText(fontSize: 18, isBold: true),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleDamagePartsDrop = [];
|
|
for (var element in adVM.vehicleDamageParts) {
|
|
vehicleDamagePartsDrop.add(DropValue(element.id?.toInt() ?? 0, element.partName ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) {
|
|
adVM.updateSelectionVehicleDamagePartId(SelectionModel(selectedOption: value.value, selectedId: value.id));
|
|
},
|
|
dropdownValue: adVM.vehicleDamagePartId.selectedId != -1 ? DropValue(adVM.vehicleDamagePartId.selectedId, adVM.vehicleDamagePartId.selectedOption, "") : null,
|
|
list: vehicleDamagePartsDrop,
|
|
hint: "Vehicle Part",
|
|
errorValue: adVM.vehicleDamagePartId.errorValue,
|
|
);
|
|
}),
|
|
8.height,
|
|
AttachImageContainer(onTap: () {
|
|
adVM.pickMultipleDamageImages();
|
|
}),
|
|
if (adVM.vehicleDamageImageError != "") ...[
|
|
10.height,
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: [
|
|
adVM.vehicleDamageImageError.toText(fontSize: 14, color: Colors.red),
|
|
],
|
|
).paddingOnly(right: 10)
|
|
],
|
|
if (adVM.pickedDamageImages.isNotEmpty) ...[
|
|
16.height,
|
|
PickedImagesContainer(
|
|
pickedImages: adVM.pickedDamageImages,
|
|
onCrossPressed: adVM.removeDamageImageFromList,
|
|
),
|
|
],
|
|
20.height,
|
|
],
|
|
).toWhiteContainer(width: double.infinity, allPading: 12, margin: const EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
class AdDuration extends StatelessWidget {
|
|
const AdDuration({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Consumer(
|
|
builder: (BuildContext context, AdVM adVM, Widget? child) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
"Ad Duration".toText(fontSize: 18, isBold: true),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleAdsDurationsDrop = [];
|
|
for (var element in adVM.vehicleAdsDurations) {
|
|
vehicleAdsDurationsDrop.add(DropValue(element.id?.toInt() ?? 0, element.name ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateVehicleAdDurationId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
errorValue: adVM.vehicleAdDurationId.errorValue,
|
|
list: vehicleAdsDurationsDrop,
|
|
hint: "Select Duration",
|
|
);
|
|
}),
|
|
8.height,
|
|
TxtField(
|
|
errorValue: adVM.adStartDateError,
|
|
hint: 'Start Date',
|
|
value: adVM.selectionDurationStartDate,
|
|
isNeedClickAll: true,
|
|
postfixData: Icons.calendar_month_rounded,
|
|
postFixDataColor: MyColors.lightTextColor,
|
|
onTap: () async {
|
|
final formattedDate = await Utils.pickDateFromDatePicker(context);
|
|
adVM.updateSelectionDurationStartDate(formattedDate);
|
|
},
|
|
),
|
|
28.height,
|
|
"Select Special Services".toText(fontSize: 18, isBold: true),
|
|
8.height,
|
|
Builder(builder: (context) {
|
|
List<DropValue> vehicleAdsSpecialServices = [];
|
|
for (var element in adVM.vehicleAdsSpecialServices) {
|
|
vehicleAdsSpecialServices.add(DropValue(element.id?.toInt() ?? 0, element.name ?? "", ""));
|
|
}
|
|
return DropdownField(
|
|
(DropValue value) => adVM.updateVehicleAdsSpecialServicesId(SelectionModel(selectedId: value.id, selectedOption: value.value)),
|
|
list: vehicleAdsSpecialServices,
|
|
hint: "Select Service",
|
|
);
|
|
}),
|
|
20.height,
|
|
],
|
|
).toWhiteContainer(width: double.infinity, allPading: 12, margin: const EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
class SingleDetailWidget extends StatelessWidget {
|
|
final String text;
|
|
final String type;
|
|
|
|
const SingleDetailWidget({Key? key, required this.text, required this.type}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
"$type:".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
|
text.toText(fontSize: 14, color: MyColors.black, isBold: true),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
class ReviewAd extends StatelessWidget {
|
|
const ReviewAd({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: const [
|
|
VehicleDetailsReview(),
|
|
DamagePartsReview(),
|
|
AdDurationReview(),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
class VehicleDetailsReview extends StatelessWidget {
|
|
const VehicleDetailsReview({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Consumer(
|
|
builder: (BuildContext context, AdVM adVM, Widget? child) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
"Vehicle Details".toText(fontSize: 18, isBold: true),
|
|
8.height,
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
children: [
|
|
Expanded(
|
|
flex: 5,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
SingleDetailWidget(text: adVM.vehicleTypeId.selectedOption, type: "Vehicle Type"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleModelYearId.selectedOption, type: "Vehicle Year"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleConditionId.selectedOption, type: "Vehicle Condition"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleMileageId.selectedOption, type: "Vehicle Mileage"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleSellerTypeId.selectedOption, type: "Seller Type"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleCityId.selectedOption, type: "Vehicle City"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleVin, type: "Vehicle VIN"),
|
|
16.height,
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 5,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
SingleDetailWidget(text: adVM.vehicleModelId.selectedOption, type: "Vehicle Model"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleColorId.selectedOption, type: "Vehicle Color"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleCategoryId.selectedOption, type: "Vehicle Category"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleTransmissionId.selectedOption, type: "Vehicle Transmission"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleCountryId.selectedOption, type: "Vehicle Country"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleDemandAmount, type: "Vehicle Amount"),
|
|
16.height,
|
|
SingleDetailWidget(text: adVM.vehicleTitle, type: "Vehicle Title"),
|
|
16.height,
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
SingleDetailWidget(text: adVM.warrantyDuration, type: "Warranty Available"),
|
|
8.height,
|
|
SingleDetailWidget(text: adVM.vehicleDescription, type: "Description"),
|
|
8.height,
|
|
SingleDetailWidget(text: adVM.financeAvailableStatus ? "Yes" : "No", type: "Finance Available"),
|
|
8.height,
|
|
"Vehicle Pictures:".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
|
if (adVM.pickedVehicleImages.isNotEmpty) ...[
|
|
// 10.height,
|
|
PickedImagesContainer(
|
|
pickedImages: adVM.pickedVehicleImages,
|
|
onCrossPressed: adVM.removeImageFromList,
|
|
),
|
|
],
|
|
],
|
|
).toWhiteContainer(width: double.infinity, allPading: 12, margin: const EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
class DamagePartsReview extends StatelessWidget {
|
|
const DamagePartsReview({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Consumer(
|
|
builder: (BuildContext context, AdVM adVM, Widget? child) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
"Vehicle Damage Part".toText(fontSize: 18, isBold: true),
|
|
8.height,
|
|
Row(
|
|
children: [
|
|
SingleDetailWidget(type: "Vehicle Part", text: adVM.vehicleDamagePartId.selectedOption),
|
|
],
|
|
),
|
|
8.height,
|
|
"Damage Part Pictures:".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
|
if (adVM.pickedDamageImages.isNotEmpty) ...[
|
|
// 16.height,
|
|
PickedImagesContainer(
|
|
pickedImages: adVM.pickedDamageImages,
|
|
onCrossPressed: adVM.removeDamageImageFromList,
|
|
),
|
|
],
|
|
],
|
|
).toWhiteContainer(width: double.infinity, allPading: 12, margin: const EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|
|
class AdDurationReview extends StatelessWidget {
|
|
const AdDurationReview({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Consumer(
|
|
builder: (BuildContext context, AdVM adVM, Widget? child) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
"Vehicle Damage Part".toText(fontSize: 18, isBold: true),
|
|
8.height,
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
flex: 5,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
SingleDetailWidget(type: "Duration", text: adVM.vehicleAdDurationId.selectedOption),
|
|
8.height,
|
|
SingleDetailWidget(type: "Special Service", text: adVM.vehicleAdsSpecialServicesId.selectedOption),
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 5,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
SingleDetailWidget(type: "Start Date", text: adVM.selectionDurationStartDate),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
).toWhiteContainer(width: double.infinity, allPading: 12, margin: const EdgeInsets.symmetric(horizontal: 21, vertical: 10));
|
|
},
|
|
);
|
|
}
|
|
}
|