Check appointmnet filter for provider

aamir_dev
Faiz Hashmi 9 months ago
parent e1a97cc5a7
commit cbffe18384

@ -34,7 +34,7 @@ class _DashboardViewState extends State<DashboardView> {
void initState() { void initState() {
super.initState(); super.initState();
dashboardVM = context.read<DashboardVmCustomer>(); dashboardVM = context.read<DashboardVmCustomer>();
scheduleMicrotask(() => dashboardVM.onRefresh(context, dashboardRouteEnum: widget.dashboardRouteEnum)); scheduleMicrotask(() async => await dashboardVM.onRefresh(context, dashboardRouteEnum: widget.dashboardRouteEnum));
} }
@override @override

@ -60,7 +60,8 @@ class AppointmentsFragment extends StatelessWidget {
}, },
), ),
16.height, 16.height,
RefreshIndicator( Expanded(
child: RefreshIndicator(
onRefresh: () async { onRefresh: () async {
int index = appointmentsVM.appointmentsFilterOptions.indexWhere((element) => element.isSelected); int index = appointmentsVM.appointmentsFilterOptions.indexWhere((element) => element.isSelected);
if (index != -1) { if (index != -1) {
@ -111,12 +112,13 @@ class AppointmentsFragment extends StatelessWidget {
navigateWithName(context, AppRoutes.appointmentDetailView, arguments: appointmentModel); navigateWithName(context, AppRoutes.appointmentDetailView, arguments: appointmentModel);
}, },
appointmentListModel: appointmentsVM.myFilteredAppointmentsForCustomers[index], appointmentListModel: appointmentsVM.myFilteredAppointmentsForCustomers[index],
).margin(left: 21, right: 21); ).margin(left: 21, right: 21).toViewOnly(context, onTap: () {
navigateWithName(context, AppRoutes.loginWithPassword, arguments: false);
});
}, },
), ),
).toViewOnly(context, onTap: () { ),
navigateWithName(context, AppRoutes.loginWithPassword, arguments: false); )
}),
], ],
), ),
), ),

@ -58,9 +58,7 @@ class HomeFragment extends StatelessWidget {
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
child: RefreshIndicator( child: RefreshIndicator(
onRefresh: () async { onRefresh: () async => await context.read<DashboardVmCustomer>().onRefresh(context),
await context.read<DashboardVmCustomer>().onRefresh(context);
},
child: ListView( child: ListView(
children: [ children: [
16.height, 16.height,

Loading…
Cancel
Save