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

day_night_switch 封面
套件詳情v1.0.4

day_night_switch

一個容易實作的自訂日夜切換小部件,適用於 Flutter。可透過白天與黑夜的顏色及圖片進行高度客製化。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
155
喜歡數
39
Pub 分數
140

安裝套件

flutter pub add day_night_switch

套件介紹

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

一個可自訂的 Flutter 小部件,支援無縫切換日間與夜間模式。它提供直覺的使用者介面,支援自訂顏色、圖片以及明暗主題之間的過渡。非常適合需要主題切換且具備精緻、使用者友善介面的應用程式。此套件輕量且易於整合,適用於跨多個平台的簡單或複雜主題需求。

適用情境

  • 移動和網頁應用中的主題
  • 基於用戶偏好主題切換
  • 可自訂的深色/淺色模式切換
  • 增強應用的可訪問性
  • 建立視覺上吸引人的UI過渡效果

主要特色

  • 高度可自訂的顏色
  • 支援自定圖像
  • 平滑過渡效果
  • 跨平台相容性
  • 簡單的整合,程式碼量最少

適合對象

  • 開發具有主題偏好設定的應用程式之開發者
  • 尋求優雅主題切換的設計人員
  • 需要為亮色/暗色模式提供響應式UI的項目
  • 針對多樣化使用者環境的應用程式

使用建議

  • 需要手動處理主題狀態
  • 有限的內建主題管理
  • 自訂樣式可能需要額外的 CSS/Flutter 知識
  • 未針對執行時動態主題變更進行優化

原始 README

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

DayNightSwitch

A day night switch widget for Flutter.

Installation

Add to pubspec.yaml.

dependencies:
  day_night_switch:

Usage

To use plugin, just import package import 'package:day_night_switch/day_night_switch.dart';

Example

DayNightSwitch(
  value: val,
  moonImage: AssetImage('assets/moon.png'),
  sunImage: AssetImage('assets/sun.png'),
  sunColor: sunColor,
  moonColor: moonColor,
  dayColor: dayColor,
  nightColor: nightColor,
  onChanged: (value) {
    setState(() {
    val = value;
    });
  },
)

Connect

LICENCE

Copyright 2019 Divyanshu Bhargava

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。