diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml
new file mode 100644
index 0000000..c8a13ba
--- /dev/null
+++ b/.github/workflows/continuous_integration.yml
@@ -0,0 +1,64 @@
+name: Continuous Integration
+
+on: [push, pull_request]
+
+jobs:
+ check:
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-java@v1
+ with:
+ java-version: '12.x'
+ - uses: subosito/flutter-action@v1
+ with:
+ channel: 'stable'
+ - name: Get dependencies
+ run: flutter pub get
+ - name: Verify source code is formatted
+ run: flutter format --set-exit-if-changed .
+ - name: Verify there are no analyzer errors
+ run: flutter analyze --fatal-infos --fatal-warnings .
+ - name: Verify all tests pass
+ run: flutter test --coverage
+ - name: Verify example app builds
+ run: cd example && flutter build web
+ - uses: codecov/codecov-action@v1.0.0
+ name: Upload coverage to codecov.io
+ with:
+ flags: unittests
+ file: coverage/lcov.info
+ token: ${{ secrets.CODECOV_TOKEN }}
+
+ publish:
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ needs: [check]
+ if: github.ref == 'refs/heads/main'
+ # Continue on error doesn't seem to work?
+ # Using || true for publishing
+ # continue-on-error: true
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Dart
+ run: |
+ sudo apt-get update
+ sudo apt-get install apt-transport-https
+ sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -'
+ sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
+ sudo apt-get update
+ sudo apt-get install dart
+ export PATH="$PATH:/usr/lib/dart/bin"
+ - name: Setup credentials
+ run: |
+ mkdir -p ~/.pub-cache
+ echo ${{ secrets.PUB_CREDENTIALS_JSON }} > ~/.pub-cache/credentials.json
+ - name: Publish the package
+ run: |
+ export version=v$(grep "version: " pubspec.yaml | cut -c 10-)
+ dart pub publish --force && (git tag $version && git push origin $version && gh release create $version) || true
+ env:
+ GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
+ - name: Delete credentials
+ run: rm ~/.pub-cache/credentials.json
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..db88d5a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,76 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+.packages
+.pub-cache/
+.pub/
+build/
+
+# Android related
+**/android/**/gradle-wrapper.jar
+**/android/.gradle
+**/android/captures/
+**/android/gradlew
+**/android/gradlew.bat
+**/android/local.properties
+**/android/**/GeneratedPluginRegistrant.java
+
+# iOS/XCode related
+**/ios/**/*.mode1v3
+**/ios/**/*.mode2v3
+**/ios/**/*.moved-aside
+**/ios/**/*.pbxuser
+**/ios/**/*.perspectivev3
+**/ios/**/*sync/
+**/ios/**/.sconsign.dblite
+**/ios/**/.tags*
+**/ios/**/.vagrant/
+**/ios/**/DerivedData/
+**/ios/**/Icon?
+**/ios/**/Pods/
+**/ios/**/.symlinks/
+**/ios/**/profile
+**/ios/**/xcuserdata
+**/ios/.generated/
+**/ios/Flutter/App.framework
+**/ios/Flutter/Flutter.framework
+**/ios/Flutter/Flutter.podspec
+**/ios/Flutter/Generated.xcconfig
+**/ios/Flutter/ephemeral
+**/ios/Flutter/app.flx
+**/ios/Flutter/app.zip
+**/ios/Flutter/flutter_assets/
+**/ios/Flutter/flutter_export_environment.sh
+**/ios/ServiceDefinitions.json
+**/ios/Runner/GeneratedPluginRegistrant.*
+
+# Exceptions to above rules.
+!**/ios/**/default.mode1v3
+!**/ios/**/default.mode2v3
+!**/ios/**/default.pbxuser
+!**/ios/**/default.perspectivev3
+coverage/
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..1d4801a
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,3 @@
+## 0.2.0+3
+
+Initial release, set up CI/CD and code coverage, etc.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..731a737
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,9 @@
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..7e447d2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,39 @@
+# `kolors`
+
+> The named HTML colors that you can use in your Flutter apps.
+
+HTML and CSS lets you use around 140 names colors. With this simple Flutter package, you can now access these colors also from your Flutter app.
+
+[![Continuous Integration](https://github.com/dartsidedev/kolors/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/dartsidedev/kolors/actions) [![codecov](https://codecov.io/gh/dartsidedev/kolors/branch/main/graph/badge.svg)](https://codecov.io/gh/dartsidedev/kolors) [![kolors](https://img.shields.io/pub/v/kolors?label=kolors&logo=dart)](https://pub.dev/packages/kolors 'See kolors package info on pub.dev') [![Published by dartside.dev](https://img.shields.io/static/v1?label=Published%20by&message=dartside.dev&logo=dart&logoWidth=30&color=40C4FF&labelColor=1d599b&labelWidth=100)](https://pub.dev/publishers/dartside.dev/packages) [![GitHub Stars Count](https://img.shields.io/github/stars/dartsidedev/kolors?logo=github)](https://github.com/dartsidedev/kolors 'Star me on GitHub!')
+
+## Important links
+
+* [Read the source code and **star the repo** on GitHub](https://github.com/dartsidedev/kolors)
+* [Open an issue on GitHub](https://github.com/dartsidedev/kolors/issues)
+* [See package on `pub.dev`](https://pub.dev/packages/kolors)
+* [Read the docs on `pub.dev`](https://pub.dev/documentation/kolors/latest/)
+
+## Usage
+
+```dart
+import 'package:kolors/kolors.dart';
+
+// If you want to show the colors with their names to your users,
+// use the "asMap" that contains the colors names and the colors.
+final m = Kolors.asMap();
+final entries = m.entries.toList(growable: false);
+
+// Just type "Kolors." and pick a color that you like.
+const appBarColor = Kolors.tomato;
+
+// You can use the grouped classes if you know which color's shades
+// you are interested in.
+const fabColor = KolorBlues.skyBlue;
+```
+
+TODO: demo app gif
+TODO: demo IntelliJ
+
+You can find the example app on GitHub and on pub.dev.
+
+Please keep in mind that this package has a `dart:ui` dependency (and [therefore runs only with Flutter](https://twitter.com/vincevargadev/status/1471965783463010311)).
\ No newline at end of file
diff --git a/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 0000000..f9b3034
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1 @@
+include: package:flutter_lints/flutter.yaml
diff --git a/example/.gitignore b/example/.gitignore
new file mode 100644
index 0000000..0fa6b67
--- /dev/null
+++ b/example/.gitignore
@@ -0,0 +1,46 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+**/ios/Flutter/.last_build_id
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+.packages
+.pub-cache/
+.pub/
+/build/
+
+# Web related
+lib/generated_plugin_registrant.dart
+
+# Symbolication related
+app.*.symbols
+
+# Obfuscation related
+app.*.map.json
+
+# Android Studio will place build artifacts here
+/android/app/debug
+/android/app/profile
+/android/app/release
diff --git a/example/.metadata b/example/.metadata
new file mode 100644
index 0000000..71a1778
--- /dev/null
+++ b/example/.metadata
@@ -0,0 +1,10 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled and should not be manually edited.
+
+version:
+ revision: 65cf7de5f45140010a5d2989f5abbbf530708a6b
+ channel: beta
+
+project_type: app
diff --git a/example/README.md b/example/README.md
new file mode 100644
index 0000000..1b8ed45
--- /dev/null
+++ b/example/README.md
@@ -0,0 +1,3 @@
+# example
+
+An example project for demonstrating how the kolors package works.
\ No newline at end of file
diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml
new file mode 100644
index 0000000..61b6c4d
--- /dev/null
+++ b/example/analysis_options.yaml
@@ -0,0 +1,29 @@
+# This file configures the analyzer, which statically analyzes Dart code to
+# check for errors, warnings, and lints.
+#
+# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
+# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
+# invoked from the command line by running `flutter analyze`.
+
+# The following line activates a set of recommended lints for Flutter apps,
+# packages, and plugins designed to encourage good coding practices.
+include: package:flutter_lints/flutter.yaml
+
+linter:
+ # The lint rules applied to this project can be customized in the
+ # section below to disable rules from the `package:flutter_lints/flutter.yaml`
+ # included above or to enable additional rules. A list of all available lints
+ # and their documentation is published at
+ # https://dart-lang.github.io/linter/lints/index.html.
+ #
+ # Instead of disabling a lint rule for the entire project in the
+ # section below, it can also be suppressed for a single line of code
+ # or a specific dart file by using the `// ignore: name_of_lint` and
+ # `// ignore_for_file: name_of_lint` syntax on the line or in the file
+ # producing the lint.
+ rules:
+ # avoid_print: false # Uncomment to disable the `avoid_print` rule
+ # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options
diff --git a/example/lib/main.dart b/example/lib/main.dart
new file mode 100644
index 0000000..6129a21
--- /dev/null
+++ b/example/lib/main.dart
@@ -0,0 +1,47 @@
+import 'package:flutter/material.dart';
+import 'package:kolors/kolors.dart';
+
+void main() => runApp(const MyApp());
+
+class MyApp extends StatelessWidget {
+ const MyApp({Key? key}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ // If you want to show the colors with their names to your users,
+ // use the "asMap" that contains the colors names and the colors.
+ final m = Kolors.asMap();
+ final entries = m.entries.toList(growable: false);
+
+ // Just type "Kolors." and pick a color that you like.
+ const appBarColor = Kolors.tomato;
+
+ // You can use the grouped classes if you know which color's shades
+ // you are interested in.
+ const fabColor = KolorBlues.skyBlue;
+
+ return MaterialApp(
+ title: 'Flutter Demo',
+ debugShowCheckedModeBanner: false,
+ home: Scaffold(
+ appBar: AppBar(
+ title: const Text('HTML Colors'),
+ backgroundColor: appBarColor,
+ ),
+ floatingActionButton: FloatingActionButton(
+ onPressed: () {},
+ tooltip: 'Do nothing',
+ child: const Icon(Icons.ac_unit),
+ backgroundColor: fabColor,
+ ),
+ body: ListView.builder(
+ itemCount: entries.length,
+ itemBuilder: (_, i) => ListTile(
+ tileColor: entries[i].value,
+ title: Text(entries[i].key),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/example/pubspec.lock b/example/pubspec.lock
new file mode 100644
index 0000000..4d7600d
--- /dev/null
+++ b/example/pubspec.lock
@@ -0,0 +1,175 @@
+# Generated by pub
+# See https://dart.dev/tools/pub/glossary#lockfile
+packages:
+ async:
+ dependency: transitive
+ description:
+ name: async
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.8.1"
+ boolean_selector:
+ dependency: transitive
+ description:
+ name: boolean_selector
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0"
+ characters:
+ dependency: transitive
+ description:
+ name: characters
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ charcode:
+ dependency: transitive
+ description:
+ name: charcode
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.3.1"
+ clock:
+ dependency: transitive
+ description:
+ name: clock
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ collection:
+ dependency: transitive
+ description:
+ name: collection
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.15.0"
+ cupertino_icons:
+ dependency: "direct main"
+ description:
+ name: cupertino_icons
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ fake_async:
+ dependency: transitive
+ description:
+ name: fake_async
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0"
+ flutter:
+ dependency: "direct main"
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ flutter_lints:
+ dependency: "direct dev"
+ description:
+ name: flutter_lints
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.4"
+ flutter_test:
+ dependency: "direct dev"
+ description: flutter
+ source: sdk
+ version: "0.0.0"
+ kolors:
+ dependency: "direct main"
+ description:
+ path: ".."
+ relative: true
+ source: path
+ version: "0.1.0"
+ lints:
+ dependency: transitive
+ description:
+ name: lints
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.0.1"
+ matcher:
+ dependency: transitive
+ description:
+ name: matcher
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.12.10"
+ meta:
+ dependency: transitive
+ description:
+ name: meta
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.7.0"
+ path:
+ dependency: transitive
+ description:
+ name: path
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.8.0"
+ sky_engine:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.99"
+ source_span:
+ dependency: transitive
+ description:
+ name: source_span
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.8.1"
+ stack_trace:
+ dependency: transitive
+ description:
+ name: stack_trace
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.10.0"
+ stream_channel:
+ dependency: transitive
+ description:
+ name: stream_channel
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0"
+ string_scanner:
+ dependency: transitive
+ description:
+ name: string_scanner
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.1.0"
+ term_glyph:
+ dependency: transitive
+ description:
+ name: term_glyph
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.2.0"
+ test_api:
+ dependency: transitive
+ description:
+ name: test_api
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.4.2"
+ typed_data:
+ dependency: transitive
+ description:
+ name: typed_data
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.3.0"
+ vector_math:
+ dependency: transitive
+ description:
+ name: vector_math
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.0"
+sdks:
+ dart: ">=2.12.0 <3.0.0"
+ flutter: ">=1.17.0"
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
new file mode 100644
index 0000000..8a74452
--- /dev/null
+++ b/example/pubspec.yaml
@@ -0,0 +1,19 @@
+name: example
+description: An example project for demonstrating how the kolors package works.
+publish_to: 'none'
+version: 1.0.0+1
+environment:
+ sdk: ">=2.12.0 <3.0.0"
+dependencies:
+ flutter:
+ sdk: flutter
+ cupertino_icons: ^1.0.2
+ kolors:
+ path: ../
+
+dev_dependencies:
+ flutter_test:
+ sdk: flutter
+ flutter_lints: ^1.0.0
+flutter:
+ uses-material-design: true
diff --git a/example/web/favicon.png b/example/web/favicon.png
new file mode 100644
index 0000000..8aaa46a
Binary files /dev/null and b/example/web/favicon.png differ
diff --git a/example/web/icons/Icon-192.png b/example/web/icons/Icon-192.png
new file mode 100644
index 0000000..b749bfe
Binary files /dev/null and b/example/web/icons/Icon-192.png differ
diff --git a/example/web/icons/Icon-512.png b/example/web/icons/Icon-512.png
new file mode 100644
index 0000000..88cfd48
Binary files /dev/null and b/example/web/icons/Icon-512.png differ
diff --git a/example/web/icons/Icon-maskable-192.png b/example/web/icons/Icon-maskable-192.png
new file mode 100644
index 0000000..eb9b4d7
Binary files /dev/null and b/example/web/icons/Icon-maskable-192.png differ
diff --git a/example/web/icons/Icon-maskable-512.png b/example/web/icons/Icon-maskable-512.png
new file mode 100644
index 0000000..d69c566
Binary files /dev/null and b/example/web/icons/Icon-maskable-512.png differ
diff --git a/example/web/index.html b/example/web/index.html
new file mode 100644
index 0000000..b829dda
--- /dev/null
+++ b/example/web/index.html
@@ -0,0 +1,101 @@
+
+
+