'How to restart the app between integration tests?
How can one restart the app between integration tests that are in one file?
The goal is to wipe out any state that the app may be keeping.
Solution 1:[1]
You can use Phoenix Package Flutter Phoenix
Phoenix restarts your application at the application level, rebuilding your application widget tree from scratch, losing any previous state.
Usage:
Wrap you App widget in the Phoenix widget.
void main() {
runApp(
Phoenix(
child: App(),
),
);
}
Call the rebirth static method when you want to restart your application (rebuild the entire widget tree from scratch).
Phoenix.rebirth(context);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nasser Hajlawi |
