Merge branch 'aamir_dev' into faiz_development

# Conflicts:
#	lib/views/requests/request_detail_page.dart
aamir_dev
Faiz Hashmi 1 year ago
commit 4079bcfb0f

@ -10,6 +10,7 @@ import 'package:mc_common_app/models/provider_branches_models/branch_detail_mode
import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/utils/navigator.dart';
import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/service_view_model.dart';
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
import 'package:mc_common_app/widgets/dropdown/dropdow_field.dart';
@ -27,8 +28,8 @@ class BranchAppointmentFragment extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar(
title: LocaleKeys.appointments.tr(),
appBar: const CustomAppBar(
title: "Select Branch",
isRemoveBackButton: true,
),
body: SizedBox(
@ -36,19 +37,6 @@ class BranchAppointmentFragment extends StatelessWidget {
height: double.infinity,
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(left: 21, right: 21, top: 21),
child: RoleTypeTab(
context.watch<ServiceVM>().selectedBranchStatus == 3 ? 0 : context.watch<ServiceVM>().selectedBranchStatus,
[
DropValue(3, "Active", ""),
DropValue(1, "Requested", ""),
],
onSelect: (DropValue value) {
context.read<ServiceVM>().updateSelectedBranchType(value.id);
},
),
),
Expanded(
child: Consumer<ServiceVM>(
builder: (context, ServiceVM serviceVM, _) {
@ -57,7 +45,7 @@ class BranchAppointmentFragment extends StatelessWidget {
} else {
List<BranchDetailModel> branches = [];
if (serviceVM.branches!.data != null) {
branches = serviceVM.branches!.data!.serviceProviderBranch!.where((element) => serviceVM.selectedBranchStatus == element.statusId).toList();
branches = serviceVM.branches!.data!.serviceProviderBranch!.where((element) => 3 == element.statusId).toList();
}
return RefreshIndicator(
onRefresh: () async => serviceVM.getBranchAndServices(),
@ -67,41 +55,44 @@ class BranchAppointmentFragment extends StatelessWidget {
itemBuilder: (context, index) {
return Row(
children: [
Container(
width: 74,
height: 50,
decoration: const BoxDecoration(
color: MyColors.darkPrimaryColor,
borderRadius: BorderRadius.all(Radius.circular(8)),
),
padding: const EdgeInsets.all(6),
child: SvgPicture.asset(
MyAssets.icBranches,
color: Colors.white,
),
),
branches[index].branchProfileImage.buildNetworkImage(width: 66, height: 53, fit: BoxFit.cover),
// Container(
// width: 74,
// height: 50,
// decoration: const BoxDecoration(
// color: MyColors.darkPrimaryColor,
// borderRadius: BorderRadius.all(Radius.circular(8)),
// ),
// padding: const EdgeInsets.all(6),
// child: SvgPicture.asset(
// MyAssets.icBranches,
// color: Colors.white,
// ),
// ),
12.width,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
const Icon(
Icons.place,
size: 12,
color: MyColors.darkPrimaryColor,
),
Geolocator.distanceBetween(AppState().currentLocation.latitude, AppState().currentLocation.latitude, double.parse(branches[index].latitude ?? "0"),
double.parse(branches[index].longitude ?? "0"))
.toStringAsFixed(2)
.toText(
fontSize: 12,
color: MyColors.darkPrimaryColor,
)
],
),
// Row(
// children: [
// const Icon(
// Icons.place,
// size: 12,
// color: MyColors.darkPrimaryColor,
// ),
// Geolocator.distanceBetween(AppState().currentLocation.latitude, AppState().currentLocation.latitude, double.parse(branches[index].latitude ?? "0"),
// double.parse(branches[index].longitude ?? "0"))
// .toStringAsFixed(2)
// .toText(
// fontSize: 12,
// color: MyColors.darkPrimaryColor,
// )
// ],
// ),
Text(
branches[index].branchName ?? "",
style: const TextStyle(
@ -115,7 +106,7 @@ class BranchAppointmentFragment extends StatelessWidget {
),
12.width,
],
).toContainer().onPress(() async {
).toContainer(borderRadius: 0, isShadowEnabled: true).onPress(() async {
branches[index].countryID = serviceVM.branches!.data!.countryID;
branches[index].countryName = serviceVM.branches!.data!.countryName;
navigateWithName(context, ProviderAppRoutes.appointment, arguments: branches[index]);
@ -125,7 +116,7 @@ class BranchAppointmentFragment extends StatelessWidget {
return 12.height;
},
itemCount: branches.length,
padding: const EdgeInsets.all(12),
padding: const EdgeInsets.only(left: 21, right: 21, top: 8),
),
);
}

@ -28,6 +28,7 @@ class HomeFragment extends StatelessWidget {
appBar: CustomAppBar(
isDrawerEnabled: true,
leadingWidth: 100,
toolbarHeight: 59,
onTap: () => navigateWithName(context, AppRoutes.settingOptionsLanguages),
actions: [
IconButton(
@ -72,8 +73,7 @@ class HomeFragment extends StatelessWidget {
onAppointmentClick: (AppointmentListModel value) {
navigateWithName(context, ProviderAppRoutes.appointmentDetailList, arguments: value);
},
).horPaddingMain(),
//margin: const EdgeInsets.only(bottom: 10, left: 21, right: 21),
).toWhiteContainer(width: double.infinity,backgroundColor: Colors.transparent).margin(left: 21,right: 21),
24.height,
ViewAllWidget(
title: LocaleKeys.myBranches.tr(),
@ -84,7 +84,7 @@ class HomeFragment extends StatelessWidget {
).horPaddingMain(),
const ServiceProviderWidget().horPaddingMain(),
],
).toWhiteContainer(width: double.infinity),
).toWhiteContainer(width: double.infinity,),
Consumer(
builder: (BuildContext context, AdVM adVM, Widget? child) {
if (adVM.state == ViewState.busy) {

@ -0,0 +1,223 @@
import 'package:flutter/material.dart';
import 'package:mc_common_app/classes/app_state.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/generated/locale_keys.g.dart';
import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/utils/navigator.dart';
import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/view_models/chat_view_model.dart';
import 'package:mc_common_app/views/advertisement/components/ads_images_corousel_widget.dart';
import 'package:mc_common_app/views/requests/request_bottomsheets.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.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';
import 'package:easy_localization/easy_localization.dart';
class RequestDetailPage extends StatelessWidget {
final RequestDetailPageArguments requestDetailPageArguments;
const RequestDetailPage({Key? key, required this.requestDetailPageArguments}) : super(key: key);
Widget buildBottomButton({
required RequestStatus requestStatus,
required String statusText,
required BuildContext context,
required Function() onViewChatTapped,
}) {
switch (requestStatus) {
case RequestStatus.submitted:
case RequestStatus.inProgress:
case RequestStatus.paid:
case RequestStatus.shipping:
return ShowFillButton(
maxWidth: double.infinity,
margin: const EdgeInsets.all(15),
maxHeight: 55,
title: LocaleKeys.viewChat.tr(),
isBold: false,
onPressed: onViewChatTapped,
);
case RequestStatus.completed:
case RequestStatus.cancelled:
case RequestStatus.expired:
case RequestStatus.pending:
return buildDisabledButton(statusText);
}
}
Widget buildDisabledButton(String text) {
return ShowFillButton(
backgroundColor: MyColors.grey98Color.withOpacity(0.3),
txtColor: MyColors.lightTextColor,
maxWidth: double.infinity,
margin: const EdgeInsets.all(15),
maxHeight: 55,
title: text,
isBold: false,
onPressed: () {},
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar(
title: LocaleKeys.requestDetail.tr(),
),
body: SizedBox(
width: double.infinity,
height: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
ImagesCorouselWidget(imagesList: requestDetailPageArguments.requestModel.requestImages ?? []),
24.height,
buildRequestContainer(context),
],
).toWhiteContainer(
width: double.infinity,
allPading: 12,
margin: const EdgeInsets.only(top: 21, right: 21, left: 21),
),
if (!requestDetailPageArguments.requestModel.isChatted) ...[
ShowFillButton(
maxWidth: double.infinity,
margin: const EdgeInsets.all(15),
maxHeight: 55,
title: LocaleKeys.sendOffer.tr(),
isBold: false,
fontSize: 18,
onPressed: () => buildSendOfferBottomSheet(context, requestDetailPageArguments),
),
] else ...[
buildBottomButton(
requestStatus: requestDetailPageArguments.requestModel.requestStatus,
statusText: "Offer ${requestDetailPageArguments.requestModel.requestStatusName}",
context: context,
onViewChatTapped: () async {
ChatViewArgumentsForRequest chatViewArgumentsForRequest = ChatViewArgumentsForRequest(
chatTypeEnum: ChatTypeEnum.requestOffer,
receiverId: requestDetailPageArguments.requestModel.customerID,
senderId: AppState().getUser.data!.userInfo!.userId.toString(),
requestId: requestDetailPageArguments.requestModel.id,
providerIndex: -1,
// This will be only sent in case of customer
requestModel: requestDetailPageArguments.requestModel,
requestIndex: requestDetailPageArguments.requestIndex, // This will be only sent in case of provider
);
ChatViewArguments chatViewArguments = ChatViewArguments(
chatTypeEnum: ChatTypeEnum.requestOffer,
chatViewArgumentsForRequest: chatViewArgumentsForRequest,
);
final chatVM = context.read<ChatVM>();
await chatVM
.getUsersChatMessagesForProvider(
customerId: requestDetailPageArguments.requestModel.customerId,
context: context,
requestOfferId: 0,
requestId: requestDetailPageArguments.requestModel.id,
customerRequestIndex: requestDetailPageArguments.requestIndex,
)
.whenComplete(
() => navigateWithName(context, AppRoutes.chatView, arguments: chatViewArguments),
);
},
),
],
],
),
),
);
}
Widget buildRequestContainer(BuildContext context) {
final requestDetail = requestDetailPageArguments.requestModel;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
requestDetail.vehicleTypeName.toText(fontSize: 16, letterSpacing: -0.64),
showItem("Manufacturer:", requestDetail.brand),
showItem("Model:", "${requestDetail.year}"),
],
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.start,
children: [
"${requestDetail.city ?? ""} ${requestDetail.countryName}".toText(
color: MyColors.lightTextColor,
),
if (requestDetail.createdOn != null) ...[
DateTime.parse(requestDetail.createdOn!).getTimeAgo().toText(
color: MyColors.lightTextColor,
),
],
],
),
],
),
showItem("Customer Name: ", requestDetail.customerName),
showItem("Description: ", requestDetail.description),
16.height,
showItem("Price Range:", ""),
Row(
children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
"${requestDetail.price.toInt()}".toText(fontSize: 19, isBold: true, letterSpacing: -1.16),
2.width,
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, fontSize: 10, letterSpacing: -0.4),
],
),
Row(
children: [
Utils.statusContainerChip(
text: (requestDetail.requestStatusName),
chipColor: MyColors.grey98Color.withOpacity(0.3),
textColor: MyColors.lightTextColor,
),
],
),
],
),
),
// const Icon(Icons.arrow_forward)
],
),
],
);
}
Widget showItem(String title, String value) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (title.isNotEmpty) title.toText(color: MyColors.lightTextColor, letterSpacing: -0.48),
if (title.isNotEmpty) 2.width,
if (value.isNotEmpty) Expanded(child: value.toText(letterSpacing: -0.48)),
],
);
}
}

@ -20,6 +20,7 @@ import 'package:mc_common_app/widgets/bottom_sheet.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
import 'package:mc_common_app/widgets/common_widgets/app_bar.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
import 'package:mc_common_app/widgets/row_with_arrow.dart';
import 'package:provider/provider.dart';
class BranchDetailPage extends StatelessWidget {
@ -68,6 +69,7 @@ class BranchDetailPage extends StatelessWidget {
backgroundColor: Colors.transparent,
borderColor: MyColors.darkPrimaryColor,
txtColor: MyColors.darkPrimaryColor,
fontSize: 15,
isFilled: false,
onPressed: () async {
showMyBottomSheet(
@ -142,6 +144,7 @@ class BranchDetailPage extends StatelessWidget {
child: SingleChildScrollView(
child: Column(
children: [
10.height,
Column(
children: [
Row(
@ -149,12 +152,19 @@ class BranchDetailPage extends StatelessWidget {
Expanded(
child: Row(
children: [
branchData.branchProfileImage.buildNetworkImage(
height: 55,
width: 50,
branchData.branchProfileImage.buildNetworkImage(height: 66, width: 53, fit: BoxFit.cover),
11.width,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
(branchData.branchName!).toText(fontSize: 16, color: MyColors.darkTextColor),
showData("${LocaleKeys.city.tr()}:", branchData.cityName.toString()),
showData("${LocaleKeys.country.tr()}:", branchData.countryName.toString()),
],
),
),
10.width,
LocaleKeys.branchInfo.tr().toText(fontSize: 16, color: Colors.black, isBold: true),
],
),
),
@ -170,15 +180,15 @@ class BranchDetailPage extends StatelessWidget {
),
Column(
children: [
showData("${LocaleKeys.country.tr()}:", branchData.countryName.toString()),
showData("${LocaleKeys.city.tr()}:", branchData.cityName.toString()),
// showData("${LocaleKeys.country.tr()}:", branchData.countryName.toString()),
// showData("${LocaleKeys.city.tr()}:", branchData.cityName.toString()),
showData("${LocaleKeys.branchName.tr()}:", branchData.branchName.toString()),
showData("${LocaleKeys.branchDescription.tr()}:", branchData.branchDescription.toString()),
showData("${LocaleKeys.branchDescription.tr()}:", branchData.branchDescription.toString()),
// showData("${LocaleKeys.branchDescription.tr()}:", branchData.branchDescription.toString()),
showData("${LocaleKeys.time.tr()}:", "${branchData.openTime.toString()} - ${branchData.closeTime.toString()}"),
showData("${LocaleKeys.address.tr()}:", branchData.address.toString()),
],
).paddingOnly(left: 60),
).paddingOnly(left: 65),
],
).horPaddingMain(),
10.height,
@ -191,6 +201,7 @@ class BranchDetailPage extends StatelessWidget {
const Icon(
Icons.calendar_month,
color: Colors.white,
),
8.width,
Expanded(
@ -198,15 +209,18 @@ class BranchDetailPage extends StatelessWidget {
isUnderLine: true,
fontSize: 12,
color: Colors.white,
decorationColor: MyColors.white,
),
),
const Icon(
Icons.arrow_forward,
size: 20,
color: Colors.white,
),
],
),
)
.withArrow(
isArrowEnabled: true,
color: Colors.white,
arrowWidth: 16.16,
arrowHeight: 11.75,
)
.margin(right: 5),
).onPress(() {
navigateWithName(context, ProviderAppRoutes.schedulesList, arguments: branchData.id.toString());
}),
@ -224,9 +238,9 @@ class BranchDetailPage extends StatelessWidget {
),
8.width,
LocaleKeys.addNewService.tr().toText(
fontSize: 15,
fontSize: 13,
color: MyColors.lightTextColor,
isBold: true,
letterSpacing: -0.52
),
],
)
@ -263,8 +277,8 @@ class BranchDetailPage extends StatelessWidget {
padding: const EdgeInsets.only(top: 5),
child: SvgPicture.asset(
MyAssets.maintenanceIcon,
width: 16,
height: 16,
width: 14,
height: 14,
),
),
8.width,
@ -276,7 +290,7 @@ class BranchDetailPage extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
categories[pIndex].categoryName.toString().toText(fontSize: 16, isBold: true),
categories[pIndex].categoryName.toString().toText(fontSize: 16),
// Padding(
// padding: const EdgeInsets.all(4.0),
// child: SvgPicture.asset(
@ -287,6 +301,7 @@ class BranchDetailPage extends StatelessWidget {
// ),
],
),
8.height,
Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
@ -301,7 +316,7 @@ class BranchDetailPage extends StatelessWidget {
.toText(
fontSize: 12,
color: MyColors.lightTextColor,
isBold: true,
),
);
},
@ -311,15 +326,15 @@ class BranchDetailPage extends StatelessWidget {
padding: EdgeInsets.zero,
),
),
const Padding(
padding: EdgeInsets.all(4.0),
child: Icon(
Icons.arrow_forward,
size: 20,
),
),
// const Padding(
// padding: EdgeInsets.all(4.0),
// child: Icon(
// Icons.arrow_forward,
// size: 20,
// ),
// ),
],
)
).withArrow(isArrowEnabled: true)
],
)),
],
@ -371,7 +386,10 @@ class BranchDetailPage extends StatelessWidget {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
title.toText(fontSize: 10, color: Colors.black, isBold: true),
title.toText(
fontSize: 12,
color: MyColors.darkTextColor,
),
8.width,
Flexible(
child: value.toText(

@ -1,5 +1,9 @@
import 'package:car_provider_app/config/provider_routes.dart';
import 'package:flutter/gestures.dart';
import 'package:mc_common_app/classes/consts.dart';
import 'package:mc_common_app/generated/locale_keys.g.dart';
import 'package:mc_common_app/utils/app_permission_handler.dart';
import 'package:mc_common_app/utils/dialogs_and_bottomsheets.dart';
import 'package:mc_common_app/view_models/service_view_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
@ -11,16 +15,50 @@ import 'package:mc_common_app/theme/colors.dart';
import 'package:mc_common_app/utils/enums.dart';
import 'package:mc_common_app/utils/navigator.dart';
import 'package:mc_common_app/utils/utils.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.dart';
import 'package:mc_common_app/widgets/common_widgets/app_bar.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/tab/role_type_tab.dart';
import 'package:mc_common_app/widgets/row_with_arrow.dart';
import 'package:provider/provider.dart';
class BranchListPage extends StatelessWidget {
const BranchListPage({Key? key}) : super(key: key);
void deleteAdBottomSheet(BuildContext context, int branchID) {
return actionConfirmationBottomSheet(
context: context,
title: LocaleKeys.deleteBranchConfirmation.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
subtitle: LocaleKeys.deleteBranchConfirmationMessage.tr(),
actionButtonYes: Expanded(
child: ShowFillButton(
maxHeight: 55,
title: LocaleKeys.yes.tr(),
fontSize: 15,
onPressed: () async {
Navigator.pop(context);
await context.read<ServiceVM>().onDeleteBranchPressed(context: context, branchID: branchID ?? -1);
},
),
),
actionButtonNo: Expanded(
child: ShowFillButton(
maxHeight: 55,
isFilled: false,
borderColor: MyColors.darkPrimaryColor,
title: LocaleKeys.no.tr(),
txtColor: MyColors.darkPrimaryColor,
fontSize: 15,
onPressed: () {
Navigator.pop(context);
},
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -70,65 +108,84 @@ class BranchListPage extends StatelessWidget {
? Center(child: LocaleKeys.no_branch.tr().toText(fontSize: 16, color: MyColors.lightTextColor))
: ListView.separated(
itemBuilder: (context, index) {
BranchDetailModel branchModel = branches[index];
return Row(
children: [
branchModel.branchProfileImage.buildNetworkImage(width: 74, height: 50, fit: BoxFit.cover),
12.width,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Utils.statusContainerChip(
text: branchModel.branchStatusLabel ?? "",
chipColor: Utils.getChipColorByBranchStatus(branchModel.branchStatus!),
),
InkWell(
onTap: () async {
await serviceVM.onDeleteBranchPressed(context: context, branchID: branchModel.id ?? -1);
},
child: const Icon(
Icons.delete,
color: MyColors.grey70Color,
return Dismissible(
key: Key(index.toString()),
background: const SizedBox(),
secondaryBackground: Container(
color: const Color(0xFFDD0505),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
children: [
LocaleKeys.delete.tr().toText(fontSize: 15, fontWeight: MyFonts.Medium, height: 23 / 25, color: MyColors.white).margin(right: 23),
],
),
),
dragStartBehavior: DragStartBehavior.start,
direction: DismissDirection.endToStart,
confirmDismiss: (DismissDirection direction) async {
deleteAdBottomSheet(context, branchModel.id!);
},
child: Row(
children: [
branchModel.branchProfileImage.buildNetworkImage(width: 66, height: 53, fit: BoxFit.cover),
12.width,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Utils.statusContainerChip(
text: branchModel.branchStatusLabel ?? "",
chipColor: Utils.getChipColorByBranchStatus(branchModel.branchStatus!),
),
),
],
),
5.height,
Text(
branchModel.branchName ?? "",
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
child: (branchModel.branchDescription ?? "").toText(
fontSize: 10,
overflow: TextOverflow.ellipsis,
color: MyColors.grey70Color,
maxLines: 2,
)),
const Icon(Icons.arrow_forward_rounded, size: 18, color: MyColors.grey70Color),
],
)
],
2.height,
// branchModel.distanceKm == null
// ? const SizedBox()
// : Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// const Icon(
// Icons.location_on,
// color: MyColors.darkPrimaryColor,
// size: 15,
// ),
// 2.width,
// ("${branchModel.distanceKm} KM").toText(
// color: MyColors.darkPrimaryColor,
// fontSize: 10,
// )
// ],
// ),
// 5.height,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
(branchModel.branchName ?? "").toText(fontSize: 16, height: 18 / 16),
],
).withArrow(isArrowEnabled: true).margin(right: 10),
(branchModel.branchDescription ?? "").toText(
fontSize: 10,
overflow: TextOverflow.ellipsis,
color: MyColors.grey70Color,
maxLines: 2,
)
],
),
),
),
],
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12)).onPress(() async {
branchModel.countryID = serviceVM.branches!.data!.countryID;
branchModel.countryName = serviceVM.branches!.data!.countryName;
navigateWithName(context, ProviderAppRoutes.branchDetail, arguments: branchModel);
});
],
).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.all(12)).onPress(() async {
branchModel.countryID = serviceVM.branches!.data!.countryID;
branchModel.countryName = serviceVM.branches!.data!.countryName;
navigateWithName(context, ProviderAppRoutes.branchDetail, arguments: branchModel);
}),
);
},
separatorBuilder: (context, index) => 12.height,
itemCount: branches.length,

@ -52,6 +52,8 @@ class _AssignDealerUserSheetState extends State<AssignDealerUserSheet> {
padding: const EdgeInsets.all(21),
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Consumer<ServiceVM>(builder: (context, model, _) {
@ -83,6 +85,8 @@ class _AssignDealerUserSheetState extends State<AssignDealerUserSheet> {
title: LocaleKeys.assignDealerUser.tr(),
maxWidth: double.infinity,
maxHeight: 55,
fontSize: 15,
onPressed: () async {
if (validation()) {
Utils.showLoading(context);
@ -113,6 +117,7 @@ class _AssignDealerUserSheetState extends State<AssignDealerUserSheet> {
title: ("+ ${LocaleKeys.createNewUser.tr()}"),
maxWidth: double.infinity,
maxHeight: 55,
fontSize: 15,
backgroundColor: Colors.transparent,
borderColor: MyColors.darkPrimaryColor,
txtColor: MyColors.darkPrimaryColor,
@ -136,18 +141,20 @@ class _AssignDealerUserSheetState extends State<AssignDealerUserSheet> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Checkbox(
value: model.allProviderDealersList[index].isBranchUser,
onChanged: (v) {
model.allProviderDealersList[index].isBranchUser = v ?? false;
model.notifyListeners();
}),
value: model.allProviderDealersList[index].isBranchUser,
onChanged: (v) {
model.allProviderDealersList[index].isBranchUser = v ?? false;
model.notifyListeners();
},
visualDensity: VisualDensity.comfortable,
),
4.width,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
("${model.allProviderDealersList[index].firstName} ${model.allProviderDealersList[index].lastName}").toText(fontSize: 16, isBold: true),
("${model.allProviderDealersList[index].firstName} ${model.allProviderDealersList[index].lastName}").toText(fontSize: 16),
8.height,
itemWidget("Role", "Dealer User"),
itemWidget("Email", model.allProviderDealersList[index].email ?? ""),

@ -41,7 +41,7 @@ dependencies:
mc_common_app:
# path: /Users/amir/StudioProjects/car_common_app
path: /Volumes/Data/Projects/Flutter/car_common_app
path: /Users/amir/StudioProjects/car_common_app

Loading…
Cancel
Save