pickFileAndReadReport method

Future<void> pickFileAndReadReport({
  1. String? pathOverride,
  2. bool readSync = false,
  3. bool clear = true,
})

Implementation

Future<void> pickFileAndReadReport({String? pathOverride, bool readSync = false, bool clear = true}) async {
  String path;
  if (pathOverride == null) {
    final result = await FilePicker.platform.pickFiles(allowMultiple: false);
    if (result == null) return;

    path = result.paths.single!;
  } else {
    path = pathOverride;
  }

  GetIt.I.get<HomePageStore>().displayLoadedReportMode = true;

  await readReportFromFile(path, sync: readSync, doClear: clear);
}