0

I have an integration test which taps a text of phone number, then it opens the phone dial app which makes my app put to background.

final firstNumber = find.byWidgetPredicate(
      (widget) => widget is RichText && tapTextSpan(widget, '09123456789'));
await tester.tap(firstNumber);

After tester.tap() it successfully open the built in dial app in phone. How can I bring my app to foreground?

Package used: integration_test, flutter_test

noyruto88
  • 767
  • 2
  • 18
  • 40

1 Answers1

0

You can use flutter_foreground_task package

use FlutterForegroundTask.minimizeApp() for app to background

and FlutterForegroundTask.launchApp() for app to foreground

that's all. I hope it helps.

JCode
  • 1,788
  • 3
  • 12
  • 29