Hey hey 🙂
A few of us are trying to understand how
const classes are instantiated and the impact that has on memory usage for an app.
- Are all instances of all the
constdeclarations in your app loaded into memory on App Startup?
const Text('Foo')is created at runtime, but after that every
const Text('Foo')just returns the same cached instance?
- Is Dart “pre-compiling” the
constinstances, then loading them into memory when they’re first accessed?
- Once a const object is created, is it garbage collected as usual or kept in memory?
Are all of these questions wrong!? 😛
Any help understand how const objects are instantiated and how that affects memory usage would be much appreciated 🙂