v0.0.1
color_hex
16진수 문자열을 Color()로 변환하고, Color()를 16진수 문자열로 변환하는 Flutter 패키지
6좋아요 76630일 다운로드140Pub 점수
AndroidiOSWebmacOSWindowsLinux
16진수 문자열을 Color()로 변환하고, Color()를 16진수 문자열로 변환하는 Flutter 패키지
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Nasr Al-Rahbi @abom_me
Pubspec changes:
dependencies:
color_hex: <last_verison>
you can add it to your text or color as extension like this :
Color color=Colors.deepPurple;
String hex="#000000";
/// here we convert the hex to color and the color to hex
Text(color.convertToHex.hex,style: TextStyle(color: hex.convertToColor),),
Another way you can convert it using the function :
Color color=Colors.deepPurple;
String hex="#000000";
InkWell(
onTap: (){
/// Convert HexColor to Color()
print(hexToColor(hex).toString());
/// Convert Color() to HexColor
print(colorToHex(color).hex);
print(colorToHex(color).color);
},
child:Text("click to convert",style: TextStyle(
/// here we convert the color to hex then we convert the hex to color again
color: color.convertToHex.hex!.convertToColor
),)
)
의존성 목록 3 개
{"sdk":"flutter"}{"sdk":"flutter"}^2.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