c_scheme_gen 1.0.21 copy "c_scheme_gen: ^1.0.21" to clipboard
c_scheme_gen: ^1.0.21 copied to clipboard

Getters and setters to save variables to and from Map

C-Scheme Gen #

This is a package of generators. Currently, you can generate a color scheme from a class of static colors.

example. #

in file colors.dart add

    part 'colors.g.dart';

to the top of the file and add annotation

    @generateColorScheme

to the class

    @generateColorScheme
    class MyColors 
        static Color get extra => const Color(0xFF003359);
    }

This will generate an extension to colorscheme

    extension MyColorsExtension on ColorScheme {
        Color get extra => MyColors.extra;
    }

The reason you might want this is so that you can access the colors through the context in widgets like so

    Theme.of(context).colorScheme.extra
2
likes
100
pub points
0%
popularity

Publisher

unverified uploader

Getters and setters to save variables to and from Map

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

analyzer, build, source_gen

More

Packages that depend on c_scheme_gen