Merge pull request 'Common Push Ads and Appointment' (#3) from faiz_development_common into master
Reviewed-on: http://34.17.52.79/Haroon6138/car_common_app/pulls/3models_removal
commit
d200584634
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32.302" height="21.85" viewBox="0 0 32.302 21.85">
|
||||
<g id="buggy" transform="translate(0.002 -82.84)">
|
||||
<g id="Page-1_7_" transform="translate(-0.002 82.84)">
|
||||
<g id="mobility_filled_7_" transform="translate(0 0)">
|
||||
<path id="buggy_x2C_-lightweight_x2C_-offroad_x2C_-car_x2C_-vehicle" d="M304.437,641.49l-.263-.525a.95.95,0,0,1-.082-.611l.95-4.75a.95.95,0,0,1,.932-.764h8.55a.95.95,0,0,1,.773.4l4.466,6.252h3.217a4.75,4.75,0,0,1,4.341,2.821l.9,2.018a.95.95,0,0,1-.868,1.336h-3.907l.327.98a4.037,4.037,0,1,1-1.78.67l-.55-1.65h-.694L317.7,652.45a.95.95,0,0,1-.8.44h-10.45a.95.95,0,0,1-.865-.557l-2.122-4.668h-.6l-.55,1.65a4.038,4.038,0,1,1-2.272-.7,4.078,4.078,0,0,1,.493.03l.327-.98h-3.907a.95.95,0,0,1-.868-1.336l1.9-4.275a.95.95,0,0,1,.868-.564h5.588Zm9.137,2.768-.278.278a.95.95,0,0,1-1.343-1.343l1.9-1.9a.95.95,0,0,1,1.343,1.343l-.278.278L316.4,644.4l1.671-2.006-4.039-5.655h-7.282l-.733,3.667,3.392,6.783h4.668l1.1-1.324ZM300.037,654.79a2.137,2.137,0,1,0-2.137-2.137A2.137,2.137,0,0,0,300.037,654.79Zm24.225,0a2.137,2.137,0,1,0-2.137-2.137A2.137,2.137,0,0,0,324.262,654.79Z" transform="translate(-295.998 -634.84)" fill="#28323a"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="34.298" height="13.328" viewBox="0 0 34.298 13.328">
|
||||
<g id="car_10_" data-name="car (10)" transform="translate(-1.121 -15.731)">
|
||||
<path id="Path_4736" data-name="Path 4736" d="M33.548,20.3a51.525,51.525,0,0,0-7.177-1.148c-.287-.072,0,0-4.378-2.656a3.75,3.75,0,0,0-1.507-.5c-4.952-.574-10.766-.431-14.714,2.656-.215.144-.359.287-.574.287l-2.3.718a1.486,1.486,0,0,0-.933.79,6.2,6.2,0,0,0-.646,4.665,1.627,1.627,0,0,0,1.22,1.22l.574.144c0-.215-.072-.359-.072-.574a4.665,4.665,0,0,1,9.331,0,4.236,4.236,0,0,1-.144,1H25.366a4.847,4.847,0,0,1-.144-1,4.665,4.665,0,1,1,9.331,0,3.5,3.5,0,0,1-.072.861,1.783,1.783,0,0,0,.933-1.579V22.958A2.522,2.522,0,0,0,33.548,20.3Zm-21.1-.072a.653.653,0,0,1-.574-.287L10.15,17.862a18.324,18.324,0,0,1,5.527-.79l.861,3.158Zm11.771-.072a.647.647,0,0,1-.359.072H18.045l-.861-3.086,3.015.215a2.339,2.339,0,0,1,.933.287L24.648,19.8Z" transform="translate(0)" fill="#28323a"/>
|
||||
<circle id="Ellipse_234" data-name="Ellipse 234" cx="3.23" cy="3.23" r="3.23" transform="translate(4.479 22.599)" fill="#28323a"/>
|
||||
<circle id="Ellipse_235" data-name="Ellipse 235" cx="3.23" cy="3.23" r="3.23" transform="translate(26.73 22.599)" fill="#28323a"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,5 @@
|
||||
<svg id="golf-cart" xmlns="http://www.w3.org/2000/svg" width="33.26" height="25.5" viewBox="0 0 33.26 25.5">
|
||||
<path id="Path_4733" data-name="Path 4733" d="M13.761,44.88A3.88,3.88,0,1,1,9.88,41,3.88,3.88,0,0,1,13.761,44.88Zm-2.217,0A1.663,1.663,0,1,0,9.88,46.543,1.663,1.663,0,0,0,11.543,44.88Z" transform="translate(17.282 -23.261)" fill="#28323a"/>
|
||||
<path id="Path_4734" data-name="Path 4734" d="M50.761,44.88A3.88,3.88,0,1,1,46.88,41a3.88,3.88,0,0,1,3.88,3.88Zm-2.217,0a1.663,1.663,0,1,0-1.663,1.663,1.663,1.663,0,0,0,1.663-1.663Z" transform="translate(-40.228 -23.261)" fill="#28323a"/>
|
||||
<path id="Path_4735" data-name="Path 4735" d="M34.152,30.619A4.989,4.989,0,0,0,27.5,25.891a4.939,4.939,0,0,0-3.326,4.728l-10.532.554h-.033a4.579,4.579,0,0,0,.033-.554,4.989,4.989,0,0,0-9.978,0,4.579,4.579,0,0,0,.033.554H2.554A7.207,7.207,0,0,1,2,29.51a.554.554,0,0,1,.554-.554V28.4c0-3.293,1.608-6.264,4.435-7V11.772A1.109,1.109,0,0,1,5.88,10.663v-.554A1.109,1.109,0,0,1,6.989,9h16.8a.948.948,0,0,1,.937.942v.887a.948.948,0,0,1-.937.942L29.467,22.11l.682.1a5.627,5.627,0,0,1,1.935.6,6.353,6.353,0,0,1,3.176,5.033A4.462,4.462,0,0,1,34.152,30.619Zm-6.536-8.775L22.084,11.772H9.206v9.241l1.109-.371V18.507a.882.882,0,0,1,1.763-.083l.349,3.88a1.253,1.253,0,0,0,1.214,1.109h1.48a1.663,1.663,0,0,1,1.619,1.325.87.87,0,0,1-.759,1.026l-1.84.244-.033.044.554,2.323h8.77l.033-.039-.222-3.98-3.3-3.3-.665.665a.557.557,0,1,1-.787-.787l2.118-2.112a.566.566,0,1,1,.793.809l-.665.665,2.422,2.422-.05-.887a.554.554,0,0,1,.6-.554Z" transform="translate(-2 -9)" fill="#28323a"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="34.141" height="21.621" viewBox="0 0 34.141 21.621">
|
||||
<g id="transportation" transform="translate(-1.505 -12.69)">
|
||||
<path id="Path_4726" data-name="Path 4726" d="M10.229,39.426h2.407a2.547,2.547,0,1,1,0-1.679H10.229a.84.84,0,0,0,0,1.679Z" transform="translate(-2.72 -10.278)" fill="#28323a"/>
|
||||
<path id="Path_4727" data-name="Path 4727" d="M52.316,38.586A2.553,2.553,0,1,1,47.8,36.957a24.27,24.27,0,0,0,2.043,2.631.835.835,0,0,0,1.192.039.844.844,0,0,0,.034-1.187,21.472,21.472,0,0,1-1.819-2.351,2.557,2.557,0,0,1,3.062,2.5Z" transform="translate(-20.118 -10.278)" fill="#28323a"/>
|
||||
<path id="Path_4728" data-name="Path 4728" d="M47.055,29.879a5.964,5.964,0,0,0-2.362.487c.521.963,1.041,1.808,1.517,2.519a3.023,3.023,0,0,1,.845-.118,3.12,3.12,0,1,1-2.278,1c-.481-.722-1-1.568-1.523-2.525a6,6,0,1,0,3.8-1.36Z" transform="translate(-17.411 -7.566)" fill="#28323a"/>
|
||||
<path id="Path_4729" data-name="Path 4729" d="M46.7,18.615v1.9a.829.829,0,0,1-.549.784,6.81,6.81,0,0,1-2.4.375,29.7,29.7,0,0,1-1.31-3.695,4.115,4.115,0,0,1,3.874-.067.8.8,0,0,1,.386.7Z" transform="translate(-18.018 -2.096)" fill="#28323a"/>
|
||||
<path id="Path_4730" data-name="Path 4730" d="M18.124,40.089a2.341,2.341,0,0,1,0,.56H12.01a.28.28,0,0,1,0-.56Z" transform="translate(-4.501 -12.06)" fill="#28323a"/>
|
||||
<path id="Path_4731" data-name="Path 4731" d="M30.743,28.947a.274.274,0,0,1-.392-.011A31.887,31.887,0,0,1,25.43,21.2c-.778.308-3.393,1.719-3.2,6.751a.968.968,0,0,1-.4.834A6.2,6.2,0,0,1,18.2,29.854a10.271,10.271,0,0,1-3.952-.873q.034-.336.034-.672a6.563,6.563,0,0,0-6.751-6.55,1.08,1.08,0,0,0-.213-.537,1.191,1.191,0,0,0-.823-.442,10.752,10.752,0,0,1-4.036-.453.728.728,0,0,1-.28-1.181c1.215-1.22,2.973-1.763,5.693-1.763a4.7,4.7,0,0,1,2.967,1.142,9.953,9.953,0,0,1,.974,1.556.576.576,0,0,0,.493.28c.885.017,2.62,0,3.5-.017a.56.56,0,0,0,.532-.392,4.128,4.128,0,0,1,4.669-3.012c.481.084,1.993.336,2.491-.05a.448.448,0,0,0,.168-.3c-.291-.952-.549-1.948-.761-2.984a.442.442,0,0,0-.465-.353,4.793,4.793,0,0,0-2.911,1.288.287.287,0,0,1-.4,0,.28.28,0,0,1,0-.4A5.3,5.3,0,0,1,22.385,12.7a.988.988,0,0,1,1.069.795,36.988,36.988,0,0,0,7.3,15.059.28.28,0,0,1-.011.4Z" transform="translate(-0.208)" fill="#28323a"/>
|
||||
<path id="Path_4732" data-name="Path 4732" d="M7.509,38.983a3.11,3.11,0,1,1,3-3.952h2.945a6,6,0,1,0,0,1.679H10.5a3.12,3.12,0,0,1-3,2.273Z" transform="translate(0 -7.562)" fill="#28323a"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,36 @@
|
||||
class MyReservedAdsRespModel {
|
||||
int? id;
|
||||
int? adsID;
|
||||
int? customerID;
|
||||
int? paymentStatus;
|
||||
int? reservationTimeID;
|
||||
double? reservationBasePrice;
|
||||
double? refundAmount;
|
||||
String? refundDate;
|
||||
|
||||
MyReservedAdsRespModel({this.id, this.adsID, this.customerID, this.paymentStatus, this.reservationTimeID, this.reservationBasePrice, this.refundAmount, this.refundDate});
|
||||
|
||||
MyReservedAdsRespModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
adsID = json['adsID'];
|
||||
customerID = json['customerID'];
|
||||
paymentStatus = json['paymentStatus'];
|
||||
reservationTimeID = json['reservationTimeID'];
|
||||
reservationBasePrice = json['reservationBasePrice'];
|
||||
refundAmount = json['refundAmount'];
|
||||
refundDate = json['refundDate'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['adsID'] = adsID;
|
||||
data['customerID'] = customerID;
|
||||
data['paymentStatus'] = paymentStatus;
|
||||
data['reservationTimeID'] = reservationTimeID;
|
||||
data['reservationBasePrice'] = reservationBasePrice;
|
||||
data['refundAmount'] = refundAmount;
|
||||
data['refundDate'] = refundDate;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final branch2 = branch2FromJson(jsonString);
|
||||
|
||||
import 'package:mc_common_app/models/provider_branches_models/branch_detail_model.dart';
|
||||
|
||||
|
||||
class ProviderProfileModel {
|
||||
ProviderProfileModel({
|
||||
this.id,
|
||||
this.companyName,
|
||||
this.countryName,
|
||||
this.companyDescription,
|
||||
this.allDocStatus,
|
||||
this.isValidSubscription,
|
||||
this.userId,
|
||||
this.serviceProviderBranch,
|
||||
this.countryID,
|
||||
});
|
||||
|
||||
final int? id;
|
||||
final String? companyName;
|
||||
final String? countryName;
|
||||
int? countryID;
|
||||
final String? companyDescription;
|
||||
final int? allDocStatus;
|
||||
final bool? isValidSubscription;
|
||||
final String? userId;
|
||||
final List<BranchDetailModel>? serviceProviderBranch;
|
||||
|
||||
factory ProviderProfileModel.fromJson(Map<String, dynamic> json) => ProviderProfileModel(
|
||||
id: json["id"],
|
||||
companyName: json["companyName"],
|
||||
countryName: json["countryName"],
|
||||
countryID: json["countryID"],
|
||||
companyDescription: json["companyDescription"],
|
||||
allDocStatus: json["allDocStatus"],
|
||||
isValidSubscription: json["isValidSubscription"],
|
||||
userId: json["userID"],
|
||||
serviceProviderBranch: json["serviceProviderBranch"] == null ? null : List<BranchDetailModel>.from(json["serviceProviderBranch"].map((x) => BranchDetailModel.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"companyName": companyName,
|
||||
"companyDescription": companyDescription,
|
||||
"allDocStatus": allDocStatus,
|
||||
"isValidSubscription": isValidSubscription,
|
||||
"userID": userId,
|
||||
"serviceProviderBranch": serviceProviderBranch == null ? null : List<dynamic>.from(serviceProviderBranch!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,32 +1,32 @@
|
||||
class ProviderCategoryModel {
|
||||
int? id;
|
||||
String? categoryName;
|
||||
String? categoryNameN;
|
||||
String? serviceCategoryIconUrl;
|
||||
String? serviceCategoryImageUrl;
|
||||
bool? isActive;
|
||||
bool? isSelected;
|
||||
|
||||
ProviderCategoryModel({this.id, this.categoryName, this.categoryNameN, this.serviceCategoryIconUrl, this.serviceCategoryImageUrl, this.isActive, this.isSelected = false});
|
||||
|
||||
ProviderCategoryModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
categoryName = json['categoryName'];
|
||||
categoryNameN = json['categoryNameN'];
|
||||
serviceCategoryIconUrl = json['serviceCategoryIconUrl'];
|
||||
serviceCategoryImageUrl = json['serviceCategoryImageUrl'];
|
||||
isActive = json['isActive'];
|
||||
isSelected = false;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['categoryName'] = categoryName;
|
||||
data['categoryNameN'] = categoryNameN;
|
||||
data['serviceCategoryIconUrl'] = serviceCategoryIconUrl;
|
||||
data['serviceCategoryImageUrl'] = serviceCategoryImageUrl;
|
||||
data['isActive'] = isActive;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
// class ProviderCategoryModel {
|
||||
// int? id;
|
||||
// String? categoryName;
|
||||
// String? categoryNameN;
|
||||
// String? serviceCategoryIconUrl;
|
||||
// String? serviceCategoryImageUrl;
|
||||
// bool? isActive;
|
||||
// bool? isSelected;
|
||||
//
|
||||
// ProviderCategoryModel({this.id, this.categoryName, this.categoryNameN, this.serviceCategoryIconUrl, this.serviceCategoryImageUrl, this.isActive, this.isSelected = false});
|
||||
//
|
||||
// ProviderCategoryModel.fromJson(Map<String, dynamic> json) {
|
||||
// id = json['id'];
|
||||
// categoryName = json['categoryName'];
|
||||
// categoryNameN = json['categoryNameN'];
|
||||
// serviceCategoryIconUrl = json['serviceCategoryIconUrl'];
|
||||
// serviceCategoryImageUrl = json['serviceCategoryImageUrl'];
|
||||
// isActive = json['isActive'];
|
||||
// isSelected = false;
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = <String, dynamic>{};
|
||||
// data['id'] = id;
|
||||
// data['categoryName'] = categoryName;
|
||||
// data['categoryNameN'] = categoryNameN;
|
||||
// data['serviceCategoryIconUrl'] = serviceCategoryIconUrl;
|
||||
// data['serviceCategoryImageUrl'] = serviceCategoryImageUrl;
|
||||
// data['isActive'] = isActive;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -1,65 +1,65 @@
|
||||
class ProviderServiceModel {
|
||||
int? id;
|
||||
String? description;
|
||||
String? descriptionN;
|
||||
String? serviceIconUrl;
|
||||
String? serviceImageUrl;
|
||||
int? serviceCategoryID;
|
||||
bool? isActive;
|
||||
String? categoryName;
|
||||
bool? ispartial;
|
||||
int? appointmentPricePercentage;
|
||||
int? refundAmountPercentage;
|
||||
bool? isSelected;
|
||||
|
||||
ProviderServiceModel(
|
||||
{this.id,
|
||||
this.description,
|
||||
this.descriptionN,
|
||||
this.serviceIconUrl,
|
||||
this.serviceImageUrl,
|
||||
this.serviceCategoryID,
|
||||
this.isActive,
|
||||
this.categoryName,
|
||||
this.ispartial,
|
||||
this.appointmentPricePercentage,
|
||||
this.refundAmountPercentage,
|
||||
this.isSelected = false,
|
||||
});
|
||||
|
||||
ProviderServiceModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
description = json['description'];
|
||||
descriptionN = json['descriptionN'];
|
||||
serviceIconUrl = json['serviceIconUrl'];
|
||||
serviceImageUrl = json['serviceImageUrl'];
|
||||
serviceCategoryID = json['serviceCategoryID'];
|
||||
isActive = json['isActive'];
|
||||
categoryName = json['categoryName'];
|
||||
ispartial = json['ispartial'];
|
||||
appointmentPricePercentage = json['appointmentPricePercentage'];
|
||||
refundAmountPercentage = json['refundAmountPercentage'];
|
||||
isSelected = false;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['description'] = description;
|
||||
data['descriptionN'] = descriptionN;
|
||||
data['serviceIconUrl'] = serviceIconUrl;
|
||||
data['serviceImageUrl'] = serviceImageUrl;
|
||||
data['serviceCategoryID'] = serviceCategoryID;
|
||||
data['isActive'] = isActive;
|
||||
data['categoryName'] = categoryName;
|
||||
data['ispartial'] = ispartial;
|
||||
data['appointmentPricePercentage'] = appointmentPricePercentage;
|
||||
data['refundAmountPercentage'] = refundAmountPercentage;
|
||||
return data;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ProviderServiceModel{id: $id, description: $description, descriptionN: $descriptionN, serviceIconUrl: $serviceIconUrl, serviceImageUrl: $serviceImageUrl, serviceCategoryID: $serviceCategoryID, isActive: $isActive, categoryName: $categoryName, ispartial: $ispartial, appointmentPricePercentage: $appointmentPricePercentage, refundAmountPercentage: $refundAmountPercentage, isSelected: $isSelected}';
|
||||
}
|
||||
}
|
||||
// class ProviderServiceModel {
|
||||
// int? id;
|
||||
// String? description;
|
||||
// String? descriptionN;
|
||||
// String? serviceIconUrl;
|
||||
// String? serviceImageUrl;
|
||||
// int? serviceCategoryID;
|
||||
// bool? isActive;
|
||||
// String? categoryName;
|
||||
// bool? ispartial;
|
||||
// int? appointmentPricePercentage;
|
||||
// int? refundAmountPercentage;
|
||||
// bool? isSelected;
|
||||
//
|
||||
// ProviderServiceModel(
|
||||
// {this.id,
|
||||
// this.description,
|
||||
// this.descriptionN,
|
||||
// this.serviceIconUrl,
|
||||
// this.serviceImageUrl,
|
||||
// this.serviceCategoryID,
|
||||
// this.isActive,
|
||||
// this.categoryName,
|
||||
// this.ispartial,
|
||||
// this.appointmentPricePercentage,
|
||||
// this.refundAmountPercentage,
|
||||
// this.isSelected = false,
|
||||
// });
|
||||
//
|
||||
// ProviderServiceModel.fromJson(Map<String, dynamic> json) {
|
||||
// id = json['id'];
|
||||
// description = json['description'];
|
||||
// descriptionN = json['descriptionN'];
|
||||
// serviceIconUrl = json['serviceIconUrl'];
|
||||
// serviceImageUrl = json['serviceImageUrl'];
|
||||
// serviceCategoryID = json['serviceCategoryID'];
|
||||
// isActive = json['isActive'];
|
||||
// categoryName = json['categoryName'];
|
||||
// ispartial = json['ispartial'];
|
||||
// appointmentPricePercentage = json['appointmentPricePercentage'];
|
||||
// refundAmountPercentage = json['refundAmountPercentage'];
|
||||
// isSelected = false;
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = <String, dynamic>{};
|
||||
// data['id'] = id;
|
||||
// data['description'] = description;
|
||||
// data['descriptionN'] = descriptionN;
|
||||
// data['serviceIconUrl'] = serviceIconUrl;
|
||||
// data['serviceImageUrl'] = serviceImageUrl;
|
||||
// data['serviceCategoryID'] = serviceCategoryID;
|
||||
// data['isActive'] = isActive;
|
||||
// data['categoryName'] = categoryName;
|
||||
// data['ispartial'] = ispartial;
|
||||
// data['appointmentPricePercentage'] = appointmentPricePercentage;
|
||||
// data['refundAmountPercentage'] = refundAmountPercentage;
|
||||
// return data;
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// String toString() {
|
||||
// return 'ProviderServiceModel{id: $id, description: $description, descriptionN: $descriptionN, serviceIconUrl: $serviceIconUrl, serviceImageUrl: $serviceImageUrl, serviceCategoryID: $serviceCategoryID, isActive: $isActive, categoryName: $categoryName, ispartial: $ispartial, appointmentPricePercentage: $appointmentPricePercentage, refundAmountPercentage: $refundAmountPercentage, isSelected: $isSelected}';
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -0,0 +1,180 @@
|
||||
import 'package:mc_common_app/extensions/string_extensions.dart';
|
||||
import 'package:mc_common_app/models/services/item_model.dart';
|
||||
import 'package:mc_common_app/models/widgets_models.dart';
|
||||
|
||||
class ServiceAppointmentScheduleModel {
|
||||
List<ServiceSlotList>? serviceSlotList;
|
||||
List<ItemData>? serviceItemList;
|
||||
String? selectedDate;
|
||||
String? selectedTimeSlot;
|
||||
List<TimeSlotModel>? availableDates;
|
||||
List<TimeSlotModel>? availableTimeSlots;
|
||||
double? amountToPay;
|
||||
double? amountTotal;
|
||||
double? amountRem;
|
||||
|
||||
ServiceAppointmentScheduleModel({
|
||||
this.serviceSlotList,
|
||||
this.serviceItemList,
|
||||
this.selectedDate,
|
||||
this.selectedTimeSlot,
|
||||
this.availableDates,
|
||||
this.availableTimeSlots,
|
||||
this.amountToPay,
|
||||
this.amountTotal,
|
||||
this.amountRem,
|
||||
});
|
||||
|
||||
List<TimeSlotModel> getFormattedSlotTimes() {
|
||||
var seenSlots = <TimeSlotModel>{};
|
||||
|
||||
var slotTimeData = serviceSlotList!
|
||||
.where((slot) => seenSlots.add(TimeSlotModel(
|
||||
slot: slot.startTime!,
|
||||
slotId: slot.id!,
|
||||
isSelected: false,
|
||||
)))
|
||||
.toList();
|
||||
List<TimeSlotModel> slotTime = [];
|
||||
for (var element in slotTimeData) {
|
||||
slotTime.add(TimeSlotModel(isSelected: false, slotId: element.id!, slot: element.slotDate ?? ""));
|
||||
}
|
||||
|
||||
return slotTime;
|
||||
}
|
||||
|
||||
List<TimeSlotModel> getFormattedSlotDates() {
|
||||
var seenDates = <TimeSlotModel>{};
|
||||
|
||||
var slotDatesData = serviceSlotList!
|
||||
.where((slot) => seenDates.add(TimeSlotModel(
|
||||
slot: slot.slotDate!,
|
||||
slotId: slot.id!,
|
||||
isSelected: false,
|
||||
)))
|
||||
.toList();
|
||||
List<TimeSlotModel> slotDates = [];
|
||||
for (var element in slotDatesData) {
|
||||
slotDates.add(TimeSlotModel(isSelected: false, slotId: element.id!, slot: element.slotDate!.toFormattedDateWithoutTime() ?? ""));
|
||||
}
|
||||
|
||||
return slotDates;
|
||||
}
|
||||
|
||||
//TODO: I WILL START FROM HERE; I NEED TO ONLY PICK THE DISTINCT DATES FROM THE RESPONSE AND THEN BASED ON THE DATE SELECTION I WILL PICK THEIR SLOTS.
|
||||
//TODO: AFTER THAT, I WILL
|
||||
|
||||
ServiceAppointmentScheduleModel.fromJson(Map<String, dynamic> json) {
|
||||
if (json['serviceSlotList'] != null) {
|
||||
serviceSlotList = <ServiceSlotList>[];
|
||||
json['serviceSlotList'].forEach((v) {
|
||||
serviceSlotList!.add(ServiceSlotList.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['serviceItemList'] != null) {
|
||||
serviceItemList = <ItemData>[];
|
||||
json['serviceItemList'].forEach((v) {
|
||||
serviceItemList!.add(ItemData.fromJson(v));
|
||||
});
|
||||
}
|
||||
|
||||
amountToPay = json['amountToPay'];
|
||||
selectedDate = '';
|
||||
selectedTimeSlot = '';
|
||||
availableDates = getFormattedSlotDates();
|
||||
availableTimeSlots = getFormattedSlotTimes();
|
||||
amountTotal = json['amountTotal'];
|
||||
amountRem = json['amountRem'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (serviceSlotList != null) {
|
||||
data['serviceSlotList'] = serviceSlotList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (serviceItemList != null) {
|
||||
data['serviceItemList'] = serviceItemList!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['amountToPay'] = amountToPay;
|
||||
data['amountTotal'] = amountTotal;
|
||||
data['amountRem'] = amountRem;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ServiceSlotList {
|
||||
int? id;
|
||||
int? branchAppointmentScheduleID;
|
||||
String? branchAppointmentSchedule;
|
||||
int? serviceProviderID;
|
||||
String? slotDate;
|
||||
String? startTime;
|
||||
String? endTime;
|
||||
int? bookAppointment;
|
||||
int? allowAppointment;
|
||||
int? slotDurationMinute;
|
||||
int? appointmentType;
|
||||
bool? isActive;
|
||||
int? createdBy;
|
||||
String? createdOn;
|
||||
int? modifiedBy;
|
||||
String? modifiedOn;
|
||||
|
||||
ServiceSlotList(
|
||||
{this.id,
|
||||
this.branchAppointmentScheduleID,
|
||||
this.branchAppointmentSchedule,
|
||||
this.serviceProviderID,
|
||||
this.slotDate,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.bookAppointment,
|
||||
this.allowAppointment,
|
||||
this.slotDurationMinute,
|
||||
this.appointmentType,
|
||||
this.isActive,
|
||||
this.createdBy,
|
||||
this.createdOn,
|
||||
this.modifiedBy,
|
||||
this.modifiedOn});
|
||||
|
||||
ServiceSlotList.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
branchAppointmentScheduleID = json['branchAppointmentScheduleID'];
|
||||
branchAppointmentSchedule = json['branchAppointmentSchedule'];
|
||||
serviceProviderID = json['serviceProviderID'];
|
||||
slotDate = json['slotDate'];
|
||||
startTime = json['startTime'];
|
||||
endTime = json['endTime'];
|
||||
bookAppointment = json['bookAppointment'];
|
||||
allowAppointment = json['allowAppointment'];
|
||||
slotDurationMinute = json['slotDurationMinute'];
|
||||
appointmentType = json['appointmentType'];
|
||||
isActive = json['isActive'];
|
||||
createdBy = json['createdBy'];
|
||||
createdOn = json['createdOn'];
|
||||
modifiedBy = json['modifiedBy'];
|
||||
modifiedOn = json['modifiedOn'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['branchAppointmentScheduleID'] = branchAppointmentScheduleID;
|
||||
data['branchAppointmentSchedule'] = branchAppointmentSchedule;
|
||||
data['serviceProviderID'] = serviceProviderID;
|
||||
data['slotDate'] = slotDate;
|
||||
data['startTime'] = startTime;
|
||||
data['endTime'] = endTime;
|
||||
data['bookAppointment'] = bookAppointment;
|
||||
data['allowAppointment'] = allowAppointment;
|
||||
data['slotDurationMinute'] = slotDurationMinute;
|
||||
data['appointmentType'] = appointmentType;
|
||||
data['isActive'] = isActive;
|
||||
data['createdBy'] = createdBy;
|
||||
data['createdOn'] = createdOn;
|
||||
data['modifiedBy'] = modifiedBy;
|
||||
data['modifiedOn'] = modifiedOn;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
// To parse this JSON data, do
|
||||
//
|
||||
// final nearBrancheModel = nearBrancheModelFromJson(jsonString);
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'branch_model.dart';
|
||||
|
||||
NearBrancheModel nearBrancheModelFromJson(String str) => NearBrancheModel.fromJson(json.decode(str));
|
||||
|
||||
String nearBrancheModelToJson(NearBrancheModel data) => json.encode(data.toJson());
|
||||
|
||||
class NearBrancheModel {
|
||||
final int? messageStatus;
|
||||
final int? totalItemsCount;
|
||||
final List<BranchModel>? data;
|
||||
final String? message;
|
||||
|
||||
NearBrancheModel({
|
||||
this.messageStatus,
|
||||
this.totalItemsCount,
|
||||
this.data,
|
||||
this.message,
|
||||
});
|
||||
|
||||
factory NearBrancheModel.fromJson(Map<String, dynamic> json) => NearBrancheModel(
|
||||
messageStatus: json["messageStatus"],
|
||||
totalItemsCount: json["totalItemsCount"],
|
||||
data: json["data"] == null ? [] : List<BranchModel>.from(json["data"]!.map((x) => BranchModel.fromJson(x))),
|
||||
message: json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"messageStatus": messageStatus,
|
||||
"totalItemsCount": totalItemsCount,
|
||||
"data": data == null ? [] : List<dynamic>.from(data!.map((x) => x.toJson())),
|
||||
"message": message,
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,302 @@
|
||||
import 'package:collection/collection.dart' show IterableExtension;
|
||||
import 'package:country_code_picker/country_code_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomCountryCodePicker extends StatefulWidget {
|
||||
final bool isTextNeeded;
|
||||
final ValueChanged<CountryCode>? onChanged;
|
||||
final ValueChanged<CountryCode?>? onInit;
|
||||
final String? initialSelection;
|
||||
final List<String> favorite;
|
||||
final TextStyle? textStyle;
|
||||
final EdgeInsetsGeometry padding;
|
||||
final bool showCountryOnly;
|
||||
final InputDecoration searchDecoration;
|
||||
final TextStyle? searchStyle;
|
||||
final TextStyle? dialogTextStyle;
|
||||
final WidgetBuilder? emptySearchBuilder;
|
||||
final Function(CountryCode?)? builder;
|
||||
final bool enabled;
|
||||
final TextOverflow textOverflow;
|
||||
final Icon closeIcon;
|
||||
|
||||
/// Barrier color of ModalBottomSheet
|
||||
final Color? barrierColor;
|
||||
|
||||
/// Background color of ModalBottomSheet
|
||||
final Color? backgroundColor;
|
||||
|
||||
/// BoxDecoration for dialog
|
||||
final BoxDecoration? boxDecoration;
|
||||
|
||||
/// the size of the selection dialog
|
||||
final Size? dialogSize;
|
||||
|
||||
/// Background color of selection dialog
|
||||
final Color? dialogBackgroundColor;
|
||||
|
||||
/// used to customize the country list
|
||||
final List<String>? countryFilter;
|
||||
|
||||
/// shows the name of the country instead of the dialcode
|
||||
final bool showOnlyCountryWhenClosed;
|
||||
|
||||
/// aligns the flag and the Text left
|
||||
///
|
||||
/// additionally this option also fills the available space of the widget.
|
||||
/// this is especially useful in combination with [showOnlyCountryWhenClosed],
|
||||
/// because longer country names are displayed in one line
|
||||
final bool alignLeft;
|
||||
|
||||
/// shows the flag
|
||||
final bool showFlag;
|
||||
|
||||
final bool hideMainText;
|
||||
|
||||
final bool? showFlagMain;
|
||||
|
||||
final bool? showFlagDialog;
|
||||
|
||||
/// Width of the flag images
|
||||
final double flagWidth;
|
||||
|
||||
/// Use this property to change the order of the options
|
||||
final Comparator<CountryCode>? comparator;
|
||||
|
||||
/// Set to true if you want to hide the search part
|
||||
final bool hideSearch;
|
||||
|
||||
/// Set to true if you want to show drop down button
|
||||
final bool showDropDownButton;
|
||||
|
||||
/// [BoxDecoration] for the flag image
|
||||
final Decoration? flagDecoration;
|
||||
|
||||
/// An optional argument for injecting a list of countries
|
||||
/// with customized codes.
|
||||
final List<Map<String, String>> countryList;
|
||||
|
||||
const CustomCountryCodePicker({
|
||||
this.isTextNeeded = true,
|
||||
this.onChanged,
|
||||
this.onInit,
|
||||
this.initialSelection,
|
||||
this.favorite = const [],
|
||||
this.textStyle,
|
||||
this.padding = const EdgeInsets.all(8.0),
|
||||
this.showCountryOnly = false,
|
||||
this.searchDecoration = const InputDecoration(),
|
||||
this.searchStyle,
|
||||
this.dialogTextStyle,
|
||||
this.emptySearchBuilder,
|
||||
this.showOnlyCountryWhenClosed = false,
|
||||
this.alignLeft = false,
|
||||
this.showFlag = true,
|
||||
this.showFlagDialog,
|
||||
this.hideMainText = false,
|
||||
this.showFlagMain,
|
||||
this.flagDecoration,
|
||||
this.builder,
|
||||
this.flagWidth = 32.0,
|
||||
this.enabled = true,
|
||||
this.textOverflow = TextOverflow.ellipsis,
|
||||
this.barrierColor,
|
||||
this.backgroundColor,
|
||||
this.boxDecoration,
|
||||
this.comparator,
|
||||
this.countryFilter,
|
||||
this.hideSearch = false,
|
||||
this.showDropDownButton = false,
|
||||
this.dialogSize,
|
||||
this.dialogBackgroundColor,
|
||||
this.closeIcon = const Icon(Icons.close),
|
||||
this.countryList = codes,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
// ignore: no_logic_in_create_state
|
||||
State<StatefulWidget> createState() {
|
||||
List<Map<String, String>> jsonList = countryList;
|
||||
|
||||
List<CountryCode> elements = jsonList.map((json) => CountryCode.fromJson(json)).toList();
|
||||
|
||||
if (comparator != null) {
|
||||
elements.sort(comparator);
|
||||
}
|
||||
|
||||
if (countryFilter != null && countryFilter!.isNotEmpty) {
|
||||
final uppercaseCustomList = countryFilter!.map((criteria) => criteria.toUpperCase()).toList();
|
||||
elements = elements.where((criteria) => uppercaseCustomList.contains(criteria.code) || uppercaseCustomList.contains(criteria.name) || uppercaseCustomList.contains(criteria.dialCode)).toList();
|
||||
}
|
||||
|
||||
return CustomCountryCodePickerState(elements);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomCountryCodePickerState extends State<CustomCountryCodePicker> {
|
||||
CountryCode? selectedItem;
|
||||
List<CountryCode> elements = [];
|
||||
List<CountryCode> favoriteElements = [];
|
||||
|
||||
CustomCountryCodePickerState(this.elements);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget internalWidget;
|
||||
if (widget.builder != null) {
|
||||
internalWidget = InkWell(
|
||||
onTap: showCountryCodePickerDialog,
|
||||
child: widget.builder!(selectedItem),
|
||||
);
|
||||
} else {
|
||||
internalWidget = TextButton(
|
||||
onPressed: widget.enabled ? showCountryCodePickerDialog : null,
|
||||
child: Padding(
|
||||
padding: widget.padding,
|
||||
child: Flex(
|
||||
direction: Axis.horizontal,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
if (widget.showFlagMain != null ? widget.showFlagMain! : widget.showFlag)
|
||||
Flexible(
|
||||
flex: widget.alignLeft ? 0 : 1,
|
||||
fit: widget.alignLeft ? FlexFit.tight : FlexFit.loose,
|
||||
child: Container(
|
||||
clipBehavior: widget.flagDecoration == null ? Clip.none : Clip.hardEdge,
|
||||
decoration: widget.flagDecoration,
|
||||
margin: widget.alignLeft ? const EdgeInsets.only(right: 16.0, left: 8.0) : const EdgeInsets.only(right: 16.0),
|
||||
child: Image.asset(
|
||||
selectedItem!.flagUri!,
|
||||
package: 'country_code_picker',
|
||||
width: widget.flagWidth,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (!widget.hideMainText)
|
||||
Flexible(
|
||||
fit: widget.alignLeft ? FlexFit.tight : FlexFit.loose,
|
||||
child: Text(
|
||||
widget.showOnlyCountryWhenClosed ? selectedItem!.toCountryStringOnly() : selectedItem.toString(),
|
||||
style: widget.textStyle ?? Theme.of(context).textTheme.labelLarge,
|
||||
overflow: widget.textOverflow,
|
||||
),
|
||||
),
|
||||
if (widget.showDropDownButton)
|
||||
Flexible(
|
||||
flex: widget.alignLeft ? 0 : 1,
|
||||
fit: widget.alignLeft ? FlexFit.tight : FlexFit.loose,
|
||||
child: Padding(
|
||||
padding: widget.alignLeft ? const EdgeInsets.only(right: 16.0, left: 8.0) : const EdgeInsets.only(right: 16.0),
|
||||
child: Icon(
|
||||
Icons.arrow_drop_down,
|
||||
color: Colors.grey,
|
||||
size: widget.flagWidth,
|
||||
)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return internalWidget;
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
|
||||
elements = elements.map((element) => element.localize(context)).toList();
|
||||
_onInit(selectedItem);
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(CustomCountryCodePicker oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
|
||||
if (oldWidget.initialSelection != widget.initialSelection) {
|
||||
if (widget.initialSelection != null) {
|
||||
selectedItem = elements.firstWhere(
|
||||
(criteria) =>
|
||||
(criteria.code!.toUpperCase() == widget.initialSelection!.toUpperCase()) ||
|
||||
(criteria.dialCode == widget.initialSelection) ||
|
||||
(criteria.name!.toUpperCase() == widget.initialSelection!.toUpperCase()),
|
||||
orElse: () => elements[0]);
|
||||
} else {
|
||||
selectedItem = elements[0];
|
||||
}
|
||||
_onInit(selectedItem);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
if (widget.initialSelection != null) {
|
||||
selectedItem = elements.firstWhere(
|
||||
(item) =>
|
||||
(item.code!.toUpperCase() == widget.initialSelection!.toUpperCase()) ||
|
||||
(item.dialCode == widget.initialSelection) ||
|
||||
(item.name!.toUpperCase() == widget.initialSelection!.toUpperCase()),
|
||||
orElse: () => elements[0]);
|
||||
} else {
|
||||
selectedItem = elements[0];
|
||||
}
|
||||
|
||||
favoriteElements = elements
|
||||
.where((item) =>
|
||||
widget.favorite.firstWhereOrNull((criteria) => item.code!.toUpperCase() == criteria.toUpperCase() || item.dialCode == criteria || item.name!.toUpperCase() == criteria.toUpperCase()) !=
|
||||
null)
|
||||
.toList();
|
||||
}
|
||||
|
||||
void showCountryCodePickerDialog() async {
|
||||
final item = await showDialog(
|
||||
barrierColor: widget.barrierColor ?? Colors.grey.withOpacity(0.5),
|
||||
context: context,
|
||||
builder: (context) => Center(
|
||||
child: Dialog(
|
||||
child: SelectionDialog(
|
||||
elements,
|
||||
favoriteElements,
|
||||
showCountryOnly: widget.showCountryOnly,
|
||||
emptySearchBuilder: widget.emptySearchBuilder,
|
||||
searchDecoration: widget.searchDecoration,
|
||||
searchStyle: widget.searchStyle,
|
||||
textStyle: widget.dialogTextStyle,
|
||||
boxDecoration: widget.boxDecoration,
|
||||
showFlag: widget.showFlagDialog ?? widget.showFlag,
|
||||
flagWidth: widget.flagWidth,
|
||||
size: widget.dialogSize,
|
||||
backgroundColor: widget.dialogBackgroundColor,
|
||||
barrierColor: widget.barrierColor,
|
||||
hideSearch: widget.hideSearch,
|
||||
closeIcon: widget.closeIcon,
|
||||
flagDecoration: widget.flagDecoration,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
if (item != null) {
|
||||
setState(() {
|
||||
selectedItem = item;
|
||||
});
|
||||
|
||||
_publishSelection(item);
|
||||
}
|
||||
}
|
||||
|
||||
void _publishSelection(CountryCode countryCode) {
|
||||
if (widget.onChanged != null) {
|
||||
widget.onChanged!(countryCode);
|
||||
}
|
||||
}
|
||||
|
||||
void _onInit(CountryCode? countryCode) {
|
||||
if (widget.onInit != null) {
|
||||
widget.onInit!(countryCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,113 @@
|
||||
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/advertisment_models/ads_duration_model.dart';
|
||||
import 'package:mc_common_app/models/widgets_models.dart';
|
||||
import 'package:mc_common_app/theme/colors.dart';
|
||||
import 'package:mc_common_app/utils/navigator.dart';
|
||||
import 'package:mc_common_app/view_models/ad_view_model.dart';
|
||||
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
|
||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AdDurationSelectionSheetContent extends StatelessWidget {
|
||||
const AdDurationSelectionSheetContent({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AdVM adVM = context.watch<AdVM>();
|
||||
|
||||
print("hello : ${adVM.vehicleAdDurationId.selectedId}");
|
||||
return SizedBox(
|
||||
height: MediaQuery.of(context).size.height / 1.2,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
"Select Duration".toText(fontSize: 22, isBold: true).paddingOnly(top: 10, left: 21, right: 21),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
itemCount: adVM.vehicleAdsDurations.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
AdsDurationModel adDuration = adVM.vehicleAdsDurations[index];
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
"${adDuration.days} Days".toString().toText(fontSize: 16, isBold: true),
|
||||
4.height,
|
||||
"Your Ad will be active for ${adDuration.days} Days and then you will need to extend it to keep it active. ".toText(
|
||||
fontSize: 14,
|
||||
color: MyColors.lightTextColor,
|
||||
),
|
||||
12.height,
|
||||
"Ad Charges".toText(fontSize: 14, color: MyColors.lightTextColor, isBold: true),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
"${adDuration.price}".toText(fontSize: 22, isBold: true),
|
||||
2.width,
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 4),
|
||||
child: "SAR".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
).toWhiteContainer(width: double.infinity, allPading: 12, isBorderRequired: adDuration.id == adVM.vehicleAdDurationId.selectedId ? true : false),
|
||||
).onPress(() {
|
||||
adVM.updateVehicleAdDurationId(
|
||||
SelectionModel(
|
||||
selectedId: adDuration.id ?? 0,
|
||||
selectedOption: "${adDuration.days} Days",
|
||||
itemPrice: adDuration.price!.toInt().toString(),
|
||||
),
|
||||
);
|
||||
});
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return 12.height;
|
||||
},
|
||||
padding: const EdgeInsets.all(20),
|
||||
),
|
||||
),
|
||||
ShowFillButton(
|
||||
title: "Select",
|
||||
maxWidth: double.infinity,
|
||||
margin: const EdgeInsets.all(21),
|
||||
onPressed: () {
|
||||
|
||||
navigateReplaceWithName(context, AppRoutes.createAdView);
|
||||
},
|
||||
).toContainer(paddingAll: 0, backgroundColor: Colors.white),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget showItem(String item, String value, {Color valueColor = Colors.black}) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
item.toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||
4.width,
|
||||
value.toText(fontSize: 12, color: valueColor, isBold: true),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mc_common_app/classes/consts.dart';
|
||||
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||
|
||||
class AdsSearchFilterView extends StatelessWidget {
|
||||
const AdsSearchFilterView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: CustomAppBar(
|
||||
title: "Filter Ads",
|
||||
profileImageUrl: MyAssets.bnCar,
|
||||
isRemoveBackButton: false,
|
||||
isDrawerEnabled: false,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,166 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mc_common_app/classes/consts.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/advertisment_models/vehicle_details_models.dart';
|
||||
import 'package:mc_common_app/models/widgets_models.dart';
|
||||
import 'package:mc_common_app/theme/colors.dart';
|
||||
import 'package:mc_common_app/utils/enums.dart';
|
||||
import 'package:mc_common_app/view_models/ad_view_model.dart';
|
||||
import 'package:mc_common_app/views/advertisement/ad_duration_selection_sheet_content.dart';
|
||||
import 'package:mc_common_app/widgets/bottom_sheet.dart';
|
||||
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
|
||||
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SelectAdTypeView extends StatelessWidget {
|
||||
final bool isProvider;
|
||||
|
||||
const SelectAdTypeView({
|
||||
Key? key,
|
||||
this.isProvider = true,
|
||||
}) : super(key: key);
|
||||
|
||||
Widget getVehicleAdTypeIcon(VehicleTypeEnum vehicleTypeEnum) {
|
||||
switch (vehicleTypeEnum) {
|
||||
case VehicleTypeEnum.car:
|
||||
return MyAssets.vehicleTypeCar.buildSvg(height: 22);
|
||||
|
||||
case VehicleTypeEnum.motorCycle:
|
||||
return MyAssets.vehicleTypeMotorcycle.buildSvg(height: 26);
|
||||
|
||||
case VehicleTypeEnum.golfCart:
|
||||
return MyAssets.vehicleTypeGolfCart.buildSvg(height: 26);
|
||||
|
||||
case VehicleTypeEnum.buggy:
|
||||
return MyAssets.vehicleTypeBuggy.buildSvg(height: 26);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: CustomAppBar(
|
||||
title: "Select Ad Type",
|
||||
profileImageUrl: MyAssets.bnCar,
|
||||
isRemoveBackButton: false,
|
||||
isDrawerEnabled: false,
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Consumer(builder: (BuildContext context, AdVM adVM, Widget? child) {
|
||||
return ListView.separated(
|
||||
itemCount: adVM.vehicleTypes.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
VehicleTypeModel vehicleTypeModel = adVM.vehicleTypes[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
adVM.updateSelectionVehicleTypeId(
|
||||
SelectionModel(selectedId: vehicleTypeModel.id!, selectedOption: vehicleTypeModel.vehicleTypeName ?? "", errorValue: ""),
|
||||
);
|
||||
|
||||
showMyBottomSheet(context, child: const AdDurationSelectionSheetContent());
|
||||
},
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
vehicleTypeModel.vehicleTypeName.toString().toText(fontSize: 18, isBold: true),
|
||||
getVehicleAdTypeIcon(vehicleTypeModel.vehicleTypeEnum!),
|
||||
],
|
||||
),
|
||||
if (isProvider) ...[
|
||||
Row(
|
||||
children: [
|
||||
"Duration: ".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||
"Valid Until Subscription Expiration".toText(fontSize: 13, isBold: true),
|
||||
],
|
||||
).paddingOnly(top: 5, bottom: 5),
|
||||
] else ...[
|
||||
Row(
|
||||
children: [
|
||||
"Duration: ".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||
adVM.vehicleAdDurationId.selectedOption.toText(fontSize: 13, isBold: true),
|
||||
const Icon(Icons.keyboard_arrow_down_sharp, color: MyColors.darkPrimaryColor, size: 20),
|
||||
],
|
||||
).paddingOnly(top: 5, bottom: 5),
|
||||
],
|
||||
if (!isProvider) ...[
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
adVM.vehicleAdDurationId.itemPrice.toText(fontSize: 22, isBold: true),
|
||||
2.width,
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 4),
|
||||
child: "SAR".toText(fontSize: 12, color: MyColors.lightTextColor, isBold: true),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.symmetric(horizontal: 20, vertical: 10)),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return 9.height;
|
||||
},
|
||||
padding: const EdgeInsets.all(20),
|
||||
);
|
||||
}),
|
||||
),
|
||||
if (isProvider) ...[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
"5 of 10 ".toText(fontSize: 29, isBold: true, letterSpacing: 0, height: 1),
|
||||
"Ads Remaining ".toText(fontSize: 17, color: MyColors.lightTextColor, isBold: true),
|
||||
],
|
||||
),
|
||||
const Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: "You have left with 05 out of 50 ads given in the subscription. ",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: MyColors.lightTextColor,
|
||||
)),
|
||||
TextSpan(
|
||||
text: "Update Subscription",
|
||||
style: TextStyle(
|
||||
decoration: TextDecoration.underline,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: MyColors.darkPrimaryColor,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
10.height,
|
||||
],
|
||||
).toContainer(paddingAll: 20, backgroundColor: Colors.white),
|
||||
]
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue