I am trying to show inline widgets like Circle Avatar, Text widget with some texts and icons. Below is the code I have written but when i run output is not inline.
I am expecting like this
Photo ---> Text ----> Text with Icon
---> More Text ---> Text
Currently, i am getting like this.
Photo
Text
Text with Icon
More Text
Text
Here is the code.
If showdata is true then it will show another set of widget and if its false then differnt set.
Widget buildList1(BuildContext context, int index) {
return InkWell(
onTap: () {
String tag = lists[index].tag ;
print(tag);
// navigateToFollowing(following, id, index);
},
child: (showdata) ?
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: Colors.white,
),
width: double.infinity,
height: (showdata) ? 70 : 180,
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 30),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 40),
child:
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Trending Posts ",
style: TextStyle(
color: primary, fontSize: 12, letterSpacing: .3)),
Text(
'#' + lists[index].tag,
style: TextStyle(
color: primary,
fontWeight: FontWeight.bold,
fontSize: 18),
),
Text(
lists[index].count + ", Posts ",
style: TextStyle(
color: primary, fontSize: 13, letterSpacing: .3)),
]
),
),
],
),
)
:
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: Colors.white,
),
width: double.infinity,
height: (showdata) ? 70 : 180,
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 30),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 40),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children:
<Widget>[
//Posts
Container(
width: 70,
height: 70,
margin: EdgeInsets.only(top:5, right: 5, bottom: 5),
child: CircleAvatar(
radius: 50,
backgroundColor: Color(0xff476cfb),
child: ClipOval(
child: Image.network(
searchlists[index].profilePhoto,
fit: BoxFit.fill,
),
),
),
),
Expanded(
child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
searchlists[index].name,
style: TextStyle(
color: primary,
fontWeight: FontWeight.bold,
fontSize: 18),
),
SizedBox(
height: 6,
),
Row(
children: <Widget>[
Icon(
Icons.location_on,
color: secondary,
size: 20,
),
SizedBox(
width: 5,
),
Text(
"Last Seen on -" + searchlists[index].lastLogin,
style: TextStyle(
color: primary, fontSize: 13, letterSpacing: .3)),
],
),
SizedBox(
height: 6,
),
Row(
children: <Widget>[
Icon(
Icons.timer,
color: secondary,
size: 20,
),
SizedBox(
width: 5,
),
Text(
searchlists[index].registrationDate ,
style: TextStyle(
color: primary, fontSize: 13, letterSpacing: .3)),
],
),
],
),
),
],
),
),
],
),
),
);
}