Flutter layout: how to expand widget vertically - flutter

I am struggling to understand how to layout my widget so that they are occupying the entire yellow space. More specifically I would like that the "hero' and the "boss" widget expand to occupy the available space on screen (excluding the keyboard)
My current code achieve the following result
I would like to get the following result below
Here is my code. I have used resizeToAvoidBottomInset: true to ensure the widget is resized with the keyboard popping up
Widget build(BuildContext context) {
return Container(
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: kColorPrimary,
appBar: AppBar(
backgroundColor: kColorPrimaryLight,
title: Text('Time to Spell'),
),
body: ModalProgressHUD(
inAsyncCall: showSpinner,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: SafeArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Expanded(
child: Container(
height: 100,
color: Colors.amberAccent,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 2,
child: Container(
color: Colors.blue,
child: Text(
result,
textAlign: TextAlign.center,
style: kTitleTextStyle,
),
),
),
Expanded(
flex: 1,
child: Container(
color: Colors.blue,
child: Text(
'Timer: 2:00',
textAlign: TextAlign.center,
),
),
),
],
),
Row(
children: <Widget>[
Expanded(
child: Container(
height: 279,
color: Colors.purple,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.white,
child: Text(
'Hero',
textAlign: TextAlign.center,
),
),
),
),
),
Expanded(
child: Container(
height: 279,
color: Colors.greenAccent,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.white,
child: Text(
'Boss',
textAlign: TextAlign.center,
),
),
),
),
),
],
),
],
),
),
),
],
),
),
))));
}

Try this. I have added comments as well. Feel free to comment if anything is not clear.
#override
Widget build(BuildContext context) {
return SafeArea(
child: Container(
color: Colors.amberAccent,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
flex: 2,
child: Container(
color: Colors.blue,
child: Text(
"Click start",
textAlign: TextAlign.center,
),
),
),
Expanded(
flex: 1,
child: Container(
color: Colors.blue,
child: Text(
'Timer: 2:00',
textAlign: TextAlign.center,
),
),
),
],
),
Expanded(
child: Row(
children: <Widget>[
//child 1 of row takes half of the space
Expanded(
child: Column(
children: <Widget>[
//expanding the container to the bottom
Expanded(
child: Container(
//maximizing the width of the container
width: double.infinity,
color: Colors.purple,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.white,
child: Text(
'Hero',
textAlign: TextAlign.center,
),
),
),
),
),
],
),
),
//child 2 of row takes half of the space
Expanded(
child: Column(
children: <Widget>[
//expanding the container to the bottom
Expanded(
child: Container(
//maximizing the width of the container
width: double.infinity,
color: Colors.greenAccent,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.white,
child: Text(
'Boss',
textAlign: TextAlign.center,
),
),
),
),
),
],
),
),
],
),
),
],
),
),
);
}

Related

Flutter error 'RenderAspectRatio has unbounded constraints' when row of containers are inside a wrapped Expanded column

