Use Border
with the bottom
argument.
Container(
decoration: BoxDecoration(
Border(
bottom: BorderSide(width: 1.5, color: Colors.grey[300]),
),
),
child: ListTile(
title: Text(title),
subtitle: Text(score + dateFormatted),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(amount),
Checkbox(
value: false,
activeColor: Colors.green,
onChanged: (bool newValue) {}),
],
),
),
);
better to use ListView.separator
constructor
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(debugShowCheckedModeBanner: false, home: Home()));
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) => Scaffold(body: Demo());
}
class Demo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView.separated(
itemCount: 42,
separatorBuilder: (_, __) => Container(height: 1.5, color: Colors.grey[300]),
itemBuilder: (context, index) {
return ListTile(
title: Text('item $index'),
);
},
);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.