Skip to content

Conversation

@gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Oct 8, 2020

Description

This changes the TextTheme values for themes to all be non-nullable instead of nullable. The constructor allows for either the legacy names or the new names to be used, but in the end, because of asserts, one or the other of them must be defined. Because of that, it's allowable to provide a default-constructed TextStyle as a fallback if both are null (which can't happen), so that the values can all be non-nullable.

Tests

  • Updated tests to not test for nullability of these themes.

@gspencergoog gspencergoog added the framework flutter/packages/flutter repository. See also f: labels. label Oct 8, 2020
@flutter-dashboard flutter-dashboard bot added the f: material design flutter/packages/flutter/material repository. label Oct 8, 2020
@google-cla google-cla bot added the cla: yes label Oct 8, 2020
@gspencergoog gspencergoog changed the title Base style nonnullable Make TextTheme attributes non-nullable. Oct 8, 2020
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change in this PR: all the others are just cascading changes from this.

@gspencergoog gspencergoog force-pushed the base_style_nonnullable branch from 23eaf76 to d32f9ac Compare October 8, 2020 20:43
@gspencergoog gspencergoog changed the title Make TextTheme attributes non-nullable. Make TextTheme attributes non-nullable. Oct 8, 2020
@gspencergoog gspencergoog force-pushed the base_style_nonnullable branch from d32f9ac to 3a63f3c Compare October 8, 2020 20:44
@gspencergoog
Copy link
Contributor Author

Actually, the asserts that I thought protected this change, don't actually do what I thought they did, so this is actually changing the way themes work. We can try again to make it non-nullable once we remove the deprecated APIs.

Closing this.

@bernaferrari
Copy link
Contributor

@gspencergoog they have been removed now.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants