swatcher 0.1.0 copy "swatcher: ^0.1.0" to clipboard
swatcher: ^0.1.0 copied to clipboard

A simple utility to convert a Flutter Color to a MaterialColor for a theme.

Swatcher #

A simple utility to convert a Flutter Color to a MaterialColor for a theme.

Example #

The simplest use of this package is:

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Swatcher.createMaterialColor(Color(0xFF37A0F4)),
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

It'll generate a MaterialColor based on the color you provided.

About the precision of this tool #

This tool is not 100% working, as you can see from the tests it differs a little by the wanted result. It'll be updated as soon as I'll be able to convert correctly a color to a MaterialColor.

1
likes
130
points
35
downloads

Publisher

verified publisheremiliodallatorre.it

Weekly Downloads

A simple utility to convert a Flutter Color to a MaterialColor for a theme.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on swatcher