搜索插件、代码仓与 APP 分类

day_night_themed_switcher 封面
插件详情v2.0.2

day_night_themed_switcher

使用纯 Dart 编写的优雅昼夜切换小部件,为您的应用增添魅力——因为切换明暗模式应如魔法般轻盈一瞬!

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
185
喜欢数
9
Pub 分数
160

安装插件

flutter pub add day_night_themed_switcher

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一款简洁、纯粹的 Dart 小部件,可轻松在 Flutter 应用中切换日间和夜间主题。它通过极简设置实现流畅的亮色/暗色模式切换,提升用户体验。专为寻求干净、可自定义解决方案以支持跨主要平台动态主题的开发者设计。该切换器可无缝集成到现有 UI 中,并通过直观的视觉反馈促进可访问性。

适合场景

  • 在移动应用中实现深色模式
  • 启用用户偏好亮色/暗色主题
  • 创建具有主题感知功能的可访问用户界面
  • 支持 Web 和桌面端的跨平台主题
  • 添加一个用于全局主题更改的切换按钮

主要特点

  • 纯 Dart 实现
  • 跨平台兼容性
  • 最小化样板设置
  • 可自定义外观
  • 平滑的主题过渡效果
  • 与 ThemeData 的轻松集成

适合对象

  • Flutter 开发人员构建具有主题偏好设置的应用程序
  • 适用于包括网页和桌面在内的多个平台的应用程序
  • 想要精致主题切换的设计者
  • 强调用户体验和可访问性的项目

使用建议

  • 需要手动处理主题持久化
  • 可能需要额外的逻辑来检测系统主题
  • 仅限基本的昼夜主题切换
  • 不会自动与设备系统设置同步
  • 自定义样式可能需要额外的代码

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Day and Night Themed Switcher

Demo

🎩✨ Behold, the marvel of simplicity meets elegance: the day_night_themed_switcher crafted purely in Dart! 🌗 With this widget, you can seamlessly toggle between the luminous radiance of daytime and the captivating allure of nighttime, right at your fingertips.

This nifty little creation not only adds functionality but also sprinkles a touch of charm to your app interface. Let your users revel in the joy of effortlessly transitioning between light and dark modes with just a tap.

So, why settle for mundane when you can dazzle your users with the magic of day and night? Add this widget to your arsenal and watch as your app shines bright like a diamond, day or night! ✨🌞🌙

Show some ❤️ and ⭐️ the Repo

Resources:

How to Use?

Utilizing this Plugin is as smooth as a gentle breeze. Tailor your experience effortlessly with customizable parameters such as duration, initiallyDark, and size, allowing you to craft the perfect appearance and behavior to suit your needs. 🛠️💫

DayNightSwitch(
  // duration: Duration(milliseconds: 800),
  // initiallyDark: true,
  size: 20,onChange: (dark) => setState(() {
    if (dark) {
      theme = ThemeMode.dark;
    } else {
      theme = ThemeMode.light;
    }
  }),
);

Contributions

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。