Commit 03a0cd25 authored by Landon Woerdeman's avatar Landon Woerdeman Committed by Hans Muller

Make full-screen dialog text editable in gallery (#13690) (#15732)

Make the full-screen dialog text editable in gallery (#13690)
parent 254c45e4
...@@ -106,8 +106,12 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -106,8 +106,12 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
DateTime _toDateTime = new DateTime.now(); DateTime _toDateTime = new DateTime.now();
bool _allDayValue = false; bool _allDayValue = false;
bool _saveNeeded = false; bool _saveNeeded = false;
bool _hasLocation = false;
bool _hasName = false;
String _eventName;
Future<bool> _onWillPop() async { Future<bool> _onWillPop() async {
_saveNeeded = _hasLocation || _hasName || _saveNeeded;
if (!_saveNeeded) if (!_saveNeeded)
return true; return true;
...@@ -147,7 +151,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -147,7 +151,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
return new Scaffold( return new Scaffold(
appBar: new AppBar( appBar: new AppBar(
title: const Text('New event'), title: new Text(_hasName ? _eventName : 'Event Name TBD'),
actions: <Widget> [ actions: <Widget> [
new FlatButton( new FlatButton(
child: new Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)), child: new Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)),
...@@ -164,19 +168,38 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -164,19 +168,38 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
children: <Widget>[ children: <Widget>[
new Container( new Container(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
),
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: new Text('Event name', style: theme.textTheme.display2) child: new TextField(
decoration: const InputDecoration(
labelText: 'Event name',
filled: true
),
style: theme.textTheme.headline,
onChanged: (String value) {
setState(() {
_hasName = value.isNotEmpty;
if (_hasName) {
_eventName = value;
}
});
}
)
), ),
new Container( new Container(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
decoration: new BoxDecoration(
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
),
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: new Text('Location', style: theme.textTheme.title.copyWith(color: Colors.black54)) child: new TextField(
decoration: const InputDecoration(
labelText: 'Location',
hintText: 'Where is the event?',
filled: true
),
onChanged: (String value) {
setState(() {
_hasLocation = value.isNotEmpty;
});
}
)
), ),
new Column( new Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment