Edit list design improvements
This commit is contained in:
parent
cb360f656f
commit
019e6dd6cc
|
@ -1,6 +1,8 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:vikunja_app/global.dart';
|
||||
import 'package:vikunja_app/models/list.dart';
|
||||
import 'package:vikunja_app/theme/button.dart';
|
||||
import 'package:vikunja_app/theme/buttonText.dart';
|
||||
|
||||
class ListEditPage extends StatefulWidget {
|
||||
final TaskList list;
|
||||
|
@ -27,7 +29,7 @@ class _ListEditPageState extends State<ListEditPage> {
|
|||
child: Form(
|
||||
key: _formKey,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.0),
|
||||
|
@ -43,7 +45,10 @@ class _ListEditPageState extends State<ListEditPage> {
|
|||
return null;
|
||||
},
|
||||
decoration:
|
||||
new InputDecoration(labelText: 'Title'),
|
||||
new InputDecoration(
|
||||
labelText: 'Title',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
|
@ -61,32 +66,37 @@ class _ListEditPageState extends State<ListEditPage> {
|
|||
return null;
|
||||
},
|
||||
decoration: new InputDecoration(
|
||||
labelText: 'Description'),
|
||||
labelText: 'Description',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
Builder(
|
||||
builder: (context) => RaisedButton(
|
||||
builder: (context) => Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(vertical: 10.0),
|
||||
onPressed: !_loading
|
||||
? () {
|
||||
if (_formKey.currentState
|
||||
.validate()) {
|
||||
Form.of(context)
|
||||
.save(); // Why does this not work?
|
||||
_saveList(context);
|
||||
} else {
|
||||
print(
|
||||
"sdf"); // TODO: handle error
|
||||
child: FancyButton(
|
||||
onPressed: !_loading
|
||||
? () {
|
||||
if (_formKey.currentState
|
||||
.validate()) {
|
||||
Form.of(context)
|
||||
.save();
|
||||
_saveList(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
: null,
|
||||
child: _loading
|
||||
? CircularProgressIndicator()
|
||||
: Text('Save'),
|
||||
)),
|
||||
])),
|
||||
)));
|
||||
: null,
|
||||
child: _loading
|
||||
? CircularProgressIndicator()
|
||||
: VikunjaButtonText('Save'),
|
||||
)
|
||||
)
|
||||
),
|
||||
])
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
_saveList(BuildContext context) async {
|
||||
|
|
Reference in New Issue