Lesson 27/34 · 7:08 min
Repository commit for this lesson
Adding row to trail will throws an error, as it tried to occupy complete width. One may want to put training Row within a constrained box. Something like below:
ConstrainedBox( constraints: BoxConstraints(maxWidth: 100), child: Row( children: <Widget>[ IconButton( icon: const Icon(Icons.edit), onPressed: () { showModalBottomSheet( isScrollControlled: true, context: context, builder: (BuildContext context) { return CategoryEdit( category, provider.updateCategory); }); }, ), IconButton( icon: const Icon(Icons.delete), onPressed: () { // delete the category }, ), ], ), ),
And looks like u can avoid that by using mainAxisSize as well :)
Adding row to trail will throws an error, as it tried to occupy complete width. One may want to put training Row within a constrained box. Something like below:
ConstrainedBox( constraints: BoxConstraints(maxWidth: 100), child: Row( children: <Widget>[ IconButton( icon: const Icon(Icons.edit), onPressed: () { showModalBottomSheet( isScrollControlled: true, context: context, builder: (BuildContext context) { return CategoryEdit( category, provider.updateCategory); }); }, ), IconButton( icon: const Icon(Icons.delete), onPressed: () { // delete the category }, ), ], ), ),
And looks like u can avoid that by using mainAxisSize as well :)