In this document https://flutter.dev/docs/development/ui/layout#nesting-rows-and-columns they use
children:
But in the Android Studio, and this doc https://api.flutter.dev/flutter/widgets/Row-class.html they use
children: <Widget>
So, what are the differences? Thank you
both of them are true and worked but the difference is :
it`s like when you create a list, you can create lists like below
List<dynamic> list;
List<Widget> list;
when you pass the <Widget>[]
you tell to compiler the input list type is Widget and all list child must be Widget not anything else
and if you use children: <Widget>[]
your IDE can know the list type and if you add anything except Widget the IDE throw an error before you build the application and waste your time
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With