Skip to content

Commit ac80a04

Browse files
authored
Merge pull request #99 from rydmike/flutter-master
FlexColorScheme 6.1.0 draft1
2 parents d66e8f8 + 2397514 commit ac80a04

File tree

150 files changed

+12516
-5257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+12516
-5257
lines changed

CHANGELOG.md

Lines changed: 131 additions & 1162 deletions
Large diffs are not rendered by default.

all_lint_rules.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# A list of all linter rules. Up to date auto generated list of all
1+
# A list of all linter rules. Up-to-date auto generated list of all
22
# lint rules can be found here:
33
# https://dart-lang.github.io/linter/lints/options/options.html
44
linter:
@@ -57,6 +57,8 @@ linter:
5757
- cascade_invocations
5858
- cast_nullable_to_non_nullable
5959
- close_sinks
60+
- collection_methods_unrelated_type
61+
- combinators_ordering
6062
- comment_references
6163
- conditional_uri_does_not_exist
6264
- constant_identifier_names
@@ -66,6 +68,7 @@ linter:
6668
- deprecated_consistency
6769
- diagnostic_describe_all_properties
6870
- directives_ordering
71+
- discarded_futures
6972
- do_not_use_environment
7073
- empty_catches
7174
- empty_constructor_bodies
@@ -76,7 +79,6 @@ linter:
7679
- flutter_style_todos
7780
- hash_and_equals
7881
- implementation_imports
79-
- invariant_booleans
8082
- iterable_contains_unrelated_type
8183
- join_return_with_assignment
8284
- leading_newlines_in_multiline_strings
@@ -174,6 +176,7 @@ linter:
174176
- unnecessary_late
175177
- unnecessary_new
176178
- unnecessary_null_aware_assignments
179+
- unnecessary_null_aware_operator_on_extension_on_nullable
177180
- unnecessary_null_checks
178181
- unnecessary_null_in_if_null_operators
179182
- unnecessary_nullable_for_final_variable_declarations
@@ -184,6 +187,8 @@ linter:
184187
- unnecessary_string_escapes
185188
- unnecessary_string_interpolations
186189
- unnecessary_this
190+
- unnecessary_to_list_in_spreads
191+
- unreachable_from_main
187192
- unrelated_type_equality_checks
188193
- unsafe_html
189194
- use_build_context_synchronously
@@ -201,6 +206,7 @@ linter:
201206
- use_rethrow_when_possible
202207
- use_setters_to_change_properties
203208
- use_string_buffers
209+
- use_string_in_part_of_directives
204210
- use_super_parameters
205211
- use_test_throws_matchers
206212
- use_to_and_as_if_applicable

changelog/changelog_1_0_0-dev.2.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
### Archived changelog entry
2+
3+
> 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.
4+
5+
## 1.0.0-dev.2
6+
7+
**December 21, 2020**
8+
9+
**BREAKING**
10+
11+
* Made planned API name changes, SchemeOnColors -> FlexSchemeOnColors and
12+
SchemeSurfaceColors -> FlexSchemeSurfaceColors. These are lower level APIs that are
13+
only used when making custom on and surface colors.
14+
Changed ThemeModeOptionButton -> FlexThemeModeOptionButton, this is a lower
15+
level API that can be used when making more advanced custom theme selection
16+
controls that are based on the same button that the `FlexThemeModeSwitch` uses.
17+
* Removed the constants that had no function in the public interface from the API.
18+
19+
**NEW**
20+
* Exposed planned configuration APIs for the FlexThemeModeSwitch and FlexThemeModeOptionButton.
21+
22+
**CHANGE**
23+
24+
* Removed legacy usage of deprecated ThemeData properties textSelectionColor, cursorColor
25+
and textSelectionHandleColor. They are no longer needed even for stable channel, they were
26+
useful earlier but not anymore, using only TextSelectionThemeData is
27+
enough in the latest stable version.
28+
29+
**DOCS**
30+
31+
* Documentation updates and corrections.

