Skip to content

@immutable should be moved to flutter sdk? #59803

@stephane-archer

Description

@stephane-archer

Use case

import 'package:flutter/material.dart';

@immutable
class Resolution {
  final int width;
  final int height;
  const Resolution(this.width, this.height);
  double get aspectRatio {
    return width / height;
  }
}

immutable is not related to material app. I think the immutable annotation should be located somewhere else. Maybe it can be part of the dart SDK? I don't see how this is Flutter-specific.

Proposal

move @immutable

flutter/flutter#160820

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).triage-automationSee https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions