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

remove noop primitive operations (#82297)

parent c9fe3bab
...@@ -453,7 +453,6 @@ Future<ProcessResult> _resultOfGradleTask({String workingDirectory, String task, ...@@ -453,7 +453,6 @@ Future<ProcessResult> _resultOfGradleTask({String workingDirectory, String task,
' Arguments: ${args.join(' ')}\n' ' Arguments: ${args.join(' ')}\n'
' Working directory: $workingDirectory\n' ' Working directory: $workingDirectory\n'
' JAVA_HOME: $javaHome\n' ' JAVA_HOME: $javaHome\n'
''
); );
return Process.run( return Process.run(
gradle, gradle,
......
...@@ -99,7 +99,7 @@ class _HomeState extends State<Home> { ...@@ -99,7 +99,7 @@ class _HomeState extends State<Home> {
min: 0.0, min: 0.0,
max: 1024.0, max: 1024.0,
value: seed.toDouble(), value: seed.toDouble(),
label: '${seed.round()}', label: '$seed',
divisions: 1025, divisions: 1025,
onChanged: (double value) { onChanged: (double value) {
setState(() { setState(() {
......
...@@ -1152,7 +1152,7 @@ class DialogRoute<T> extends RawDialogRoute<T> { ...@@ -1152,7 +1152,7 @@ class DialogRoute<T> extends RawDialogRoute<T> {
} }
double _paddingScaleFactor(double textScaleFactor) { double _paddingScaleFactor(double textScaleFactor) {
final double clampedTextScaleFactor = textScaleFactor.clamp(1.0, 2.0).toDouble(); final double clampedTextScaleFactor = textScaleFactor.clamp(1.0, 2.0);
// The final padding scale factor is clamped between 1/3 and 1. For example, // The final padding scale factor is clamped between 1/3 and 1. For example,
// a non-scaled padding of 24 will produce a padding between 24 and 8. // a non-scaled padding of 24 will produce a padding between 24 and 8.
return lerpDouble(1.0, 1.0 / 3.0, clampedTextScaleFactor - 1.0)!; return lerpDouble(1.0, 1.0 / 3.0, clampedTextScaleFactor - 1.0)!;
......
...@@ -924,7 +924,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate { ...@@ -924,7 +924,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
if (extendBody) { if (extendBody) {
bodyMaxHeight += bottomWidgetsHeight; bodyMaxHeight += bottomWidgetsHeight;
bodyMaxHeight = bodyMaxHeight.clamp(0.0, looseConstraints.maxHeight - contentTop).toDouble(); bodyMaxHeight = bodyMaxHeight.clamp(0.0, looseConstraints.maxHeight - contentTop);
assert(bodyMaxHeight <= math.max(0.0, looseConstraints.maxHeight - contentTop)); assert(bodyMaxHeight <= math.max(0.0, looseConstraints.maxHeight - contentTop));
} }
......
...@@ -423,8 +423,8 @@ class _IndicatorPainter extends CustomPainter { ...@@ -423,8 +423,8 @@ class _IndicatorPainter extends CustomPainter {
final double index = controller.index.toDouble(); final double index = controller.index.toDouble();
final double value = controller.animation!.value; final double value = controller.animation!.value;
final bool ltr = index > value; final bool ltr = index > value;
final int from = (ltr ? value.floor() : value.ceil()).clamp(0, maxTabIndex).toInt(); final int from = (ltr ? value.floor() : value.ceil()).clamp(0, maxTabIndex);
final int to = (ltr ? from + 1 : from - 1).clamp(0, maxTabIndex).toInt(); final int to = (ltr ? from + 1 : from - 1).clamp(0, maxTabIndex);
final Rect fromRect = indicatorRect(size, from); final Rect fromRect = indicatorRect(size, from);
final Rect toRect = indicatorRect(size, to); final Rect toRect = indicatorRect(size, to);
_currentRect = Rect.lerp(fromRect, toRect, (value - from).abs()); _currentRect = Rect.lerp(fromRect, toRect, (value - from).abs());
......
...@@ -2273,8 +2273,8 @@ class VisualDensity with Diagnosticable { ...@@ -2273,8 +2273,8 @@ class VisualDensity with Diagnosticable {
BoxConstraints effectiveConstraints(BoxConstraints constraints){ BoxConstraints effectiveConstraints(BoxConstraints constraints){
assert(constraints != null && constraints.debugAssertIsValid()); assert(constraints != null && constraints.debugAssertIsValid());
return constraints.copyWith( return constraints.copyWith(
minWidth: (constraints.minWidth + baseSizeAdjustment.dx).clamp(0.0, double.infinity).toDouble(), minWidth: (constraints.minWidth + baseSizeAdjustment.dx).clamp(0.0, double.infinity),
minHeight: (constraints.minHeight + baseSizeAdjustment.dy).clamp(0.0, double.infinity).toDouble(), minHeight: (constraints.minHeight + baseSizeAdjustment.dy).clamp(0.0, double.infinity),
); );
} }
......
...@@ -691,7 +691,7 @@ class InteractiveViewer extends StatefulWidget { ...@@ -691,7 +691,7 @@ class InteractiveViewer extends StatefulWidget {
// the point. // the point.
final Vector3 l1P = point - l1; final Vector3 l1P = point - l1;
final Vector3 l1L2 = l2 - l1; final Vector3 l1L2 = l2 - l1;
final double fraction = (l1P.dot(l1L2) / lengthSquared).clamp(0.0, 1.0).toDouble(); final double fraction = (l1P.dot(l1L2) / lengthSquared).clamp(0.0, 1.0);
return l1 + l1L2 * fraction; return l1 + l1L2 * fraction;
} }
......
...@@ -23,8 +23,7 @@ void main() { ...@@ -23,8 +23,7 @@ void main() {
equalsIgnoringHashCodes( equalsIgnoringHashCodes(
'Directionality-[GlobalKey#00000](textDirection: ltr)\n' 'Directionality-[GlobalKey#00000](textDirection: ltr)\n'
'└Builder(dependencies: [Directionality-[GlobalKey#00000]])\n' '└Builder(dependencies: [Directionality-[GlobalKey#00000]])\n'
' └SizedBox(renderObject: RenderConstrainedBox#00000)\n' ' └SizedBox(renderObject: RenderConstrainedBox#00000)\n',
'',
), ),
); );
...@@ -41,8 +40,7 @@ void main() { ...@@ -41,8 +40,7 @@ void main() {
equalsIgnoringHashCodes( equalsIgnoringHashCodes(
'Directionality-[GlobalKey#00000](textDirection: rtl)\n' 'Directionality-[GlobalKey#00000](textDirection: rtl)\n'
'└Builder(dependencies: [Directionality-[GlobalKey#00000]])\n' '└Builder(dependencies: [Directionality-[GlobalKey#00000]])\n'
' └SizedBox(renderObject: RenderConstrainedBox#00000)\n' ' └SizedBox(renderObject: RenderConstrainedBox#00000)\n',
'',
), ),
); );
}); });
......
...@@ -2537,8 +2537,7 @@ void main() { ...@@ -2537,8 +2537,7 @@ void main() {
' - NavigatorState#00000(tickers: tracking 1 ticker)\n' ' - NavigatorState#00000(tickers: tracking 1 ticker)\n'
' Please create a HeroControllerScope for each Navigator or use a\n' ' Please create a HeroControllerScope for each Navigator or use a\n'
' HeroControllerScope.none to prevent subtree from receiving a\n' ' HeroControllerScope.none to prevent subtree from receiving a\n'
' HeroController.\n' ' HeroController.\n',
'',
), ),
); );
}); });
...@@ -2640,8 +2639,7 @@ void main() { ...@@ -2640,8 +2639,7 @@ void main() {
equalsIgnoringHashCodes( equalsIgnoringHashCodes(
'FlutterError\n' 'FlutterError\n'
' The Navigator.onPopPage must be provided to use the\n' ' The Navigator.onPopPage must be provided to use the\n'
' Navigator.pages API\n' ' Navigator.pages API\n',
'',
), ),
); );
}); });
...@@ -2676,8 +2674,7 @@ void main() { ...@@ -2676,8 +2674,7 @@ void main() {
'FlutterError\n' 'FlutterError\n'
' A page-based route should not be added using the imperative api.\n' ' A page-based route should not be added using the imperative api.\n'
' Provide a new list with the corresponding Page to Navigator.pages\n' ' Provide a new list with the corresponding Page to Navigator.pages\n'
' instead.\n' ' instead.\n',
'',
), ),
); );
} }
......
...@@ -957,8 +957,7 @@ abstract class WidgetController { ...@@ -957,8 +957,7 @@ abstract class WidgetController {
'The hit test result at that offset is: $result\n' 'The hit test result at that offset is: $result\n'
'${StackTrace.current}' '${StackTrace.current}'
'To silence this warning, pass "warnIfMissed: false" to "$callee()".\n' 'To silence this warning, pass "warnIfMissed: false" to "$callee()".\n'
'To make this warning fatal, set WidgetController.hitTestWarningShouldBeFatal to true.\n' 'To make this warning fatal, set WidgetController.hitTestWarningShouldBeFatal to true.\n',
''
); );
} }
} }
......
...@@ -1021,7 +1021,7 @@ class ArtifactUpdater { ...@@ -1021,7 +1021,7 @@ class ArtifactUpdater {
final Digest digest = await digests.stream.last; final Digest digest = await digests.stream.last;
final String rawDigest = base64.encode(digest.bytes); final String rawDigest = base64.encode(digest.bytes);
if (rawDigest != md5Hash) { if (rawDigest != md5Hash) {
throw Exception('' throw Exception(
'Expected $url to have md5 checksum $md5Hash, but was $rawDigest. This ' 'Expected $url to have md5 checksum $md5Hash, but was $rawDigest. This '
'may indicate a problem with your connection to the Flutter backend servers. ' 'may indicate a problem with your connection to the Flutter backend servers. '
'Please re-try the download after confirming that your network connection is ' 'Please re-try the download after confirming that your network connection is '
......
...@@ -516,7 +516,6 @@ void main() { ...@@ -516,7 +516,6 @@ void main() {
'\n' '\n'
'! Doctor found issues in 4\n' '! Doctor found issues in 4\n'
' categories.\n' ' categories.\n'
''
)); ));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Platform: _kNoColorOutputPlatform, Platform: _kNoColorOutputPlatform,
...@@ -563,7 +562,6 @@ void main() { ...@@ -563,7 +562,6 @@ void main() {
'\n' '\n'
'! Doctor found issues in 4\n' '! Doctor found issues in 4\n'
' categories.\n' ' categories.\n'
''
)); ));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Platform: _kNoColorOutputPlatform, Platform: _kNoColorOutputPlatform,
......
...@@ -280,7 +280,6 @@ void main() { ...@@ -280,7 +280,6 @@ void main() {
' (entrypoint.main as _NullaryFunction)();\n' ' (entrypoint.main as _NullaryFunction)();\n'
' }\n' ' }\n'
'}\n' '}\n'
''
), ),
); );
}); });
...@@ -418,7 +417,6 @@ void main() { ...@@ -418,7 +417,6 @@ void main() {
' (entrypoint.main as _NullaryFunction)();\n' ' (entrypoint.main as _NullaryFunction)();\n'
' }\n' ' }\n'
'}\n' '}\n'
''
), ),
); );
}); });
......
...@@ -731,8 +731,7 @@ void main() { ...@@ -731,8 +731,7 @@ void main() {
' } else {\n' ' } else {\n'
' (entrypoint.main as _NullaryFunction)();\n' ' (entrypoint.main as _NullaryFunction)();\n'
' }\n' ' }\n'
'}\n' '}\n',
'',
); );
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fs, FileSystem: () => fs,
......
...@@ -437,7 +437,6 @@ dependencies: ...@@ -437,7 +437,6 @@ dependencies:
'plugin-a=${pluginA.path}/\n' 'plugin-a=${pluginA.path}/\n'
'plugin-b=${pluginB.path}/\n' 'plugin-b=${pluginB.path}/\n'
'plugin-c=${pluginC.path}/\n' 'plugin-c=${pluginC.path}/\n'
''
); );
final String pluginsString = flutterProject.flutterPluginsDependenciesFile.readAsStringSync(); final String pluginsString = flutterProject.flutterPluginsDependenciesFile.readAsStringSync();
......
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