Unverified Commit bd1921ec authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

unnecessary parenthesis (#14533)

parent a37a8424
...@@ -153,11 +153,11 @@ Press play to produce texture frames.'''; ...@@ -153,11 +153,11 @@ Press play to produce texture frames.''';
], ],
), ),
), ),
floatingActionButton: (_icon == null ? null : new FloatingActionButton( floatingActionButton: _icon == null ? null : new FloatingActionButton(
key: const ValueKey<String>('fab'), key: const ValueKey<String>('fab'),
child: new Icon(_icon), child: new Icon(_icon),
onPressed: _nextState, onPressed: _nextState,
)), ),
), ),
); );
} }
......
...@@ -399,7 +399,7 @@ class _VideoDemoState extends State<VideoDemo> ...@@ -399,7 +399,7 @@ class _VideoDemoState extends State<VideoDemo>
appBar: new AppBar( appBar: new AppBar(
title: const Text('Videos'), title: const Text('Videos'),
), ),
body: (isSupported) body: isSupported
? new ConnectivityOverlay( ? new ConnectivityOverlay(
child: new ListView( child: new ListView(
children: <Widget>[ children: <Widget>[
......
...@@ -109,7 +109,7 @@ class GestureDemoState extends State<GestureDemo> { ...@@ -109,7 +109,7 @@ class GestureDemoState extends State<GestureDemo> {
void _handleScaleUpdate(ScaleUpdateDetails details) { void _handleScaleUpdate(ScaleUpdateDetails details) {
setState(() { setState(() {
_zoom = (_previousZoom * details.scale); _zoom = _previousZoom * details.scale;
// Ensure that item under the focal point stays in the same place despite zooming // Ensure that item under the focal point stays in the same place despite zooming
final Offset normalizedOffset = (_startingFocalPoint - _previousOffset) / _previousZoom; final Offset normalizedOffset = (_startingFocalPoint - _previousOffset) / _previousZoom;
......
...@@ -117,7 +117,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> { ...@@ -117,7 +117,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
// 0.0 -> Expanded // 0.0 -> Expanded
// 1.0 -> Collapsed to toolbar // 1.0 -> Collapsed to toolbar
final double t = (1.0 - (settings.currentExtent - settings.minExtent) / (deltaExtent)).clamp(0.0, 1.0); final double t = (1.0 - (settings.currentExtent - settings.minExtent) / deltaExtent).clamp(0.0, 1.0);
// background image // background image
if (widget.background != null) { if (widget.background != null) {
......
...@@ -225,7 +225,7 @@ class ColorSwatch<T> extends Color { ...@@ -225,7 +225,7 @@ class ColorSwatch<T> extends Color {
if (other.runtimeType != runtimeType) if (other.runtimeType != runtimeType)
return false; return false;
final ColorSwatch<T> typedOther = other; final ColorSwatch<T> typedOther = other;
return super==(other) && _swatch == typedOther._swatch; return super == other && _swatch == typedOther._swatch;
} }
@override @override
......
...@@ -285,16 +285,16 @@ void main() { ...@@ -285,16 +285,16 @@ void main() {
Color textColor(Key key) => tester.state<TestTextState>(find.byKey(key)).textStyle.color; Color textColor(Key key) => tester.state<TestTextState>(find.byKey(key)).textStyle.color;
// A selected ListTile's leading, trailing, and text get the primary color by default // A selected ListTile's leading, trailing, and text get the primary color by default
await(tester.pumpWidget(buildFrame(selected: true))); await tester.pumpWidget(buildFrame(selected: true));
await(tester.pump(const Duration(milliseconds: 300))); // DefaultTextStyle changes animate await tester.pump(const Duration(milliseconds: 300)); // DefaultTextStyle changes animate
expect(iconColor(leadingKey), theme.primaryColor); expect(iconColor(leadingKey), theme.primaryColor);
expect(iconColor(trailingKey), theme.primaryColor); expect(iconColor(trailingKey), theme.primaryColor);
expect(textColor(titleKey), theme.primaryColor); expect(textColor(titleKey), theme.primaryColor);
expect(textColor(subtitleKey), theme.primaryColor); expect(textColor(subtitleKey), theme.primaryColor);
// A selected ListTile's leading, trailing, and text get the ListTileTheme's selectedColor // A selected ListTile's leading, trailing, and text get the ListTileTheme's selectedColor
await(tester.pumpWidget(buildFrame(selected: true, selectedColor: green))); await tester.pumpWidget(buildFrame(selected: true, selectedColor: green));
await(tester.pump(const Duration(milliseconds: 300))); // DefaultTextStyle changes animate await tester.pump(const Duration(milliseconds: 300)); // DefaultTextStyle changes animate
expect(iconColor(leadingKey), green); expect(iconColor(leadingKey), green);
expect(iconColor(trailingKey), green); expect(iconColor(trailingKey), green);
expect(textColor(titleKey), green); expect(textColor(titleKey), green);
...@@ -302,16 +302,16 @@ void main() { ...@@ -302,16 +302,16 @@ void main() {
// An unselected ListTile's leading and trailing get the ListTileTheme's iconColor // An unselected ListTile's leading and trailing get the ListTileTheme's iconColor
// An unselected ListTile's title texts get the ListTileTheme's textColor // An unselected ListTile's title texts get the ListTileTheme's textColor
await(tester.pumpWidget(buildFrame(iconColor: red, textColor: green))); await tester.pumpWidget(buildFrame(iconColor: red, textColor: green));
await(tester.pump(const Duration(milliseconds: 300))); // DefaultTextStyle changes animate await tester.pump(const Duration(milliseconds: 300)); // DefaultTextStyle changes animate
expect(iconColor(leadingKey), red); expect(iconColor(leadingKey), red);
expect(iconColor(trailingKey), red); expect(iconColor(trailingKey), red);
expect(textColor(titleKey), green); expect(textColor(titleKey), green);
expect(textColor(subtitleKey), green); expect(textColor(subtitleKey), green);
// If the item is disabled it's rendered with the theme's disabled color. // If the item is disabled it's rendered with the theme's disabled color.
await(tester.pumpWidget(buildFrame(enabled: false))); await tester.pumpWidget(buildFrame(enabled: false));
await(tester.pump(const Duration(milliseconds: 300))); // DefaultTextStyle changes animate await tester.pump(const Duration(milliseconds: 300)); // DefaultTextStyle changes animate
expect(iconColor(leadingKey), theme.disabledColor); expect(iconColor(leadingKey), theme.disabledColor);
expect(iconColor(trailingKey), theme.disabledColor); expect(iconColor(trailingKey), theme.disabledColor);
expect(textColor(titleKey), theme.disabledColor); expect(textColor(titleKey), theme.disabledColor);
...@@ -319,8 +319,8 @@ void main() { ...@@ -319,8 +319,8 @@ void main() {
// If the item is disabled it's rendered with the theme's disabled color. // If the item is disabled it's rendered with the theme's disabled color.
// Even if it's selected. // Even if it's selected.
await(tester.pumpWidget(buildFrame(enabled: false, selected: true))); await tester.pumpWidget(buildFrame(enabled: false, selected: true));
await(tester.pump(const Duration(milliseconds: 300))); // DefaultTextStyle changes animate await tester.pump(const Duration(milliseconds: 300)); // DefaultTextStyle changes animate
expect(iconColor(leadingKey), theme.disabledColor); expect(iconColor(leadingKey), theme.disabledColor);
expect(iconColor(trailingKey), theme.disabledColor); expect(iconColor(trailingKey), theme.disabledColor);
expect(textColor(titleKey), theme.disabledColor); expect(textColor(titleKey), theme.disabledColor);
......
...@@ -1332,11 +1332,11 @@ void main() { ...@@ -1332,11 +1332,11 @@ void main() {
// A fling in the TabBar or TabBarView, shouldn't do anything. // A fling in the TabBar or TabBarView, shouldn't do anything.
await(tester.fling(find.byType(TabBar), const Offset(-100.0, 0.0), 5000.0)); await tester.fling(find.byType(TabBar), const Offset(-100.0, 0.0), 5000.0);
await(tester.pumpAndSettle()); await tester.pumpAndSettle();
await(tester.fling(find.byType(TabBarView), const Offset(100.0, 0.0), 5000.0)); await tester.fling(find.byType(TabBarView), const Offset(100.0, 0.0), 5000.0);
await(tester.pumpAndSettle()); await tester.pumpAndSettle();
expect(controller.index, 0); expect(controller.index, 0);
}); });
...@@ -1378,17 +1378,17 @@ void main() { ...@@ -1378,17 +1378,17 @@ void main() {
// A fling in the TabBar or TabBarView, shouldn't move the tab. // A fling in the TabBar or TabBarView, shouldn't move the tab.
await(tester.fling(find.byType(TabBar), const Offset(-100.0, 0.0), 5000.0)); await tester.fling(find.byType(TabBar), const Offset(-100.0, 0.0), 5000.0);
await(tester.pump(const Duration(milliseconds: 50))); await tester.pump(const Duration(milliseconds: 50));
expect(tester.getTopLeft(find.widgetWithText(Tab, 'TAB')).dx, 0); expect(tester.getTopLeft(find.widgetWithText(Tab, 'TAB')).dx, 0);
expect(tester.getTopRight(find.widgetWithText(Tab, 'TAB')).dx, 800); expect(tester.getTopRight(find.widgetWithText(Tab, 'TAB')).dx, 800);
await(tester.pumpAndSettle()); await tester.pumpAndSettle();
await(tester.fling(find.byType(TabBarView), const Offset(100.0, 0.0), 5000.0)); await tester.fling(find.byType(TabBarView), const Offset(100.0, 0.0), 5000.0);
await(tester.pump(const Duration(milliseconds: 50))); await tester.pump(const Duration(milliseconds: 50));
expect(tester.getTopLeft(find.widgetWithText(Tab, 'TAB')).dx, 0); expect(tester.getTopLeft(find.widgetWithText(Tab, 'TAB')).dx, 0);
expect(tester.getTopRight(find.widgetWithText(Tab, 'TAB')).dx, 800); expect(tester.getTopRight(find.widgetWithText(Tab, 'TAB')).dx, 800);
await(tester.pumpAndSettle()); await tester.pumpAndSettle();
expect(controller.index, 0); expect(controller.index, 0);
expect(find.text('TAB'), findsOneWidget); expect(find.text('TAB'), findsOneWidget);
......
...@@ -758,7 +758,7 @@ void main() { ...@@ -758,7 +758,7 @@ void main() {
// Scroll the target upwards by 25 pixels. The Hero flight's Y coordinate // Scroll the target upwards by 25 pixels. The Hero flight's Y coordinate
// will be redirected from 100 to 75. // will be redirected from 100 to 75.
await(tester.drag(find.byKey(routeContainerKey), const Offset(0.0, -25.0))); await tester.drag(find.byKey(routeContainerKey), const Offset(0.0, -25.0));
await tester.pump(); await tester.pump();
await tester.pump(const Duration(milliseconds: 10)); await tester.pump(const Duration(milliseconds: 10));
final double yAt110ms = tester.getTopLeft(find.byKey(routeHeroKey)).dy; final double yAt110ms = tester.getTopLeft(find.byKey(routeHeroKey)).dy;
...@@ -833,7 +833,7 @@ void main() { ...@@ -833,7 +833,7 @@ void main() {
expect(yAt100ms, lessThan(200.0)); expect(yAt100ms, lessThan(200.0));
expect(yAt100ms, greaterThan(100.0)); expect(yAt100ms, greaterThan(100.0));
await(tester.drag(find.byKey(routeContainerKey), const Offset(0.0, -400.0))); await tester.drag(find.byKey(routeContainerKey), const Offset(0.0, -400.0));
await tester.pump(); await tester.pump();
await tester.pump(const Duration(milliseconds: 10)); await tester.pump(const Duration(milliseconds: 10));
expect(find.byKey(routeContainerKey), findsNothing); // Scrolled off the top expect(find.byKey(routeContainerKey), findsNothing); // Scrolled off the top
......
...@@ -229,7 +229,7 @@ void main() { ...@@ -229,7 +229,7 @@ void main() {
// Fully expand the appbar by scrolling (no animation) to 0.0. // Fully expand the appbar by scrolling (no animation) to 0.0.
controller.jumpTo(0.0); controller.jumpTo(0.0);
await(tester.pumpAndSettle()); await tester.pumpAndSettle();
expect(scrollOffset, 0.0); expect(scrollOffset, 0.0);
expect(tester.renderObject<RenderBox>(find.byType(AppBar)).size.height, 200.0); expect(tester.renderObject<RenderBox>(find.byType(AppBar)).size.height, 200.0);
...@@ -291,12 +291,12 @@ void main() { ...@@ -291,12 +291,12 @@ void main() {
// A scroll collapses Page0's appbar to 150.0. // A scroll collapses Page0's appbar to 150.0.
controller.jumpTo(50.0); controller.jumpTo(50.0);
await(tester.pumpAndSettle()); await tester.pumpAndSettle();
expect(tester.renderObject<RenderBox>(find.byType(AppBar)).size.height, 150.0); expect(tester.renderObject<RenderBox>(find.byType(AppBar)).size.height, 150.0);
// Fling to Page1. Page1's appbar height is the same as the appbar for Page0. // Fling to Page1. Page1's appbar height is the same as the appbar for Page0.
await tester.fling(find.text('Page0'), const Offset(-100.0, 0.0), 10000.0); await tester.fling(find.text('Page0'), const Offset(-100.0, 0.0), 10000.0);
await(tester.pumpAndSettle()); await tester.pumpAndSettle();
expect(find.text('Page0'), findsNothing); expect(find.text('Page0'), findsNothing);
expect(find.text('Page1'), findsOneWidget); expect(find.text('Page1'), findsOneWidget);
expect(find.text('Page2'), findsNothing); expect(find.text('Page2'), findsNothing);
...@@ -305,10 +305,10 @@ void main() { ...@@ -305,10 +305,10 @@ void main() {
// Expand Page1's appbar and then fling to Page2. Page2's appbar appears // Expand Page1's appbar and then fling to Page2. Page2's appbar appears
// fully expanded. // fully expanded.
controller.jumpTo(0.0); controller.jumpTo(0.0);
await(tester.pumpAndSettle()); await tester.pumpAndSettle();
expect(tester.renderObject<RenderBox>(find.byType(AppBar)).size.height, 200.0); expect(tester.renderObject<RenderBox>(find.byType(AppBar)).size.height, 200.0);
await tester.fling(find.text('Page1'), const Offset(-100.0, 0.0), 10000.0); await tester.fling(find.text('Page1'), const Offset(-100.0, 0.0), 10000.0);
await(tester.pumpAndSettle()); await tester.pumpAndSettle();
expect(find.text('Page0'), findsNothing); expect(find.text('Page0'), findsNothing);
expect(find.text('Page1'), findsNothing); expect(find.text('Page1'), findsNothing);
expect(find.text('Page2'), findsOneWidget); expect(find.text('Page2'), findsOneWidget);
......
...@@ -37,10 +37,10 @@ void main() { ...@@ -37,10 +37,10 @@ void main() {
expect(find.text('Page2-Item1'), findsNothing); expect(find.text('Page2-Item1'), findsNothing);
controller.jumpTo(listItemHeight + 10); controller.jumpTo(listItemHeight + 10);
await (tester.pumpAndSettle()); await tester.pumpAndSettle();
await tester.fling(find.text('Page0-Item1'), const Offset(-100.0, 0.0), 10000.0); await tester.fling(find.text('Page0-Item1'), const Offset(-100.0, 0.0), 10000.0);
await (tester.pumpAndSettle()); await tester.pumpAndSettle();
expect(find.text('Page0-Item1'), findsNothing); expect(find.text('Page0-Item1'), findsNothing);
expect(find.text('Page1-Item1'), findsOneWidget); expect(find.text('Page1-Item1'), findsOneWidget);
...@@ -48,7 +48,7 @@ void main() { ...@@ -48,7 +48,7 @@ void main() {
expect(find.text('Page2-Item1'), findsNothing); expect(find.text('Page2-Item1'), findsNothing);
await tester.fling(find.text('Page1-Item1'), const Offset(-100.0, 0.0), 10000.0); await tester.fling(find.text('Page1-Item1'), const Offset(-100.0, 0.0), 10000.0);
await (tester.pumpAndSettle()); await tester.pumpAndSettle();
expect(find.text('Page0-Item1'), findsNothing); expect(find.text('Page0-Item1'), findsNothing);
expect(find.text('Page1-Item1'), findsNothing); expect(find.text('Page1-Item1'), findsNothing);
......
...@@ -274,8 +274,8 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -274,8 +274,8 @@ Future<XcodeBuildResult> buildXcodeProject({
appIosDir: appDirectory, appIosDir: appDirectory,
iosEngineDir: flutterFrameworkDir(buildInfo.mode), iosEngineDir: flutterFrameworkDir(buildInfo.mode),
isSwift: app.isSwift, isSwift: app.isSwift,
pluginOrFlutterPodChanged: (injectPluginsResult.hasChanged pluginOrFlutterPodChanged: injectPluginsResult.hasChanged
|| previousGeneratedXcconfig != currentGeneratedXcconfig), || previousGeneratedXcconfig != currentGeneratedXcconfig,
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment