Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions lib/ui/geometry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ abstract class OffsetBase {
///
/// The first argument sets the horizontal component, and the second the
/// vertical component.
const OffsetBase(this._dx, this._dy);
const OffsetBase(double dx, double dy)
: _dx = dx ?? 0.0,
_dy = dy ?? 0.0,
assert(dx != null),
assert(dy != null);

final double _dx;
final double _dy;
Expand Down Expand Up @@ -615,11 +619,15 @@ class Size extends OffsetBase {
class Rect {
/// Construct a rectangle from its left, top, right, and bottom edges.
@pragma('vm:entry-point')
const Rect.fromLTRB(this.left, this.top, this.right, this.bottom)
: assert(left != null),
assert(top != null),
assert(right != null),
assert(bottom != null);
const Rect.fromLTRB(double left, double top, double right, double bottom)
: left = left ?? 0.0,
right = right ?? 0.0,
top = top ?? 0.0,
bottom = bottom ?? 0.0,
assert(left != null),
assert(top != null),
assert(right != null),
assert(bottom != null);

/// Construct a rectangle from its left and top edges, its width, and its
/// height.
Expand Down
3 changes: 2 additions & 1 deletion lib/web_ui/lib/src/ui/geometry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ abstract class OffsetBase {
///
/// The first argument sets the horizontal component, and the second the
/// vertical component.
const OffsetBase(this._dx, this._dy);
const OffsetBase(double dx, double dy)
: _dx = dx, _dy = dy;

final double _dx;
final double _dy;
Expand Down