Skip to content

Support Flutter 3.41 - #142

Open
yusufkecer wants to merge 1 commit into
ethanblake4:masterfrom
yusufkecer:flutter-3.41-compat
Open

Support Flutter 3.41#142
yusufkecer wants to merge 1 commit into
ethanblake4:masterfrom
yusufkecer:flutter-3.41-compat

Conversation

@yusufkecer

Copy link
Copy Markdown

flutter_eval 0.8.2 does not compile on Flutter 3.41 or later. Not a warning — the package fails to build, and so does anything that depends on it, including its own test suite:

Error: The non-abstract class '$Container' is missing implementations for these members:
 - Container.isAntiAlias
class $Container implements Container, $Instance {
      ^^^^^^^^^^

Container gained an isAntiAlias field in 3.41. $Container implements Container and did not implement it, which makes the class abstract by omission.

Changes

  • $Container forwards isAntiAlias, the same way it forwards clipBehavior and the rest.
  • Minimum Flutter raised to 3.41.0. This one is load-bearing rather than housekeeping: Container.isAntiAlias does not exist before 3.41, so the forwarder cannot compile on older versions. I checked 3.19, 3.27, 3.32, 3.35, 3.38, 3.39 and 3.40 — the field first appears in 3.41.0. Anyone on an older Flutter keeps resolving to 0.8.2, which still works for them.
  • Minimum dart_eval raised to ^0.8.5, to match. Flutter 3.41 ships a Dart newer than dart_eval supported before 0.8.3, so those are the versions this release can actually run against. Happy to drop this back to ^0.8.1 if you would rather keep the constraint loose.
  • CHANGELOG entry and version bump to 0.8.3. Also happy to drop those if you prefer to handle releases yourself.

Verification

flutter analyze lib reports no errors, and all 16 tests in test/flutter_eval_test.dart pass, on Flutter 3.44.8 stable.

Not included

Three things current Flutter also complains about, left out to keep this reviewable — happy to open separate PRs:

  • lib/src/cupertino/colors.dart forwards Color.value, .red, .green, .blue, .alpha, .opacity and withOpacity, all deprecated after 3.33. The exposed API should keep those names, so the fix is to change the internals only.
  • lib/src/widgets/scroll_view.dart uses cacheExtent, deprecated after 3.41 in favour of scrollCacheExtent.
  • lib/src/widgets/icon_data.dart constructs IconData from runtime arguments, which now warns because Flutter wants those const for icon tree-shaking. Not fixable in a library that builds icons dynamically; it probably wants an ignore and a note that apps should build with --no-tree-shake-icons.

Flutter 3.41 added an `isAntiAlias` field to `Container`. `$Container`
implements `Container` and did not implement it, so the class is abstract by
omission and the package does not compile at all on 3.41 or later:

  Error: The non-abstract class '$Container' is missing implementations for
  these members:
   - Container.isAntiAlias

This forwards it like every other Container property.

Because `Container.isAntiAlias` does not exist before 3.41, the forwarder
cannot compile on older Flutter either, so the minimum Flutter version moves
to 3.41.0. Anyone on 3.19-3.40 keeps resolving to 0.8.2, which works there.

The dart_eval constraint moves to ^0.8.5 to match: Flutter 3.41 ships a Dart
newer than dart_eval supported before 0.8.3, so the versions this release can
actually run with start there.

With this, `flutter analyze lib` reports no errors and all 16 tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant