Trivial style nits (#8042)
This commit is contained in:
parent
00cbdb3800
commit
473b67ef19
@ -26,34 +26,34 @@ void handleOnDismissed(DismissDirection direction, int item) {
|
|||||||
Widget buildTest({ double startToEndThreshold }) {
|
Widget buildTest({ double startToEndThreshold }) {
|
||||||
Widget buildDismissableItem(int item) {
|
Widget buildDismissableItem(int item) {
|
||||||
return new Dismissable(
|
return new Dismissable(
|
||||||
key: new ValueKey<int>(item),
|
key: new ValueKey<int>(item),
|
||||||
direction: dismissDirection,
|
direction: dismissDirection,
|
||||||
onDismissed: (DismissDirection direction) {
|
onDismissed: (DismissDirection direction) {
|
||||||
handleOnDismissed(direction, item);
|
handleOnDismissed(direction, item);
|
||||||
},
|
},
|
||||||
onResize: () {
|
onResize: () {
|
||||||
handleOnResize(item);
|
handleOnResize(item);
|
||||||
},
|
},
|
||||||
background: background,
|
background: background,
|
||||||
dismissThresholds: startToEndThreshold == null
|
dismissThresholds: startToEndThreshold == null
|
||||||
? <DismissDirection, double>{}
|
? <DismissDirection, double>{}
|
||||||
: <DismissDirection, double>{DismissDirection.startToEnd: startToEndThreshold},
|
: <DismissDirection, double>{DismissDirection.startToEnd: startToEndThreshold},
|
||||||
child: new Container(
|
child: new Container(
|
||||||
width: itemExtent,
|
width: itemExtent,
|
||||||
height: itemExtent,
|
height: itemExtent,
|
||||||
child: new Text(item.toString())
|
child: new Text(item.toString())
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Container(
|
return new Container(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
child: new ScrollableList(
|
child: new ScrollableList(
|
||||||
scrollDirection: scrollDirection,
|
scrollDirection: scrollDirection,
|
||||||
itemExtent: itemExtent,
|
itemExtent: itemExtent,
|
||||||
children: <int>[0, 1, 2, 3, 4]
|
children: <int>[0, 1, 2, 3, 4]
|
||||||
.where((int i) => !dismissedItems.contains(i))
|
.where((int i) => !dismissedItems.contains(i))
|
||||||
.map(buildDismissableItem)
|
.map(buildDismissableItem),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -124,8 +124,8 @@ class Test1215DismissableWidget extends StatelessWidget {
|
|||||||
key: new ObjectKey(text),
|
key: new ObjectKey(text),
|
||||||
child: new AspectRatio(
|
child: new AspectRatio(
|
||||||
aspectRatio: 1.0,
|
aspectRatio: 1.0,
|
||||||
child: new Text(this.text)
|
child: new Text(this.text),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -293,10 +293,10 @@ void main() {
|
|||||||
child: new Column(
|
child: new Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
new Test1215DismissableWidget('1'),
|
new Test1215DismissableWidget('1'),
|
||||||
new Test1215DismissableWidget('2')
|
new Test1215DismissableWidget('2'),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
));
|
));
|
||||||
expect(find.text('1'), findsOneWidget);
|
expect(find.text('1'), findsOneWidget);
|
||||||
expect(find.text('2'), findsOneWidget);
|
expect(find.text('2'), findsOneWidget);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user