Skip to content

Instantly share code, notes, and snippets.

@diegoperini
Created November 3, 2020 11:00
Show Gist options
  • Save diegoperini/6079f1d0d245048592caf9c8d431efcb to your computer and use it in GitHub Desktop.
Save diegoperini/6079f1d0d245048592caf9c8d431efcb to your computer and use it in GitHub Desktop.
Dart 2 update guide for TestFairy

To be able to use TestFairy Flutter Plugin 2.+, you must have the environment specified below and upgrade your project code base to Dart 2 using this guide.

environment:
  sdk: ">=2.10.0 <3.0.0"
  flutter: ">=1.22.0 <2.0.0"

Make sure your project root has an analysis_options.yaml that looks similar to this. The important part is the enabled experiment in the top declaration.

You also have to enable the same experiment in your run and test commands:

flutter run --enable-experiment=non-nullable --no-sound-null-safety

flutter drive --enable-experiment=non-nullable --no-sound-null-safety -v --target=test_driver/app.dart

If this transition is not suitable for your project, you can stay in TestFairy plugin 1.0.25 but that requires an upper limit on your Dart and Flutter version specified like this:

environment:
  sdk: ">=2.0.0 <2.1.0"
  flutter: ">=1.0.0 <1.12.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment