Index of every page on this site: llms.txt
All skills
randalschwartz avatar

/flutter-sdk-changelog

@3231ba2
Run it yourself

Authoritative guide for Flutter framework APIs, widget lifecycle deprecations, design package unbundling, and version changelogs from Flutter 1.0 through Flutter 3.x+. Use this skill whenever authoring Flutter widgets, inspecting flutter sdk constraints, handling deprecated widgets (WillPopScope, withOpacity, MaterialState, FlatButton), migrating to standalone design libraries (material_ui, cupertino_ui), verifying widget API availability against the project's Flutter minSdk, or upgrading legacy Flutter applications.

Use this Skill: https://skilld.dev/gh/randalschwartz/dart-sdk-skills/flutter-sdk-changelog

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesmaterial-2-to-material-3-guide.md

≈1.5k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Material 2 to Material 3 Migration Guide in Flutter

A practical runbook for migrating Flutter applications from Material 2 (M2) to Material 3 (M3 / Material You), covering theme configuration, dynamic color schemes, component replacements, and breaking visual changes.


🧭 Overview of Material 3 in Flutter

Material 3 was introduced incrementally across Flutter 3.0–3.16 and became the default design specification in Flutter 3.16+ (useMaterial3: true).

┌────────────────────────────────────────────────────────┐
│ Key Differences: Material 2 vs. Material 3             │
├────────────────────────────────────────────────────────┤
│ • Color: Static primary/accent ➔ Dynamic ColorScheme   │
│ • Elevation: Drop shadows ➔ Surface tint colors        │
│ • Shapes: Sharp rounded corners (4dp) ➔ Pill/Rounded   │
│ • Typography: 2018 Scale (headline) ➔ 2021 Scale (size)│
│ • Navigation: BottomNavigationBar ➔ NavigationBar      │
└────────────────────────────────────────────────────────┘

1. Enabling Material 3 & Seed-Based ColorScheme

The ColorScheme.fromSeed Pattern

Instead of manually defining 20+ separate color properties in ThemeData, generate a complete, harmonized tonal palette using a single seedColor:

// ❌ Material 2 ThemeData (Deprecated approach)
final m2Theme = ThemeData(
  primaryColor: Colors.indigo,
  accentColor: Colors.amber,
  scaffoldBackgroundColor: Colors.white,
  appBarTheme: const AppBarTheme(
    color: Colors.indigo,
  ),
);

// ✅ Modern Material 3 ThemeData
final m3Theme = ThemeData(
  useMaterial3: true,
  colorScheme: ColorScheme.fromSeed(
    seedColor: const Color(0xFF6750A4), // Seed color
    brightness: Brightness.light,
  ),
);

2. Component Migration Matrix

Material 2 Component Modern Material 3 Component Major Changes in M3
BottomNavigationBar NavigationBar Pill indicator, indicator tint, no shifting animation bugs
ToggleButtons SegmentedButton Single or multi-select, typed generics (<T>), unified border radius
PopupMenuButton MenuAnchor / SubmenuButton Native platform menu bar integration, keyboard navigation, nested submenus
ElevatedButton (M2) FilledButton / ElevatedButton (M3) FilledButton is the new high-emphasis button; ElevatedButton has surface tint
Chip (M2) FilterChip, InputChip, ActionChip (M3) Distinct semantics, elevation states, delete icon styling
Drawer (M2) NavigationDrawer (M3) Seamless integration with NavigationDestination, rounded selection pill
Card (M2) Card (M3 variants: Elevated, Filled, Outlined) Tint-based elevation replaces heavy drop shadows

3. Component Code Examples

A. NavigationBar (Replacing BottomNavigationBar)

// ❌ Material 2
BottomNavigationBar(
  currentIndex: _selectedIndex,
  onTap: (index) => setState(() => _selectedIndex = index),
  items: const [
    BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
    BottomNavigationBarItem(icon: Icon(Icons.settings), label: 'Settings'),
  ],
)

// ✅ Material 3
NavigationBar(
  selectedIndex: _selectedIndex,
  onDestinationSelected: (index) => setState(() => _selectedIndex = index),
  destinations: const [
    NavigationDestination(icon: Icon(Icons.home_outlined), selectedIcon: Icon(Icons.home), label: 'Home'),
    NavigationDestination(icon: Icon(Icons.settings_outlined), selectedIcon: Icon(Icons.settings), label: 'Settings'),
  ],
)

B. SegmentedButton (Replacing ToggleButtons)

// ❌ Material 2 ToggleButtons (Manual boolean lists)
ToggleButtons(
  isSelected: [selectedOption == 0, selectedOption == 1],
  onPressed: (index) => setState(() => selectedOption = index),
  children: const [Text('Day'), Text('Week')],
)

// ✅ Material 3 SegmentedButton (Type-safe enum/object set)
enum CalendarView { day, week }

SegmentedButton<CalendarView>(
  segments: const [
    ButtonSegment(value: CalendarView.day, label: Text('Day')),
    ButtonSegment(value: CalendarView.week, label: Text('Week')),
  ],
  selected: {selectedView},
  onSelectionChanged: (newSelection) => setState(() => selectedView = newSelection.first),
)

C. MenuAnchor (Replacing PopupMenuButton)

// ✅ Modern Material 3 MenuAnchor
MenuAnchor(
  builder: (context, controller, child) {
    return IconButton(
      onPressed: () => controller.isOpen ? controller.close() : controller.open(),
      icon: const Icon(Icons.more_vert),
    );
  },
  menuChildren: [
    MenuItemButton(
      onPressed: () => handleAction('share'),
      leadingIcon: const Icon(Icons.share),
      child: const Text('Share'),
    ),
    MenuItemButton(
      onPressed: () => handleAction('delete'),
      leadingIcon: const Icon(Icons.delete),
      child: const Text('Delete'),
    ),
  ],
)

4. Visual Migration Checklist

  • Surface Tints: If cards or app bars appear purple/tinted instead of pure white/grey, check surfaceTintColor: Colors.transparent or customize colorScheme.surfaceContainer.
  • AppBar Center Title: Material 3 defaults AppBar.centerTitle to true on iOS and false on Android. Override explicitly if consistent alignment is required.
  • Elevation: Remove excessive manual elevation: 8 drop shadows; use Material 3 tonal elevation and surface colors.
  • Buttons: Replace flat/outline button custom styles with FilledButton.tonal() or OutlinedButton().

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert11d3 checks · Risk CRITICAL
  • Gen Agent Trust Hub12d

    This skill provides a guide for Flutter SDK migrations and widget deprecations. A security concern exists because the skill references a domain (flutterreleases.com) that is blacklisted by automated scanners for malicious activity. Additionally, the skill presents speculative or non-standard framework changes as authoritative SDK requirements, which could mislead developers into adopting third-party dependencies.

  • Socket11d

    No alerts

  • Snyk12d

    Risk: LOW · No issues

Signed by skilld at 3231ba2. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 2 weeks ago

README badge

README badge for randalschwartz/dart-sdk-skills/flutter-sdk-changelog