goToPin method

Future<void> goToPin(
  1. String pinId, {
  2. dynamic appTab,
})

Implementation

Future<void> goToPin(String pinId, {Key? appTab}) async {
  await find.byKey(Keys.mainNav).should(findsOneWidget);
  await navigateTo([
    MainNavKeys.dashboardHome,
    MainNavKeys.dashboardHome,
    MainNavKeys.quickJump,
    MainNavKeys.quickJump,
    QuickJumpKeys.pins,
  ]);

  final select = find.byKey(Key('pin-list-item-$pinId'));
  await tester.ensureVisible(select);
  await select.should(findsOneWidget);
  await select.longPress();

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