I wrote an extension function to add SizedBox
between every child in Column
or Row
to add space between child, instead of putting SizedBox
between every child, for which I didn't find any other way around.
Column(
children: [
// widgets
].setSpace(height: 10),
)
Row(
children: [
// widgets
].setSpace(width: 10),
)
So here List<Widget> setSpace({double? height, double? width})
takes height or width for the SizedBox
used between child. But since height and width are not const
I cannot use const SizedBox
. So is there any way in dart to say that both the parameters and the return type will ALWAYS be cosnt? like const List<Widget> setSpace({const double? height, const double? width})
like C/C++?