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,34 +302,11 @@ 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(() {
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;
@ -350,7 +320,42 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
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,7 +65,9 @@ class BranchListPage extends StatelessWidget {
title: LocaleKeys.myBranches.tr(),
isRemoveBackButton: true,
),
body: SizedBox(
body: RefreshIndicator(
onRefresh: () async => await context.read<ServiceVM>().getBranchAndServices(),
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: Column(
@ -101,9 +103,7 @@ class BranchListPage extends StatelessWidget {
}
}
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,8 +189,7 @@ class BranchListPage extends StatelessWidget {
},
separatorBuilder: (context, index) => 12.height,
itemCount: branches.length,
).paddingAll(21),
);
).paddingAll(21);
}
},
),
@ -198,6 +197,7 @@ class BranchListPage extends StatelessWidget {
],
),
),
),
floatingActionButton: FloatingActionButton(
backgroundColor: MyColors.darkPrimaryColor,
child: const Icon(

@ -174,11 +174,13 @@ class _DefineBranchViewState extends State<DefineBranchView> {
},
),
12.height,
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(

@ -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,8 +87,7 @@ class _CreateServicesPage3State extends State<CreateServicesPage3> {
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
(model.state == ViewState.idle)
? DropdownField(
DropdownField(
isSelectAble: !widget.branchModel!.isForEdit,
(DropValue value) async {
categoryId = value.id;
@ -101,10 +101,10 @@ class _CreateServicesPage3State extends State<CreateServicesPage3> {
dropdownValue: category,
list: model.categoryDropList,
hint: category != null ? category!.value : LocaleKeys.selectServiceCategory.tr(),
)
: const CircularProgressIndicator(),
),
12.height,
categoryId != -1 && model.servicesDropList.isNotEmpty
(model.state == ViewState.idle)
? categoryId != -1 && model.servicesDropList.isNotEmpty
? DropdownField(
(DropValue value) {
service = value;
@ -117,7 +117,12 @@ class _CreateServicesPage3State extends State<CreateServicesPage3> {
list: model.servicesDropList,
hint: LocaleKeys.defineServices.tr(),
)
: EmptyWidget(text: LocaleKeys.noServicesAvailable.tr()),
: categoryId == -1
? const SizedBox()
: model.state == ViewState.idle
? EmptyWidget(text: LocaleKeys.noServicesAvailable.tr())
: const SizedBox()
: const CircularProgressIndicator(),
12.height,
if (serviceId != -1) ...[
Column(

@ -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