Add a static function to Material UI widgets exposing internal default values
### Is there an existing issue for this? - [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues) - [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports) ### Use case When making custom widgets, it is often useful to use default values from standard Material UI widgets as default fall-back values for the custom widget from its equivalent standard version's theme properties. Doing that currently involves looking up the correct fallback value for such properties from its corresponding standard Material UI Widget **in the source code from its private classes** that implement these default values, and then add them as hard coded own constants for its own M2 and/or M3 mode values. It would be very useful if we could access the private default values contained in Material UI component class files. They are typically found at the end of every UI widget having the name structure `_ComponentDefaultsM2` and `_ComponentDefaultsM3`, where `Component` is the name of the Material UI widget in question. Before Material3 was added, the UI widget default values where spread all over Widget build methods. Getting access to them was not feasible and even finding the default values was very difficult. However, the Material3 addition/migration cleaned up all this and extracted the default values into own private classes that the Material UI widgets access to get their defaults from. It would thus now easily be possible and
Posted by rydmike on Jul 7, 2023, 1:38 PM
Tags
Related issues
- This is the biggest problem with contracts, there's simply no way to actually say "please always execute this check".
- I don't disagree with you on this, I worked my whole life in corporate and haven't worked as a OSS maintainer before, though I will _and ...
- the new VSCode UI, looks cute, i don't like it.
- I've been working on my own private harness for the past 8 months, and I've been collecting ideas from such repos I've stumbled upon.
- The way AI is able to interact with outside resources is pretty impressive, but the quality of code it produces to me is still questionab...
- Add PR-style review comments in Git Diff UI that feed into the active agent thread
Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments
ux (Software)
This is the biggest problem with contracts, there's simply no way to actually say "please always execute this check".
I don't disagree with you on this, I worked my whole life in corporate and haven't worked as a OSS maintainer before, though I will _and ...
the new VSCode UI, looks cute, i don't like it.
I've been working on my own private harness for the past 8 months, and I've been collecting ideas from such repos I've stumbled upon.
The way AI is able to interact with outside resources is pretty impressive, but the quality of code it produces to me is still questionab...
Add PR-style review comments in Git Diff UI that feed into the active agent thread
Thanks for indulging me so far, by the way, I really appreciate this discussion, it's very stimulating.
Migrate GDScript to the GDExtension mechanism and overhaul the implementation
Add a static function to Material UI widgets exposing internal default values
### Is there an existing issue for this? - [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues) - [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports) ### Use case When making custom widgets, it is often useful to use default values from standard Material UI widgets as default fall-back values for the custom widget from its equivalent standard version's theme properties. Doing that currently involves looking up the correct fallback value for such properties from its corresponding standard Material UI Widget **in the source code from its private classes** that implement these default values, and then add them as hard coded own constants for its own M2 and/or M3 mode values. It would be very useful if we could access the private default values contained in Material UI component class files. They are typically found at the end of every UI widget having the name structure `_ComponentDefaultsM2` and `_ComponentDefaultsM3`, where `Component` is the name of the Material UI widget in question. Before Material3 was added, the UI widget default values where spread all over Widget build methods. Getting access to them was not feasible and even finding the default values was very difficult. However, the Material3 addition/migration cleaned up all this and extracted the default values into own private classes that the Material UI widgets access to get their defaults from. It would thus now easily be possible and
Comments (0)
No comments yet. Start the discussion.