Compare commits
No commits in common. "a613292095b785d106cfcdfbdada2ff163028b9b" and "d914b8bcaedf964b184a7e3da80cf1c5469729cb" have entirely different histories.
a613292095
...
d914b8bcae
|
|
@ -76,14 +76,15 @@ class _AddFormState extends State<AddForm> {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
textInputAction: TextInputAction.next,
|
onFieldSubmitted: (value) {
|
||||||
onFieldSubmitted: (value) =>
|
if (_formKey.currentState!.validate()) {
|
||||||
_formKey.currentState!.validate(),
|
FocusScope.of(context).requestFocus(_TemplateFocusNode);
|
||||||
|
}
|
||||||
|
},
|
||||||
decoration: const InputDecoration(labelText: 'Label')),
|
decoration: const InputDecoration(labelText: 'Label')),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
decoration:
|
decoration:
|
||||||
const InputDecoration(labelText: 'Description(optional)'),
|
const InputDecoration(labelText: 'Description(optional)'),
|
||||||
textInputAction: TextInputAction.next,
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
_listDesc = value;
|
_listDesc = value;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,6 @@ class _MainListPageState extends State<MainListPage> {
|
||||||
int _selectedPage = data.Page.lists.index;
|
int _selectedPage = data.Page.lists.index;
|
||||||
List<data.List> lists = [];
|
List<data.List> lists = [];
|
||||||
|
|
||||||
final double _marginHorizontal = 10;
|
|
||||||
final double _cardSpacing = 4;
|
|
||||||
|
|
||||||
Future<void> _loadData(data.Page listType) async {
|
Future<void> _loadData(data.Page listType) async {
|
||||||
lists.clear();
|
lists.clear();
|
||||||
var res = await DBHelper.dbHelper.getAllLists(listType);
|
var res = await DBHelper.dbHelper.getAllLists(listType);
|
||||||
|
|
@ -69,9 +66,6 @@ class _MainListPageState extends State<MainListPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final EdgeInsets cardMargin =
|
|
||||||
EdgeInsets.symmetric(vertical: _cardSpacing, horizontal: 0);
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(widget.title),
|
title: Text(widget.title),
|
||||||
|
|
@ -89,9 +83,7 @@ class _MainListPageState extends State<MainListPage> {
|
||||||
tooltip: 'Add List',
|
tooltip: 'Add List',
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
),
|
),
|
||||||
body: Container(
|
body: RefreshIndicator(
|
||||||
padding: EdgeInsets.symmetric(horizontal: _marginHorizontal),
|
|
||||||
child: RefreshIndicator(
|
|
||||||
onRefresh: () => _loadData(data.Page.values[_selectedPage]),
|
onRefresh: () => _loadData(data.Page.values[_selectedPage]),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
itemCount: lists.length,
|
itemCount: lists.length,
|
||||||
|
|
@ -100,7 +92,6 @@ class _MainListPageState extends State<MainListPage> {
|
||||||
direction: DismissDirection.startToEnd,
|
direction: DismissDirection.startToEnd,
|
||||||
key: Key(lists[index].id.toString()),
|
key: Key(lists[index].id.toString()),
|
||||||
background: Card(
|
background: Card(
|
||||||
margin: cardMargin,
|
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: const [
|
children: const [
|
||||||
|
|
@ -146,7 +137,6 @@ class _MainListPageState extends State<MainListPage> {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Card(
|
child: Card(
|
||||||
margin: cardMargin,
|
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
|
|
@ -162,7 +152,7 @@ class _MainListPageState extends State<MainListPage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}))),
|
})),
|
||||||
bottomNavigationBar: BottomNavigationBar(
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
elevation: 4,
|
elevation: 4,
|
||||||
currentIndex: _selectedPage,
|
currentIndex: _selectedPage,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue