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-ui-and-cupertino-ui-migration.md

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

Migrating to Standalone material_ui and cupertino_ui Packages

A comprehensive migration guide and tactical runbook for the decoupling of Material and Cupertino design libraries from the core Flutter framework into standalone material_ui and cupertino_ui packages.


🧭 Overview & Architectural Decoupling

In modern Flutter architecture, Google decoupled the Material and Cupertino design libraries from the monolithic flutter core SDK. Introduced as an opt-in preview in Flutter 3.44 / 3.47 and formally superseding the deprecated in-framework libraries in Flutter 3.50, both component systems are published as standalone packages on pub.dev:

  • material_ui: Independent implementation of Material Design (Material 3 and future design iterations).
  • cupertino_ui: Independent implementation of iOS/macOS human interface guidelines.
┌────────────────────────────────────────────────────────────────────────┐
│ Legacy Architecture (Flutter Monolithic)                              │
│                                                                        │
│  ┌──────────────────────────────────────────────────────────────────┐  │
│  │ package:flutter/material.dart  &  package:flutter/cupertino.dart │  │
│  ├──────────────────────────────────────────────────────────────────┤  │
│  │ package:flutter/widgets.dart   &  package:flutter/rendering.dart │  │
│  └──────────────────────────────────────────────────────────────────┘  │
└────────────────────────────────────────────────────────────────────────┘
                                    ▼
┌────────────────────────────────────────────────────────────────────────┐
│ Modern Decoupled Architecture                                          │
│                                                                        │
│  ┌───────────────────────────────┐   ┌──────────────────────────────┐  │
│  │ package:material_ui           │   │ package:cupertino_ui         │  │
│  └───────────────┬───────────────┘   └──────────────┬───────────────┘  │
│                  └───────────────┬──────────────────┘                  │
│                                  ▼                                     │
│  ┌──────────────────────────────────────────────────────────────────┐  │
│  │ Core Flutter SDK (package:flutter/widgets.dart)                  │  │
│  └──────────────────────────────────────────────────────────────────┘  │
└────────────────────────────────────────────────────────────────────────┘

💡 Why It Changed

  1. Independent Release Cadence: Design system components can be updated, patched, and evolved on pub.dev without requiring a full Flutter SDK upgrade.
  2. Minimal Framework Overhead: Apps building custom design systems or enterprise UI toolkits no longer bundle unused Material or Cupertino widget implementations.
  3. Multi-Design System Freedom: Facilitates combining or swapping design systems cleanly without naming collisions or unwanted framework coupling.

🚀 Fast Automated Migration with dart fix

The Flutter SDK provides an automated lint and fix rule to update existing applications:

# Apply automatic import migrations and dependency updates
dart fix --apply --code=migrate_design_widgets

This automated command:

  1. Adds material_ui and/or cupertino_ui to your pubspec.yaml.
  2. Updates import directives across your codebase.
  3. Replaces references to deprecated SDK-bundled design constants with the package-provided equivalents.

🛠️ Step-by-Step Manual Migration

If performing the migration manually or reviewing changes across large monorepos, follow these steps:

1. Update pubspec.yaml Dependencies

Add the standalone packages to your application or design package dependencies:

dependencies:
  flutter:
    sdk: flutter
  # Standalone design packages
  material_ui: ^1.0.0
  cupertino_ui: ^1.0.0

Alternatively, use the Flutter CLI:

flutter pub add material_ui
flutter pub add cupertino_ui

2. Update Import Directives

Update the library imports in your Dart source files:

Material Design Migration
// ❌ Legacy SDK Import
import 'package:flutter/material.dart';

// ✅ Modern Standalone Package Import
import 'package:material_ui/material_ui.dart';
Cupertino Migration
// ❌ Legacy SDK Import
import 'package:flutter/cupertino.dart';

// ✅ Modern Standalone Package Import
import 'package:cupertino_ui/cupertino_ui.dart';

3. Updating App Entrypoints & Roots

Configure your top-level MaterialApp or CupertinoApp with the unbundled packages:

// main.dart
import 'package:flutter/widgets.dart';
import 'package:material_ui/material_ui.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Modern Decoupled App',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF6750A4)),
      ),
      home: const HomeScreen(),
    );
  }
}

4. Localization Configuration

The standalone packages provide updated global localizations directly:

import 'package:flutter/widgets.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:material_ui/material_ui.dart';
import 'package:cupertino_ui/cupertino_ui.dart';

Widget buildApp() {
  return MaterialApp(
    localizationsDelegates: const [
      GlobalMaterialLocalizations.delegate,
      GlobalCupertinoLocalizations.delegate,
      GlobalWidgetsLocalizations.delegate,
    ],
    supportedLocales: const [
      Locale('en', 'US'),
      Locale('es', 'ES'),
    ],
    home: const HomeScreen(),
  );
}

🔍 Coexistence & Headless Core Architecture

For applications utilizing custom design systems (for example bespoke company themes or canvas rendering), you can now omit material_ui and cupertino_ui entirely, building strictly against package:flutter/widgets.dart:

import 'package:flutter/widgets.dart';

// Pure headless custom component without Material/Cupertino dependencies
class CustomDesignButton extends StatelessWidget {
  final Widget child;
  final VoidCallback onTap;

  const CustomDesignButton({
    super.key,
    required this.child,
    required this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
        decoration: BoxDecoration(
          color: const Color(0xFF007AFF),
          borderRadius: BorderRadius.circular(8.0),
        ),
        child: child,
      ),
    );
  }
}

⚠️ Common Migration Issues & Solutions

Issue 1: Ambiguous Imports / Duplicate Symbols

Symptom: Compilation errors stating that symbols like Icon, Text, or Center are defined in multiple libraries.
Solution: Ensure you are not importing both package:flutter/material.dart and package:material_ui/material.dart in the same file. Remove the legacy package:flutter/material.dart import.

Issue 2: Transitive Dependency Version Conflicts

Symptom: flutter pub get fails due to version mismatch on material_ui or cupertino_ui.
Solution: Run flutter pub upgrade --major-versions to allow resolution of compatible semantic versions across all shared dependencies.

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