搜尋套件、儲存庫與 APP 分類

theme_x 封面
套件詳情v1.0.4

theme_x

ThemeX 是一個簡單的主題操作工具。只需提供主要顏色,ThemeX 就會為您生成所有顏色組合配色方案。

近 30 天下載
19
喜歡數
19
Pub 分數
60

安裝套件

flutter pub add theme_x

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

ThemeX 是一個 Flutter 套件,透過從單一主要顏色自動產生完整的色彩調色板來簡化主題建立。它消除了手動定義補充色彩的需求,確保淺色與深色模式之間設計的一致性與和諧性。非常適合尋求快速主題原型設計或以最少努力維護一致 UI 的開發者。此套件可透過 pub add 隨意整合至 Flutter 項目中,並利用託管於 GitHub 的原始碼實現透明度與自訂功能。

適用情境

  • 快速主題原型設計
  • 自動配色方案生成
  • 一致的淺色和深色模式設計
  • 應用介面在各個畫面間的一致性
  • 快速品牌色彩實現

主要特色

  • 自動生成色彩調色盤
  • 單個主色調輸入
  • 支援淺色和深色模式
  • 最小設定需求
  • 在 GitHub 上開源

適合對象

  • 初學者Flutter開發者
  • 注重設計的應用程式創作者
  • 需要快速用戶介面迭代的項目
  • 優先考慮設計一致性的團隊
  • 具有動態主題需求的應用程式

使用建議

  • 超出主色之外的自訂選項有限
  • 取決於自動產生的邏輯
  • 無平台特定優化
  • 可能需要對複雜設計進行手動調整
  • 不太適合高度特定的色彩方案

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

ThemeX is an easy theme manipulation basied on Material Design. Only inform primary color and the ThemeX generate all color combination palette for you

ThemeX result

theme_x_palette

Usage

ThemeX a simple usage. Only inform primary color and the magic happens

Create a ThemeX instance
final theme = ThemeX(
    brightness: Brightness.light,
    primaryColor: const Color(0xFF684437),
    colorEngine: ThemeXColorEngine.traditional,
);
Set theme on MaterialApp
MaterialApp(
  title: 'ThemeX',
  theme: theme.get(), //Here set theme attribute with ThemeX codes
  home: const MyHomePage(),
);

How to see visual result?

For see result is simple call a dialog any page or menu that you will see the entire generated color palette

 showDialog(
  context: context,
  builder: (context) {
    return const ThemeXDialog();
  },
);

How to get properties from ThemeX?

Colors
Get primary color
var primary = ThemeX.I.primary;
OR get primary variants
var primary50 = ThemeX.I.primary[50];
var primary100 = ThemeX.I.primary[100];
var primary200 = ThemeX.I.primary[200];
var primary300 = ThemeX.I.primary[300];
var primary400 = ThemeX.I.primary[400];
var primary500 = ThemeX.I.primary[500];
var primary600 = ThemeX.I.primary[600];
var primary700 = ThemeX.I.primary[700];
var primary800 = ThemeX.I.primary[800];
var primary900 = ThemeX.I.primary[900];
Get secondary color
var secondary = ThemeX.I.secondary;
OR get secondary variants
var secondary100 = ThemeX.I.secondary[100];
var secondary200 = ThemeX.I.secondary[200];
var secondary400 = ThemeX.I.secondary[400];
var secondary700 = ThemeX.I.secondary[700];
Get Greyscale color
var grey = ThemeX.I.grey;
OR Greyscale variants
var grey50 = ThemeX.I.grey[50];
var grey100 = ThemeX.I.grey[100];
var grey200 = ThemeX.I.grey[200];
var grey300 = ThemeX.I.grey[300];
var grey400 = ThemeX.I.grey[400];
var grey500 = ThemeX.I.grey[500];
var grey600 = ThemeX.I.grey[600];
var grey700 = ThemeX.I.grey[700];
var grey800 = ThemeX.I.grey[800];
var grey900 = ThemeX.I.grey[900];
Semantic colors
var success = ThemeX.I.success;
var danger = ThemeX.I.danger;
var warning = ThemeX.I.warning;
var info = ThemeX.I.info;
var secondarySuccess = ThemeX.I.secondarySuccess;
var secondaryDanger = ThemeX.I.secondaryDanger;
var secondaryWarning = ThemeX.I.secondaryWarning;
var secondaryInfo = ThemeX.I.secondaryInfo;
Typography
var h1 = ThemeX.I.h1;
var h2 = ThemeX.I.h2;
var h3 = ThemeX.I.h3;
var h4 = ThemeX.I.h4;
var h5 = ThemeX.I.h5;
var bodyLarge = ThemeX.I.bodyLarge;
var bodyMedium = ThemeX.I.bodyMedium;
var buttonLarge = ThemeX.I.buttonLarge;
var buttonMedium = ThemeX.I.buttonMedium;
var subtitleLarge = ThemeX.I.subtitleLarge;
var subtitleMedium = ThemeX.I.subtitleMedium;

Features

Discover Highlight/Contrast color from the another color

If you use the yellow color in the background and want to find out which one color accent this background

var backgroundAccentColor = ThemeX.I.contrastColor(Colors.yellow);

Color engine

Color engine generate a pallet color variants basied on Constantin Material Design, Buckner Material Design and Traditional Material Design.

Pass attribute "colorEngine" on ThemeX create
final theme = ThemeX(
    brightness: Brightness.light,
    primaryColor: const Color(0xFF684437),
    colorEngine: ThemeXColorEngine.constantin, //Or ThemeXColorEngine.buckner or ThemeXColorEngine.traditional or ThemeXColorEngine.complementary
);
Pass attribute "googleFont" to using GoogleFonts packages
final theme = ThemeX(
    brightness: Brightness.light,
    primaryColor: const Color(0xFF684437),
    colorEngine: ThemeXColorEngine.constantin, 
    googleFont: GoogleFonts.latoTextTheme, //Here pass google fonts
);
Pass attribute "backgroundColor"
final theme = ThemeX(
    brightness: Brightness.light,
    primaryColor: const Color(0xFF684437),
    colorEngine: ThemeXColorEngine.constantin, 
    backgroundColor: (primary, secondary, grey) {
      return Colors.white;
    }, //Here pass background color
);

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。