Advertisement
mitrakov

ListTile own implementation

Jul 22nd, 2020
1,710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.80 KB | None | 0 0
  1. Widget listTile({Widget leading, Widget title, Widget subtitle, GestureTapCallback onTap, contentPadding: EdgeInsetsGeometry}) {
  2.   return Padding(
  3.     padding: contentPadding,
  4.     child: Material(
  5.       color: Colors.white,
  6.       child: InkWell(
  7.         onTap: onTap,
  8.         child: Row(
  9.           children: <Widget>[
  10.             Padding(padding: EdgeInsets.only(right: contentPadding.right), child: leading),
  11.             Expanded(
  12.               child: Column(
  13.                 mainAxisSize: MainAxisSize.min,
  14.                 crossAxisAlignment: CrossAxisAlignment.start,
  15.                 children: <Widget>[
  16.                   title,
  17.                   SizedBox(height: 2),
  18.                   subtitle
  19.                 ],
  20.               ),
  21.             )
  22.           ],
  23.         ),
  24.       ),
  25.     ),
  26.   );
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement