kt.dart icon indicating copy to clipboard operation
kt.dart copied to clipboard

KtList (and others) has no const factories

Open myvaheed opened this issue 4 years ago • 0 comments

KtList (and others) has no const factories with const initializers. For example, KtList.of(1, 2, 3). And therefore no available pass constructed list with const to const constructors:

class State {
    final KtList<int> keys;
    const State(this.keys);
}
...

final state = const State(KtList.of(1, 2, 3, 4)); //no compile

myvaheed avatar Dec 21 '20 17:12 myvaheed