changelog/changelog_1_1_0.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
### Archived changelog entry
2+
3+
> 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.
4+
5+
## 1.1.0
6+
7+
**December 29, 2020**
8+
9+
**NEW**
10+
11+
* Added API to make a matching dark scheme from a light scheme. See
12+
[FlexSchemeColor.toDark](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexSchemeColor/toDark.html).
13+
* Added a [showSystemMode](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexThemeModeSwitch/showSystemMode.html)
14+
property to [FlexThemeModeSwitch](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexThemeModeSwitch-class.html).
15+
It defaults to true. Set it to `false`, to exclude the system setting based theme mode option.
16+
* Added static method [FlexColorScheme.comfortablePlatformDensity](https://pub.dev/documentation/flex_color_scheme/latest/flex_color_scheme/FlexColorScheme/comfortablePlatformDensity.html).
17+
* 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.
18+
* 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.
19+
20+
**EXAMPLES**
21+
22+
* All examples now use the new platform adaptive `FlexColorScheme.comfortablePlatformDensity` as their `visualDensity`
23+
setting. The Flutter default `compact` mode for desktop and web goes a bit overboard in its compactness. This
24+
optional setting presents an alternative where `comfortable` density is used on desktops and Web, while devices keep
25+
their standard visual density. Just omit the setting if you prefer Flutter's super compact Web and Desktop widgets.
26+
* *Example 3:* excludes the system theme mode option, just to show this new feature of the switch.
27+
* *Example 4:* includes all built-in schemes, plus 3 custom ones, including one where the dark scheme is made
28+
with the `toDark` method. Example 4 also includes a sub-page that can be opened to see the same theme on a new page.
29+
* *Example 5:* now includes an option make all the dark mode schemes with the `toDark` option, so it can be
30+
toggled and compared to the hand-tuned versions. The same custom color scheme as in example 4 are also included.
31+
Example 5 also has the same sub-page as example 4. Example 5 now also show how to solve the issue that the system
32+
navigation bar does not get color scheme and theme mode appropriate style in Android when we
33+
change the theme. This improvement is done with an `AnnotatedRegion` and the new static helper
34+
method `FlexColorScheme.themedSystemNavigationBar`.
35+
36+
**DOCS**
37+
38+
* Documentation updates and typo corrections.
39+

changelog/changelog_1_1_1.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
### Archived changelog entry
2+
3+
> 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.
4+
5+
## 1.1.1
6+
7+
**December 31, 2020**
8+
9+
**NEW**
10+
11+
* Added a `defaultError` modifier that enables the built-in schemes to use the Material design guide's default dark
12+
error color when using the `toDark` method to compute a dark scheme from a light scheme.
13+
The `toDark` method can be used without the `defaultError` scheme modifier, but then the
14+
error color also changes with the other computed dark scheme colors when using `toDark` method
15+
and the level adjustment. This is not necessarily the desired behavior. The fix enables the alternative more often
16+
desired behavior and ensures that the dark error color just uses the default value. For custom schemes that do not
17+
specify a custom error color for their light scheme and thus default to the Material Guide's standard error color,
18+
the fix is not needed. Example 5 demonstrates the use case of `defaultError` as well.
19+
20+
**EXAMPLES**
21+
22+
* Updated example 5 to include UI that can be used to vary the computed dark themes white blend percentage level.
23+
This was added to better demonstrate the `toDark` feature.
24+
25+
**DOCS**
26+
27+
* Major documentation review and updates.

changelog/changelog_1_2_0.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
### Archived changelog entry
2+
3+
> 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.
4+
5+
## 1.2.0
6+
7+
**January 4, 2021**
8+
9+
**NEW**
10+
* Added four new built-in color schemes.
11+
* **Amber blue** - Amber blaze and blue color theme, based on Material amber and blue accent colors.
12+
Use enum value `FlexScheme.amber` for easy access to it.
13+
* **Vesuvius burned** - Vesuvius burned orange and eden green theme.
14+
Use enum value `FlexScheme.vesuviusBurn` for easy access to it.
15+
* **Deep purple** - Deep purple daisy bush theme, based on Material deepPurple and lightBlueAccent colors.
16+
Use enum value `FlexScheme.deepPurple` for easy access to it.
17+
* **Ebony clay** - Ebony clay dark blue-grey and watercourse green colored theme.
18+
Use enum value `FlexScheme.ebonyClay` for easy access to it.
19+
20+
* Added a style option for the tab bar. The `FlexColorScheme` created tab bar theme now **defaults** to a
21+
`TabBarTheme` that fits its created `AppBarTheme`, also works via the factory app bar style options. There is also
22+
an optional style that makes the tab bar theme suitable for surface and background colors. This was the
23+
default style before. The change to this default style is a **fix** to make the default `TabBarTheme` one that
24+
fits on app bar's instead, which is expected default behavior in Flutter and Material design.
25+
The style is set via the `FlexColorScheme` property `tabBarStyle` using enum values `FlexTabBarStyle.forAppBar`
26+
(default) and `FlexTabBarStyle.forBackground`.
27+
28+
* The themed `AppBar` and `BottomAppBar` elevations still default to 0. For convenience, the themed values
29+
can now both be modified directly via the `FlexColorScheme` properties `appBarElevation` and `bottomAppBarElevation`,
30+
without need to change these frequently modified values with an extra `copyWith` to get them re-themed as desired.
31+
When using the recommended `FlexColorScheme.light` and `FlexColorScheme.dark` factories, `appBarElevation`
32+
defaults to '0', if not defined and `bottomAppBarElevation` defaults to `appBarElevation`, if not defined.
33+
When using the default constructor (the factories are recommended), they both default to '0'.
34+
35+
**EXAMPLES**
36+
37+
38+
* All examples: The widget showcase now show the resulting themed tab bar on two different backgrounds, one on the
39+
app bar color and one on background color. This can guide you in which tab bar style is right for your use case.
40+
* Example 4 and 5: The sub-page now has a demo tab bar in the app bar, and a demo bottom navigation bar.
41+
* Example 5: Now includes a toggle that can be used to select the tab bar theme style.
42+
* Example 5: Now includes a slider to modify the themed app bar elevation.
43+
* Example 5: The Roboto font that is always used by the examples regardless of platform, is now also
44+
used when you create the theme from the scheme with the `ThemeData.from(colorScheme)`. It looked
45+
a bit odd when it changed to platform default font on Desktop and Web versions, while
46+
`FlexColorScheme.toTheme` used Roboto. This was modified so that the resulting themes use the
47+
same font and are thus more comparable.

changelog/changelog_1_3_0.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
### Archived changelog entry
2+
3+
> 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.
4+
5+
## 1.3.0
6+
7+
**January 7, 2021**
8+
9+
**DEPRECATED**
10+
11+
* Marked `FlexSchemeSurfaceColors.themeSurface` as deprecated in favor of the correctly named
12+
`FlexSchemeSurfaceColors.surfaceStyle` version. The older `themeSurface` will be removed when
13+
null safe Version 2.0.0 is officially released as the main version.
14+
15+
**NEW**
16+
17+
* Added `Diagnosticable` mixin to classes `FlexSchemeOnColors`, `FlexSchemeSurfaceColors` and `FlexColorScheme`,
18+
that all also received proper identity overrides and `copyWith` methods.
19+
20+
**CHANGE**
21+
22+
* Improved internal null safe behavior, with fall-backs values in some classes and helper functions.
23+
It might make migration to null-safety easier.
24+
25+
**TESTS**
26+
27+
* Added 389 tests. Coverage is 89% based on Codecov report. Will add more tests later, enough for now.
28+
* The tests will make the migration to null-safety easier by providing some quality control checks.
29+
* Added GitHub actions to run all the tests and automated test coverage analysis with Codecov.
30+
31+
**DOCS**
32+
33+
* Documentation improvements and API doc fixes.
34+
In previous version API-doc analysis says
35+
"441 out of 444 API elements (99.3 %) have documentation comments.". I have not been able to find any missing ones.
36+
The result from this update will only be seen after it has been uploaded, but I doubt it will change much. If
37+
somebody happens to find the missing doc comments let my know, the IDE analyzer does not find them either.

changelog/changelog_1_4_0.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
### Archived changelog entry
2+
3+
> 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.
4+
5+
## 1.4.0
6+
7+
**January 18, 2021**
8+
9+
**NEW**
10+
11+
* Added convenience property `scheme` to FlexColorScheme factories light and dark. This a shortcut for
12+
using the built-in color schemes. The `colors` property can still be used as before. The `.light` and
13+
`.dark` factories no longer have any required properties. If `scheme` is not provided it defaults
14+
to `FlexScheme.material` and if both `scheme` and `colors` are provided, the scheme provided via `colors` prevail.
15+
* Added experimental support for transparent system navigation bar for Android for SDK >= 30 (Android 11).
16+
The support is added via new `opacity` property in `FlexColorScheme.themedSystemNavigationBar`.
17+
18+
**EXAMPLES**
19+
20+
* Updated the simple example 1 to use the new `scheme` property, as in
21+
`theme: FlexColorScheme.light(scheme: FlexScheme.mandyRed).toTheme`.
22+
23+
* Added a separate example that builds
24+
on example 5, shows and explains how and when transparent system navigation bar can be used in Android. It also shows
25+
how to make it look nice when using primary color branded background color applied to the system
26+
navigation bar in Android, that is used when transparency is not supported. While if supported, your app otherwise
27+
uses a transparent system navigation. Please see this separate small stand-alone example Android project
28+
[**sysnavbar** on GitHub](https://github.com/rydmike/sysnavbar) for more information.
29+
30+
**TESTS**
31+
* Added more tests, now 689 tests. All color values used are now also tested, any modification to them is considered
32+
a breaking change. A bit more tests would still be nice, for the ThemeModeSwitch Widget at least.
33+
Total test coverage > 98%, it will do for now.
34+
35+
**DOCS**
36+
37+
* Changed example one and the intro, to use the new simpler `scheme` property when using built-in schemes.
38+
* Added a section that lists which sub-themes, and which of their properties, are NOT null when creating a theme data
39+
object with FlexColorScheme.toTheme.
40+
* Removed the "back to content" link after each chapter. It was nice and worked fine on GitHub, but for some reason
41+
it did not on pub.dev.
42+
* Tried finding and adding comments for the 3 missing API comments needed to reach 100% API

changelog/changelog_1_4_1.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
### Archived changelog entry
2+
3+
> 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.
4+
5+
### 1.4.1
6+
7+
**January 31, 2021**
8+
9+
**NEW**
10+
11+
* **New color schemes:** Added four new built-in color schemes.
12+
* **Barossa** - Barossa red and cardin green theme.
13+
Use enum value `FlexScheme.barossa` for easy access to it.
14+
* **Shark and orange** - Shark grey and orange ecstasy theme.
15+
Use enum value `FlexScheme.shark` for easy access to it.
16+
* **Big stone tulip** - Big stone blue and tulip tree yellow theme.
17+
Use enum value `FlexScheme.bigStone` for easy access to it.
18+
* **Damask and lunar** - Damask red and lunar green theme.
19+
Use enum value `FlexScheme.damask` for easy access to it.
20+
21+
* Semantics for the ThemeMode Widget buttons.
22+
23+
**TESTS**
24+
25+
* FlexThemeModeSwitch widget tests, makes and checks for system mode changes.
26+
* More tests, totally 723 tests, codecov is now > 99.5%.
27+
* **CI/CD:** Added GitHub actions to automate build and to publish the examples on the Web on a new release.
28+
29+
**EXAMPLES**
30+
31+
* Minor changes to the examples. Modified to not need the `late` keyword when they are converted
32+
to null safe versions.
33+
34+
**DOCS**
35+
36+
* Added the new color schemes to the documentation.
37+
* Minor typo corrections.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### Archived changelog entry
2+
3+
> 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.
4+
5+
## 2.0.0-nullsafety.1
6+
7+
**February 4, 2021**
8+
9+
### Overview
10+
11+
First dev version with null-safety.
12+
13+
**BREAKING**
14+
15+
* Removed the in version 1.3.0 deprecated `FlexSchemeSurfaceColors.themeSurface`, use
16+
`FlexSchemeSurfaceColors.surfaceStyle` instead.
17+
18+
**TESTS**
19+
20+
* Number of tests were reduced from 723 to 639, when all null related tests were removed.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
### Archived changelog entry
2+
3+
> 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.
4+
5+
## 2.0.0-nullsafety.2
6+
7+
**March 15, 2021**
8+
9+
**BREAKING**
10+
11+
* Minor change to the none default `tooltipsMatchBackground: true` border style, it now uses
12+
the theme divider color as its default outline color.
13+
* As stated earlier in the documentation, as a planned change for version 2.0.0, the sub theme for
14+
`FloatingActionButtonThemeData` was removed. It is thus now null, just as in a default Flutter ThemeData.
15+
It still produces the same theme as before, the ThemeData definition was just no longer needed to do so.
16+
17+
**NEW**
18+
19+
* The static helper `FlexColorScheme.themedSystemNavigationBar` received three new properties
20+
`noAppBar`, `invertStatusIcons` and `systemNavigationBarDividerColor`. The old property
21+
`nullContextBackground` was deprecated and replaced with `systemNavigationBarColor`. Example 5
22+
has been updated to show how and when these new features can be used.
23+
24+
**CHANGE**
25+
* AppBar theming to use the implementation introduced in Flutter 2.0.0 instead of using
26+
its own custom implementation for the "white" app bar theme.
27+
28+
**TESTS**
29+
30+
* Number of tests increased from 639 to 661. Coverage 99.78%.
31+
32+
**DOCS**
33+
34+
* Added thumbnails to **Appendix A**. This pub.dev version is also to test the
35+
thumbnails work and how they look on pub.dev before stable 2.0.0 release.

0 commit comments

Comments
 (0)