I have in my mind that dart will use the const
constructor if it is able to do it automatically, to explain the hypothesis lets assume that we have a widget that already have a const constructor
like:
class Retry extends StatelessWidget {
const Retry();
}
And then because dart "is able to infer the const ussage" both of the next codes will mean and be compiled into the same code:
1.
Container(
child: Retry()
)
Container(
child: const Retry()
)
Is this assumption that dart can infer that he must use the const
constructor for a class that have that option declared? Or is not?
How can I corroborate it?