Add SimpleDialogOption (#7494)

The demo of the SimpleDialog had some useful code that should really be part of
the framework. This patch extracts it into a SimpleDialogOption widget.

Remove debugCheckHasScaffold because it is unused.

Also, add tests for InkWell, SimpleDialog, and other widgets.
This commit is contained in:
Adam Barth
2017-01-13 23:26:05 -08:00
committed by GitHub
parent 3b702448fd
commit ad27fcd3dc
9 changed files with 214 additions and 66 deletions

View File

@@ -29,22 +29,19 @@ class DialogDemoItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new InkWell(
onTap: onPressed,
child: new Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 24.0),
child: new Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
new Icon(icon, size: 36.0, color: color),
new Padding(
padding: const EdgeInsets.only(left: 16.0),
child: new Text(text)
)
]
)
)
return new SimpleDialogOption(
onPressed: onPressed,
child: new Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
new Icon(icon, size: 36.0, color: color),
new Padding(
padding: const EdgeInsets.only(left: 16.0),
child: new Text(text),
),
],
),
);
}
}