flare_splash_screen
flare_splash_screen copied to clipboard
Testing with flare_splash_screen requires FlareTesting.setup()
I just wanted to share something, perhaps for the docs? It wasn't super hard to find out why but I couldn't manage to get flutter test driver to work with the splash screen, it just wouldn't show up and the tests would eventually time out. A bit of sleuthing turned up that I had to manually rely on the underlying flare_flutter
package and set it up for testing. The resulting test_driver/main.dart
is as follows.
import 'package:flare_flutter/flare_testing.dart';
import 'package:flutter_driver/driver_extension.dart';
import 'package:my_package/main_test.dart' as app;
void main() {
enableFlutterDriverExtension();
FlareTesting.setup(); // <-- This here line
app.main();
}
Just sharing in case anyone else has the same problem or in case it needs to make it into the docs.
Might be interesting indeed to have that in the Readme ! Thanks for that !