<p>Let's see how to impose different constraints on its child than it gets from its parent.</p> <p>Below is an example of how it looks.</p> <p> on its child widget than it gets from its parent widget, possibly allowing the child to overflow the parent widget as shown above.</p> <p>Here is the complete code from main.dart file for this example.</p> <p id="4ec9b0;](MyApp());" color:="" color:=>color: #9cdcfe;](args) </p> <p id="9cdcfe;](key" color:= color:=>color: #569cd6;](class color: #4ec9b0;](MyApp color: #569cd6;](extends color: #4ec9b0;](StatelessWidget ); color: #9cdcfe;](@ color: #9cdcfe;](override</p> <p>color: #4ec9b0;](Widget color: #dcdcaa;](build(color: #4ec9b0;](BuildContext color: #9cdcfe;](context) { color: #c586c0;](return color: #569cd6;](const color: #4ec9b0;](MaterialApp( color: #9cdcfe;](home: color: #4ec9b0;](Scaffold( color: #9cdcfe;](body: color: #4ec9b0;](MyLayoutWidget(), ), ); } }</p> <p id="9cdcfe;](key," color:= color:="" color:="">color: #569cd6;](class color: #4ec9b0;](MyLayoutWidget color: #569cd6;](extends color: #4ec9b0;](StatelessWidget ); color: #9cdcfe;](@ color: #9cdcfe;](override</p> <p>color: #4ec9b0;](Widget color: #dcdcaa;](build(color: #4ec9b0;](BuildContext color: #9cdcfe;](context) { color: #c586c0;](return color: #4ec9b0;](Center( color: #9cdcfe;](child: color: #4ec9b0;](LayoutBuilder( color: #9cdcfe;](builder: (color: #9cdcfe;](p0, color: #9cdcfe;](p1) { color: #c586c0;](return color: #4ec9b0;](Container( color: #9cdcfe;](color: color: #4ec9b0;](Colors.color: #9cdcfe;](grey, color: #9cdcfe;](height: color: #9cdcfe;](p1.color: #9cdcfe;](maxHeight / color: #b5cea8;](2, color: #9cdcfe;](width: color: #9cdcfe;](p1.color: #9cdcfe;](maxWidth / color: #b5cea8;](2, color: #9cdcfe;](child: color: #4ec9b0;](OverflowBox( color: #9cdcfe;](minHeight: color: #b5cea8;](50, color: #9cdcfe;](minWidth: color: #b5cea8;](50, color: #9cdcfe;](maxHeight: color: #b5cea8;](200, color: #9cdcfe;](maxWidth: color: #b5cea8;](200, color: #9cdcfe;](child: color: #4ec9b0;](Container( color: #9cdcfe;](color: color: #4ec9b0;](Colors.color: #9cdcfe;](green, color: #9cdcfe;](height: color: #b5cea8;](100, color: #9cdcfe;](width: color: #b5cea8;](100, ), ), ); }, ), ); } } ` Thanks,Srikanth</p>
How to impose different constraints (height/width) on its child than it gets from its parent in Flutter?
This Article is posted by seven.srikanth at 11/22/2022 1:08:31 AM
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter
Tags: bigger than parent widget; make child widget grow beyond parent widget; Overflow parent widget;
Check out our other latest articles
Safearea widget - How to avoid visual overlap with Notch on flutter mobile app?How to convert row of widgets into column of widgets in flutter based on screen size?
How to run Flutter programs from GitHub?
How to get screen orientation in flutter?
NavigationRail example in flutter