FR: Adding methods to classes without subclassing #34778
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
core-m
type-enhancement
A request for a change that isn't a bug
Idea comes from Objective-C's "Categories".
Would be great to be able to add methods, both instance and static, to a class without having to create a new type. Here's how it works in Objective-C (I bet you could make it less verbose!) The
-
method is an instance method and+
is the static one:Source File: UILabel+MyNewInits.h
Consuming File: SomeView.m
The text was updated successfully, but these errors were encountered: