Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 307 Vote(s) - 3.54 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I put a widget above another widget in Flutter?

#1
I would like to overlay a Round view on top of a background View just like in this screenshot below.

[![Getting like this][1]][1]


[1]:
Reply

#2
@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: (){}),
)
],
),
);
}


[![above UI will look like this][1]][1]


[1]:
Reply

#3
```
Stack(
alignment: Alignment.topRight,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: ClipRRect(
child: Image.network(
image,
height: 150,
width: 100,
fit: BoxFit.fitHeight,
),
borderRadius: new BorderRadius.circular(8.0),
),
),
new Align(alignment: Alignment.topRight,
child:ClipRRect(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(30),
bottomLeft: Radius.circular(30),
topRight: Radius.circular(30)),
child: RaisedButton(
elevation: 1,
color: Color(0xFF69C86C),
child: Text(
"Name",
style: TextStyle(color: Colors.white),
),
onPressed: () {},
),
),
)
],
),
```
Reply

#4
You can also use `IndexedStack` if you wish to show only one of the children based on the index.
```dart
IndexedStack(
index: 0,
children: [
FooWidget(), // Visible if index = 0
BarWidget(), // Visible if index = 1
],
)
```
Reply

#5
You can use the [Stack][1] widget.

Stack(
children: [
/*your_widget_1*/,
/*your_widget_2*/,
],
);


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through