Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@immutable should be moved to flutter sdk? #59803

Closed
stephane-archer opened this issue Dec 24, 2024 · 2 comments
Closed

@immutable should be moved to flutter sdk? #59803

stephane-archer opened this issue Dec 24, 2024 · 2 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug

Comments

@stephane-archer
Copy link

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

@dart-github-bot
Copy link
Collaborator

Summary: User suggests moving the @immutable annotation from the Flutter SDK to the Dart SDK, arguing it's not Flutter-specific and belongs in the core language.

@dart-github-bot dart-github-bot added area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug labels Dec 24, 2024
@bwilkerson
Copy link
Member

The annotation is defined in package:meta/meta.dart, which is in the sdk repository. It is exported by package:flutter/foundation.dart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants