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

All of ThemeData's factory constructor parameters should be required to be non-null #66060

Open
HansMuller opened this issue Sep 17, 2020 · 1 comment
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@HansMuller
Copy link
Contributor

HansMuller commented Sep 17, 2020

Because having a few needless exceptions is confusing and likely due to historical accident not design.

Of the 73 ThemeData.raw() parameters, buttonColor, applyElevationOverlayColor, and cupertinoOverrideTheme are not required to be non-null.

@HansMuller HansMuller added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Sep 17, 2020
@markusaksli-nc
Copy link
Member

Currently the only two remaining properties that are not required to be non-null are cupertinoOverrideTheme and androidOverscrollIndicator. androidOverscrollIndicator defaults to AndroidOverscrollIndicator.glow so it seemed like it wouldn't be that hard to change but I ran into a failing test because of this null dependent behavior

final AndroidOverscrollIndicator indicator = _androidOverscrollIndicator
?? Theme.of(context).androidOverscrollIndicator
?? androidOverscrollIndicator;

It seems like this can be circumvented by allowing the ScrollBehavior.androidOverscrollIndicator to be null instead of the ThemeData property but not sure if this would result in a breaking change.

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-design Owned by Design Languages team triaged-design Triaged by Design Languages team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
Development

No branches or pull requests

4 participants