modified card and dissmiss padding
This commit is contained in:
parent
b8c49132d7
commit
a613292095
|
|
@ -43,6 +43,9 @@ class _MainListPageState extends State<MainListPage> {
|
|||
int _selectedPage = data.Page.lists.index;
|
||||
List<data.List> lists = [];
|
||||
|
||||
final double _marginHorizontal = 10;
|
||||
final double _cardSpacing = 4;
|
||||
|
||||
Future<void> _loadData(data.Page listType) async {
|
||||
lists.clear();
|
||||
var res = await DBHelper.dbHelper.getAllLists(listType);
|
||||
|
|
@ -66,6 +69,9 @@ class _MainListPageState extends State<MainListPage> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final EdgeInsets cardMargin =
|
||||
EdgeInsets.symmetric(vertical: _cardSpacing, horizontal: 0);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.title),
|
||||
|
|
@ -83,7 +89,9 @@ class _MainListPageState extends State<MainListPage> {
|
|||
tooltip: 'Add List',
|
||||
child: const Icon(Icons.add),
|
||||
),
|
||||
body: RefreshIndicator(
|
||||
body: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: _marginHorizontal),
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () => _loadData(data.Page.values[_selectedPage]),
|
||||
child: ListView.builder(
|
||||
itemCount: lists.length,
|
||||
|
|
@ -92,6 +100,7 @@ class _MainListPageState extends State<MainListPage> {
|
|||
direction: DismissDirection.startToEnd,
|
||||
key: Key(lists[index].id.toString()),
|
||||
background: Card(
|
||||
margin: cardMargin,
|
||||
color: Colors.red,
|
||||
child: Row(
|
||||
children: const [
|
||||
|
|
@ -137,6 +146,7 @@ class _MainListPageState extends State<MainListPage> {
|
|||
});
|
||||
},
|
||||
child: Card(
|
||||
margin: cardMargin,
|
||||
child: ListTile(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
|
|
@ -152,7 +162,7 @@ class _MainListPageState extends State<MainListPage> {
|
|||
),
|
||||
),
|
||||
);
|
||||
})),
|
||||
}))),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
elevation: 4,
|
||||
currentIndex: _selectedPage,
|
||||
|
|
|
|||
Loading…
Reference in New Issue