Make Demos in flutter_gallery more accessible (#10832)
Remaining known issues are #10831 and #10830.
diff --git a/examples/flutter_gallery/lib/demo/contacts_demo.dart b/examples/flutter_gallery/lib/demo/contacts_demo.dart
index 3cd4831..9f7cfb9 100644
--- a/examples/flutter_gallery/lib/demo/contacts_demo.dart
+++ b/examples/flutter_gallery/lib/demo/contacts_demo.dart
@@ -70,12 +70,14 @@
)
));
}
- return new Padding(
- padding: const EdgeInsets.symmetric(vertical: 16.0),
- child: new Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: rowChildren
- )
+ return new MergeSemantics(
+ child: new Padding(
+ padding: const EdgeInsets.symmetric(vertical: 16.0),
+ child: new Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: rowChildren
+ )
+ ),
);
}
}
diff --git a/examples/flutter_gallery/lib/demo/pesto_demo.dart b/examples/flutter_gallery/lib/demo/pesto_demo.dart
index b56232a..8bb0809 100644
--- a/examples/flutter_gallery/lib/demo/pesto_demo.dart
+++ b/examples/flutter_gallery/lib/demo/pesto_demo.dart
@@ -246,41 +246,43 @@
@override
Widget build(BuildContext context) {
- return new GestureDetector(
- onTap: onTap,
- child: new Card(
- child: new Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- new Hero(
- tag: recipe.imagePath,
- child: new Image.asset(recipe.imagePath, fit: BoxFit.contain)
- ),
- new Expanded(
- child: new Row(
- children: <Widget>[
- new Padding(
- padding: const EdgeInsets.all(16.0),
- child: new Image.asset(
- recipe.ingredientsImagePath,
- width: 48.0,
- height: 48.0,
- ),
- ),
- new Expanded(
- child: new Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- new Text(recipe.name, style: titleStyle, softWrap: false, overflow: TextOverflow.ellipsis),
- new Text(recipe.author, style: authorStyle),
- ],
- ),
- ),
- ],
+ return new MergeSemantics(
+ child: new GestureDetector(
+ onTap: onTap,
+ child: new Card(
+ child: new Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: <Widget>[
+ new Hero(
+ tag: recipe.imagePath,
+ child: new Image.asset(recipe.imagePath, fit: BoxFit.contain)
),
- ),
- ],
+ new Expanded(
+ child: new Row(
+ children: <Widget>[
+ new Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: new Image.asset(
+ recipe.ingredientsImagePath,
+ width: 48.0,
+ height: 48.0,
+ ),
+ ),
+ new Expanded(
+ child: new Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: <Widget>[
+ new Text(recipe.name, style: titleStyle, softWrap: false, overflow: TextOverflow.ellipsis),
+ new Text(recipe.author, style: authorStyle),
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
),
),
);
diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
index 4383bed..cca75cc 100644
--- a/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
+++ b/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
@@ -252,39 +252,41 @@
Widget build(BuildContext context) {
final Size screenSize = MediaQuery.of(context).size;
final ShrineTheme theme = ShrineTheme.of(context);
- return new SizedBox(
- height: screenSize.width > screenSize.height
- ? (screenSize.height - kToolbarHeight) * 0.85
- : (screenSize.height - kToolbarHeight) * 0.70,
- child: new Container(
- decoration: new BoxDecoration(
- color: theme.cardBackgroundColor,
- border: new Border(bottom: new BorderSide(color: theme.dividerColor)),
- ),
- child: new CustomMultiChildLayout(
- delegate: new _HeadingLayout(),
- children: <Widget>[
- new LayoutId(
- id: _HeadingLayout.price,
- child: new _FeaturePriceItem(product: product),
- ),
- new LayoutId(
- id: _HeadingLayout.image,
- child: new Image.asset(product.imageAsset, fit: BoxFit.cover),
- ),
- new LayoutId(
- id: _HeadingLayout.title,
- child: new Text(product.featureTitle, style: theme.featureTitleStyle),
- ),
- new LayoutId(
- id: _HeadingLayout.description,
- child: new Text(product.featureDescription, style: theme.featureStyle),
- ),
- new LayoutId(
- id: _HeadingLayout.vendor,
- child: new _VendorItem(vendor: product.vendor),
- ),
- ],
+ return new MergeSemantics(
+ child: new SizedBox(
+ height: screenSize.width > screenSize.height
+ ? (screenSize.height - kToolbarHeight) * 0.85
+ : (screenSize.height - kToolbarHeight) * 0.70,
+ child: new Container(
+ decoration: new BoxDecoration(
+ color: theme.cardBackgroundColor,
+ border: new Border(bottom: new BorderSide(color: theme.dividerColor)),
+ ),
+ child: new CustomMultiChildLayout(
+ delegate: new _HeadingLayout(),
+ children: <Widget>[
+ new LayoutId(
+ id: _HeadingLayout.price,
+ child: new _FeaturePriceItem(product: product),
+ ),
+ new LayoutId(
+ id: _HeadingLayout.image,
+ child: new Image.asset(product.imageAsset, fit: BoxFit.cover),
+ ),
+ new LayoutId(
+ id: _HeadingLayout.title,
+ child: new Text(product.featureTitle, style: theme.featureTitleStyle),
+ ),
+ new LayoutId(
+ id: _HeadingLayout.description,
+ child: new Text(product.featureDescription, style: theme.featureStyle),
+ ),
+ new LayoutId(
+ id: _HeadingLayout.vendor,
+ child: new _VendorItem(vendor: product.vendor),
+ ),
+ ],
+ ),
),
),
);
@@ -303,35 +305,37 @@
@override
Widget build(BuildContext context) {
- return new Card(
- child: new Stack(
- children: <Widget>[
- new Column(
- children: <Widget>[
- new Align(
- alignment: FractionalOffset.centerRight,
- child: new _ProductPriceItem(product: product),
- ),
- new Container(
- width: 144.0,
- height: 144.0,
- padding: const EdgeInsets.symmetric(horizontal: 8.0),
- child: new Hero(
- tag: product.tag,
- child: new Image.asset(product.imageAsset, fit: BoxFit.contain),
- ),
+ return new MergeSemantics(
+ child: new Card(
+ child: new Stack(
+ children: <Widget>[
+ new Column(
+ children: <Widget>[
+ new Align(
+ alignment: FractionalOffset.centerRight,
+ child: new _ProductPriceItem(product: product),
),
- new Padding(
- padding: const EdgeInsets.symmetric(horizontal: 8.0),
- child: new _VendorItem(vendor: product.vendor),
- ),
- ],
- ),
- new Material(
- type: MaterialType.transparency,
- child: new InkWell(onTap: onPressed),
- ),
- ],
+ new Container(
+ width: 144.0,
+ height: 144.0,
+ padding: const EdgeInsets.symmetric(horizontal: 8.0),
+ child: new Hero(
+ tag: product.tag,
+ child: new Image.asset(product.imageAsset, fit: BoxFit.contain),
+ ),
+ ),
+ new Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8.0),
+ child: new _VendorItem(vendor: product.vendor),
+ ),
+ ],
+ ),
+ new Material(
+ type: MaterialType.transparency,
+ child: new InkWell(onTap: onPressed),
+ ),
+ ],
+ ),
),
);
}