c_material 是一個現代的 Flutter 顏色系統,提供預定義的顏色、語意標記和 Material 3 主題。它讓開發者能在各個平台建構一致、可擴展且視覺上協調的使用者介面。透過使用語意顏色標記,它支援動態主題設定,並提升設計系統的可維護性。此套件與 Flutter 的 UI 工具包無縫整合,並符合 Material Design 3 指南,為 Android、iOS、Web、macOS、Windows 與 Linux 提供精緻、反應靈敏的體驗。
適用情境
在多個平台上建立一致的使用者介面
實施 Material 3 設計標準
建立可擴展的設計系統
啟用動態主題切換
在大型應用中簡化顏色管理
透過語意色彩支援可存取性
主要特色
預定義的 Material 3 顏色方案
語義顏色標記以提高清晰度
跨平台相容性
與 Flutter 的輕鬆整合
支援淺色和深色主題
可擴展的顏色系統
適合對象
設計系統開發者
使用 Material 3 的 Flutter 團隊
需要一致主題的應用程式
專注於可存取性的項目
尋求可重用顏色邏輯的開發者
建構多平台應用的團隊
使用建議
需要熟悉 Material 3 設計原則
可能需要針對非 Material 設計進行自訂
依賴於 Flutter 的主題系統
僅限色彩聚焦功能
不適合複雜的UI組件庫
最佳使用於結構化設計工作流程
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
c_material_colors_flutter
A new package for choosing colors. It is very powerful and supports all operating systems, including iPhone, Android, the web, and many platforms. It helps in direct access to colors.
_ Simple package helps you to use all colors to direct code and flexible and eazy use when use class it found over 100 colors
Support = [**[ Android , IOS and WEB(soon) ] **];
Support All Platform in flutter
Ease of use and flexibility in accessing colors directly
It has a strong advantage, which is that it contains almost all colors
It is also easy to use in any mobile project and supports all platforms
Features
It is a very powerful package that includes around 140 colors and more. Its features include being filled with a wide variety of colors, being easy to use, and allowing developers to access the desired color through the MaterialColors class. It is also distinguished by its attractiveness across all colors.
Setup
iOS
Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file
with the key io.flutter.embedded_views_preview and the value YES.
iOS (only support> 11.0) you need to add this line in your ios/Podfile
platform :ios, '11.0'
Getting Started
To use C_Material_Colors in your project, add the c_material package to pubspec.yaml:
dart pub add c_material or flutter pub add flex_color_scheme
import it
Import the package to use it:
import'package:c_material/c_material.dart';
Usage :
Explaining of how to use this package
/// You Can use Any Widgets in flutter like this :/// Container(
color: MaterialColors.blue;
/// )/// But Note Very Important :/// you can use class MaterialColors just type proberity class Color/// Not use MaterialAllProberity ....
عرض الصور
Usage Just Class Color Type Not Type Class WidgetStateProperty<Colors?>
/// You Can use Any Widgets in flutter like this :/// Container(
color: MaterialColors.blue;
/// ),/// Container(
color: MaterialColors.offWhite;
/// )/// AppBar(
backgroundColor: MaterialColors.green
/// )/// But Note Very Important :/// you can use class MaterialColors just type proberity class Color/// Not use MaterialAllProberity ....
Using Widgets in Flutter
/// Example :/// Scaffold Widget => Scaffold(backgroundColor: MaterialColors.red,
) ,
/// Card Widget => Card(color: MaterialColors.blue ,
),
Notes :
/// The most important thing about the package is that it does not accept a class of type WidgetStateProperty because it has a different type; it only accepts the type Color. ///
Global access to [Colors] from any Project :
///If you need any thing from [Color Blue]///you can use it MaterialColors class to access Many Colors :MaterialColors.aliceBlue;
///If you need any thing from [Color Red]///you can use it MaterialColors class to access Many Colors :MaterialColors.red;
///If you need any thing from [Color Yellow]///you can use it MaterialColors class to access Many Colors :MaterialColors.yellow;
///If you need use color black [Color Black]///you can use it MaterialColors class to access Many Colors :MaterialColors.black;
///If you need use color sandyBrown [Color Brown]///you can use it MaterialColors class to access Many Colors :MaterialColors.sandyBrown;
Global access to [All Colors ] using class [MaterialColors Class]
///If you need any thing from [Color blanchedAlmond]///you can use it MaterialColors class to access Many Colors :MaterialColors.blanchedAlmond,
///If you need any thing from [Color blueViolet]///you can use it MaterialColors class to access Many Colors :MaterialColors.blueViolet,
///If you need any thing from [Color cornflowerBlue]///you can use it MaterialColors class to access Many Colors :MaterialColors.cornflowerBlue,
///If you need any thing from [Color chocolate]///you can use it MaterialColors class to access Many Colors :MaterialColors.chocolate,
///If you need any thing from [Color saddleBrown]///you can use it MaterialColors class to access Many Colors :MaterialColors.saddleBrown,
///If you need any thing from [Color fireBrick]///you can use it MaterialColors class to access Many Colors :MaterialColors.fireBrick,
///If you need any thing from [Color wheat]///you can use it MaterialColors class to access Many Colors :MaterialColors.wheat,
///If you need any thing from [Color darkGoldenrod]///you can use it MaterialColors class to access Many Colors :MaterialColors.darkGoldenrod,
///If you need any thing from [Color lightBlue]///you can use it MaterialColors class to access Many Colors :MaterialColors.lightBlue,
///If you need any thing from [Color darkRed]///you can use it MaterialColors class to access Many Colors :MaterialColors.darkRed,