resolved Bugs

master
FaizHashmi 4 weeks ago
parent fe4fa4182a
commit 8af49fac84

@ -41,8 +41,6 @@ import 'package:intl/date_symbol_data_local.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:toastification/toastification.dart';
final navigatorKey = GlobalKey<NavigatorState>();
//test commit
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

@ -275,4 +275,3 @@ class _BranchDetailViewState extends State<BranchDetailView> {
);
}
}

@ -24,6 +24,7 @@ class AppointmentsFragment extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isArabic = AppState().isArabic(context);
return Consumer(
builder: (BuildContext context, AppointmentsVM appointmentsVM, Widget? child) {
return Scaffold(
@ -32,7 +33,7 @@ class AppointmentsFragment extends StatelessWidget {
isRemoveBackButton: true,
actions: [
Padding(
padding: EdgeInsets.only(top: appointmentsVM.appointmentFiltersCounter > 0 ? 20 : 0, right: 21),
padding: EdgeInsets.only(top: appointmentsVM.appointmentFiltersCounter > 0 ? 20 : 0, right: isArabic ? 0 : 16, left: isArabic ? 16 : 0),
child: Badge(
isLabelVisible: appointmentsVM.appointmentFiltersCounter > 0,
largeSize: 15,

@ -1,3 +1,4 @@
import 'package:mc_common_app/classes/app_state.dart';
import 'package:mc_common_app/view_models/appointments_view_model.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
@ -22,6 +23,7 @@ class BranchesFragment extends StatelessWidget {
@override
Widget build(BuildContext context) {
final isArabic = AppState().isArabic(context);
return Consumer(
builder: (BuildContext context, AppointmentsVM appointmentsVM, Widget? child) {
return Scaffold(
@ -30,7 +32,7 @@ class BranchesFragment extends StatelessWidget {
isRemoveBackButton: true,
actions: [
Padding(
padding: EdgeInsets.only(top: appointmentsVM.branchFiltersCounter > 0 ? 20 : 0, right: 21),
padding: EdgeInsets.only(top: appointmentsVM.branchFiltersCounter > 0 ? 20 : 0, right: isArabic ? 0 : 16, left: isArabic ? 16 : 0),
child: Badge(
largeSize: 15,
smallSize: 20,

@ -383,6 +383,3 @@ class _HomeFragmentState extends State<HomeFragment> {
);
}
}

@ -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);
}
},
);
},
);
}

Loading…
Cancel
Save