You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the regular theme instance, we are able to provide our own ThemeData to material app in the format:
theme:ThemeData(),
darkTheme:ThemeData()
Similarly, we can provide the BatThemeData to the Batcave in the format:
theme:BatThemeData(),
darkTheme:BatThemeData()
However, since all properties of BatThemeData are required, one has to provide them. The ideal way is to keep these properties null and copy them with defaults internally. However, this means one has to do a null check while calling properties from BatThemeData which isn't desirable. While the defaults might be returned, there should be no null checks. The flutter framework achieves this by doing:
This means no null checks in calling the extensions; however, that doesn't remove the null check on the properties.
Expected behaviour
We should be able to define the theme in the form:
theme:BatThemeData(),
darkTheme:BatThemeData()
We should be able to call properties in the form BatThemeData.of(context).colors.primary as we currently do meaning no breaking change should be expected.
The text was updated successfully, but these errors were encountered:
Overview
With the regular theme instance, we are able to provide our own ThemeData to material app in the format:
Similarly, we can provide the BatThemeData to the Batcave in the format:
However, since all properties of BatThemeData are required, one has to provide them. The ideal way is to keep these properties null and copy them with defaults internally. However, this means one has to do a null check while calling properties from BatThemeData which isn't desirable. While the defaults might be returned, there should be no null checks. The flutter framework achieves this by doing:
which will always return a ThemeData instance. For us in the BatCave, we have done:
This means no null checks in calling the extensions; however, that doesn't remove the null check on the properties.
Expected behaviour
We should be able to define the theme in the form:
We should be able to call properties in the form
BatThemeData.of(context).colors.primary
as we currently do meaning no breaking change should be expected.The text was updated successfully, but these errors were encountered: