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

Version 7-3-0 #180

Merged
merged 21 commits into from Aug 16, 2023
Merged

Version 7-3-0 #180

merged 21 commits into from Aug 16, 2023

Conversation

rydmike
Copy link
Owner

@rydmike rydmike commented Aug 16, 2023

August 16, 2023

This release uses new features in Material-3 theming that are only available in Flutter 3.13 or later. It thus requires minimum Flutter 3.13.0.

In the next Flutter stable release after 3.13, Flutter will change the ThemeData.useMaterial3 default from false to true. In other words, applications using FCS will get the Material-3 colors, text styles, and other visuals, by default. The FlexColorScheme API will then be following along with this breaking change. In this release the FlexColorScheme API useMaterial3 still defaults to false. The Themes Playground app has for quite some time already defaulted to setting the value to true. Which is also already the case in Flutter when you create a new application with flutter create.

PACKAGE

NEW

  • To FlexSubThemes in buttonTheme added bool alignedDropdown.

  • To FlexSubThemesData added bool alignedDropdown. Setting it to true improves the style of the DropdownButton and the DropdownButtonForField. They no longer expand outside the width of the parent dropdown button but are kept size aligned with it.

  • To FlexSubThemes in:

    • chipTheme added TextStyle secondaryLabelStyle
    • dialogTheme added TextStyle titleTextStyle and contentTextStyle
    • floatingActionButtonTheme added TextStyle extendedTextStyle
    • menuButtonTheme added TextStyle textStyle
    • snackBarTheme added TextStyle contentTextStyle
    • timePickerTheme added TextStyle dayPeriodTextStyle, dialTextStyle, helpTextStyle and hourMinuteTextStyle
    • toggleButtonsTheme added TextStyle textStyle
  • The TextStyle additions above, to mentioned FlexSubThemes, do not yet bring any new features usable via FlexColorScheme theming APIs. They are a preparation for adding more component TextStyles to FlexSubThemesData. This in turn, will enable more direct TextStyle theming via FlexColorScheme API without using copyWith to override produced ThemeData.

  • As planned in previous versions, made the FlexSubThemesData.useInputDecoratorThemeInDialogs apply also to DatePickerDialog and not only to TimePickerDialog. This feature is not optimally supported by the framework. The current implementation has severe limitations. See more info in PR #128950 comment. For more information about the differences in how InputDecorationTheme behaves in different component themes, read the proposal "Make InputDecorationTheme usage in components consistent" in issue #131666.

CHANGE

  • Minor style breaking changes:
  • FlexSubThemes.dropdownMenuTextStyle now default to TextTheme.bodyLarge if not defined. Previously it used Flutter SDK default TextTheme.bodyLarge, which is a poor design default as the style does not fit with default style bodyLarge used as default style in TextFieldin M3 mode. See issue #131350 that contains a mention of this style deviant. In Jetpack compose, the DropdownMenu and its TextField part correctly defaults to using bodyLarge, this is thus assumed to be the correct spec wise. The issue of wrong default text styles in Flutter menus is further discussed in issue #131676. FlexColorScheme will not internally correct the wrong default TextStyle on menu items, it will however change to follow the default when Flutter stable does. The difference in the DropdownMenu text input field was however significant enough to warrant a change already before the fix lands in Flutter stable.

FIX

  • Fixed the FlexSubThemes.checkboxTheme that broke due to an unexpected breaking change in Flutter 3.13 caused by PR #125643. The breaking change is discussed further in issue #130295. The fix to the checkbox theme incorporates the new behavior to keep its custom styling working as before and expected.

  • Fixed useInputDecoratorThemeInDialogs not working for some properties in the InputDecorator, when the value was null or false, where some properties in the TextFields in the TimePickerDialog did not revert back to default styles. Now they do, but via hard defined values to mimic the default M3 style, as that is the only way to get back to it when a very custom themeData.inputDecoratorTheme is being used.

THEMES PLAYGROUND

NEW

  • The PopupMenu and Dropdowns panel got a setting for older Material-2 based DropdownButtonFormField and DropdownButton to set the new alignment property, which is an ancient theming property in the old ButtonThemeData that was used by deprecated and removed Material Buttons, but the theme is still used by these buttons.

  • On the TextField panel, added a feature to set the input decoration style back to FlexColorScheme's own defaults.

CHANGE

  • Harmonized custom color activation settings on Theme Colors and Seeded ColorScheme.

  • Removed old switch in custom colors in dark mode, that was used to enable using input scheme color as own seed colors in dark mode when using custom colors. For simplicity, the custom dark mode colors have been used directly as seed colors in a few releases in the Playground already. The control was an old left-over with no function anymore.

  • The global themed input decorator usage is now on by default for TimePickerdialog and DatePickerdialog. This is the only style currently supported for DatePickerDialog in Flutter, so it makes sense to keep it on by default. Turning it OFF for now only removes the custom, input decorator style from the TimePickerDialog. Despite the new feature in Flutter SDK, it cannot be removed from the DatePickerDialog. This is discussed in PR #128950 comment. Additional info is also available in Flutter issue #131666.

FIX

  • Fixed the old default color info for the toggles Switch, Checkbox and Radio, that are shown when FlexColorScheme is disabled as default values in Material 2 dark mode. They have been updated in Flutter SDK to ColorScheme.secondary color and are no longer not the horrid dark mode teal color. This default color info, shown when FlexColorScheme is disabled in the Themes Playground, had not been updated for the dark M2 mode Switch, Checkbox and Radio colors.

@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #180 (3121f71) into master (b5222c9) will not change coverage.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #180   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         4871      4947   +76     
=========================================
+ Hits          4871      4947   +76     
Files Changed Coverage Δ
lib/src/flex_color_scheme.dart 100.00% <100.00%> (ø)
lib/src/flex_sub_themes.dart 100.00% <100.00%> (ø)
lib/src/flex_sub_themes_data.dart 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5222c9...3121f71. Read the comment docs.

@rydmike rydmike merged commit c5006b4 into master Aug 16, 2023
3 checks passed
@rydmike rydmike deleted the version-7-3-0 branch August 16, 2023 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant