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:
@@ -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),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user