In Flutter, I'm attempting to build rows of containers that are inside the Expanded wrapped column which is also inside a row. for some reason, it errors on 'RenderAspectRatio has unbounded constraints'. I've attempted to move the Expanded widget to different places on the code but it continues to error sometimes it will throw,
"RenderFlex children have non-zero flex but incoming height constraints are unbounded"
I've tried many things and I read many Q&A on the issues here in StackOverflow and elsewhere but to no avail, I still haven't solved the problem.
here's the code:
Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
onTap: () {
print('Just clicked on 7');
},
child: Align(
alignment: Alignment.center,
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.yellow,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'7',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0, color: Colors.black45),
),
),
),
),
),
GestureDetector(
onTap: () {
print('Just clicked on 7');
},
child: Align(
alignment: Alignment.center,
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.yellow,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'7',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0, color: Colors.black45),
),
),
),
),
),
GestureDetector(
onTap: () {
print('Just clicked on 7');
},
child: Align(
alignment: Alignment.center,
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.yellow,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'7',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0, color: Colors.black45),
),
),
),
),
),
GestureDetector(
onTap: () {
print('Just clicked on 7');
},
child: Align(
alignment: Alignment.center,
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.yellow,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'7',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0, color: Colors.black45),
),
),
),
),
),
],
),
],
),
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
//Expanded(
//child:
GestureDetector(
onTap: () {
print('Just clicked on 8');
},
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.cyan,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'8',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0, color: Colors.black45),
),
),
),
),
],
),
),
],
),
],
),
),
),
);
}
I'm attempting to create something that looks like this:
I didn't get the whole idea from the image but from what I understood, I have implemented it like this.
Since there is a lot of repetition and there is a pattern, I use GridView and ListView respectively.
class NumbersGridView extends StatelessWidget {
const NumbersGridView({Key? key}) : super(key: key);
#override
Widget build(BuildContext context) {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
childAspectRatio: 3 / 2,
crossAxisSpacing: 10,
mainAxisSpacing: 20,
),
itemCount: 30,
itemBuilder: (buildContext, index) {
return InkWell(
onTap: () {
print(index);
},
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.cyan,
margin: const EdgeInsets.all(1.0),
child: AutoSizeText(
index.toString(),
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 300.0, color: Colors.black45),
),
),
),
);
}),
),
Container(width: 20.0, child: VerticalDivider(color: Colors.red)),
Flexible(
child: SizedBox(
width: 50.0,
child: ListView.builder(
itemCount: 5,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (buildContext, index) {
return Container(
height: 40.0,
width: 40.0,
alignment: Alignment.center,
color: Colors.cyan,
child: AutoSizeText(
index.toString(),
textAlign: TextAlign.center,
style: const TextStyle(color: Colors.black45),
),
);
}),
),
)
],
);
}
}
If you want to implement it as you originally tried, here's is the code without the specified error.
Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: GestureDetector(
onTap: () {
print('Just clicked on 7');
},
child: Align(
alignment: Alignment.center,
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.yellow,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'7',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0,
color: Colors.black45),
),
),
),
),
),
),
Expanded(
child: GestureDetector(
onTap: () {
print('Just clicked on 7');
},
child: Align(
alignment: Alignment.center,
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.yellow,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'7',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0,
color: Colors.black45),
),
),
),
),
),
),
Expanded(
child: GestureDetector(
onTap: () {
print('Just clicked on 7');
},
child: Align(
alignment: Alignment.center,
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.yellow,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'7',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0,
color: Colors.black45),
),
),
),
),
),
),
Expanded(
child: GestureDetector(
onTap: () {
print('Just clicked on 7');
},
child: Align(
alignment: Alignment.center,
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.yellow,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'7',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0,
color: Colors.black45),
),
),
),
),
),
),
],
),
],
),
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
//Expanded(
//child:
GestureDetector(
onTap: () {
print('Just clicked on 8');
},
child: AspectRatio(
aspectRatio: 1,
child: Container(
color: Colors.cyan,
margin: const EdgeInsets.all(1.0),
child: const AutoSizeText(
'8',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 300.0, color: Colors.black45),
),
),
),
),
],
),
),
],
)

Keyboard hides textfield on Flutter

