Receiving ozh's github-colors repository with latest commit of colors.json to Flutter's Color object.

Overview

Apply GitHub's languages colours into Flutter's Color object.

Pub Version GitHub Sponsors

Receiving ozh's github-colors repository with latest commit of colors.json to Flutter's Color object.

It also provide web demo for the demo.

Usage

You can either initalized GitHubColour before runApp(Widget) (Call it after WidgetsFlutterBinding.ensureInitialized() if want to get data from offline):

// With offline last resort
void main() async {
    WidgetsFlutterBinding.ensureInitialized();
    await GitHubColour.getInstance();
    runApp(const YourApp());
}

// Without offline last resort
void main() async {
    await GitHubColour.getInstance(offlineLastResort: false);
    runApp(const YourApp());
}

then uses getExistedInstance() inside the Widget:

class YourAppWidget extends StatelessWidget {
    @override
    Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
            backgroundColor: GitHubColour.getExistedInstance().find("Go")
        )
    );
}

or wrapped into FutureBuilder with initalized Future<GitHubColour> variable from State's initState (not recommended uses getInstance() directly in FutureBuilder):

class _YourAnotherAppWidgetState extends State<YourAnotherAppWidget> {
    late final Future<GitHubColour> _ghc;

    @override
    void initState() {
        super.initState();
        _ghc = GitHubColour.getInstance();
    }

    @override
    Widget build(BuildContext context) => FutureBuilder<GitHubColour>(
        future: _ghc,
        builder: (context, snapshot) {
            // Implement whatever you want
        }
    );
}

Cache for connection failed

This package supported caching system as a backup when making request failed. It uses LZMA compress data and store as a file under temporary directory (for VM) or store as shared_preference (for Web, which is LocalStorage).

If no cache available, by default, GitHubColour.getInstance() will uses local's colors.json as last resort. However, this package will not synchronized when newer commit of color.json pushed since it minified that ensure the package can be downloaded as fast as possible.

Note for American English developers

It's provide alias class GitHubColor for who uses "color" mostly.

Screenshots

C++ Dart

Go Java

Python

License

BSD-3

You might also like...

ThemeX is an easy theme manipulation. Only inform primary color and the ThemeX generate all color combination palette for you

ThemeX is an easy theme manipulation. Only inform primary color and the ThemeX generate all color combination palette for you

ThemeX is an easy theme manipulation basied on Material Design. Only inform primary color and the ThemeX generate all color combination palette for yo

Jan 31, 2022

Color picker for Flutter, based on the Google Docs color picker.

Color picker for Flutter, based on the Google Docs color picker.

Material ColorPicker Color picker for Flutter, based on the Google Docs color picker. Getting Started You can embed into your material app or use it o

Oct 30, 2022

A Fluter tabview that text color can change with animation and bg color change with animation

A Fluter tabview that text color can change with animation and bg color change with animation

float_tab A Fluter tabview that text color can change with animation and bg color change with animation Getting Started This project is a starting poi

Dec 8, 2021

A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically.

A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically.

flutter_statusbarcolor A package can help you to change your flutter app's statusbar's color or navigationbar's color programmatically. Getting Starte

Nov 10, 2022

Color matching game - A Crossplatform Color Matching Game made with Flutter

Color matching game - A Crossplatform Color Matching Game made with Flutter

color_matching_game A Color Matching Game built with Flutter. It is a simple app made without adding a plug-in. Play by specifying the red, green and

Nov 21, 2022

A colorful TabBar Flutter library with color animating indicator where each tab has a color. (inspired by SmartNews app)

A colorful TabBar Flutter library with color animating indicator where each tab has a color. (inspired by SmartNews app)

Flutter Colorful TabBar A colorful TabBar for Flutter where each tab has a color (inspired by SmartNews app). Getting Started Add this to your package

Jun 17, 2022

Colorpicker flutter - This Color picker for flutter apps provide picking facility for both single and multiple color choosing

Colorpicker flutter - This Color picker for flutter apps provide picking facility for both single and multiple color choosing

