flutter-sdk-changelog

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Flutter SDK Changelog & Widget Migration Guide (Flutter 1.0 to Modern Flutter)

Flutter SDK 更新日志与组件迁移指南(Flutter 1.0 至现代Flutter)

This skill provides an authoritative, structured reference for Flutter framework releases, widget deprecations, API replacements, Material 3 design migrations, and legacy Flutter codebase rescue runbooks.

本技能提供了关于Flutter框架发布、组件弃用、API替换、Material 3设计迁移以及旧版Flutter代码库拯救手册的权威结构化参考资料。

🎯 Fast Flutter Widget & API Replacement Matrix

🎯 Flutter组件与API快速替换对照表

Deprecated / Obsolete APIIntroduced / Deprecated InModern ReplacementReference
Color.withOpacity(o)
Deprecated in Flutter 3.22
Color.withValues(alpha: o)
Widget Deprecations
MaterialState
/
MaterialStateProperty
Deprecated in Flutter 3.22
WidgetState
/
WidgetStateProperty
Widget Deprecations
WillPopScope
Deprecated in Flutter 3.12+
PopScope(canPop: ..., onPopInvokedWithResult: ...)
Widget Deprecations
FlatButton
,
RaisedButton
,
OutlineButton
Deprecated in Flutter 2.0
TextButton
,
ElevatedButton
,
OutlinedButton
Widget Deprecations
TextTheme.headline1...6
,
bodyText1/2
Deprecated in Flutter 3.7+
displayLarge...small
,
bodyLarge/Medium
Widget Deprecations
ThemeData.accentColor
Deprecated in Flutter 2.5+
ColorScheme.secondary
Widget Deprecations
Scaffold.of(context).showSnackBar()
Deprecated in Flutter 2.0
ScaffoldMessenger.of(context).showSnackBar()
Widget Deprecations
BottomNavigationBar
Legacy M2 Navigation
NavigationBar
(Material 3)
Material 3 Guide
ToggleButtons
Legacy M2 Toggle
SegmentedButton<T>
(Material 3)
Material 3 Guide
PopupMenuButton
Legacy popup menu
MenuAnchor
/
SubmenuButton
Material 3 Guide

已弃用/过时API引入/弃用版本现代替代方案参考资料
Color.withOpacity(o)
Flutter 3.22中弃用
Color.withValues(alpha: o)
组件弃用列表
MaterialState
/
MaterialStateProperty
Flutter 3.22中弃用
WidgetState
/
WidgetStateProperty
组件弃用列表
WillPopScope
Flutter 3.12+中弃用
PopScope(canPop: ..., onPopInvokedWithResult: ...)
组件弃用列表
FlatButton
,
RaisedButton
,
OutlineButton
Flutter 2.0中弃用
TextButton
,
ElevatedButton
,
OutlinedButton
组件弃用列表
TextTheme.headline1...6
,
bodyText1/2
Flutter 3.7+中弃用
displayLarge...small
,
bodyLarge/Medium
组件弃用列表
ThemeData.accentColor
Flutter 2.5+中弃用
ColorScheme.secondary
组件弃用列表
Scaffold.of(context).showSnackBar()
Flutter 2.0中弃用
ScaffoldMessenger.of(context).showSnackBar()
组件弃用列表
BottomNavigationBar
旧版Material 2导航组件
NavigationBar
(Material 3)
Material 3指南
ToggleButtons
旧版Material 2切换组件
SegmentedButton<T>
(Material 3)
Material 3指南
PopupMenuButton
旧版弹出菜单
MenuAnchor
/
SubmenuButton
Material 3指南

⚡ Subskill Spotlights

⚡ 子技能亮点

Subskill: Widget Deprecations & Modernization

子技能:组件弃用与现代化

  • Predictive Back Navigation: Replace
    WillPopScope
    with
    PopScope
    for zero-stutter predictive back gestures on Android 14+ and iOS.
  • Wide-Gamut Colors: Replace
    withOpacity
    with
    withValues(alpha: ...)
    to eliminate 8-bit precision loss and color clipping.
  • Unified State Management: Replace
    MaterialState
    with universal
    WidgetState
    . 👉 Read the full Widget Deprecations & Replacements Guide.
  • 预测式返回导航:将
    WillPopScope
    替换为
    PopScope
    ,在Android 14+和iOS上实现无卡顿的预测式返回手势。
  • 广色域色彩:使用
    withValues(alpha: ...)
    替代
    withOpacity
    ,消除8位精度损失和色彩裁剪问题。
  • 统一状态管理:使用通用的
    WidgetState
    替代
    MaterialState
    。 👉 阅读完整的组件弃用与替换指南

Subskill: Material 2 to Material 3 Migration

子技能:Material 2 转 Material 3 迁移

  • Seed-Based Theming: Generate tonal palettes with
    ColorScheme.fromSeed(seedColor: ...)
    .
  • Component Modernization: Migrate from
    BottomNavigationBar
    to
    NavigationBar
    ,
    ToggleButtons
    to
    SegmentedButton
    , and M2 buttons to
    FilledButton
    . 👉 Read the full Material 2 to Material 3 Guide.
  • 基于种子的主题设计:使用
    ColorScheme.fromSeed(seedColor: ...)
    生成色调调色板。
  • 组件现代化:将
    BottomNavigationBar
    迁移为
    NavigationBar
    ToggleButtons
    迁移为
    SegmentedButton
    ,将Material 2按钮迁移为
    FilledButton
    。 👉 阅读完整的Material 2转Material 3指南

Subskill: Rescuing Legacy Flutter Apps (Flutter 1.x / 2.x to Modern 3.x)

子技能:拯救旧版Flutter应用(Flutter 1.x / 2.x 至现代3.x)

  • 5-Phase Upgrade Pipeline: Baseline toolchain check → null safety bridge → widget deprecation fixes → Material 3 update → modern state & routing. 👉 Read the full Legacy Flutter App Rescue Runbook.

  • 五阶段升级流程:基准工具链检查 → 空安全过渡 → 组件弃用修复 → Material 3更新 → 现代状态与路由管理。 👉 阅读完整的旧版Flutter应用拯救手册

📚 Table of Contents & Reference Archive

📚 目录与参考资料归档

DocumentFocus AreaDescription
flutter-to-dart-version-matrix.md
Version MappingFull mapping of Flutter 1.0–3.27+ to bundled Dart SDKs and engine milestones.
widget-deprecations-and-replacements.md
Widget DictionaryBefore/After code snippets for all deprecated Flutter widgets and properties.
material-2-to-material-3-guide.md
UI & ThemingComprehensive Material 3 migration guide, dynamic color schemes, and new components.
rescuing-legacy-flutter-apps.md
Upgrade Runbook5-phase structured runbook for stepping legacy Flutter apps to modern Flutter.
文档聚焦领域描述
flutter-to-dart-version-matrix.md
版本映射Flutter 1.0–3.27+与配套Dart SDK及引擎里程碑的完整对应关系。
widget-deprecations-and-replacements.md
组件字典所有已弃用Flutter组件和属性的前后代码示例。
material-2-to-material-3-guide.md
UI与主题设计全面的Material 3迁移指南、动态色彩方案及新组件介绍。
rescuing-legacy-flutter-apps.md
升级手册将旧版Flutter应用升级至现代Flutter的五阶段结构化手册。