FLUTTER ECOSYSTEM

brworkit/flutter-package-string-to-color

将字符串颜色名称转换为 Color 和 MaterialColors 的 Flutter 包

flutter-包-字符串转颜色 项目封面
Stars
7
Forks
1
最近推送(UTC)
2020年6月5日
项目状态
未归档
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
语言DartSwiftKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 2 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 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.