Unverified Commit 5654bfe8 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Remove duplicated dart:ui imports (#130606)

Small clean up. A file probably doesn't need multiple way to refer to dart:ui concepts.
parent 3132b3a7
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
library material_animated_icons; library material_animated_icons;
import 'dart:math' as math show pi; import 'dart:math' as math show pi;
import 'dart:ui' as ui show Canvas, Paint, Path; import 'dart:ui' as ui show Canvas, Paint, Path, lerpDouble;
import 'dart:ui' show lerpDouble;
import 'package:flutter/foundation.dart' show clampDouble; import 'package:flutter/foundation.dart' show clampDouble;
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
......
...@@ -196,7 +196,7 @@ class _PathFrames { ...@@ -196,7 +196,7 @@ class _PathFrames {
final List<double> opacities; final List<double> opacities;
void paint(ui.Canvas canvas, Color color, _UiPathFactory uiPathFactory, double progress) { void paint(ui.Canvas canvas, Color color, _UiPathFactory uiPathFactory, double progress) {
final double opacity = _interpolate<double?>(opacities, progress, lerpDouble)!; final double opacity = _interpolate<double?>(opacities, progress, ui.lerpDouble)!;
final ui.Paint paint = ui.Paint() final ui.Paint paint = ui.Paint()
..style = PaintingStyle.fill ..style = PaintingStyle.fill
..color = color.withOpacity(color.opacity * opacity); ..color = color.withOpacity(color.opacity * opacity);
...@@ -293,7 +293,7 @@ T _interpolate<T>(List<T> values, double progress, _Interpolator<T> interpolator ...@@ -293,7 +293,7 @@ T _interpolate<T>(List<T> values, double progress, _Interpolator<T> interpolator
if (values.length == 1) { if (values.length == 1) {
return values[0]; return values[0];
} }
final double targetIdx = lerpDouble(0, values.length -1, progress)!; final double targetIdx = ui.lerpDouble(0, values.length -1, progress)!;
final int lowIdx = targetIdx.floor(); final int lowIdx = targetIdx.floor();
final int highIdx = targetIdx.ceil(); final int highIdx = targetIdx.ceil();
final double t = targetIdx - lowIdx; final double t = targetIdx - lowIdx;
......
...@@ -6,8 +6,6 @@ import 'dart:async'; ...@@ -6,8 +6,6 @@ import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'dart:math' as math; import 'dart:math' as math;
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'dart:ui' show Locale, Size, TextDirection;
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -54,7 +52,7 @@ class ImageConfiguration { ...@@ -54,7 +52,7 @@ class ImageConfiguration {
ImageConfiguration copyWith({ ImageConfiguration copyWith({
AssetBundle? bundle, AssetBundle? bundle,
double? devicePixelRatio, double? devicePixelRatio,
Locale? locale, ui.Locale? locale,
TextDirection? textDirection, TextDirection? textDirection,
Size? size, Size? size,
TargetPlatform? platform, TargetPlatform? platform,
...@@ -77,7 +75,7 @@ class ImageConfiguration { ...@@ -77,7 +75,7 @@ class ImageConfiguration {
final double? devicePixelRatio; final double? devicePixelRatio;
/// The language and region for which to select the image. /// The language and region for which to select the image.
final Locale? locale; final ui.Locale? locale;
/// The reading direction of the language for which to select the image. /// The reading direction of the language for which to select the image.
final TextDirection? textDirection; final TextDirection? textDirection;
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:math' as math; import 'dart:math' as math;
import 'dart:ui' as ui; import 'dart:ui' show Offset, Rect, SemanticsAction, SemanticsFlag, SemanticsUpdate, SemanticsUpdateBuilder, StringAttribute, TextDirection;
import 'dart:ui' show Offset, Rect, SemanticsAction, SemanticsFlag, StringAttribute, TextDirection;
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
...@@ -52,7 +51,7 @@ typedef SemanticsActionHandler = void Function(Object? args); ...@@ -52,7 +51,7 @@ typedef SemanticsActionHandler = void Function(Object? args);
/// Signature for a function that receives a semantics update and returns no result. /// Signature for a function that receives a semantics update and returns no result.
/// ///
/// Used by [SemanticsOwner.onSemanticsUpdate]. /// Used by [SemanticsOwner.onSemanticsUpdate].
typedef SemanticsUpdateCallback = void Function(ui.SemanticsUpdate update); typedef SemanticsUpdateCallback = void Function(SemanticsUpdate update);
/// Signature for the [SemanticsConfiguration.childConfigurationsDelegate]. /// Signature for the [SemanticsConfiguration.childConfigurationsDelegate].
/// ///
...@@ -2668,7 +2667,7 @@ class SemanticsNode with DiagnosticableTreeMixin { ...@@ -2668,7 +2667,7 @@ class SemanticsNode with DiagnosticableTreeMixin {
static final Int32List _kEmptyCustomSemanticsActionsList = Int32List(0); static final Int32List _kEmptyCustomSemanticsActionsList = Int32List(0);
static final Float64List _kIdentityTransform = _initIdentityTransform(); static final Float64List _kIdentityTransform = _initIdentityTransform();
void _addToUpdate(ui.SemanticsUpdateBuilder builder, Set<int> customSemanticsActionIdsUpdate) { void _addToUpdate(SemanticsUpdateBuilder builder, Set<int> customSemanticsActionIdsUpdate) {
assert(_dirty); assert(_dirty);
final SemanticsData data = getSemanticsData(); final SemanticsData data = getSemanticsData();
final Int32List childrenInTraversalOrder; final Int32List childrenInTraversalOrder;
...@@ -3288,7 +3287,7 @@ class SemanticsOwner extends ChangeNotifier { ...@@ -3288,7 +3287,7 @@ class SemanticsOwner extends ChangeNotifier {
} }
} }
visitedNodes.sort((SemanticsNode a, SemanticsNode b) => a.depth - b.depth); visitedNodes.sort((SemanticsNode a, SemanticsNode b) => a.depth - b.depth);
final ui.SemanticsUpdateBuilder builder = SemanticsBinding.instance.createSemanticsUpdateBuilder(); final SemanticsUpdateBuilder builder = SemanticsBinding.instance.createSemanticsUpdateBuilder();
for (final SemanticsNode node in visitedNodes) { for (final SemanticsNode node in visitedNodes) {
assert(node.parent?._dirty != true); // could be null (no parent) or false (not dirty) assert(node.parent?._dirty != true); // could be null (no parent) or false (not dirty)
// The _serialize() method marks the node as not dirty, and // The _serialize() method marks the node as not dirty, and
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
library material_animated_icons; library material_animated_icons;
import 'dart:math' as math show pi; import 'dart:math' as math show pi;
import 'dart:ui' show Offset, lerpDouble; import 'dart:ui' as ui show Canvas, Paint, Path, lerpDouble;
import 'dart:ui' as ui show Canvas, Paint, Path;
import 'package:flutter/foundation.dart' show clampDouble; import 'package:flutter/foundation.dart' show clampDouble;
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
......
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