Created
April 24, 2017 03:26
-
-
Save matanlurey/b95c26e73b1bfcbd424fecdc24362b3b to your computer and use it in GitHub Desktop.
An example of using the @immutable annotation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'pacakge:meta/meta.dart'; | |
// Error: This class inherits from a class marked as @immutable, and therefore | |
// should be immutable (all instance fields must be final). | |
@immutable | |
class User { | |
String name; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Typo in the import...