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

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

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

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

Loading…
Cancel
Save