테마 매니저는 플러터 패키지로, 라이트, 다크 및 시스템 테마 지원을 간편하게 구현할 수 있도록 도와줍니다. 앱 재시작 후에도 자동으로 지속되는 동적 테마 전환을 가능하게 합니다. 개발자는 테마 상태를 쉽게 관리하고 전역적으로 적용하여 일관된 사용자 경험을 보장할 수 있습니다. 이 패키지는 플러터의 테마 시스템과 원활하게 통합되며, 모바일, 웹, 데스크톱을 포함한 모든 주요 플랫폼을 지원합니다.
사용 사례
앱에서의 동적 테마 전환
사용자 테마 선호 설정 유지
다크 모드 및 시스템 테마 지원
다양한 테마로 접근성 있는 UI 만들기
사용자 정의 가능한 사용자 인터페이스 만들기
주요 기능
라이트, 다크 및 시스템 테마 지원
자동 테마 유지
Flutter의 테마 시스템과의 간편한 통합
크로스 플랫폼 호환성
테마 변경을 위한 간단한 API
실시간 테마 업데이트
적합한 대상
다크 모드가 필요한 앱
사용자 정의 가능한 UI를 구축하는 개발자
다중 플랫폼을 대상으로 하는 프로젝트
테마 선호도를 가진 사용자 친화적 애플리케이션
테마 관리를 위한 최소한의 설정을 원하는 팀
고려 사항
테마 상태 초기화를 수동으로 처리해야 합니다
사전 정의된 테마 유형에 제한됨
사용자 정의 테마를 위해 추가 로직이 필요할 수 있습니다
Flutter의 내장 테마 시스템에 의존합니다
라이트/다크/시스템 외의 복잡한 테마 구성에는 적합하지 않습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
theme_manager
A theme manager for light, dark, and system themes.
A theme manager that supports light, dark, and system default themes. State is retained and applied upon application start. Heavily inspired by dynamic_theme by Norbert Kozsir.
Getting Started
Add theme_manager to your project.
dependencies:theme_manager:^2.0.4
run flutter packages get and import theme_manager
import'package:theme_manager/theme_manager.dart';
A dialog is provided that can switch between themes.
The system default will load either light or dark based on the device preferences. If your device
changes themes at sunset or sunrise then light/dark mode will apply automatically.
The BrightnessPreference is saved in SharedPreferences automatically. There is also a clear
function to remove the preferences.