gotoSpace method

Future<void> gotoSpace(
  1. String spaceId, {
  2. dynamic appTab,
})

Implementation

Future<void> gotoSpace(String spaceId, {Key? appTab}) async {
  SystemChannels.textInput.invokeMethod('TextInput.hide');
  await find.byKey(Keys.mainNav).should(findsOneWidget);
  await navigateTo([
    MainNavKeys.dashboardHome,
    MainNavKeys.dashboardHome,
    DashboardKeys.widgetMySpacesHeader,
  ]);

  final select = find.byKey(Key('space-list-item-$spaceId'));
  await tester.ensureVisible(select);
  await select.should(findsOneWidget);
  await select.tap();

  if (appTab != null) {
    final selectedApp = find.byKey(appTab);
    await tester.ensureVisible(selectedApp);
    await selectedApp.should(findsOneWidget);
    await selectedApp.tap();
  }
}