diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d07059a..cc0f37b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: - name: "Install Flutter and Dart SDK" uses: subosito/flutter-action@v1.5.3 with: - channel: "beta" + channel: "stable" - name: "Show Dart SDK version" run: dart --version - name: "Show Flutter SDK version" diff --git a/CHANGELOG.md b/CHANGELOG.md index 78c0fb8..f139d54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to the **FlexSeedScheme** (FSS) package are documented here. +## 1.0.0 + +**Aug 30, 2022** + +First stable release. + +* Document updates +* Updated minimum dependencies to Dart >=2.18.0 and Flutter >= 3.3.0. + ## 0.2.0-dev.2 **Aug 28, 2022** diff --git a/example/pubspec.lock b/example/pubspec.lock index 3e3f6df..92b3b73 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -56,7 +56,7 @@ packages: path: ".." relative: true source: path - version: "0.2.0-dev.1" + version: "1.0.0" flutter: dependency: "direct main" description: flutter @@ -150,4 +150,5 @@ packages: source: hosted version: "2.1.2" sdks: - dart: ">=2.18.0-271.4.beta <3.0.0" + dart: ">=2.18.0 <3.0.0" + flutter: ">=3.3.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index a7c0463..3887f5f 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,9 +1,10 @@ name: flex_seed_scheme_example description: Example that demonstrate how to use the FlexSeedScheme package. -version: 0.2.0-dev.2 +version: 1.0.0 publish_to: 'none' environment: - sdk: '>=2.18.0-271.4.beta <3.0.0' + sdk: '>=2.18.0 <3.0.0' + flutter: '>=3.3.0' dependencies: # Adds the Cupertino Icons font to your application. Used by the diff --git a/lib/src/flex_core_palette.dart b/lib/src/flex_core_palette.dart index 7427ba9..3a408e7 100644 --- a/lib/src/flex_core_palette.dart +++ b/lib/src/flex_core_palette.dart @@ -48,7 +48,7 @@ import 'package:meta/meta.dart' show immutable; /// chroma, but vary in tone. /// /// This is a modification of package material_color_utilities [TonalPalette] -/// to be able to add the tone 98, that the Web based Material 3 theme builder +/// made to include the tone 98, that the Web based Material 3 theme builder /// has, as well as an additional custom tone, 5. /// /// This class can be instantiated in two ways: @@ -60,13 +60,13 @@ import 'package:meta/meta.dart' show immutable; /// corresponding to [commonTones]. @immutable class FlexTonalPalette { - // If changed commonTones length, update commonSize to commonTones.length. - // There is a test and assert that fails if you did not. - // + // If modifying commonTones length, update commonSize to equal + // commonTones.length. There is a test and assert that fails if you did not. + /// Commonly-used tone values in a [FlexTonalPalette]. /// /// Contains custom tones 5 and 98, in addition to the 13 tones included - /// in the Material 3 guide. The tone 98 also exists in the + /// in the Material 3 guide tonal palette. The tone 98 also exists in the /// [Web Material Theme Builder app](https://m3.material.io/theme-builder#/custom), /// but not in Flutter or /// [Material Color Utilities package](https://pub.dev/packages/material_color_utilities). @@ -89,9 +89,9 @@ class FlexTonalPalette { 100, ]; - // If you changed commonTones length, update commonSize to commonTones.length. - // There is a test and assert that fails if you did not. - // + // If modifying commonTones length, update commonSize to equal + // commonTones.length. There is a test and assert that fails if you did not. + /// Number of tones in [commonTones]. /// /// In original implementation package material_color_utilities this is @@ -190,7 +190,7 @@ class FlexTonalPalette { /// An intermediate concept between the key color for a UI theme, and a full /// color scheme. Five tonal palettes are generated, plus a default -/// error palette. +/// error palette if not provided. /// /// This is a modification of package:material_color_utilities [CorePalette], /// to make it possible to create Material 3 seeded ColorScheme using tonal @@ -201,7 +201,9 @@ class FlexTonalPalette { /// This implementation also has an unnamed constructor for the five main final /// [FlexTonalPalette] properties. Exposes the original version's private /// constructor [FlaxCorePalette.fromHueChroma], that is used by -/// [FlexCorePalette.of]. It also adds a [FlexCorePalette.fromSeeds] constructor +/// [FlexCorePalette.of]. +/// +/// It adds a [FlexCorePalette.fromSeeds] constructor /// to enable creating the [FlexTonalPalette]s for primary, secondary and /// tertiary color groups using optional ARGB seed colors, for secondary and /// tertiary [FlexTonalPalette]s, instead of tying them down to same seed ARGB diff --git a/lib/src/flex_seed_scheme.dart b/lib/src/flex_seed_scheme.dart index 50edbaf..d404dd9 100644 --- a/lib/src/flex_seed_scheme.dart +++ b/lib/src/flex_seed_scheme.dart @@ -16,10 +16,10 @@ import 'flex_tones.dart'; /// /// 1) Three seed colors instead of just one. /// -/// Instead of [CorePalette] it uses inherited version called [FlexCorePalette] +/// Instead of [CorePalette] it uses custom version called [FlexCorePalette] /// that enables using 1, 2 or 3 seed colors for more degrees /// of freedom in seeded ColorScheme, using defined seed colors for -/// primary, secondary and tertiary colors. The extended [FlexCorePalette] +/// primary, secondary and tertiary colors. The custom [FlexCorePalette] /// version also allows for adjusting chroma usage and levels that are /// hard coded into M3 design [CorePalette]. /// @@ -184,8 +184,8 @@ class FlexSeedScheme { /// tones mapping. /// /// A [FlexSeedScheme] cannot be created externally. It is only used - /// internally to create a seeded [ColorScheme] via its static method - /// [FlexSeedScheme.fromSeeds] from one, two or three seed + /// internally to create a seeded [ColorScheme] via its static extension + /// [SeedColorScheme.fromSeeds] from one, two or three seed /// colors, and with customizable [FlexTones] tone mapping to [ColorScheme]. factory FlexSeedScheme._tones({ required int primaryKey, diff --git a/lib/src/flex_tones.dart b/lib/src/flex_tones.dart index 7f1b17c..7ada0ca 100644 --- a/lib/src/flex_tones.dart +++ b/lib/src/flex_tones.dart @@ -3,12 +3,12 @@ import 'package:flutter/foundation.dart'; // ignore_for_file: comment_references /// Configuration data class that defines which tone to use from each -/// [TonalPalette] when assigning used color to each [ColorScheme] color. +/// [FlexTonalPalette] when assigning used color to each [ColorScheme] color. /// /// It is also possible to define how Cam16 chroma is used and limited when /// generating the tonal palette. /// -/// To use [FlexTones] pass in one of the predefined configs to [tones]: +/// To use [FlexTones] pass in one of the predefined configs to `tones`]: /// /// * FlexTones.material, default and same as Flutter SDK M3 setup. /// * FlexTones.soft, softer and earthier tones than M3 FlexTones.material. @@ -24,32 +24,25 @@ import 'package:flutter/foundation.dart'; /// /// You can also easily create custom configurations by using the /// [FlexTones.light] and [FlexTones.dark] factories that have defaults that -/// match the Material 3 design setup. Just modify the properties you +/// match the Material 3 design setup tone mapping wise, but don't lock +/// chroma bu default. Just modify the properties you /// want to change. The above pre-made constructors are examples of doing this. /// -/// When [TonalPalette]s are generated from key color(s) and used to define +/// When [FlexTonalPalette]s are generated from key color(s) and used to define /// a [ColorScheme], it is recommended to use the same key colors and /// [FlexTones] setup for both the light and dark theme. By doing so the -/// same [TonalPalette] is used to assign suitable tones from the same -/// [TonalPalette] but using different tones. +/// same [FlexTonalPalette] is used to assign suitable tones from identical +/// [FlexTonalPalette], but using different tones for light and dark +/// [Brightness]. /// -/// When you use [FlexColorScheme.dark] and its built in schemes via [scheme] -/// enum property, it automatically uses the light mode [primary], -/// [secondary] and [tertiary] color definitions as seed keys for their -/// respective tonal palette generation. Thus creating identical [TonalPalettes] -/// for dark mode as for light mode and using the tones based and chroma setup -/// from provided or default [FlexTones]. +/// The [FlexTones.light] and [FlexTones.dark] constructors match the +/// definition used by Material Design 3 based seed generated tones, for +/// the tone mapping, however chroma is by default unbound. Use the +/// [FlexTones.material], for an exact match. /// -/// If you make custom color schemes using [FlexColorScheme] it is up to you -/// to define what colors you use when you use key colors to seed -/// [ColorScheme]s. -/// -/// The used default [FlexTones.light] and [FlexTones.dark] match the definition -/// Flutter SDK uses for its Material Design 3 based seed generated tones. /// In Flutter SDK this tone mapping and chroma setup is done with hard coded -/// values in [ColorScheme.fromSeed] and libraries it uses. You have to go to -/// lower APIs and open them up a bit to offer the possibilities and flexibility -/// FlexColorScheme provides as configurable parameters. +/// values in [ColorScheme.fromSeed] and libraries it uses. This class offers +/// configuration of those parameters. @immutable class FlexTones with Diagnosticable { /// Default constructor requiring all properties. diff --git a/pubspec.lock b/pubspec.lock index 1cf259b..2c3c991 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -367,4 +367,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=2.18.0-271.4.beta <3.0.0" + dart: ">=2.18.0 <3.0.0" + flutter: ">=3.3.0" diff --git a/pubspec.yaml b/pubspec.yaml index 05feb64..ee09e7b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,13 +1,14 @@ name: flex_seed_scheme description: A more flexible version of Flutter's ColorScheme.fromSeed, use multiple seed colors, custom chroma and tone mapping. -version: 0.2.0-dev.2 +version: 1.0.0 homepage: https://github.com/rydmike/flex_seed_scheme repository: https://github.com/rydmike/flex_seed_scheme issue_tracker: https://github.com/rydmike/flex_seed_scheme/issues documentation: https://github.com/rydmike/flex_seed_scheme/blob/master/README.md environment: - sdk: '>=2.18.0-271.4.beta <3.0.0' + sdk: '>=2.18.0 <3.0.0' + flutter: '>=3.3.0' dependencies: flutter: