Skip to content

Commit

Permalink
Release version 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rydmike committed Mar 21, 2021
1 parent 2ceaf6a commit 64bfc66
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to the **FlexColorScheme** package will be documented in this file.

## [2.1.0] - March 21, 2021
## [2.1.0] - March 22, 2021

* **Fix:** Toggling `FlexColorScheme(transparentStatusBar)` from true to false, did not restore the
Android default status bar scrim, unless the app was completely rebuilt. This has been fixed.
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,9 @@ like shown below:

<img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/FlexSchemeAppBar.gif?raw=true" alt="AppBar StatusBar" width="250"/><img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/FlexSchemeNavBar.gif?raw=true" alt="SysNavBar Style" width="250"/>

The top status bar scrim toggle and system navigation divider and sysem navbar style only work on Android builds
and do not have any functionality on the live Web example.

> **NOTE:**
> The static helper `FlexColorScheme.themedSystemNavigationBar(context, ...)` is designed to provide a convenience
> wrapper for a `SystemUiOverlayStyle` that works for screens that use and adhere to current theme mode colors.
Expand All @@ -1301,7 +1304,7 @@ The above concludes the code walk through of example 5. When we build it, the ex
the **deep blue sea** scheme. In the example below we can also see the correctly
themed system navigation bar on the Android device.

<img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/fcs_phone_ex5al.png?raw=true" alt="ColorScheme example 5 light" width="250"/><img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/fcs_phone_ex5ad.png?raw=true" alt="ColorScheme example 5 dark" width="250"/>
<img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/fcs_phone_ex5al.png?raw=true" alt="ColorScheme example 5 light" width="300"/><img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/fcs_phone_ex5ad.png?raw=true" alt="ColorScheme example 5 dark" width="300"/>

Try example 5 live on the [**web here**](https://rydmike.com/flexcolorscheme5)

Expand Down
3 changes: 1 addition & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ dependencies:
cupertino_icons: ^1.0.2

# Color scheme package (by Mike Rydstrom, rydmike.com).
flex_color_scheme:
path: ../
flex_color_scheme: ^2.1.0

# The Flutter SDK (by Google flutter.dev).
flutter:
Expand Down
29 changes: 13 additions & 16 deletions lib/src/flex_color_scheme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1303,9 +1303,9 @@ class FlexColorScheme with Diagnosticable {
/// [systemNavigationBarDividerColor]. The call to set and use the divider
/// color is only made once a none null value has been given to [useDivider].
/// Android does not use any provided alpha value on the color of the
/// divider color and calling it with null again will not remove it, thus
/// for working with transparent system navigation bars, never set any divider
/// because you can't get rid of it once it has been set.
/// divider color and calling it with null again will not remove it. Unless
/// you are working with experimental transparent system navigation bars. If
/// you are, then transparency or alpha channel on the divider also works.
///
/// Use and support for the [opacity] value on the system navigation bar
/// is EXPERIMENTAL, it ONLY works on Android API 30 (=Android 11) or higher.
Expand All @@ -1325,9 +1325,9 @@ class FlexColorScheme with Diagnosticable {

/// Use a divider line on the top edge of the system navigation bar.
///
/// Defaults to null. Keeping it null, byt omission or passing null always
/// Defaults to null. Keeping it null, by omission or passing null, always
/// omits the call to set any divider color in the created
/// [SystemUiOverlayStyle]
/// [SystemUiOverlayStyle].
///
/// The divider on the navigation bar, is only respected on Android P
/// (= Pie = API 28 = Android 9) or higher.
Expand Down Expand Up @@ -1484,7 +1484,9 @@ class FlexColorScheme with Diagnosticable {
// Using the theme divider color does not work, as Android system calls do
// not use the alpha channel value in the passed color. Default divider
// theme color uses alpha, using it here does not look good at all as the
// alpha channel value is not used.
// alpha channel value is not used. If you are working with enabled
// transparent system navigation bar on Android API 30 or higher, then
// opacity on the divider also works as expected.
//
// The logic below is intended to keep the `dividerColor` used in the
// [SystemUiOverlayStyle] as null as long as `useDivider` is null. As soon
Expand All @@ -1495,18 +1497,13 @@ class FlexColorScheme with Diagnosticable {
// with a null color value after it has been enabled with any known
// `SystemUiOverlayStyle` and `SystemChrome` call. The false value then
// provide means to at least hide it again, but it will still be there.
// This can be observed if you use transparent sys navbar, so never enable
// the divider if you intend to use system navigation bars that are fully
// transparent, you won't be able to get rid of it again from Flutter side
// without removing it and rebuilding the app.
//
// Worth noticing is also the the opacity does not really have any effect on
// divider color in current versions of Android. We apply it here anyway
// in case it does some day. It would be nice if it was supported for two
// reasons:
// 1. We could use Flutter default Divider theme color as its color.
// 2. We could make it invisible on transparent nav bars after it has
// has been enabled as well.
// divider color in most versions of Android. We apply it here anyway
// because if you are experimenting with transparent system navigation bar
// on Android API30 or higher it does work. It would be nice if it worked
// on lower version and without adjusting the Android embedder, then we
// could use Flutter default Divider theme color as its color.
Color? dividerColor;

if (useDivider == null) {
Expand Down

0 comments on commit 64bfc66

Please sign in to comment.