|
|
|
@ -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,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|