strcolor 1.0.2 copy "strcolor: ^1.0.2" to clipboard
strcolor: ^1.0.2 copied to clipboard

outdated

Flutter package to convert color names to Color in Flutter. Offers a handful way to use colors by their names instead of using Colors constants.

strcolor #

Dart Pub

Description #

Flutter package to convert color names to Color in Flutter.

Offers a handful way to use colors using their names instead of using Colors constants.

It is specialy useful when you need to place color in a component comming dynamically from server.

All Flutter Colors constants supported.

Getting Started #

In your flutter project add the dependency:

dependencies:
  ...  
  strcolor: ^1.0.0

Usage example #

import 'package:strcolor/strcolor.dart';

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: "purple".color(), // write the color name. When you receive dynamic color name from server this is much more useful.        
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

Source Code #

strcolor

Author #

2020 brworkit.

25
likes
0
pub points
28%
popularity

Publisher

unverified uploader

Flutter package to convert color names to Color in Flutter. Offers a handful way to use colors by their names instead of using Colors constants.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on strcolor