I have an app that has a bottomappbar with a textformfield, but when the user tries to insert data there the keyboard hides the text being typed.
I tried "resizeToAvoidBottomInset: true" and didnt worked, also tried to put a SingleChildScrollView on the body of the app and got "RenderBox was not laid out: RenderRepaintBoundary#32f0a relayoutBoundary=up1 NEEDS-PAINT 'package:flutter/src/rendering/box.dart': Failed assertion: line 1785 pos 12: 'hasSize'".
I need a way to make the bottom part "expand" to the top of the keyboard when the user is typing or a way to show in the screen the text that is being typed.
How can I solve that? I have tried many ways and nothing seems to work.
The structure of my app is:
The code:
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: AppBar(
title: Text(
"xx",
),
//+ produtosList1[0].cod_produto),
actions: <Widget>[
Padding(
padding: EdgeInsets.only(right: 20.0),
child: GestureDetector(
onTap: () {
showDialog(
//dialog content
);
},
child: Icon(
Icons.search,
size: 26.0,
),
)),
],
),
drawer: Drawer(
elevation: 20.0,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
]
//appbar content
)),
body: Column(
children: [
Container(
color: Colors.blue,
child: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Column(
children: [
Row(children: [
Text(
"xxx",
style: TextStyle(
color: Colors.white,
),
overflow: TextOverflow.ellipsis),
]),
Row(children: [
Text(
"xxxx",
style: TextStyle(color: Colors.white),
)
])
],
)),
),
Container(
color: Colors.blue,
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 8.0, 0, 8.0),
child: Row(
children: <Widget>[
Expanded(
flex: 2,
child: Text("xxxx",
style: TextStyle(fontWeight: FontWeight.bold),
overflow: TextOverflow.ellipsis),
),
Expanded(
flex: 1,
child: Text(
"xxxxx",
style: TextStyle(fontWeight: FontWeight.bold),
)),
Expanded(
flex: 4,
child: Text(
"xxxx",
style: TextStyle(fontWeight: FontWeight.bold),
)),
Expanded(
flex: 4,
child: Text(
"xxxx",
style: TextStyle(fontWeight: FontWeight.bold),
)),
],
)),
),
Divider(
height: 5.0,
),
Expanded(
child: ListView.builder(
itemCount: produtosList1.length,
itemBuilder: (context, index) {
return Padding(
padding: const EdgeInsets.fromLTRB(0.0, 4.0, 0.0, 4.0),
child: Row(
children: <Widget>[
Expanded(
flex: 2,
child: Text(
"xxxx"
),
),
Expanded(
flex: 1,
child: Text(
"xxxxx",
style: TextStyle(fontWeight: FontWeight.bold),
),
),
Expanded(
flex: 4,
child: Text(
"xxxx",
style: TextStyle(fontWeight: FontWeight.bold),
overflow: TextOverflow.ellipsis),
),
Expanded(
flex: 4,
child: Text(
"xxxxx",
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 12),
overflow: TextOverflow.ellipsis),
),
],
),
);
}),
)
],
),
bottomNavigationBar: BottomAppBar(
child: Form(
child: Container(
height: 180.0,
color: Colors.blue[400],
child: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(children: [
Container(
height: 50,
decoration: BoxDecoration(
color: Colors.white,
),
child: DropdownButtonFormField(
hint: Text('Choose '),
onChanged: (value) {
//dropdown values
},
items: newFuncionariosList,
),
),
Divider(
height: 6.0,
),
Row(
children: [
Expanded(
flex: 2,
child: TextFormField(
controller: _codprodController,
decoration: InputDecoration(
icon: Icon(Icons.add),
),
),
),
Expanded(
flex: 1,
child: ElevatedButton(
//button content
),
)
],
),
Divider(
height: 8.0,
),
Row(
children: [
Expanded(
flex: 6,
child: Text(produtoDesc == null ? "- - -" : produtoDesc,
overflow: TextOverflow.ellipsis)),
Expanded(
flex: 2,
child: TextFormField(
keyboardType: TextInputType.number,
controller: _qtdController,
decoration: InputDecoration(hintText: "qtd"),
),
),
Expanded(
flex: 2,
child: ElevatedButton(
//button content
))
],
)
]),
),
),
),
),
);
}
use MediaQuery.of(context).viewInsets.bottom and add it to your bottom navigation height
child: Form(
child: Container(
height: 180.0 + MediaQuery.of(context).viewInsets.bottom,
color: Colors.blue[400],
child: Padding(
padding: const EdgeInsets.all(8.0),
child: ListView(children: [
Container(
height: 50,
decoration: BoxDecoration(
color: Colors.white,
),
),```
Fixed problem textfield was hidden by keyboard
new Scaffold(
appBar: new AppBar(
...
resizeToAvoidBottomPadding: true,
....

How to make a Card lies between Body in flutter

Anybody how to do the layout similar to the image? I am having difficulty on the CardView and it position is lies between the body. I am still consider quite new to Flutter, having some difficulty in UI part. Full code is as below:
Widget build(BuildContext context) {
return Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(45.0),
child: AppBar(
automaticallyImplyLeading: false,
elevation: 0.0,
centerTitle: true,
backgroundColor: Color(0xFFED2849),
leading: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
margin: const EdgeInsets.only(left: 8.0),
child: GestureDetector(
onTap: (){
Navigator.of(context).pop(null);
},
child: Image.asset('assets/ic_user_title_back.png', width: 12.0, height: 12.0,),
),
),
],
),
title: Center(
child: Container(
child: Text(
'账号中心',
style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 14),
),
),
),
actions: <Widget>[
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
child: GestureDetector(
onTap: (){
//logout
},
child: Text(
'退出登陆',
style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 11),
),
),
),
],
),
)
],
)
),
body: SafeArea(
top: false,
child: Material(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
color: Color(0xFFED2849),
),
),
Expanded(
flex: 7,
child: Container(
color: Color(0xFFF1F1F1),
),
)
],
),
),
)
);
}
You can do this using Stack
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Stack(
// fit: StackFit.expand,
children: [
Column(
children: [
Expanded(
flex: 3,
child : Container(color: Colors.red)
),
Expanded(
flex: 7,
child: Container(
color : Colors.white)
)
]
),
Positioned(
top: MediaQuery.of(context).size.height * 0.2,
left: 20,
right: 20,
child:Card(
child: Padding(
padding : const EdgeInsets.all(16),
child: Text("Your Text here", ),
),)
)
],
)
Try using Stack() it will allow you to overlap several children in a simple way.

Column/Scrollview not showing after i made a fixed bottom bar

Apparently i tried to make a bottom button for checkout and it seems to be affecting how the body of the app is working. This only happened after i added the bottomnavbar padding etc
heres the link for the snip: https://imgur.com/a/sDhqasr
class _State extends State<CartOverviewScreen> {
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Your Cart'),
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Center(child: Text('HI!'),)
],
),
),
bottomNavigationBar: Padding(
padding: EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Card(
margin: EdgeInsets.all(15),
child: Padding(
padding: EdgeInsets.all(8),
child: Row(
children: <Widget>[
Text(
'Total',
style: TextStyle(
fontSize: 20,
),
),
SizedBox(width: 10,),
Chip(label: Text('\$0.00'),)
],
),
),
),
ButtonTheme(
minWidth: double.infinity,
child: RaisedButton(
elevation: 8,
onPressed: () {},
color: colorCustom,
textColor: Colors.white,
child: Text('Checkout'),
),
),
],
),
),
);
}
}
you can also try this
class _State extends State<stat> {
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Your Cart'),
),
body: Column(
children: <Widget>[
Expanded(
child: Center(
child: Text("Hi"),
),
)
],
),
bottomNavigationBar: Padding(
padding: EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Card(
margin: EdgeInsets.all(15),
child: Padding(
padding: EdgeInsets.all(8),
child: Row(
children: <Widget>[
Text(
'Total',
style: TextStyle(
fontSize: 20,
),
),
SizedBox(
width: 10,
),
Chip(
label: Text('\$0.00'),
)
],
),
),
),
ButtonTheme(
minWidth: double.infinity,
child: RaisedButton(
elevation: 8,
onPressed: () {},
color: Colors.red,
textColor: Colors.white,
child: Text('Checkout'),
),
),
],
),
),
);
}
}
Ahh i found my own answer actually, the problem was caused by bottomNavigationBar hogging the entire body of the app. i just needed to place the following code from below onto the bottomNavigationBar Column.
mainAxisSize: MainAxisSize.min

Layout in list tile - flutter

Current output:
Expected output:
Code:
SizedBox(
width: 380,
height: 180,
child: Swiper(
itemCount: items.length,
itemBuilder: (context, index) {
return Column(
children: <Widget>[
Expanded(
child: Card(
child: ListTile(
title: Text(
'${items[index].title}',
),
subtitle: Text(
'${items[index].body}',
),
trailing: Column(
children: <Widget>[
CircleAvatar(
backgroundColor: HexColor("#0087a8"),
child: IconButton(
icon: Icon(Icons.add),
],
),
),
),
)
],
);
},
viewportFraction: 0.8,
scale: 0.9,
control: SwiperControl(color: Colors.white),
),
);
I am unable to create the icon button to be that way. As when i put in padding, it says that the pixels overflowed. I need to get the add button on the bottom right hand side.
As already pointed out, you shouldn't use a ListTile for this, as you want to use more than just a title, subtitle for your content.
The reason I've picked a Stack over a Column here, is that it allows you to safely use it in different size screens whilst assuring the view won't overflow. With Column, it would use the button diameter as the whole space to use (vertically), even though it is restrict to the right side of the box.
I believe this is what you're looking for.
class MyListTile extends StatelessWidget {
const MyListTile({
Key key,
}) : super(key: key);
#override
Widget build(BuildContext context) {
return Container(
height: 180.0,
color: const Color(0xff0087a8),
child: Container(
padding: const EdgeInsets.all(20.0),
margin: const EdgeInsets.all(10.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
color: const Color.fromRGBO(19, 12, 117, 1.0),
),
child: Stack(
children: <Widget>[
Text(
'EUR - USD',
style: Theme.of(context).textTheme.display2.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
Align(
alignment: Alignment.centerLeft,
child: Text(
'Forex',
style: TextStyle(color: Colors.white, fontSize: 20.0),
),
),
Align(
alignment: Alignment.bottomRight,
child: FloatingActionButton(
backgroundColor: const Color(0xff0087a8),
onPressed: () {},
child: Icon(
Icons.add,
color: Colors.white,
size: 50.0,
),
),
)
],
),
),
);
}
}
Try this code
Container(
height: 180,
width: double.infinity,
child: Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'EUR/USD',
style: TextStyle(fontSize: 40),
),
Text('FOREX', style: TextStyle(fontSize: 20)),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
CircleAvatar(
backgroundColor: Colors.blueAccent,
child: IconButton(
onPressed: () {
print('On Pressed');
},
icon: Icon(Icons.add),
)),
],
)
],
),
),
),
)
Use custom widget for list item OR column from below code for single view. To align left and right you have to put your view in 'Align' as in below -
class _ItemsState extends State<Items> {
#override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
body: SizedBox(
width: 380,
height: 160,
child: Card(
child: ListView.builder(
itemCount: 1,
itemBuilder: (context, index) {
return
Padding(padding: EdgeInsets.all(10.0),child: Column(children: <Widget>[
Align(
alignment: Alignment.centerLeft,
child: Column(children: <Widget>[
Text(
'title',
style: TextStyle(fontSize: 20.0 , fontWeight: FontWeight.bold,),
),
Text(
'body',
style: TextStyle(fontSize: 14.0), )
]),
),
Align(
alignment: Alignment.centerRight,
child: CircleAvatar(
maxRadius: 20.0,
backgroundColor: Colors.blueGrey,
child: IconButton(
icon: Icon(Icons.add,
color: Colors.white,),
))
)
]));
}))));
}
}