I’m making my project with flutter, and used ListTile Widget, and set icons in ListTile’s leading.
but It only locates in center.. I used Align, Center, Container decoration and so on.
problems
here’s the code
ListTile(
horizontalTitleGap: 10,
leading: Align(
alignment: Alignment.topCenter,
child: CircleAvatar(child: FaIcon(FontAwesomeIcons.dog, size:28, color: Colors.white), backgroundColor: Color(0xffB8CCA3)),
),
title: Text(" ${messages[index].nickname}", textAlign: TextAlign.left, style: TextStyle(fontSize:14)),
subtitle: Align(
alignment: Alignment.centerLeft,
child: Container(
margin : const EdgeInsets.only(bottom:5),
padding: const EdgeInsets.fromLTRB(15, 5, 15, 5),
constraints: BoxConstraints(
maxWidth:320
),
decoration: BoxDecoration(
color: Color(0xffe9ecef),
borderRadius: BorderRadius.circular(20),
),
child: Text(messages[index].message, textAlign: TextAlign.left, style: TextStyle(fontSize: 17))
),
)
);
I want to make my Icon locates next to nickname like image
result