Search packages, repositories and app categories

Package detailsv2.34.0

dart_code_metrics_presets

Predefined presets for DCM, a code quality tool for Flutter dev teams.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
118K
Likes
39
Pub points
150

Install package

flutter pub add dart_code_metrics_presets

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A collection of predefined configuration presets for Dart Code Metrics (DCM), a code quality tool designed to help Flutter development teams maintain consistent coding standards. These presets offer ready-to-use rulesets tailored for different project types and team preferences, simplifying setup and enforcement of best practices in code style, complexity, and maintainability. By integrating with DCM, teams can quickly apply industry-aligned guidelines without manual configuration. The package supports all major platforms, making it ideal for cross-platform Flutter projects.

Use cases

  • Enforcing consistent code style across teams
  • Automating code quality checks in CI/CD pipelines
  • Onboarding new developers with standardized rules
  • Improving code maintainability in large Flutter apps
  • Customizing linting rules for specific project needs

Key features

  • Predefined, battle-tested presets
  • Easy integration via pub add
  • Support for all Flutter platforms
  • Alignment with Dart and Flutter best practices
  • Extensible for custom configurations

Suitable for

  • Flutter teams prioritizing code quality
  • CI/CD environments requiring automated linting
  • New Flutter projects needing quick setup
  • Teams adopting standardized coding conventions
  • Developers seeking minimal configuration overhead

Considerations

  • Requires Dart Code Metrics to be installed
  • Presets may need adjustment for unique project needs
  • Not a standalone linter; depends on DCM runtime
  • Limited customization within preset definitions
  • Best used alongside team-wide documentation

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Pub Version License package publisher

DCM Presets

DCM is an advanced linter for Dart and Flutter that helps you analyze and improve your code quality. You can find all available lint rules here.

This repository contains a list of predefined DCM presets for lints:

  • All: contains all available lint rules for Dart and Flutter.
  • Recommended: contains recommended Dart and Flutter rules (with an emphasis on finding errors).
  • Dart: contains all lint rules applicable to any Dart app.
  • Flutter: contains all lint rules applicable to any Flutter app.
  • Pub: contains all lint rules for linting the pubspec.yaml files.
  • Flame: contains all lint rules for the Flame package.
  • Provider: contains all lint rules for the Provider package.
  • Bloc: contains all lint rules for the Bloc package.
  • Riverpod: contains all lint rules for the Riverpod package.
  • Equatable: contains all lint rules for the Equatable package.
  • Patrol: contains all lint rules for the Patrol package.
  • FakeAsync: contains all lint rules for the FakeAsync package.
  • Mocktail: contains all lint rules for the Mocktail package.
  • GetIt: contains all lint rules for the GetIt package.
  • JsonSerializable: contains all lint rules for the JsonSerializable package.
  • FlutterHooks: contains all lint rules for the FlutterHooks package.
  • FirebaseAnalytics: contains all lint rules for the FirebaseAnalytics package.
  • GetX: contains all lint rules for the GetX package.
  • Intl: contains all lint rules for the Intl package.
  • EasyLocalization: contains all lint rules for the EasyLocalization package.

and for metrics:

  • All Metrics: contains all available metrics with recommended default thresholds.
  • Recommended metrics: contains recommended metrics with default thresholds.

How to use a preset

Take these steps to enable a preset:

  1. Install this package as a dev dependency:

    dart pub add --dev dart_code_metrics_presets
    

    or:

    flutter pub add --dev dart_code_metrics_presets
    
  2. For DCM configuration add the extents entry:

    dart_code_metrics:
      extends:
        - package:dart_code_metrics_presets/all.yaml
    

Disabling or reconfiguring a rule from the preset

To disable a rule, simply set its value to false:

dart_code_metrics:
  extends:
    - package:dart_code_metrics_presets/all.yaml
  rules:
    - avoid-banned-imports: false

To reconfigure a rule, that is included into a preset:

dart_code_metrics:
  extends:
    - package:dart_code_metrics_presets/all.yaml
  rules:
    - arguments-ordering:
        child-last: true

Defining a custom preset

Any other preset can be passed to the extends entry. To create a custom preset create a yaml file with the same structure as for regular DCM configuration.

Categories

Source repository

Projects using this package