Skip to content

Commit

Permalink
Merge pull request #99 from rydmike/flutter-master
Browse files Browse the repository at this point in the history
FlexColorScheme 6.1.0 draft1
  • Loading branch information
rydmike authored Nov 15, 2022
2 parents d66e8f8 + 2397514 commit ac80a04
Show file tree
Hide file tree
Showing 150 changed files with 12,516 additions and 5,257 deletions.
1,293 changes: 131 additions & 1,162 deletions CHANGELOG.md

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions all_lint_rules.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# A list of all linter rules. Up to date auto generated list of all
# A list of all linter rules. Up-to-date auto generated list of all
# lint rules can be found here:
# https://dart-lang.github.io/linter/lints/options/options.html
linter:
Expand Down Expand Up @@ -57,6 +57,8 @@ linter:
- cascade_invocations
- cast_nullable_to_non_nullable
- close_sinks
- collection_methods_unrelated_type
- combinators_ordering
- comment_references
- conditional_uri_does_not_exist
- constant_identifier_names
Expand All @@ -66,6 +68,7 @@ linter:
- deprecated_consistency
- diagnostic_describe_all_properties
- directives_ordering
- discarded_futures
- do_not_use_environment
- empty_catches
- empty_constructor_bodies
Expand All @@ -76,7 +79,6 @@ linter:
- flutter_style_todos
- hash_and_equals
- implementation_imports
- invariant_booleans
- iterable_contains_unrelated_type
- join_return_with_assignment
- leading_newlines_in_multiline_strings
Expand Down Expand Up @@ -174,6 +176,7 @@ linter:
- unnecessary_late
- unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_aware_operator_on_extension_on_nullable
- unnecessary_null_checks
- unnecessary_null_in_if_null_operators
- unnecessary_nullable_for_final_variable_declarations
Expand All @@ -184,6 +187,8 @@ linter:
- unnecessary_string_escapes
- unnecessary_string_interpolations
- unnecessary_this
- unnecessary_to_list_in_spreads
- unreachable_from_main
- unrelated_type_equality_checks
- unsafe_html
- use_build_context_synchronously
Expand All @@ -201,6 +206,7 @@ linter:
- use_rethrow_when_possible
- use_setters_to_change_properties
- use_string_buffers
- use_string_in_part_of_directives
- use_super_parameters
- use_test_throws_matchers
- use_to_and_as_if_applicable
Expand Down
31 changes: 31 additions & 0 deletions changelog/changelog_1_0_0-dev.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### Archived changelog entry

> The Dart package site [pub.dev](https://pub.dev/) restricts the size of the main [CHANGELOG.md](https://github.com/rydmike/flex_color_scheme/blob/master/CHANGELOG.md) file size to maximum 128kB. To work around this limitation older change entries have been moved into individual files linked from the main changelog.
## 1.0.0-dev.2

**December 21, 2020**

**BREAKING**

* Made planned API name changes, SchemeOnColors -> FlexSchemeOnColors and
SchemeSurfaceColors -> FlexSchemeSurfaceColors. These are lower level APIs that are
only used when making custom on and surface colors.
Changed ThemeModeOptionButton -> FlexThemeModeOptionButton, this is a lower
level API that can be used when making more advanced custom theme selection
controls that are based on the same button that the `FlexThemeModeSwitch` uses.
* Removed the constants that had no function in the public interface from the API.

**NEW**
* Exposed planned configuration APIs for the FlexThemeModeSwitch and FlexThemeModeOptionButton.

**CHANGE**

* Removed legacy usage of deprecated ThemeData properties textSelectionColor, cursorColor
and textSelectionHandleColor. They are no longer needed even for stable channel, they were
useful earlier but not anymore, using only TextSelectionThemeData is
enough in the latest stable version.

**DOCS**

* Documentation updates and corrections.
39 changes: 39 additions & 0 deletions changelog/changelog_1_1_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
### Archived changelog entry

> The Dart package site [pub.dev](https://pub.dev/) restricts the size of the main [CHANGELOG.md](https://github.com/rydmike/flex_color_scheme/blob/master/CHANGELOG.md) file size to maximum 128kB. To work around this limitation older change entries have been moved into individual files linked from the main changelog.
## 1.1.0

**December 29, 2020**

**NEW**

* Added API to make a matching dark scheme from a light scheme. See
[FlexSchemeColor.toDark](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexSchemeColor/toDark.html).
* Added a [showSystemMode](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexThemeModeSwitch/showSystemMode.html)
property to [FlexThemeModeSwitch](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexThemeModeSwitch-class.html).
It defaults to true. Set it to `false`, to exclude the system setting based theme mode option.
* Added static method [FlexColorScheme.comfortablePlatformDensity](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexColorScheme/comfortablePlatformDensity.html).
* Added static method [FlexColorScheme.themedSystemNavigationBar](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexColorScheme/themedSystemNavigationBar.html) that can be used to assist with theming the system navigation bar via an annotated region. See updated example 5, for a demo on how to use it.
* Added API property [FlexColorScheme.transparentStatusBar](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexColorScheme/transparentStatusBar.html) to allow opting out of the one-toned AppBar in Android.

**EXAMPLES**

* All examples now use the new platform adaptive `FlexColorScheme.comfortablePlatformDensity` as their `visualDensity`
setting. The Flutter default `compact` mode for desktop and web goes a bit overboard in its compactness. This
optional setting presents an alternative where `comfortable` density is used on desktops and Web, while devices keep
their standard visual density. Just omit the setting if you prefer Flutter's super compact Web and Desktop widgets.
* *Example 3:* excludes the system theme mode option, just to show this new feature of the switch.
* *Example 4:* includes all built-in schemes, plus 3 custom ones, including one where the dark scheme is made
with the `toDark` method. Example 4 also includes a sub-page that can be opened to see the same theme on a new page.
* *Example 5:* now includes an option make all the dark mode schemes with the `toDark` option, so it can be
toggled and compared to the hand-tuned versions. The same custom color scheme as in example 4 are also included.
Example 5 also has the same sub-page as example 4. Example 5 now also show how to solve the issue that the system
navigation bar does not get color scheme and theme mode appropriate style in Android when we
change the theme. This improvement is done with an `AnnotatedRegion` and the new static helper
method `FlexColorScheme.themedSystemNavigationBar`.

**DOCS**

* Documentation updates and typo corrections.

27 changes: 27 additions & 0 deletions changelog/changelog_1_1_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
### Archived changelog entry

> The Dart package site [pub.dev](https://pub.dev/) restricts the size of the main [CHANGELOG.md](https://github.com/rydmike/flex_color_scheme/blob/master/CHANGELOG.md) file size to maximum 128kB. To work around this limitation older change entries have been moved into individual files linked from the main changelog.
## 1.1.1

**December 31, 2020**

**NEW**

* Added a `defaultError` modifier that enables the built-in schemes to use the Material design guide's default dark
error color when using the `toDark` method to compute a dark scheme from a light scheme.
The `toDark` method can be used without the `defaultError` scheme modifier, but then the
error color also changes with the other computed dark scheme colors when using `toDark` method
and the level adjustment. This is not necessarily the desired behavior. The fix enables the alternative more often
desired behavior and ensures that the dark error color just uses the default value. For custom schemes that do not
specify a custom error color for their light scheme and thus default to the Material Guide's standard error color,
the fix is not needed. Example 5 demonstrates the use case of `defaultError` as well.

**EXAMPLES**

* Updated example 5 to include UI that can be used to vary the computed dark themes white blend percentage level.
This was added to better demonstrate the `toDark` feature.

**DOCS**

* Major documentation review and updates.
47 changes: 47 additions & 0 deletions changelog/changelog_1_2_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
### Archived changelog entry

> The Dart package site [pub.dev](https://pub.dev/) restricts the size of the main [CHANGELOG.md](https://github.com/rydmike/flex_color_scheme/blob/master/CHANGELOG.md) file size to maximum 128kB. To work around this limitation older change entries have been moved into individual files linked from the main changelog.
## 1.2.0

**January 4, 2021**

**NEW**
* Added four new built-in color schemes.
* **Amber blue** - Amber blaze and blue color theme, based on Material amber and blue accent colors.
Use enum value `FlexScheme.amber` for easy access to it.
* **Vesuvius burned** - Vesuvius burned orange and eden green theme.
Use enum value `FlexScheme.vesuviusBurn` for easy access to it.
* **Deep purple** - Deep purple daisy bush theme, based on Material deepPurple and lightBlueAccent colors.
Use enum value `FlexScheme.deepPurple` for easy access to it.
* **Ebony clay** - Ebony clay dark blue-grey and watercourse green colored theme.
Use enum value `FlexScheme.ebonyClay` for easy access to it.

* Added a style option for the tab bar. The `FlexColorScheme` created tab bar theme now **defaults** to a
`TabBarTheme` that fits its created `AppBarTheme`, also works via the factory app bar style options. There is also
an optional style that makes the tab bar theme suitable for surface and background colors. This was the
default style before. The change to this default style is a **fix** to make the default `TabBarTheme` one that
fits on app bar's instead, which is expected default behavior in Flutter and Material design.
The style is set via the `FlexColorScheme` property `tabBarStyle` using enum values `FlexTabBarStyle.forAppBar`
(default) and `FlexTabBarStyle.forBackground`.

* The themed `AppBar` and `BottomAppBar` elevations still default to 0. For convenience, the themed values
can now both be modified directly via the `FlexColorScheme` properties `appBarElevation` and `bottomAppBarElevation`,
without need to change these frequently modified values with an extra `copyWith` to get them re-themed as desired.
When using the recommended `FlexColorScheme.light` and `FlexColorScheme.dark` factories, `appBarElevation`
defaults to '0', if not defined and `bottomAppBarElevation` defaults to `appBarElevation`, if not defined.
When using the default constructor (the factories are recommended), they both default to '0'.

**EXAMPLES**


* All examples: The widget showcase now show the resulting themed tab bar on two different backgrounds, one on the
app bar color and one on background color. This can guide you in which tab bar style is right for your use case.
* Example 4 and 5: The sub-page now has a demo tab bar in the app bar, and a demo bottom navigation bar.
* Example 5: Now includes a toggle that can be used to select the tab bar theme style.
* Example 5: Now includes a slider to modify the themed app bar elevation.
* Example 5: The Roboto font that is always used by the examples regardless of platform, is now also
used when you create the theme from the scheme with the `ThemeData.from(colorScheme)`. It looked
a bit odd when it changed to platform default font on Desktop and Web versions, while
`FlexColorScheme.toTheme` used Roboto. This was modified so that the resulting themes use the
same font and are thus more comparable.
37 changes: 37 additions & 0 deletions changelog/changelog_1_3_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
### Archived changelog entry

> The Dart package site [pub.dev](https://pub.dev/) restricts the size of the main [CHANGELOG.md](https://github.com/rydmike/flex_color_scheme/blob/master/CHANGELOG.md) file size to maximum 128kB. To work around this limitation older change entries have been moved into individual files linked from the main changelog.
## 1.3.0

**January 7, 2021**

**DEPRECATED**

* Marked `FlexSchemeSurfaceColors.themeSurface` as deprecated in favor of the correctly named
`FlexSchemeSurfaceColors.surfaceStyle` version. The older `themeSurface` will be removed when
null safe Version 2.0.0 is officially released as the main version.

**NEW**

* Added `Diagnosticable` mixin to classes `FlexSchemeOnColors`, `FlexSchemeSurfaceColors` and `FlexColorScheme`,
that all also received proper identity overrides and `copyWith` methods.

**CHANGE**

* Improved internal null safe behavior, with fall-backs values in some classes and helper functions.
It might make migration to null-safety easier.

**TESTS**

* Added 389 tests. Coverage is 89% based on Codecov report. Will add more tests later, enough for now.
* The tests will make the migration to null-safety easier by providing some quality control checks.
* Added GitHub actions to run all the tests and automated test coverage analysis with Codecov.

**DOCS**

* Documentation improvements and API doc fixes.
In previous version API-doc analysis says
"441 out of 444 API elements (99.3 %) have documentation comments.". I have not been able to find any missing ones.
The result from this update will only be seen after it has been uploaded, but I doubt it will change much. If
somebody happens to find the missing doc comments let my know, the IDE analyzer does not find them either.
42 changes: 42 additions & 0 deletions changelog/changelog_1_4_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
### Archived changelog entry

> The Dart package site [pub.dev](https://pub.dev/) restricts the size of the main [CHANGELOG.md](https://github.com/rydmike/flex_color_scheme/blob/master/CHANGELOG.md) file size to maximum 128kB. To work around this limitation older change entries have been moved into individual files linked from the main changelog.
## 1.4.0

**January 18, 2021**

**NEW**

* Added convenience property `scheme` to FlexColorScheme factories light and dark. This a shortcut for
using the built-in color schemes. The `colors` property can still be used as before. The `.light` and
`.dark` factories no longer have any required properties. If `scheme` is not provided it defaults
to `FlexScheme.material` and if both `scheme` and `colors` are provided, the scheme provided via `colors` prevail.
* Added experimental support for transparent system navigation bar for Android for SDK >= 30 (Android 11).
The support is added via new `opacity` property in `FlexColorScheme.themedSystemNavigationBar`.

**EXAMPLES**

* Updated the simple example 1 to use the new `scheme` property, as in
`theme: FlexColorScheme.light(scheme: FlexScheme.mandyRed).toTheme`.

* Added a separate example that builds
on example 5, shows and explains how and when transparent system navigation bar can be used in Android. It also shows
how to make it look nice when using primary color branded background color applied to the system
navigation bar in Android, that is used when transparency is not supported. While if supported, your app otherwise
uses a transparent system navigation. Please see this separate small stand-alone example Android project
[**sysnavbar** on GitHub](https://github.com/rydmike/sysnavbar) for more information.

**TESTS**
* Added more tests, now 689 tests. All color values used are now also tested, any modification to them is considered
a breaking change. A bit more tests would still be nice, for the ThemeModeSwitch Widget at least.
Total test coverage > 98%, it will do for now.

**DOCS**

* Changed example one and the intro, to use the new simpler `scheme` property when using built-in schemes.
* Added a section that lists which sub-themes, and which of their properties, are NOT null when creating a theme data
object with FlexColorScheme.toTheme.
* Removed the "back to content" link after each chapter. It was nice and worked fine on GitHub, but for some reason
it did not on pub.dev.
* Tried finding and adding comments for the 3 missing API comments needed to reach 100% API
37 changes: 37 additions & 0 deletions changelog/changelog_1_4_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
### Archived changelog entry

> The Dart package site [pub.dev](https://pub.dev/) restricts the size of the main [CHANGELOG.md](https://github.com/rydmike/flex_color_scheme/blob/master/CHANGELOG.md) file size to maximum 128kB. To work around this limitation older change entries have been moved into individual files linked from the main changelog.
### 1.4.1

**January 31, 2021**

**NEW**

* **New color schemes:** Added four new built-in color schemes.
* **Barossa** - Barossa red and cardin green theme.
Use enum value `FlexScheme.barossa` for easy access to it.
* **Shark and orange** - Shark grey and orange ecstasy theme.
Use enum value `FlexScheme.shark` for easy access to it.
* **Big stone tulip** - Big stone blue and tulip tree yellow theme.
Use enum value `FlexScheme.bigStone` for easy access to it.
* **Damask and lunar** - Damask red and lunar green theme.
Use enum value `FlexScheme.damask` for easy access to it.

* Semantics for the ThemeMode Widget buttons.

**TESTS**

* FlexThemeModeSwitch widget tests, makes and checks for system mode changes.
* More tests, totally 723 tests, codecov is now > 99.5%.
* **CI/CD:** Added GitHub actions to automate build and to publish the examples on the Web on a new release.

**EXAMPLES**

* Minor changes to the examples. Modified to not need the `late` keyword when they are converted
to null safe versions.

**DOCS**

* Added the new color schemes to the documentation.
* Minor typo corrections.
20 changes: 20 additions & 0 deletions changelog/changelog_2_0_0-nullsafety_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Archived changelog entry

> The Dart package site [pub.dev](https://pub.dev/) restricts the size of the main [CHANGELOG.md](https://github.com/rydmike/flex_color_scheme/blob/master/CHANGELOG.md) file size to maximum 128kB. To work around this limitation older change entries have been moved into individual files linked from the main changelog.
## 2.0.0-nullsafety.1

**February 4, 2021**

### Overview

First dev version with null-safety.

**BREAKING**

* Removed the in version 1.3.0 deprecated `FlexSchemeSurfaceColors.themeSurface`, use
`FlexSchemeSurfaceColors.surfaceStyle` instead.

**TESTS**

* Number of tests were reduced from 723 to 639, when all null related tests were removed.
35 changes: 35 additions & 0 deletions changelog/changelog_2_0_0-nullsafety_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### Archived changelog entry

> The Dart package site [pub.dev](https://pub.dev/) restricts the size of the main [CHANGELOG.md](https://github.com/rydmike/flex_color_scheme/blob/master/CHANGELOG.md) file size to maximum 128kB. To work around this limitation older change entries have been moved into individual files linked from the main changelog.
## 2.0.0-nullsafety.2

**March 15, 2021**

**BREAKING**

* Minor change to the none default `tooltipsMatchBackground: true` border style, it now uses
the theme divider color as its default outline color.
* As stated earlier in the documentation, as a planned change for version 2.0.0, the sub theme for
`FloatingActionButtonThemeData` was removed. It is thus now null, just as in a default Flutter ThemeData.
It still produces the same theme as before, the ThemeData definition was just no longer needed to do so.

**NEW**

* The static helper `FlexColorScheme.themedSystemNavigationBar` received three new properties
`noAppBar`, `invertStatusIcons` and `systemNavigationBarDividerColor`. The old property
`nullContextBackground` was deprecated and replaced with `systemNavigationBarColor`. Example 5
has been updated to show how and when these new features can be used.

**CHANGE**
* AppBar theming to use the implementation introduced in Flutter 2.0.0 instead of using
its own custom implementation for the "white" app bar theme.

**TESTS**

* Number of tests increased from 639 to 661. Coverage 99.78%.

**DOCS**

* Added thumbnails to **Appendix A**. This pub.dev version is also to test the
thumbnails work and how they look on pub.dev before stable 2.0.0 release.
Loading

0 comments on commit ac80a04

Please sign in to comment.