v1.1.1
strcolor
Flutter에서 색 이름을 Color로 변환하는 Flutter 패키지입니다. Colors 상수를 사용하는 대신 색 이름으로 색을 사용할 수 있는 편리한 방법을 제공합니다.
25좋아요 1030일 다운로드30Pub 점수
플랫폼 정보 없음
문자열 색 이름을 Color 및 MaterialColors로 변환하는 Flutter 패키지
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
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.
In your flutter project add the dependency:
dependencies:
...
strcolor: ^1.1.1
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'),
);
}
}