|
|
|
|
@ -195,8 +195,8 @@ class _HomeFragmentState extends State<HomeFragment> {
|
|
|
|
|
14.height,
|
|
|
|
|
Consumer(
|
|
|
|
|
builder: (BuildContext context, AppointmentsVM appointmentVM, Widget? child) {
|
|
|
|
|
// Show shimmer when loading
|
|
|
|
|
if (appointmentVM.state == ViewState.busy) {
|
|
|
|
|
// Show shimmer only when services are not loaded yet
|
|
|
|
|
if (appointmentVM.branchesCategoriesFilterOptions.isEmpty) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
_buildServicesHeader(),
|
|
|
|
|
@ -205,11 +205,11 @@ class _HomeFragmentState extends State<HomeFragment> {
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
// Show actual data when idle
|
|
|
|
|
// Show actual data when services are available
|
|
|
|
|
if (appointmentVM.branchesCategoriesFilterOptions.isNotEmpty) {
|
|
|
|
|
// Filter services based on search query
|
|
|
|
|
final filteredServices = _filterServices(appointmentVM.branchesCategoriesFilterOptions);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
_buildServicesHeader().toViewOnly(context, onTap: () {
|
|
|
|
|
@ -220,10 +220,10 @@ class _HomeFragmentState extends State<HomeFragment> {
|
|
|
|
|
? Padding(
|
|
|
|
|
padding: const EdgeInsets.all(40),
|
|
|
|
|
child: LocaleKeys.noServiceFound.tr().toText(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: MyServicesCategoriesWidget(homeCategories: filteredServices).horPaddingMain(),
|
|
|
|
|
],
|
|
|
|
|
@ -360,3 +360,6 @@ class _HomeFragmentState extends State<HomeFragment> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|