fetchData method
Implementation
void fetchData(bool isConnected, DateTime? selectedDate) {
if (isConnected) {
context.read<DashboardBloc>().add(DashboardRefreshEvent(
projectId: DashboardSingleton().projectId,
syncFromServer: true,
selectedDate: selectedDate ?? DateTime.now(),
));
} else {
Toast.showToast(
context,
message: localizations.translate(i18.dashboard.networkFailureError),
type: ToastType.error,
);
}
}