Tomek Polański
1 min readJun 13, 2018

--

You mean something like this?

Remember that Text widget has always padding on top and bottom that is build into the font — you would need to play with the padding of the image to be the same.

The solution with the CustomMultiChildLayout should work:

CustomMultiChildLayout(
delegate: new _Layout(),
children: <Widget>[
new LayoutId(
id: Colors.red,
child: new Container(
color: Colors.yellowAccent,
child: new Text(
'Hi',
style: new TextStyle(fontSize: 60.0),
),
),
),
new LayoutId(
id: Colors.blue,
child: new Image.network(
'https://flutter.io/images/flutter-mark-square-100.png',
fit: BoxFit.fill,
),
),
],
),

--

--

Tomek Polański
Tomek Polański

Written by Tomek Polański

Passionate mobile developer. One thing I like more than learning new things: sharing them

Responses (1)