Skip to content

Commit

Permalink
Release 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rydmike committed Jan 31, 2021
1 parent f981faf commit f2143ea
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 129 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
# - Show outdated packages, just added for info.
# - Verify that dart format is used by all committed code, fails if not. Controversial but pub.dev penalizes you if
# dart format is not used.
# - Run all tests.
# - Run all tests with coverage.
# - Upload code coverage output to Codecov for analysis.
# - Install linux rpl tool. It is used to automate the needed change of a line in index.html.
# - Build 5 different WEB example apps using FlexColorScheme. All examples use these steps:
# - Flutter clean.
Expand All @@ -20,8 +21,8 @@
# but runs on release, when it is published, created or edited.
#
# TODO Maybe set this workflow up to also run on a weekly schedule to check that nothing is broken?
# Also planning to setup another matrix test run, but this one is also a nice test
# since it does not just runs tests, but also builds actual Web apps using the package.
# Also planning to setup a matrix test run, but this one is anyway a nice test
# since it does not just runs tests, it also builds actual Web apps using the package.
#
name: Build Web
on:
Expand Down
90 changes: 0 additions & 90 deletions .github/workflows/build.yml.old-with-sep-jobs

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This GitHub action runs on a release, when it is published, created or edited.
# TODO: Test how this trigger works in practice!
#
# - Installs dart and flutter
# - Uses flutter dev channel for now, will change to stable when web supported on stable.
Expand All @@ -11,7 +10,8 @@
# - Show outdated packages, just added for info.
# - Verify that dart format is used by all committed code, fails if not. Controversial but pub.dev penalizes you if
# dart format is not used.
# - Run all tests.
# - Run all tests with coverage.
# - Upload code coverage output to Codecov for analysis.
# - Install linux rpl tool. It is used to automate the needed change of a line in index.html.
# - Build 5 different WEB example apps using FlexColorScheme. All examples use these steps:
# - Flutter clean.
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# This GitHub action runs on push to master, it:
#
# - Installs dart and flutter
# - Uses flutter stable channel for now, might setup a matrix later with beta and dev included too.
# - Gets package dependencies
# - Runs dart analyze, allows deprecation warnings, we on purpose allow use of deprecated features for now.
# - Show outdated packages, just added for info.
# - Verify that dart format is used by all committed code, fails if not. Controversial but pub.dev penalizes you if
# dart format is not used.
# - Run all tests with coverage.
# - Upload code coverage output to Codecov for analysis.
#
name: Test
on:
push:
Expand All @@ -23,6 +35,9 @@ jobs:
- name: Analyze Dart source
run: dart analyze

- name: Show outdated packges
run: flutter pub outdated

- name: Verify that Dart formatting is used, fail if not
run: dart format --output=none --set-exit-if-changed .

Expand Down
15 changes: 8 additions & 7 deletions 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.

## [1.4.1] - January 30, 2021
## [1.4.1] - January 31, 2021

* Added four new built-in color schemes.
* **Barossa** - Barossa red and cardin green theme.
Expand All @@ -15,8 +15,9 @@ All notable changes to the **FlexColorScheme** package will be documented in thi
Use enum value `FlexScheme.damask` for easy access to it.

