forked from firka/flutter
remove noop primitive operations (#82297)
This commit is contained in:
committed by
GitHub
parent
c9fe3bab9b
commit
c03e7488b4
@@ -453,7 +453,6 @@ Future<ProcessResult> _resultOfGradleTask({String workingDirectory, String task,
|
||||
' Arguments: ${args.join(' ')}\n'
|
||||
' Working directory: $workingDirectory\n'
|
||||
' JAVA_HOME: $javaHome\n'
|
||||
''
|
||||
);
|
||||
return Process.run(
|
||||
gradle,
|
||||
|
||||
@@ -99,7 +99,7 @@ class _HomeState extends State<Home> {
|
||||
min: 0.0,
|
||||
max: 1024.0,
|
||||
value: seed.toDouble(),
|
||||
label: '${seed.round()}',
|
||||
label: '$seed',
|
||||
divisions: 1025,
|
||||
onChanged: (double value) {
|
||||
setState(() {
|
||||
|
||||
@@ -1152,7 +1152,7 @@ class DialogRoute<T> extends RawDialogRoute<T> {
|
||||
}
|
||||
|
||||
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,
|
||||
// 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)!;
|
||||
|
||||
@@ -924,7 +924,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
|
||||
|
||||
if (extendBody) {
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
@@ -423,8 +423,8 @@ class _IndicatorPainter extends CustomPainter {
|
||||
final double index = controller.index.toDouble();
|
||||
final double value = controller.animation!.value;
|
||||
final bool ltr = index > value;
|
||||
final int from = (ltr ? value.floor() : value.ceil()).clamp(0, maxTabIndex).toInt();
|
||||
final int to = (ltr ? from + 1 : from - 1).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);
|
||||
final Rect fromRect = indicatorRect(size, from);
|
||||
final Rect toRect = indicatorRect(size, to);
|
||||
_currentRect = Rect.lerp(fromRect, toRect, (value - from).abs());
|
||||
|
||||
@@ -2273,8 +2273,8 @@ class VisualDensity with Diagnosticable {
|
||||
BoxConstraints effectiveConstraints(BoxConstraints constraints){
|
||||
assert(constraints != null && constraints.debugAssertIsValid());
|
||||
return constraints.copyWith(
|
||||
minWidth: (constraints.minWidth + baseSizeAdjustment.dx).clamp(0.0, double.infinity).toDouble(),
|
||||
minHeight: (constraints.minHeight + baseSizeAdjustment.dy).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),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -691,7 +691,7 @@ class InteractiveViewer extends StatefulWidget {
|
||||
// the point.
|
||||
final Vector3 l1P = point - 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,7 @@ void main() {
|
||||
equalsIgnoringHashCodes(
|
||||
'Directionality-[GlobalKey#00000](textDirection: ltr)\n'
|
||||
'└Builder(dependencies: [Directionality-[GlobalKey#00000]])\n'
|
||||
' └SizedBox(renderObject: RenderConstrainedBox#00000)\n'
|
||||
'',
|
||||
' └SizedBox(renderObject: RenderConstrainedBox#00000)\n',
|
||||
),
|
||||
);
|
||||
|
||||
@@ -41,8 +40,7 @@ void main() {
|
||||
equalsIgnoringHashCodes(
|
||||
'Directionality-[GlobalKey#00000](textDirection: rtl)\n'
|
||||
'└Builder(dependencies: [Directionality-[GlobalKey#00000]])\n'
|
||||
' └SizedBox(renderObject: RenderConstrainedBox#00000)\n'
|
||||
'',
|
||||
' └SizedBox(renderObject: RenderConstrainedBox#00000)\n',
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -2537,8 +2537,7 @@ void main() {
|
||||
' - NavigatorState#00000(tickers: tracking 1 ticker)\n'
|
||||
' Please create a HeroControllerScope for each Navigator or use a\n'
|
||||
' HeroControllerScope.none to prevent subtree from receiving a\n'
|
||||
' HeroController.\n'
|
||||
'',
|
||||
' HeroController.\n',
|
||||
),
|
||||
);
|
||||
});
|
||||
@@ -2640,8 +2639,7 @@ void main() {
|
||||
equalsIgnoringHashCodes(
|
||||
'FlutterError\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() {
|
||||
'FlutterError\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'
|
||||
' instead.\n'
|
||||
'',
|
||||
' instead.\n',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -957,8 +957,7 @@ abstract class WidgetController {
|
||||
'The hit test result at that offset is: $result\n'
|
||||
'${StackTrace.current}'
|
||||
'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 {
|
||||
final Digest digest = await digests.stream.last;
|
||||
final String rawDigest = base64.encode(digest.bytes);
|
||||
if (rawDigest != md5Hash) {
|
||||
throw Exception(''
|
||||
throw Exception(
|
||||
'Expected $url to have md5 checksum $md5Hash, but was $rawDigest. This '
|
||||
'may indicate a problem with your connection to the Flutter backend servers. '
|
||||
'Please re-try the download after confirming that your network connection is '
|
||||
|
||||
@@ -516,7 +516,6 @@ void main() {
|
||||
'\n'
|
||||
'! Doctor found issues in 4\n'
|
||||
' categories.\n'
|
||||
''
|
||||
));
|
||||
}, overrides: <Type, Generator>{
|
||||
Platform: _kNoColorOutputPlatform,
|
||||
@@ -563,7 +562,6 @@ void main() {
|
||||
'\n'
|
||||
'! Doctor found issues in 4\n'
|
||||
' categories.\n'
|
||||
''
|
||||
));
|
||||
}, overrides: <Type, Generator>{
|
||||
Platform: _kNoColorOutputPlatform,
|
||||
|
||||
@@ -280,7 +280,6 @@ void main() {
|
||||
' (entrypoint.main as _NullaryFunction)();\n'
|
||||
' }\n'
|
||||
'}\n'
|
||||
''
|
||||
),
|
||||
);
|
||||
});
|
||||
@@ -418,7 +417,6 @@ void main() {
|
||||
' (entrypoint.main as _NullaryFunction)();\n'
|
||||
' }\n'
|
||||
'}\n'
|
||||
''
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -731,8 +731,7 @@ void main() {
|
||||
' } else {\n'
|
||||
' (entrypoint.main as _NullaryFunction)();\n'
|
||||
' }\n'
|
||||
'}\n'
|
||||
'',
|
||||
'}\n',
|
||||
);
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
|
||||
@@ -437,7 +437,6 @@ dependencies:
|
||||
'plugin-a=${pluginA.path}/\n'
|
||||
'plugin-b=${pluginB.path}/\n'
|
||||
'plugin-c=${pluginC.path}/\n'
|
||||
''
|
||||
);
|
||||
|
||||
final String pluginsString = flutterProject.flutterPluginsDependenciesFile.readAsStringSync();
|
||||
|
||||
Reference in New Issue
Block a user