Issues Fixed

aamir_dev
Faiz Hashmi 1 year ago
parent 7ba4a191bb
commit 7afe4683ed

@ -21,6 +21,7 @@ import 'package:mc_common_app/utils/navigator.dart';
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/common_widgets/custom_add_button_widget.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';
@ -51,7 +52,7 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
},
);
await serviceVM.filterUserBranchCategories();
serviceVM.filterUserBranchCategories();
});
}
@ -144,15 +145,7 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
],
),
12.height,
ShowFillButton(
title: LocaleKeys.rejectedFormAdmin.tr(),
maxWidth: double.infinity,
backgroundColor: MyColors.darkWhiteColor,
borderColor: MyColors.darkPrimaryColor,
txtColor: MyColors.lightTextColor,
isFilled: true,
onPressed: () {},
),
Utils.buildStatusContainer(LocaleKeys.rejectedFormAdmin.tr(), marginAll: 0, fontSize: 16),
],
);
}
@ -309,48 +302,60 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
context.read<ScheduleVM>().currentSelectedBranchName = widget.branchData.branchName.toString();
navigateWithName(context, AppRoutes.schedulesList, arguments: widget.branchData.id.toString());
}),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(
Icons.add,
color: Colors.white,
size: 18,
).toContainer(
borderRadius: 100,
paddingAll: 2,
backgroundColor: MyColors.darkIconColor,
),
8.width,
LocaleKeys.addNewService.tr().toText(fontSize: 15, color: MyColors.lightTextColor, letterSpacing: -0.52),
],
)
.toContainer(
borderRadius: 0,
backgroundColor: MyColors.darkWhiteColor,
width: double.infinity,
paddingAll: 25,
margin: const EdgeInsets.only(
left: 20,
right: 20,
top: 20,
))
.onPress(() {
if (widget.branchData.branchStatus == BranchStatusEnum.pending || widget.branchData.branchStatus == BranchStatusEnum.rejected) {
Utils.showToast("Please wait for the branch verification.");
return;
}
navigateWithName(
context,
AppRoutes.createServices3,
arguments: CreateBranchModel(
branchId: widget.branchData.id.toString(),
branchName: widget.branchData.branchName.toString(),
isForEdit: false,
),
);
}),
10.height,
CustomAddButton(
needsBorder: true,
bgColor: MyColors.white,
onTap: () {
if (widget.branchData.branchStatus == BranchStatusEnum.pending || widget.branchData.branchStatus == BranchStatusEnum.rejected) {
Utils.showToast("Please wait for the branch verification.");
return;
}
navigateWithName(
context,
AppRoutes.createServices3,
arguments: CreateBranchModel(
branchId: widget.branchData.id.toString(),
branchName: widget.branchData.branchName.toString(),
isForEdit: false,
),
);
},
text: LocaleKeys.addNewService.tr(),
icon: Container(
height: 24,
width: 24,
decoration: const BoxDecoration(shape: BoxShape.circle, color: MyColors.darkTextColor),
child: const Icon(Icons.add, color: MyColors.white),
)).horPaddingMain(),
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// const Icon(
// Icons.add,
// color: Colors.white,
// size: 18,
// ).toContainer(
// borderRadius: 100,
// paddingAll: 2,
// backgroundColor: MyColors.darkIconColor,
// ),
// 8.width,
// LocaleKeys.addNewService.tr().toText(fontSize: 15, color: MyColors.lightTextColor, letterSpacing: -0.52),
// ],
// )
// .toContainer(
// borderRadius: 0,
// backgroundColor: MyColors.darkWhiteColor,
// width: double.infinity,
// paddingAll: 25,
// margin: const EdgeInsets.only(
// left: 20,
// right: 20,
// top: 20,
// ))
// .onPress(() {}),
if (serviceVM.state == ViewState.busy) ...[
30.height,
const Center(

@ -65,45 +65,45 @@ class BranchListPage extends StatelessWidget {
title: LocaleKeys.myBranches.tr(),
isRemoveBackButton: true,
),
body: SizedBox(
width: double.infinity,
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);
},
body: RefreshIndicator(
onRefresh: () async => await context.read<ServiceVM>().getBranchAndServices(),
child: SizedBox(
width: double.infinity,
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, _) {
if (serviceVM.state == ViewState.busy) {
return const Center(child: CircularProgressIndicator());
} else {
List<BranchDetailModel> branches = [];
if (serviceVM.branches!.data != null) {
if (serviceVM.selectedBranchStatus == 3) {
// 3 means active branch
branches = serviceVM.branches!.data!.serviceProviderBranch!.where((element) => element.statusId == 3).toList();
} else {
branches = serviceVM.branches!.data!.serviceProviderBranch!.where((element) {
return element.statusId != 3; // means rest of the branches
}).toList();
Expanded(
child: Consumer<ServiceVM>(
builder: (context, serviceVM, _) {
if (serviceVM.state == ViewState.busy) {
return const Center(child: CircularProgressIndicator());
} else {
List<BranchDetailModel> branches = [];
if (serviceVM.branches!.data != null) {
if (serviceVM.selectedBranchStatus == 3) {
// 3 means active branch
branches = serviceVM.branches!.data!.serviceProviderBranch!.where((element) => element.statusId == 3).toList();
} else {
branches = serviceVM.branches!.data!.serviceProviderBranch!.where((element) {
return element.statusId != 3; // means rest of the branches
}).toList();
}
}
}
return RefreshIndicator(
onRefresh: () async => await context.read<ServiceVM>().getBranchAndServices(),
child: branches.isEmpty
return branches.isEmpty
? Center(child: LocaleKeys.no_branch.tr().toText(fontSize: 16, color: MyColors.lightTextColor, fontWeight: MyFonts.Medium))
: ListView.separated(
itemBuilder: (context, index) {
@ -189,13 +189,13 @@ class BranchListPage extends StatelessWidget {
},
separatorBuilder: (context, index) => 12.height,
itemCount: branches.length,
).paddingAll(21),
);
}
},
).paddingAll(21);
}
},
),
),
),
],
],
),
),
),
floatingActionButton: FloatingActionButton(

@ -174,11 +174,13 @@ class _DefineBranchViewState extends State<DefineBranchView> {
},
),
12.height,
DottedRectContainer(
onTap: () => serviceVM.pickMultipleImages(),
text: LocaleKeys.attachImage.tr(),
icon: MyAssets.attachmentIcon.buildSvg(),
),
if (serviceVM.pickedBranchImages.isEmpty) ...[
DottedRectContainer(
onTap: () => serviceVM.pickMultipleImages(),
text: LocaleKeys.attachImage.tr(),
icon: MyAssets.attachmentIcon.buildSvg(),
),
],
if (serviceVM.branchImageError != "") ...[
10.height,
Row(

@ -93,7 +93,7 @@ class _SchedulesListPageState extends State<SchedulesListPage> {
: scheduleVM.schedule!.data!.isEmpty
? EmptyWidget(
text: LocaleKeys.noSchedulesFound.tr(),
)
).paddingAll(21)
: ListView.separated(
itemBuilder: (BuildContext context, int index) {
return Column(
@ -130,7 +130,7 @@ class _SchedulesListPageState extends State<SchedulesListPage> {
showItem("${LocaleKeys.shiftEndTime.tr()}:", scheduleVM.schedule!.data![index].endTime ?? ""),
showItem("${LocaleKeys.slotsTime.tr()}:", "${scheduleVM.schedule!.data![index].slotDurationMinute} Mins"),
showItem("${LocaleKeys.appointmentPerSlot.tr()}:", scheduleVM.schedule!.data![index].perSlotAppointment.toString()),
showItem(LocaleKeys.serviceLocation.tr(), scheduleVM.schedule!.data![index].appointmentType ==1 ? "Company Location" : "Home Location"),
showItem(LocaleKeys.serviceLocation.tr(), scheduleVM.schedule!.data![index].appointmentType == 1 ? "Company Location" : "Home Location"),
showItem("${LocaleKeys.offDays.tr()}:", offDays(scheduleVM.schedule!.data![index])),
12.height,
"${LocaleKeys.services.tr()}:".toText(fontSize: 12, color: MyColors.lightTextColor),

@ -40,7 +40,7 @@ class _CreateServicesPage3State extends State<CreateServicesPage3> {
bool isHomeAppointmentAvailable = false;
int serviceRage = 0;
String chargersPerKm = "";
int? categoryId;
int? categoryId = -1;
int? serviceId = -1;
DropValue? category;
DropValue? service;
@ -71,6 +71,7 @@ class _CreateServicesPage3State extends State<CreateServicesPage3> {
@override
Widget build(BuildContext context) {
log("categoryId: ${categoryId}");
return Scaffold(
appBar: CustomAppBar(title: LocaleKeys.editServices.tr()),
body: SizedBox(
@ -86,39 +87,43 @@ class _CreateServicesPage3State extends State<CreateServicesPage3> {
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
DropdownField(
isSelectAble: !widget.branchModel!.isForEdit,
(DropValue value) async {
categoryId = value.id;
category = value;
service = null;
serviceId = -1;
isAppointmentAvailable = false;
isHomeAppointmentAvailable = false;
model.fetchServicesByCategoryId(value.id);
},
dropdownValue: category,
list: model.categoryDropList,
hint: category != null ? category!.value : LocaleKeys.selectServiceCategory.tr(),
),
12.height,
(model.state == ViewState.idle)
? DropdownField(
isSelectAble: !widget.branchModel!.isForEdit,
(DropValue value) async {
categoryId = value.id;
category = value;
service = null;
serviceId = -1;
isAppointmentAvailable = false;
isHomeAppointmentAvailable = false;
model.fetchServicesByCategoryId(value.id);
},
dropdownValue: category,
list: model.categoryDropList,
hint: category != null ? category!.value : LocaleKeys.selectServiceCategory.tr(),
)
? categoryId != -1 && model.servicesDropList.isNotEmpty
? DropdownField(
(DropValue value) {
service = value;
serviceId = value.id;
isAppointmentAvailable = false;
isHomeAppointmentAvailable = false;
model.setState(ViewState.idle);
},
dropdownValue: service,
list: model.servicesDropList,
hint: LocaleKeys.defineServices.tr(),
)
: categoryId == -1
? const SizedBox()
: model.state == ViewState.idle
? EmptyWidget(text: LocaleKeys.noServicesAvailable.tr())
: const SizedBox()
: const CircularProgressIndicator(),
12.height,
categoryId != -1 && model.servicesDropList.isNotEmpty
? DropdownField(
(DropValue value) {
service = value;
serviceId = value.id;
isAppointmentAvailable = false;
isHomeAppointmentAvailable = false;
model.setState(ViewState.idle);
},
dropdownValue: service,
list: model.servicesDropList,
hint: LocaleKeys.defineServices.tr(),
)
: EmptyWidget(text: LocaleKeys.noServicesAvailable.tr()),
12.height,
if (serviceId != -1) ...[
Column(
children: [

@ -79,7 +79,7 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
12.height,
packageItem(
LocaleKeys.nowVar.tr(),
(LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr() + " ${DateHelper.formatAsLongDate(widget.subscription.dateEnd ?? DateTime.now())}"),
("${LocaleKeys.yourSubscriptionUpgradeAffectingFrom.tr()} ${DateHelper.formatAsLongDate(widget.subscription.dateEnd ?? DateTime.now())}"),
double.parse(model.newPrice).toStringAsFixed(2),
isNowSelected,
).onPress(() {
@ -89,10 +89,10 @@ class _UpgradePackageSheetState extends State<UpgradePackageSheet> {
});
}),
6.height,
if (!AppState().getproviderSubscription.first.isExpired!)
if (AppState().getproviderSubscription.isNotEmpty && !AppState().getproviderSubscription.first.isExpired!)
packageItem(
LocaleKeys.upgradeAfterCurrentExpiry.tr(),
(LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr() + " ${DateHelper.formatAsLongDate(widget.subscription.dateEnd ?? DateTime.now())}"),
("${LocaleKeys.yourSubscriptionUpgradeCurrentSubscriptionAffectingFrom.tr()} ${DateHelper.formatAsLongDate(widget.subscription.dateEnd ?? DateTime.now())}"),
widget.subscription.price.toString(),
isNowSelected ? false : true,
).onPress(() {

Loading…
Cancel
Save