Skip to content

refactor: import widgets.dart instead of material.dart - #161

Merged
LinXunFeng merged 2 commits into
mainfrom
LinXunFeng/feature-request-flutter-version-3.47-has-been-re
Sep 14, 2026
Merged

LinXunFeng merged 2 commits into
mainfrom
LinXunFeng/feature-request-flutter-version-3.47-has-been-re

Conversation

@LinXunFeng

Copy link
Copy Markdown
Member

Related Issues

Description

Flutter 3.47 ships Material and Cupertino as the standalone material_ui and cupertino_ui packages, and the in-framework package:flutter/material.dart is scheduled for deprecation.

scrollview_observer doesn't use any Material widgets. lib/ only imported package:flutter/material.dart for the widgets, rendering and foundation symbols it re-exports. This PR replaces those imports with package:flutter/widgets.dart in all 27 files under lib/, so the package no longer depends on either design library.

  • No material_ui dependency is added, so it works the same whether the app uses package:flutter/material.dart or package:material_ui.
  • No Material types appear in the public API, so there are no type mismatches for apps that have migrated to material_ui.
  • The SDK constraints (sdk: ">=2.19.0 <4.0.0", flutter: '>=3.7.0') stay unchanged, and there are no public API changes, so this ships as a patch release (1.27.3).
  • The doc comment [SliverAppBar] in ObserverUtils.calcPersistentHeaderExtent becomes `SliverAppBar`, since that symbol is no longer in scope and would otherwise produce an unresolved dartdoc reference.

example/ and test/ still import package:flutter/material.dart. They are not part of the published library and will be migrated separately.

Tests

  • Flutter 3.47.1: flutter test - 86 passed, flutter analyze . - no issues, dart format --set-exit-if-changed . - 0 changed
  • Flutter 3.44.4 / 3.41.7: flutter analyze lib - no issues, flutter test - 86 passed
  • Flutter 3.7.0: flutter analyze lib - no issues, sliver_observer_test.dart and observer_utils_test.dart passed
  • Build a minimal app with Flutter 3.47.1 that only depends on material_ui (migrated with dart fix --apply --code=migrate_design_widgets), and verify ListViewObserver + jumpTo works via a widget test
  • pana - 160/160

@LinXunFeng
LinXunFeng merged commit 14a0314 into main Sep 14, 2026
2 checks passed
@LinXunFeng
LinXunFeng deleted the LinXunFeng/feature-request-flutter-version-3.47-has-been-re branch September 14, 2026 17:10
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.

[Feature request] Flutter version 3.47 has been released, and the UI has been separated. This plugin needs to be adapted.

1 participant