FLUTTER ECOSYSTEM

brworkit/flutter-package-string-to-color

Flutter package to convert String color names to Color and MaterialColors

flutter-package-string-to-color project cover
Stars
7
Forks
1
Last push (UTC)
Jun 5, 2020
Project status
Active
brworkit GitHub avatar
GITHUB User

brworkit ↗

“For a moment, nothing happened. Then, after a second or so, nothing continued to happen.” ― Douglas Adams, The Hitchhiker's Guide to the Galaxy

São Paulo - Brasil
LanguagesDartSwiftKotlinObjective-C

Packages published by this repository

Dependencies used

Dependency list 2 items
  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}

Original README

English project snapshot. Visit GitHub for the latest content.

Expand / collapse project README

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.

Hexa Colors supported.

Getting Started

In your flutter project add the dependency:

dependencies:
  ...  
  strcolor: ^1.1.1

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'),
    );
  }
}

Dart Pub

strcolor

Author

2020 brworkit.

License

MIT License.