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

套件詳情v0.1.0

thememode_selector

一個用於在淺色和深色 ThemeMode 之間選擇的組件(開發中,但運行良好)

近 30 天下載
16
喜歡數
46
Pub 分數
40

安裝套件

flutter pub add thememode_selector

套件介紹

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

一個 Flutter 小部件,讓使用者能輕鬆在淺色與深色主題模式之間切換。設計簡潔且易於整合,提供乾淨的介面進行主題選擇,無需複雜設定。目前處於開發階段,但已具備基本功能且穩定。適用於希望支援使用者偏好淺色或深色外觀之應用程式。該套件為開源專案,託管於 GitHub 上,以確保透明度並促進社群貢獻。

適用情境

  • 啟用使用者控制的亮色/暗色主題切換
  • 在應用設定中整合主題偏好
  • 透過可自訂主題支援無障礙使用
  • 使用動態主題建構響應式 UI
  • 在設備間建立一致的設計體驗

主要特色

  • 簡單直覺的主題選擇小工具
  • 支援淺色和深色主題模式
  • 開源且持續維護
  • 所需設定最少
  • 與 Flutter 的主題系統無縫配合

適合對象

  • 開發具有主題自訂功能的應用程式之開發者
  • 面向無障礙和使用者偏好之應用
  • 使用 Flutter 內建主題的專案
  • 希望輕量級主題管理的團隊
  • 專注於使用者體驗一致性的前端開發人員

使用建議

  • 尚未完全穩定(開發中)
  • 僅限淺色/深色模式
  • 沒有可用的其他主題預設
  • 平台特定的行為可能會有所不同
  • 需要手動處理持久化主題狀態

原始 README

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

ThemeModeSelector Widget

I am currently working with the concept of Theme's in Flutter and I wanted to build a widget which would allow me to switch between light and dark themes. Seeking a design for a simple toggle, I was lucky enough to stumble into some of Zhenya Karapetyan's amazing work on Dribbble. Zhenya's simple yet fun design of a toggle component would look very nice in Flutter, and it has some really cool animations which I wanted to learn.

Zhenya Karapetyan's Light/Dark Toggle

https://dribbble.com/shots/7635203-Light-Dark-mode-toggle-switcher/attachments/396864?mode=media

thememode_selector

A widget to toggle between a light or dark ThemeMode

Features

  • Configurable colors for background and foreground colors for both light and dark modes
  • API similar to standard Material Slider widget

Supported Platforms

  • Flutter Android
  • Flutter iOS
  • Flutter Web
  • Flutter Desktop

Installation

Add thememode_selector: ^0.1.0 to your pubspec.yaml configuration.

import 'package:thememode_selector/thememode_selector.dart'

How to use

Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text(title),
    ),
    body: Center(
      child: ThemeModeSelector(
        height: 39,
        onChanged: (mode) {
          print('ThemeMode changed to $mode');
          ThemeModeManager.of(context)!.themeMode = mode;
        },
      ),
    ),
  );
}

License

MIT

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。