Building flutter apps is all about code efficiency. Of course, when building a reactive application I would use "const" before widgets and classes with constant constructors. However, I would like to know if there is any PERFORMANCE and APP SIZE difference between the following examples:
const List<Color> colors = <Color>[
Color(0xFFFFFFFF),
Color(0xFF000000),
];
and
const List<Color> colors = <Color>[
const Color(0xFFFFFFFF),
const Color(0xFF000000),
];
No.
Since Dart 2.0, these redundant const keywords are optional.
So:
const foo = <T>[ Foo() ];
is strictly equivalent to:
const foo = const <T>[ const Foo() ];
User contributions licensed under CC BY-SA 3.0