|
|
|
|
@ -5,7 +5,6 @@ import 'package:mc_common_app/classes/consts.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/models/general_models/widgets_models.dart';
|
|
|
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
|
|
|
import 'package:mc_common_app/view_models/appointments_view_model.dart';
|
|
|
|
|
import 'package:mc_common_app/view_models/dashboard_view_model_customer.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
|
@ -62,10 +61,7 @@ class MyServicesCategoriesWidget extends StatelessWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
// Special handling for Special Requests service (displays local SVG icon)
|
|
|
|
|
if (category.id == -1)
|
|
|
|
|
SvgPicture.asset(category.iconUrl, height: 32, width: 32, fit: BoxFit.fill)
|
|
|
|
|
else
|
|
|
|
|
category.iconUrl.buildNetworkImage(height: 32, width: 32, fit: BoxFit.fill),
|
|
|
|
|
if (category.id == -1) SvgPicture.asset(category.iconUrl, height: 32, width: 32, fit: BoxFit.fill) else category.iconUrl.buildNetworkImage(height: 32, width: 32, fit: BoxFit.fill),
|
|
|
|
|
10.height,
|
|
|
|
|
Flexible(
|
|
|
|
|
child: (isArabic ? category.titleN : category.title).toText(
|
|
|
|
|
@ -95,22 +91,24 @@ class MyServicesCategoriesWidget extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
final dashboardCustomerVM = context.read<DashboardVmCustomer>();
|
|
|
|
|
|
|
|
|
|
// Check if this is the Special Requests service
|
|
|
|
|
if (category.id == -1) {
|
|
|
|
|
// Navigate to Requests tab (index 4)
|
|
|
|
|
dashboardCustomerVM.onNavbarTapped(4);
|
|
|
|
|
} else {
|
|
|
|
|
// Original behavior for other services
|
|
|
|
|
final appointmentVM = context.read<AppointmentsVM>();
|
|
|
|
|
dashboardCustomerVM.onNavbarTapped(0);
|
|
|
|
|
// Adjust index: subtract 1 because Special Requests was added at index 0
|
|
|
|
|
int originalIndex = homeCategories.indexOf(category) - 1;
|
|
|
|
|
appointmentVM.applyFilterOnBranches(index: originalIndex);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
).onPress(
|
|
|
|
|
() {
|
|
|
|
|
final dashboardCustomerVM = context.read<DashboardVmCustomer>();
|
|
|
|
|
|
|
|
|
|
// Check if this is the Special Requests service
|
|
|
|
|
if (category.id == -1) {
|
|
|
|
|
// Navigate to Requests tab (index 4)
|
|
|
|
|
dashboardCustomerVM.onNavbarTapped(4);
|
|
|
|
|
} else {
|
|
|
|
|
// Original behavior for other services
|
|
|
|
|
final appointmentVM = context.read<AppointmentsVM>();
|
|
|
|
|
dashboardCustomerVM.onNavbarTapped(0);
|
|
|
|
|
// Adjust index: subtract 1 because Special Requests was added at index 0
|
|
|
|
|
int originalIndex = homeCategories.indexOf(category) - 1;
|
|
|
|
|
appointmentVM.applyFilterOnBranches(index: originalIndex);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|