Skip to content

Size.isEmpty description should be "Whether this size encloses a zero area." #172004

@ahmedsameha1

Description

@ahmedsameha1

In flutter/engine/src/flutter/lib/ui/geometry.dart

  /// Whether this size encloses a non-zero area.
  ///
  /// Negative areas are considered empty.
  bool get isEmpty => width <= 0.0 || height <= 0.0;

When width is <= 0.0, then the result is true. But a size that has a width that is equal to or less than zero is not a "non-zero" area; I think it is a "zero area".
When height is <= 0.0, then the result is true. But a size that has a height that is equal to or less than zero is not a "non-zero" area; I think it is a "zero area".

  /// An empty size, one with a zero width and a zero height.
  static const Size zero = Size(0.0, 0.0);
  print(zero.isEmpty)  // true

So, I think that the correct description should be: "Whether this size encloses a zero area.".

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterd: api docsIssues with https://api.flutter.dev/engineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions