Compare commits

...

3 Commits

Author SHA1 Message Date
Faiz Hashmi 40500614d3 Merge remote-tracking branch 'origin/faiz_dev' into faiz_development 10 months ago
Faiz Hashmi 44ae05f9e7 Quick Fixes 10 months ago
Aamir Muhammad ea54455fdc fixes 10 months ago

@ -60,7 +60,9 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
bool validation(BuildContext context) {
bool isValid = false;
for (var element in context.read<ServiceVM>().allProviderDealersList) {
for (var element in context
.read<ServiceVM>()
.allProviderDealersList) {
if (element.isBranchUser ?? false) {
isValid = true;
}
@ -112,6 +114,7 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
onPressed: () async {
showMyBottomSheet(
context,
isScrollControlled: true,
child: AssignDealerUserSheet(
branchId: widget.branchData.id.toString(),
callBackFunc: () {
@ -170,43 +173,46 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
8.width,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
serviceVM.categories[pIndex].categoryName.toString().toText(fontSize: 16),
],
),
8.height,
Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: ListView.builder(
itemBuilder: (context, index) {
return Container(
child: (EasyLocalization.of(context)?.currentLocale?.countryCode == "SA"
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
serviceVM.categories[pIndex].categoryName.toString().toText(fontSize: 16),
],
),
8.height,
Row(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: ListView.builder(
itemBuilder: (context, index) {
return Container(
child: (EasyLocalization
.of(context)
?.currentLocale
?.countryCode == "SA"
? serviceVM.categories[pIndex].services![index].serviceDescriptionN.toString()
: serviceVM.categories[pIndex].services![index].serviceDescription.toString())
.toText(
fontSize: 12,
color: MyColors.lightTextColor,
),
);
},
itemCount: serviceVM.categories[pIndex].services?.length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
),
),
.toText(
fontSize: 12,
color: MyColors.lightTextColor,
),
);
},
itemCount: serviceVM.categories[pIndex].services?.length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.zero,
),
),
],
).withArrow(isArrowEnabled: true)
],
).withArrow(isArrowEnabled: true)
],
)),
)),
],
).toWhiteContainer(width: double.infinity, allPading: 12);
}
@ -281,27 +287,29 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
8.width,
Expanded(
child: LocaleKeys.setorEditBranchSchedule.tr().toText(
isUnderLine: true,
fontSize: 12,
color: Colors.white,
decorationColor: MyColors.white,
),
isUnderLine: true,
fontSize: 12,
color: Colors.white,
decorationColor: MyColors.white,
),
),
],
)
.withArrow(
isArrowEnabled: true,
color: Colors.white,
arrowWidth: 16.16,
arrowHeight: 11.75,
)
isArrowEnabled: true,
color: Colors.white,
arrowWidth: 16.16,
arrowHeight: 11.75,
)
.margin(right: 5),
).onPress(() {
if (widget.branchData.branchStatus == BranchStatusEnum.pending || widget.branchData.branchStatus == BranchStatusEnum.rejected) {
Utils.showToast(LocaleKeys.waitForBranchVerification.tr());
return;
}
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());
}),
10.height,
@ -332,7 +340,7 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
)).horPaddingMain(),
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,Assign
// children: [
// const Icon(
// Icons.add,
@ -363,38 +371,39 @@ class _BranchDetailPageState extends State<BranchDetailPage> {
const Center(
child: CircularProgressIndicator(),
),
] else ...[
ListView.separated(
itemBuilder: (context, pIndex) {
return buildServiceTileWidget(pIndex, serviceVM).onPress(() {
serviceVM.categories[pIndex].branchId = widget.branchData.id.toString();
serviceVM.categories[pIndex].branchName = widget.branchData.branchName.toString();
// CategoryData categoryData = serviceVM.categories[pIndex];
serviceVM.applyFilterOnBranchServices(serviceStatusEnum: ServiceStatusEnum.approvedOrActive);
] else
...[
ListView.separated(
itemBuilder: (context, pIndex) {
return buildServiceTileWidget(pIndex, serviceVM).onPress(() {
serviceVM.categories[pIndex].branchId = widget.branchData.id.toString();
serviceVM.categories[pIndex].branchName = widget.branchData.branchName.toString();
// CategoryData categoryData = serviceVM.categories[pIndex];
serviceVM.applyFilterOnBranchServices(serviceStatusEnum: ServiceStatusEnum.approvedOrActive);
CategoryData categoryData = CategoryData(
id: serviceVM.categories[pIndex].id,
branchId: serviceVM.categories[pIndex].branchId,
branchName: serviceVM.categories[pIndex].branchName,
categoryName: serviceVM.categories[pIndex].categoryName,
categoryNameN: serviceVM.categories[pIndex].categoryNameN,
serviceCategoryIconUrl: serviceVM.categories[pIndex].serviceCategoryIconUrl,
serviceCategoryImageUrl: serviceVM.categories[pIndex].serviceCategoryImageUrl,
services: [],
);
CategoryData categoryData = CategoryData(
id: serviceVM.categories[pIndex].id,
branchId: serviceVM.categories[pIndex].branchId,
branchName: serviceVM.categories[pIndex].branchName,
categoryName: serviceVM.categories[pIndex].categoryName,
categoryNameN: serviceVM.categories[pIndex].categoryNameN,
serviceCategoryIconUrl: serviceVM.categories[pIndex].serviceCategoryIconUrl,
serviceCategoryImageUrl: serviceVM.categories[pIndex].serviceCategoryImageUrl,
services: [],
);
navigateWithName(context, AppRoutes.servicesList, arguments: categoryData);
});
},
itemCount: serviceVM.categories.length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: const EdgeInsets.all(20),
separatorBuilder: (BuildContext context, int index) {
return 12.height;
},
),
],
navigateWithName(context, AppRoutes.servicesList, arguments: categoryData);
});
},
itemCount: serviceVM.categories.length,
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: const EdgeInsets.all(20),
separatorBuilder: (BuildContext context, int index) {
return 12.height;
},
),
],
12.height,
],
),

@ -179,6 +179,7 @@ class _DefineBranchViewState extends State<DefineBranchView> {
onTap: () => serviceVM.pickMultipleImages(),
text: LocaleKeys.attachImage.tr(),
icon: MyAssets.attachmentIcon.buildSvg(),
extensions: GlobalConsts.allowedFileExtensions,
),
],
if (serviceVM.branchImageError != "") ...[

@ -184,10 +184,13 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
initial: tomorrowDate,
firstDate: DateTime.now(),
);
if (scheduleID != null) {
endDate = "";
}
if (endDate.isNotEmpty) {
DateTime sDate = DateTime.parse(startDate);
DateTime eDate = DateTime.parse(endDate);
DateTime sDate = DateHelper.parseStringToDate(startDate);
DateTime eDate = DateHelper.parseStringToDate(endDate);
if (sDate.isAfter(eDate)) {
startDate = "";
@ -215,18 +218,24 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
Utils.showToast(LocaleKeys.pleaseEnterStartDateFirst.tr());
return;
} else {
sDate = DateTime.parse(startDate);
// sDate = DateTime.parse(startDate);
sDate = DateHelper.parseStringToDate(startDate);
firstDate = sDate.add(const Duration(days: 1)).subtract(
Duration(hours: DateTime.now().hour, minutes: DateTime.now().minute, seconds: DateTime.now().second, microseconds: DateTime.now().microsecond),
);
}
if (startDate != null && startDate.isNotEmpty) {
tomorrowDate = firstDate;
}
//
endDate = await Utils.pickDateFromDatePicker(
context,
initial: tomorrowDate,
firstDate: firstDate ?? tomorrowDate,
);
DateTime eDate = DateTime.parse(endDate);
DateTime eDate = DateHelper.parseStringToDate(endDate);
if (!eDate.isAfter(sDate)) {
endDate = "";
@ -259,6 +268,7 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
Expanded(
child: TxtField(
hint: LocaleKeys.shiftStartTime.tr(),
maxLines: 1,
postfixWidget: const Icon(
Icons.access_time_filled_outlined,
size: 16,
@ -286,6 +296,7 @@ class _AddSchedulesPageState extends State<AddSchedulesPage> {
Expanded(
child: TxtField(
hint: LocaleKeys.shiftEndTime.tr(),
maxLines: 1,
postfixWidget: const Icon(
Icons.access_time_filled_outlined,
size: 16,

@ -149,6 +149,7 @@ class _CreateItemPageState extends State<CreateItemPage> {
},
text: LocaleKeys.attachImage.tr(),
icon: MyAssets.attachmentIcon.buildSvg(),
extensions: GlobalConsts.allowedFileExtensions,
)
],
20.height,

Loading…
Cancel
Save