fetchData method

void fetchData(
  1. bool isConnected,
  2. DateTime? selectedDate
)

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