diff --git a/lib/views/dashboard/dashboard_view.dart b/lib/views/dashboard/dashboard_view.dart index 961db98..b2bde28 100644 --- a/lib/views/dashboard/dashboard_view.dart +++ b/lib/views/dashboard/dashboard_view.dart @@ -30,15 +30,15 @@ class _DashboardViewState extends State { log("widget.dashboardRouteEnum: ${widget.dashboardRouteEnum}"); super.initState(); dashboardVMProvider = Provider.of(context, listen: false); - + // Ensure selected index is valid for individual providers (no Requests tab) - if (AppState().userType != UserType.providerDealer) { + if (AppState().userType != UserType.providerDealer && AppState().userType != UserType.dealershipUser) { // For individuals, max index is 3 (Ads), so if selected is 4, set to Home (2) if (dashboardVMProvider.selectedNavbarBarIndex >= 4) { dashboardVMProvider.selectedNavbarBarIndex = 2; // Home } } - + scheduleMicrotask(() => dashboardVMProvider.onRefresh(context, dashboardRouteEnum: widget.dashboardRouteEnum)); } @@ -47,13 +47,12 @@ class _DashboardViewState extends State { // Build fragments list conditionally based on user type // Individual providers should not have access to Requests List fragments = [ - const BranchListPage(), // 0 + const BranchListPage(), // 0 const BranchAppointmentFragment(), // 1 - const HomeFragment(), // 2 - const AdsFragment(), // 3 - // Only Dealerships can access Special Requests - if (AppState().userType == UserType.providerDealer) - const MyRequestsFragment(), // 4 (only for dealerships) + const HomeFragment(), // 2 + const AdsFragment(), // 3 + // Only Dealerships (and dealership staff users) can access Special Requests + if (AppState().userType == UserType.providerDealer || AppState().userType == UserType.dealershipUser) const MyRequestsFragment(), // 4 (only for dealerships) ]; // Ensure the selected index is valid for the current fragments list diff --git a/lib/views/dashboard/widget/my_service_provider.dart b/lib/views/dashboard/widget/my_service_provider.dart index 73ceb9b..c2c6ce0 100644 --- a/lib/views/dashboard/widget/my_service_provider.dart +++ b/lib/views/dashboard/widget/my_service_provider.dart @@ -11,6 +11,7 @@ import 'package:mc_common_app/extensions/string_extensions.dart'; import 'package:mc_common_app/utils/enums.dart'; import 'package:mc_common_app/utils/navigator.dart'; import 'package:mc_common_app/widgets/extensions/extensions_widget.dart'; +import 'package:mc_common_app/widgets/shimmer/home_shimmer_widgets.dart'; import 'package:provider/provider.dart'; import 'package:easy_localization/easy_localization.dart'; @@ -22,10 +23,10 @@ class ServiceProviderWidget extends StatelessWidget { return SizedBox( width: double.infinity, height: 140, - child: Consumer( + child: Consumer( builder: (BuildContext context, ServiceVM serviceVM, Widget? child) { if (serviceVM.state == ViewState.busy) { - return const Center(child: CircularProgressIndicator()); + return const HomeBranchesShimmer(); } else { return serviceVM.branches == null || serviceVM.branches!.data == null ? Center(child: LocaleKeys.noBranchFound.tr().toText(fontSize: 16, color: MyColors.lightTextColor)) diff --git a/lib/views/subscriptions/sheet/downgrade_data_sheet.dart b/lib/views/subscriptions/sheet/downgrade_data_sheet.dart index 565986b..c9bb1c3 100644 --- a/lib/views/subscriptions/sheet/downgrade_data_sheet.dart +++ b/lib/views/subscriptions/sheet/downgrade_data_sheet.dart @@ -110,6 +110,7 @@ class _DowngradeDataSheetState extends State { listOfBranches: listOfBranches, listOfUsers: listOfUsers, ); + Utils.hideLoading(context); if (response.messageStatus == 1) { diff --git a/lib/views/subscriptions/sheet/upgrade_package_sheet.dart b/lib/views/subscriptions/sheet/upgrade_package_sheet.dart index 5a1602f..e025615 100644 --- a/lib/views/subscriptions/sheet/upgrade_package_sheet.dart +++ b/lib/views/subscriptions/sheet/upgrade_package_sheet.dart @@ -209,5 +209,3 @@ class _UpgradePackageSheetState extends State { ); } } - -