I want to make a card with a CircleAvatar
, which stick out (you can see the details in this picture):
I don't know, how it could work :/ I tried something with a Stack
and the Positioned Widget, but it didn't work...
To change the avatar size, you can use radius property. There are two other properties related to size: minRadius and maxRadius . The are used to set the minimum and maximum radius respectively. If you alredy use radius , you are not allowed to use minRadius and/or maxRadius .
Stack
indeed is the solution.
Stack(
children: <Widget>[
Card(
margin: const EdgeInsets.only(top: 20.0),
child: SizedBox(
height: 100.0,
width: double.infinity,
child: Padding(
padding: const EdgeInsets.only(top: 45.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
"Foo",
style: Theme.of(context).textTheme.subhead,
),
Text("bar")
],
),
)),
),
Positioned(
top: .0,
left: .0,
right: .0,
child: Center(
child: CircleAvatar(
radius: 30.0,
child: Text("D"),
),
),
)
],
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With