Repository navigation
Migrate to material_ui, require Dart 3.12 / Flutter 3.44 (3.0.0) - #15
Conversation
Replace package:flutter/material.dart with package:material_ui/material_ui.dart in lib/ and the example, add material_ui ^1.0.0, and raise the SDK floor to Dart ^3.12.0 / Flutter >=3.44.0 (FPL-48). The template now builds a material_ui MaterialApp, so material_ui widgets inside example pages find their MaterialLocalizations. Public types now come from material_ui, hence 3.0.0. Adds a widget test that pumps BaseflowPluginExample with a material_ui TextField and DropdownMenu; it fails with "No MaterialLocalizations found" on 2.2.1. Linear: FPL-58 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
package:flutter/cupertino.dart is deprecated since Flutter 3.47 in favour of cupertino_ui; ExamplePage only needs IconData and WidgetBuilder, which widgets.dart provides. Fixes the deprecated_member_use info on Flutter 3.50.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
medium.com answers 403 to bots, which fails the linkinator step in CI. Point the 2.0.0-nullsafety entry at dart.dev/null-safety instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI's stable Flutter builds with Java 25, which Gradle 7.6.3 cannot run
("Unsupported class file major version 69"). Move the example's Android
project to the current Flutter template: Kotlin DSL build scripts,
Gradle 9.9.2, AGP 9.3.1, Kotlin 2.4.20, Java 17 target. applicationId and
namespace stay com.example.example. Builds with Flutter 3.44.9 and 3.50.1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| import 'package:baseflow_plugin_template/src/info_page.dart'; | ||
| import 'package:baseflow_plugin_template/src/page.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:material_ui/material_ui.dart'; |
There was a problem hiding this comment.
Nit (optional): an example that bumps to 3.0.0 but still builds its pages with package:flutter/material.dart widgets (TextField, DropdownMenu) compiles, then throws "No MaterialLocalizations found" when the page builds. BaseflowPluginExample.build now returns material_ui's MaterialApp, which registers only material_ui's localizations, and nothing bridges flutter widgets under a material_ui app. flutter analyze only shows deprecation infos, so the break shows up at runtime.
Fix: also pass flutter's DefaultMaterialLocalizations.delegate in localizationsDelegates so unmigrated examples keep working, or keep the break and make sure each plugin example changes its imports in the same PR as the bump.
rickdijk
left a comment
There was a problem hiding this comment.
| Criterion | Verdict | Reason |
|---|---|---|
| Real value | pass | Unblocks flutter analyze on Flutter 3.50 for every plugin example (FPL-58) and fixes the MaterialLocalizations crash that an import-only switch causes |
| Really fixes it | pass | All of lib/ moves to material_ui's MaterialApp; the new test reportedly fails on the old template. Not re-run in this review |
| Breaks something | concern | Intended and documented: material_ui types in the public API, new runtime dependency, SDK floor Dart 3.0 to 3.12 and Flutter 3.19 to 3.44. Unmigrated pages fail at runtime, not compile time (inline comment on lib/src/app.dart) |
| Version bump | pass | 3.0.0 is a major for a breaking change, above 2.2.1 on main and pub.dev, matches the top CHANGELOG heading. Headings carry no dates, so no date check. No other open PR claims a version |
| Tests | concern | Good regression test, but CI has no flutter test step, so it never runs there (inline comment on the test) |
| Contribution guidelines | concern | PR template not used, see below |
Recommendation: comment. The change is sound and CI is green. Adding flutter test to CI and filling in the template would make this an approve.
- The description drops the PR template: the "Pre-launch Checklist" is missing and no GitHub issue is linked. FPL-58 is a private Linear ticket, so outside contributors can't follow it. Restore the checklist and either link a public issue or summarise the problem without the ticket.
- Scope: the material_ui migration, a repo-wide
dart format, the Android Gradle/AGP/Kotlin DSL migration and a CHANGELOG link fix land together. The format and Android changes are needed for CI on current stable, and each sits in its own commit, so merge with a merge commit rather than squash to keep them apart in history. - Release: deploy runs on a
v*tag. The last tag isv2.2.0while pub.dev has 2.2.1, so tagv3.0.0on the merge commit, and consider backfillingv2.2.1.
Flutter rewrites analysis_options.yaml during `flutter test` to exclude build/**. In CI that left a modified checked-in file, so the publish dry run that follows the test step failed. Commit the rewritten file so the tree stays clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Rick van Dijk <rickavdijk@gmail.com>
rickdijk
left a comment
There was a problem hiding this comment.
- Already in the code before this PR, not blocking:
BaseflowPluginExample's constructor (lib/src/app.dart:26) callspages.add(InfoPage.createPage(...))on the caller's list. Passingpages: const [...]throws "Cannot add to an unmodifiable list", and building the widget twice from the same list adds the Info page twice. Fix:pages = [...pages, InfoPage.createPage(pluginName, githubURL, pubDevURL)]in the initializer list. Fine as a follow-up PR.
What changed
lib/**andexample/lib/**importpackage:material_ui/material_ui.dartinstead ofpackage:flutter/material.dart.material_ui: ^1.0.0added to both pubspecs.lib/src/page.dartimportspackage:flutter/widgets.dartinstead of the deprecatedpackage:flutter/cupertino.dart(it only needsIconDataandWidgetBuilder).^3.12.0/ Flutter>=3.44.0inpubspec.yamlandexample/pubspec.yaml.test/material_ui_compat_test.dart: pumpsBaseflowPluginExamplewith oneExamplePagewhoseScaffoldholds a material_uiTextFieldandDropdownMenu, and assertstester.takeException()is null.dart format(Dart 3.12 tall style) applied in a separate commit.applicationId/namespace unchanged;build apk --releasepasses on Flutter 3.44.9 and 3.50.1.material_ui: ^1.0.0is deliberate: 1.3.0 is the last release that allows Flutter 3.44; 1.4.0+ needs Flutter >=3.47 / Dart ^3.13. Pub picks the right one per SDK.Why
Flutter 3.50.1 (current stable, used by CI) deprecates
package:flutter/material.dartin favour ofmaterial_ui, which failsflutter analyzeon the plugin examples (FPL-58, e.g. flutter-geocoding). Switching the examples' imports alone passes analyze but crashes at runtime with "No MaterialLocalizations found", because the template still built the legacy flutterMaterialApp, and material_ui widgets look up material_ui's localizations.MaterialUiCompatibilityBridgeonly bridges the other direction. So the template migrates first; the plugin examples follow on 3.0.0. The SDK floor follows the Baseflow-wide floor (FPL-48).Breaking change for consumers
The public API now exposes material_ui types:
BaseflowPluginExamplebuilds a material_uiMaterialApp/ThemeData, andBaseflowPluginExample.createMaterialColorreturns material_ui'sMaterialColor. Examples on 3.0.0 must importpackage:material_ui/material_ui.dart(and addmaterial_uito their pubspec) instead ofpackage:flutter/material.dart, and need Dart 3.12 / Flutter 3.44 or newer.Verification
pub getanalyzetestpub downgrade+analyze+testdart format --set-exit-if-changed .flutter/material.dart) with "No MaterialLocalizations found", so it covers the regression.pub publish --dry-run(CI runs it).Linear: FPL-58
🤖 Generated with Claude Code