Skip to content

IOSSystemContextMenuItem should use Diagnosticable instead of toString #169696

@justinmc

Description

@justinmc

Subclasses of IOSSystemContextMenu have custom toString methods, e.g.:

String toString() {
return 'IOSSystemContextMenuItemShare(title: $title)';
}

In cases like these, we should instead prefer Diagnosticable and debugFillProperties. This integrates with devtools and provides structured, consistent output.

See the styleguide: https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#override-tostring

This came up in #169150 (comment).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions