Skip to main content

migrate_design_widgets

Learn about the migrate_design_widgets linter rule.

Unreleased
Fix available
Released in Dart 3.13

Design widgets should be imported from Material or Cupertino packages.

Details

#

The 'package:flutter/material.dart' and 'package:flutter/cupertino.dart' libraries are deprecated.

Enable

#

To enable the migrate_design_widgets rule, add migrate_design_widgets under linter > rules in your analysis_options.yaml file:

analysis_options.yaml
yaml
linter:
  rules:
    - migrate_design_widgets

If you're instead using the YAML map syntax to configure linter rules, add migrate_design_widgets: true under linter > rules:

analysis_options.yaml
yaml
linter:
  rules:
    migrate_design_widgets: true