Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnosticable properties #555

Open
jpnurmi opened this issue Jan 20, 2023 · 5 comments
Open

Diagnosticable properties #555

jpnurmi opened this issue Jan 20, 2023 · 5 comments
Assignees
Labels
development enhancement New feature or request

Comments

@jpnurmi
Copy link
Member

jpnurmi commented Jan 20, 2023

Implement Diagnosticable.debugFillProperties for all widgets to allow inspecting property values in dev tools.

@Jupi007
Copy link
Member

Jupi007 commented Jan 20, 2023

I am wrong, or it is like this that we could merge the tree of a YaruCheckbox, with its RepaintBoundary, CustomPainter, etc. into just a YaruCheckbox?

@jpnurmi
Copy link
Member Author

jpnurmi commented Jan 20, 2023

For example, the Material Switch:

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties.add(FlagProperty('value', value: value, ifTrue: 'on', ifFalse: 'off', showName: true));
    properties.add(ObjectFlagProperty<ValueChanged<bool>>('onChanged', onChanged, ifNull: 'disabled'));
  }

This makes it possible to see the value at runtime in dev tools:

Material Yaru
image image

@jpnurmi
Copy link
Member Author

jpnurmi commented Jan 20, 2023

There's probably some special handling for Material widgets in dev tools so I'm not sure if we can make it appear as nice, but we can certainly make the value appear under the state if we use the diagnosticable mixin and implement the properties.

@Jupi007
Copy link
Member

Jupi007 commented Jan 20, 2023

Okay great 👍

@jpnurmi
Copy link
Member Author

jpnurmi commented Jan 20, 2023

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants