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/bottom_sheet.dart';
import 'package:mc_common_app/widgets/button/show_fill_button.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/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/extensions/extensions_widget.dart';
import 'package:mc_common_app/widgets/row_with_arrow.dart'; import 'package:mc_common_app/widgets/row_with_arrow.dart';
import 'package:provider/provider.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, 12.height,
ShowFillButton( Utils.buildStatusContainer(LocaleKeys.rejectedFormAdmin.tr(), marginAll: 0, fontSize: 16),
title: LocaleKeys.rejectedFormAdmin.tr(),
maxWidth: double.infinity,
backgroundColor: MyColors.darkWhiteColor,
borderColor: MyColors.darkPrimaryColor,
txtColor: MyColors.lightTextColor,
isFilled: true,
onPressed: () {},
),
], ],
); );
} }
@ -309,34 +302,11 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
context.read<ScheduleVM>().currentSelectedBranchName = widget.branchData.branchName.toString(); context.read<ScheduleVM>().currentSelectedBranchName = widget.branchData.branchName.toString();
navigateWithName(context, AppRoutes.schedulesList, arguments: widget.branchData.id.toString()); navigateWithName(context, AppRoutes.schedulesList, arguments: widget.branchData.id.toString());
}), }),
Row( 10.height,
crossAxisAlignment: CrossAxisAlignment.center, CustomAddButton(
mainAxisAlignment: MainAxisAlignment.center, needsBorder: true,
children: [ bgColor: MyColors.white,
const Icon( onTap: () {
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) { if (widget.branchData.branchStatus == BranchStatusEnum.pending || widget.branchData.branchStatus == BranchStatusEnum.rejected) {
Utils.showToast("Please wait for the branch verification."); Utils.showToast("Please wait for the branch verification.");
return; return;
@ -350,7 +320,42 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
isForEdit: false, 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) ...[ if (serviceVM.state == ViewState.busy) ...[
30.height, 30.height,
const Center( const Center(

@ -65,7 +65,9 @@ class BranchListPage extends StatelessWidget {
title: LocaleKeys.myBranches.tr(), title: LocaleKeys.myBranches.tr(),
isRemoveBackButton: true, isRemoveBackButton: true,
), ),
body: SizedBox( body: RefreshIndicator(
onRefresh: () async => await context.read<ServiceVM>().getBranchAndServices(),
child: SizedBox(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
child: Column( child: Column(
@ -101,9 +103,7 @@ class BranchListPage extends StatelessWidget {
} }
} }
return RefreshIndicator( return branches.isEmpty
onRefresh: () async => await context.read<ServiceVM>().getBranchAndServices(),
child: branches.isEmpty
? Center(child: LocaleKeys.no_branch.tr().toText(fontSize: 16, color: MyColors.lightTextColor, fontWeight: MyFonts.Medium)) ? Center(child: LocaleKeys.no_branch.tr().toText(fontSize: 16, color: MyColors.lightTextColor, fontWeight: MyFonts.Medium))
: ListView.separated( : ListView.separated(
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -189,8 +189,7 @@ class BranchListPage extends StatelessWidget {
}, },
separatorBuilder: (context, index) => 12.height, separatorBuilder: (context, index) => 12.height,
itemCount: branches.length, itemCount: branches.length,
).paddingAll(21), ).paddingAll(21);
);
} }
}, },
), ),
@ -198,6 +197,7 @@ class BranchListPage extends StatelessWidget {
], ],
), ),
), ),
),
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
backgroundColor: MyColors.darkPrimaryColor, backgroundColor: MyColors.darkPrimaryColor,
child: const Icon( child: const Icon(

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

@ -93,7 +93,7 @@ class _SchedulesListPageState extends State<SchedulesListPage> {
: scheduleVM.schedule!.data!.isEmpty : scheduleVM.schedule!.data!.isEmpty
? EmptyWidget( ? EmptyWidget(
text: LocaleKeys.noSchedulesFound.tr(), text: LocaleKeys.noSchedulesFound.tr(),
) ).paddingAll(21)
: ListView.separated( : ListView.separated(
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Column( return Column(

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

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

Loading…
Cancel
Save