EasyDynamicTheme는 시스템의 선호 테마(라이트 모드 또는 다크 모드)를 자동으로 감지하여 테마 관리를 간소화하는 Flutter 패키지입니다. 개발자가 특정 테마를 강제 적용할 수 있으며, 앱 재시작 후에도 사용자 설정을 지속적으로 유지합니다. Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼을 지원합니다. Flutter의 테마 시스템과 원활하게 통합되어 반복 코드를 줄이고, 적응형 디자인을 통해 사용자 경험을 향상시킵니다. 사용자 설정과 기기 동작에 따라 일관되고 개인화된 UI를 제공하고자 하는 앱에 이상적입니다.
사용 사례
시스템 테마에 기반한 적응형 UI
사용자 테마 선호도 유지
라이트 모드 또는 다크 모드 강제 적용
크로스 플랫폼 테마 일관성
대규모 앱에서 테마 로직 간소화
접근성 기능 지원
주요 기능
자동 OS 테마 감지
지속적인 테마 저장
테마 전환 쉽게
모든 플러터 플랫폼 지원
최소한의 설정 필요
내장 테마 제공자
적합한 대상
간단한 테마 관리를 원하는 개발자
다크/라이트 모드 지원이 필요한 앱
다중 플랫폼을 대상으로 하는 프로젝트
보일러플레이트를 줄이고자 하는 팀
사용자 경험에 중점을 둔 앱
접근성에 민감한 애플리케이션
고려 사항
테마 재빌드를 수동으로 처리해야 합니다
기본 테마를 넘어서는 사용자 정의가 제한적
런타임 중 동적 테마 업데이트를 지원하지 않습니다
정적 테마 선택이 있는 앱에 가장 적합
복잡한 테마 시나리오를 처리하기 위해 추가 로직이 필요할 수 있습니다
지속성을 위해 shared_preferences에 의존합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Easy Dynamic Theme
This is a new and easy approach on Flutter Themes.
Automatically get your OS defined Theme (Dynamic), force your prefered one (Light / Dark) and persist your choice in the device.
Easy peasy, don't you think? ;)
Demo
Getting Started
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Minimum Requirements
Dart SDK: >=2.12.0 <3.0.0
Flutter: >= 1.20.0
Installation and Usage
Once you're familiar with Flutter you may install this package adding easy_dynamic_theme to the dependencies list
of the pubspec.yaml file as follow:
EasyDynamicThemeBtn, which is (kind of) a FlatButton that displays the icon according to the current theme of your app and allows you to switch between them.
EasyDynamicThemeSwitch, which is a Switch widget, based on the current theme's brightness of your context and allows you to switch between light/dark them.
EasyDynamicThemeAutoSwitch, which is a Switch widget, based on the current theme of your app and allows you to prioritize (or not) your OS defined brightness.