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

套件詳情v0.0.4

theme_manager_plus

不再提供主題資料。使用您的主題類別自訂主題

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
24
喜歡數
20
Pub 分數
150

安裝套件

flutter pub add theme_manager_plus

套件介紹

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

ThemeManagerPlus 透過允許開發者定義自訂主題類別,簡化了 Flutter 應用中的主題管理,消除重複的主題資料。它提供了一種乾淨、可重用的方法,用於跨平台處理明亮與黑暗模式主題。該套件內建支援 Android、iOS、Web、macOS、Windows 和 Linux,確保一致的使用者介面體驗。透過直覺的 API,該套件簡化了主題切換與自訂,非常適合需要動態主題且程式碼量最少的應用。

適用情境

  • 動態主題切換
  • 跨平台主題一致性
  • 自定主題類實作
  • 淺色和深色模式管理
  • 應用範圍的主題自訂

主要特色

  • 自定主題類別支援
  • 內建的亮色/暗色模式切換
  • 平台無關的設計
  • 最小的樣板程式碼
  • 與現有程式碼的輕鬆整合

適合對象

  • 具有複雜主題需求的 Flutter 應用
  • 尋求可重用主題邏輯的開發者
  • 跨平台應用程式
  • 需要使用者主題偏好設定的應用
  • 強調清潔架構的專案

使用建議

  • 需要理解 Flutter 的主題系統
  • 可能需要額外的狀態管理
  • 不適合簡單的靜態主題
  • 依賴於正確的初始化
  • 除了基本設置外,文件有限

原始 README

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

theme_manager_plus

Say goodbye to the hassle of remembering complex color schemes! With Theme Manager Plus, managing themes is a breeze. Simply create a class for light and dark themes, tweak your desired colors and styles, and enjoy a seamless and modern app experience. No more headaches, just easy and efficient theme management!

simulator-screen-recording-iphone-15-pro-2024-01-31-at-214253_5zDSZU03-ezgif com-video-to-gif-converter

Getting started

First, add theme_manager_plus as a dependency in your pubspec.yaml file

theme_manager_plus: ^[version]

Create Your own class which defines colors and styles which you have to inject e.g

class AppTheme {
  Color? backgroundColor;
  TextStyle? heading;
  TextStyle? subheading;

  AppTheme({this.backgroundColor, this.heading, this.subheading});
}

Wrap your material app with the ThemeMangerWrapper and assign your light and dark theme and set the current theme to initial theme you want

home:ThemeManagerPlus<AppTheme>(
          currentTheme: lightTheme,
          darkTheme: Darktheme,
          lightTheme: lightTheme,
          child: MyApp()),
    );

Access data from theme

context.themeOf<AppTheme>()?.backgroundColor

Note: Replace your class name with the custom class name

Change current theme with theme manager plus

 context.changeCurrentTheme<AppTheme>();

Check current theme is dark theme

bool isDarkMode context.isDarkMode<AppTheme>();

Contribution 🤝

Feel free to contribute and open pull requests. 🙌

Issues and Feedback 🐛

Feel free to post a feature requests or report a bug here.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。