more UI-as-code (#35516)

This commit is contained in:
Alexandre Ardhuin
2019-09-17 16:23:44 +02:00
committed by GitHub
parent d03aecab58
commit df4bf453ab
117 changed files with 1728 additions and 2132 deletions

View File

@@ -179,26 +179,27 @@ class OverlayGeometryAppState extends State<OverlayGeometryApp> {
@override
Widget build(BuildContext context) {
final List<Widget> layers = <Widget>[
Scaffold(
appBar: AppBar(title: const Text('Tap a Card')),
body: Container(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
child: NotificationListener<ScrollNotification>(
onNotification: handleScrollNotification,
child: ListView.custom(
childrenDelegate: CardBuilder(
cardModels: cardModels,
onTapUp: handleTapUp,
return Stack(
children: <Widget>[
Scaffold(
appBar: AppBar(title: const Text('Tap a Card')),
body: Container(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 8.0),
child: NotificationListener<ScrollNotification>(
onNotification: handleScrollNotification,
child: ListView.custom(
childrenDelegate: CardBuilder(
cardModels: cardModels,
onTapUp: handleTapUp,
),
),
),
),
),
),
];
for (MarkerType type in markers.keys)
layers.add(Marker(type: type, position: markers[type]));
return Stack(children: layers);
for (MarkerType type in markers.keys)
Marker(type: type, position: markers[type]),
],
);
}
}

View File

@@ -556,9 +556,6 @@ class _UnderlinesState extends State<Underlines> {
@override
Widget build(BuildContext context) {
final List<Widget> lines = <Widget>[_wrap(null)];
for (TextDecorationStyle style in TextDecorationStyle.values)
lines.add(_wrap(style));
final Size size = MediaQuery.of(context).size;
return Container(
color: Colors.black,
@@ -572,7 +569,10 @@ class _UnderlinesState extends State<Underlines> {
vertical: size.height * 0.1,
),
child: ListBody(
children: lines,
children: <Widget>[
_wrap(null),
for (TextDecorationStyle style in TextDecorationStyle.values) _wrap(style),
],
),
),
),
@@ -647,9 +647,6 @@ class _FallbackState extends State<Fallback> {
@override
Widget build(BuildContext context) {
final List<Widget> lines = <Widget>[];
for (String font in androidFonts)
lines.add(Text(multiScript, style: style.copyWith(fontFamily: font, fontSize: math.exp(_fontSize))));
final Size size = MediaQuery.of(context).size;
return Container(
color: Colors.black,
@@ -666,7 +663,16 @@ class _FallbackState extends State<Fallback> {
),
child: IntrinsicWidth(
child: ListBody(
children: lines,
children: <Widget>[
for (String font in androidFonts)
Text(
multiScript,
style: style.copyWith(
fontFamily: font,
fontSize: math.exp(_fontSize),
),
),
],
),
),
),

View File

@@ -2,7 +2,7 @@ name: manual_tests
environment:
# The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite.
sdk: ">=2.2.0 <3.0.0"
sdk: ">=2.2.2 <3.0.0"
dependencies:
flutter: