How could I achieve this layout in Flutter?
Asked
Active
Viewed 9,360 times
5

ButteredQwaffles
- 196
- 1
- 11
-
what have you tried so far? – Umair M Jan 10 '19 at 14:04
-
Nothing, really. I was searching the docs for something that would point me in the right direction and didn't find any. – ButteredQwaffles Jan 10 '19 at 14:06
-
2https://github.com/flutter/flutter/issues/2022 – Jordan Davies Jan 10 '19 at 14:12
-
Disappointing... – ButteredQwaffles Jan 10 '19 at 14:58
-
1https://github.com/flutter/flutter/issues/2022#issuecomment-376370973 you can easily implement it like this – Umair M Jan 10 '19 at 15:13
-
@UmairM Yeah, I saw that in the thread earlier. I meant it was disappointing there's nothing built in for it. Thank you! If you want, you can add it as an answer. I'll accept it. – ButteredQwaffles Jan 10 '19 at 15:57
-
I have posted the answer and will see if I got some free time this weekend. I will implement this and let you know how it turns out :) – Umair M Jan 10 '19 at 18:18
3 Answers
12
I published package drop_cap_text to achive DropCapText, you can also put an image as custom widget inside DropCap.

Tiziano Munegato
- 869
- 1
- 7
- 21
-
I'm using this package. But I have an issue: https://github.com/mtiziano/drop_cap_text/issues/14 – Mr. ZeroOne Jan 04 '21 at 05:48
-2
its Pretty basic just simple Row with the data inside it
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Image.asset('Your image link here'),
Text('you paragraph here')
],)

Mohamed hassan kadri
- 994
- 6
- 17
-
1Apologies, I should have been clearer. This will have a fixed width and the text will also need to go flow below the image. – ButteredQwaffles Jan 10 '19 at 13:45
-2
You can use Stack(): https://flutter.io/docs/development/ui/layout#stack
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
var stack = Stack(
alignment: const Alignment(0.6, 0.6),
children: [
CircleAvatar(
backgroundImage: AssetImage('images/pic.jpg'),
radius: 100.0,
),
Container(
decoration: BoxDecoration(
color: Colors.black45,
),
child: Text(
'Mia B',
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
],
);
// ...
}
}
You can use a Container() widget with foregroundDecoration:
Container(
child: Text('Hello World'),
foregroundDecoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage('https://www.example.com/images/frame.png'),
centerSlice: Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0),
),
),

Rubens Melo
- 3,111
- 15
- 23
-
3This seems to make the text overlay the image rather than put the text to the side around the image. – ButteredQwaffles Jan 10 '19 at 13:53