What is Constraint layout's equivalent in Flutter?
What is Constraint layout's equivalent in Flutter?
Can I position a widget based on another widget?
like this:
Tiled Layout
Without
flutter_staggered_grid_view Library
1 Answer
1
There is no Widget similar to ConstraintLayout but you can achieve what you want using different widgets, like this example:
Widget
ConstraintLayout
class Testing2 extends StatelessWidget {
@override
Widget build(BuildContext context)
return Container(
color: Colors.red,
child: Row(
children: <Widget>[
Flexible(
child: Column(
children: <Widget>[
Flexible(
flex: 1,
child: Container(
color: Colors.deepOrange,
),
),
Flexible(
flex: 2,
child: Container(
color: Colors.lightBlue,
),
),
],
),
),
Flexible(
child: Column(
children: <Widget>[
Flexible(
flex: 3,
child: Container(
color: Colors.orange,
)),
Flexible(
flex: 1,
child: Row(
children: <Widget>[
Flexible(
flex: 2,
child: Container(
color: Colors.blue,
)),
Flexible(child: Container(color: Colors.green))
],
),
)
],
),
)
],
),
);

Also you can take a look this link to know about Layout Widgets: https://flutter.io/widgets/layout/
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Flutter is a constraint layout at its core.
– Rémi Rousselet
Aug 20 at 7:36