This Color picker for flutter apps provide picking facility for both single and

Feb 2, 2022

Choose color theme template - A template will help you choose a color scheme for the application, show how widgets interact with it

Choose color theme template - A template will help you choose a color scheme for the application, show how widgets interact with it

choose_color_theme_template This template will help you choose a color scheme fo

Oct 24, 2022

An open-source unofficial GitHub mobile client, that aims to deliver the ultimate GitHub experience on mobile devices.

An open-source unofficial GitHub mobile client, that aims to deliver the ultimate GitHub experience on mobile devices.

DioHub for Github Summary Features Roadmap Support Screenshots Build Instructions Summary DioHub is an open-source unofficial GitHub mobile client, th

Jan 4, 2023
Comments
  • Incompatible `path` version when using `flutter_test` dependencies.

    Incompatible `path` version when using `flutter_test` dependencies.

    This package uses newer version of path which flutter_test also depended with older version (1.8.0) that unable to perform test until the SDK shipped with newer path dependency version.

    The newer version one fixed crashes when convert path to URI which supposed to be updated in SDK.

    opened by rk0cc 1
Owner
Cyrus Chan
Graduated Higher Diploma of Software Engineering. Flutter and Dart mainly, then Maven Java, Node.js, .NET.
Cyrus Chan
Color-Converter - A minimalist application made with flutter to convert hexadecimal colors to RGB colors and vise-versa.

Color Converter A minimalist application made with flutter to convert hexadecimal colors to RGB colors and vise-versa for Flutter Create Competition.

Poojan Pandya 2 Sep 16, 2020
Material color picker, you can customize colors. Selection in two step, first main color and after shades.

Flutter Material Color Picker Material Color picker is a Flutter widget, that can be customizable. By default, it's Material Colors, but you can defin

Jean-Charles Moussé 70 Nov 25, 2022
Github-apps-flutter - Github Apps Build Using bloc 8.0 and Github API

Github_apps Inspiration This app is made to build using bloc 8.0 and github API.

Irvan Lutfi Gunawan 18 Apr 14, 2022
Commit = Session task

Flutter Course Code Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is your fir

null 4 Jul 12, 2022
Build an example app for receiving notification from Firebase Cloud Messaging (FCM)

notify Build an app demo for receiving notifications from Firebase Cloud Messaging. Check more information: https://firebase.google.com/docs/cloud-mes

TAD 3 Dec 9, 2022
Flutter shareable package of object-oriented classes for local caching of user data in json

json_cache Json Cache is an object-oriented package to serve as a layer on top of local storage packages - packages that persist data locally on the u

Dartoos 10 Dec 19, 2022
🎯 This library automatically generates object classes from JSON files that can be parsed by the freezed library.

The Most Powerful Way to Automatically Generate Model Objects from JSON Files ⚡ 1. Guide ?? 1.1. Features ?? 1.1.1. From 1.1.2. To 1.2. Getting Starte

KATO, Shinya / 加藤 真也 14 Nov 9, 2022
A Flutter color palette with eyedropper, HSL, RGB and Material colors

Cyclop A flutter colorpicker with an eyedropper tool. Works on mobile, desktop & web ( CanvasKit) Demo Desktop & tablet Mobile Material HSL RVB Custom

Erick Ghaumez 106 Oct 17, 2022
A Flutter color palette with eyedropper, HSL, RGB and Material colors

Cyclop A flutter colorpicker with an eyedropper tool. Works on mobile, desktop & web ( CanvasKit) Demo Desktop & tablet Mobile Material HSL RVB Custom

Erick Ghaumez 107 Jan 5, 2023
Automatically generate profile picture with random first name and background color. But you can still provide pictures if you have them. As the default color, based on the name of the first letter. :fire: :fire: :fire:

FLUTTER PROFILE PICTURE Automatically generate profile picture with random first name and background color. But you can still provide pictures if you

Aditya Dharmawan Saputra 10 Dec 20, 2022