Add an `elevationToShadow` option to override default M3 shadows in `ThemeData`
- Dominant language
- Dart
- Stars
- 179k
- Forks
- 31.1k
- PR merge metrics
- PR metrics pending
Description
### Use case
Design of an app may be built upon M3 widgets, but with different shadows
i.e.
| elevation | y | blur |
|-----------|----|------|
| 1 | 4 | 8 |
| 2 | 6 | 8 |
| 3 | 10 | 10 |
Would look cool:
But at the moment to override all shadows in my app - I need not only to replace all `Card` with `Container`, but also wriggle around `ContextMenu`, `BottomSheet` etc
Now they're just hardcoded here _(since k in constants was good practice)_
https://github.com/flutter/flutter/blob/a0ba2decab156c88708c4261d40660ab8f60da5f/packages/flutter/lib/src/material/shadows.dart#L40
And being used like this
https://github.com/flutter/flutter/blob/a0ba2decab156c88708c4261d40660ab8f60da5f/packages/flutter/lib/src/material/dropdown.dart#L57-L64
### Proposal
My proposal is to add `shadowToElevation` parameter in `ThemeData`
Contributor guide
Assessment
This issue has not been assessed yet.