Skip to content

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

Closed

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.".

Activity

  1. tirth-patel-nc commented on Jul 11, 2025

    @tirth-patel-nc
    Member

    hi @ahmedsameha1, thanks for the report. labelling it as a docs proposal. you're welcome to submit a PR if you'd like.

  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    engineflutter/engine related. See also e: labels.
    d: api docsIssues with https://api.flutter.dev/
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Jul 11, 2025
  3. ahmedsameha1 commented on Jul 11, 2025

    @ahmedsameha1
    ContributorAuthor

    Ok, I will create a PR to fix this.

  4. added
    P3Issues that are less important to the Flutter project
    on Jul 15, 2025
  5. added a commit that references this issue on Jul 17, 2025
    de0efff
  6. added a commit that references this issue on Jul 28, 2025
    14bc373
  7. github-actions commented on Jul 31, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Jul 31, 2025
  9. added a commit that references this issue on Aug 19, 2025
    8872989
  10. added a commit that references this issue on Sep 18, 2025
    2b1bdb4
  11. added a commit that references this issue on Nov 21, 2025
    a81167d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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