* Improved Semantics for the ThemeMode Widget buttons.
* Improved the widget tests, makes and checks for system mode changes. Totally 723 tests, codecov > 99.5%.
* Added GitHub actions to automate build and publish the examples on the web.
* Improved FlexThemeModeSwitch widget tests, makes and checks for system mode changes.
* More tests, totally 723 tests, codecov is now > 99.5%.
* Added GitHub actions to automate build and to publish the examples on the Web on a new release.
* Minor changes to the examples. Modified to not need the `late` keyword when they are converted
to null safe versions.
* **Documentation:**
Expand Down Expand Up @@ -207,7 +208,7 @@ Feel free to open a [suggestion or issue](https://github.com/rydmike/flex_color_
- Version 1.4.0: Increased unit and widget test to 689 tests. All color definitions are now also tested to ensure
they will not be changed by any accidental edit. Test coverage is higher than 95%, certainly sufficient for this
type of package, but there are still some areas that could and will be improved.
- Version 1.4.1 Consider testing sufficient for now.
- Version 1.4.1 More tests, tests are now considered sufficient for current features.
- Version 1.4.1 Added automated build and publish pipes for the Web examples!

### MAYBE
Expand All @@ -223,10 +224,10 @@ Feel free to open a [suggestion or issue](https://github.com/rydmike/flex_color_
`FlexColorScheme` to be functionally on a level similar to `ColorScheme`, and therefore it should not cover
serialization of itself. Serialization have to deal with a lot of potential failure points that I think should
not have to be a concern in this type of component. I am not planning to add it, not yet at least, I might
reconsider it later.
reconsider this later.

My recommendation for saving the state of a `FlexColorScheme`. Include values for its settings that you
use in your implementation, in other models in your application, like an "AppSettings" model or similar.
My recommendation for saving the state of a `FlexColorScheme` is to include values for its settings that you
use in your implementation in other models in your application, like an "AppSettings" model or similar.
You probably serialize and store such data already, perhaps with shared preferences, hive, get_storage or
some other solution. Include the values you need for your `FlexColorScheme` implementation in your stored settings
and then use those values to restore your `FlexColorScheme` configuration and theme. This way, your implementation
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
color branding on surfaces. The created themes are based on the same concept as Flutter's ColorScheme based themes,
but with a few interesting twists and convenience features.

For some additional information about **FlexColorScheme**, its background and use cases, this package companion
For some additional information about **FlexColorScheme**, its background and use cases, the package companion
[**blog post and article**](https://rydmike.com/colorscheme) is also recommended reading.

<img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/CollageSize50.png?raw=true" alt="ColorScheme Intro"/>
Expand Down Expand Up @@ -242,7 +242,7 @@ to using FlexColorScheme and is really only there to better demonstrate the resu


> **NOTE:**
> Version 1.4.0 introduces the easier and less verbose `scheme` convenience factory property used above.
> Version 1.4.0 introduced the easier and less verbose `scheme` convenience factory property used above.
> You can use it instead of `colors` if all you want to do is just use one of the built-in color schemes.
> The previous way of
> using `colors` with the `FlexColor.schemes` **map**, with the `FlexScheme` enum values as keys, works as before
Expand Down Expand Up @@ -306,9 +306,9 @@ With them you can see the active theme's colors, and the created theme's impact

<img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/fcs_phone_ex1al.png?raw=true" alt="ColorScheme example 1 light" width="180"/><img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/fcs_phone_ex1bl.png?raw=true" alt="ColorScheme example 1 lightb" width="180"/><img src="https://github.com/rydmike/flex_color_scheme/blob/master/resources/fcs_phone_ex1cl.png?raw=true" alt="ColorScheme example 1 dark" width="180"/>

The default sample app, example 1, just shows the simplest use-case of FlexColorScheme and barely scratches the
surface of what it can do. To get the full details in a step by step progression you should go through the tutorial
that uses examples 1 through 5 to introduce more features in a step by step complexity progression.
The default sample app, example 1, shows the simplest use-case of FlexColorScheme and barely scratches the
surface of what it can do. To get the full details in a step by step progression, go through the tutorial
that uses examples 1 through 5, to introduce more features in a step by step complexity progression.

> **Building the examples**
>If you cloned the repository to build the examples, you can open the package `/example` folder with your IDE to build
Expand Down Expand Up @@ -434,7 +434,7 @@ widget shows the theme with several common Material widgets.

This example is basically a repeat of the Flutter default counter app modification earlier, but with a different
`HomePage` and a way to change the `MaterialApp` active `themeMode` property value via the `FlexThemeModeSwitch`
switch on the `HomePage`, using a basic value changed callback function.
switch on the `HomePage`, using a normal value changed callback function.

```dart
void main() => runApp(const DemoApp());
Expand Down
2 changes: 1 addition & 1 deletion example/lib/example4/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class HomePage extends StatelessWidget {
EdgeInsets.symmetric(horizontal: AppConst.edgePadding),
child: ShowThemeColors(),
),
const Divider(),
const SizedBox(height: 8),
// Open a sub-page
ListTile(
title: const Text('Open a demo subpage'),
Expand Down
27 changes: 14 additions & 13 deletions example/lib/example5/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,20 @@ class _HomePageState extends State<HomePage> {
child: ShowThemeColors(),
),
const SizedBox(height: 8),
// Open a sub-page
ListTile(
title: const Text('Open a demo subpage'),
subtitle: const Text(
'The subpage will use the same '
'color scheme based theme automatically.',
),
trailing: const Icon(Icons.chevron_right, size: 34),
onTap: () {
Subpage.show(context);
},
),
const Divider(),
// const SizedBox(height: 8),
SwitchListTile.adaptive(
title: const Text('Compute dark theme'),
subtitle: const Text(
Expand Down Expand Up @@ -925,19 +939,6 @@ class _HomePageState extends State<HomePage> {
onChanged: widget.onUseToThemeChanged,
),
const Divider(),
// Open a sub-page
ListTile(
title: const Text('Open a demo subpage'),
subtitle: const Text(
'The subpage will use the same '
'color scheme based theme automatically.',
),
trailing: const Icon(Icons.chevron_right, size: 34),
onTap: () {
Subpage.show(context);
},
),
const Divider(),
Text('Menu', style: headline4),
const Text(
'The menu is a just a demo to make a larger '
Expand Down
8 changes: 4 additions & 4 deletions example/lib/shared/subpage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ class _SubpageState extends State<Subpage> {
actions: const <Widget>[AboutIconButton()],
bottom: const TabBar(
tabs: <Widget>[
Tab(icon: Icon(Icons.home), text: 'Home'),
Tab(icon: Icon(Icons.star), text: 'Favorites'),
Tab(icon: Icon(Icons.face), text: 'Profile'),
Tab(icon: Icon(Icons.settings), text: 'Settings'),
Tab(text: 'Home'),
Tab(text: 'Favorites'),
Tab(text: 'Profile'),
Tab(text: 'Settings'),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ packages:
version: "2.1.0-nullsafety.5"
sdks:
dart: ">=2.12.0-0.0 <3.0.0"
flutter: ">=1.22.0 <2.0.0"
flutter: ">=1.22.0"
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.0

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

# The Flutter SDK (by Google flutter.dev).
flutter:
Expand Down

0 comments on commit f2143ea

Please sign in to comment.