How can I put a widget above another widget in Flutter?
@override
Widget build(BuildContext context) {
// TODO: implement build
return new Container(
width: 150.0,
height: 150.0,
child: new Stack(children: <Widget>[
new Container(
alignment: Alignment.center,
color: Colors.redAccent,
child: Text('Hello'),
),
new Align(alignment: Alignment.bottomRight,
child: FloatingActionButton(
child: new Icon(Icons.add),
onPressed: (){}),
)
],
),
);
}
You can use the Stack widget.
Stack(
children: [
/*your_widget_1*/,
/*your_widget_2*/,
],
);