플랫폼 간에 네이티브한 외관을 갖춘 앱 내 설정 화면을 쉽게 만들 수 있도록 설계된 플러터 패키지입니다. 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스의 시스템 설정의 외관과 느낌을 모방하는 사전 구축된 사용자 정의 가능한 위젯을 제공합니다. 각 플랫폼별 맞춤 스타일링 없이 일관되고 세련된 설정 인터페이스를 개발할 수 있도록 단순화합니다. 최소한의 설정으로 직관적인 구성 패널이 필요한 앱에 적합합니다.
사용 사례
크로스 플랫폼 설정 UI 만들기
앱 설정 패널 만들기
테마 및 알림 설정 구현
접근성 있는 구성 화면 설계
사용자 프로필 관리 추가
앱 사용자 정의 옵션 활성화
주요 기능
모든 플랫폼에서의 네이티브 스타일 외관
사전 설계된 재사용 가능한 설정 위젯
크로스 플랫폼 일관성
기존 Flutter 앱과의 간편한 통합
다크 모드 및 접근성 지원
최소한의 보일러플레이트 코드
적합한 대상
기능이 풍부한 모바일 및 데스크톱 앱을 개발하는 개발자
UX 일관성을 우선시하는 팀
광범위한 사용자 구성이 필요한 앱
사용 가능한 UI 컴포넌트를 찾는 플러터 초보자
여러 운영 체제를 대상으로 하는 프로젝트
고려 사항
Flutter SDK 3.0 이상이 필요합니다
내장 테마를 초과한 사용자 정의 기능이 제한적
매우 독창적인 디자인을 위해 추가 스타일링이 필요할 수 있습니다
플랫폼 고유의 렌더링 동작에 의존합니다
복잡한 양식보다는 표준 설정 레이아웃에 적합
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
gizmos_settings_screen
A Flutter package for displaying settings screens (or similar screens). I built this after finding it near impossible to customize the look and feel of the other popular settings screen packages. This package takes a different approach and separates the functionality from the UI customization. This lets you create custom skins to better fit into your existing app. There are several skin prototypes included for Cupertino (light and dark modes), and Material (light and dark modes). In most cases, you can just subclass those, alter your colours and move on to the rest of your app.
This package doesn't depend on any specific package for settings storage. In fact, gizmos_settings_screen can be used for any type of general purpose cell based list, it's just that settings is the most obvious use case. The example application included uses shared_preferences, but I've also used flutter_secure_storage in production apps.
Check the included example app for full details. For basic usage, you need to instantiate a SkinDelegate using one of the supplied skins, or by create your own subclass of one of the supplied skins. Then customize a SettingsScreen by attaching one of more SettingsSections configured with one or more SettingsCell subclasses. Included subclasses include DetailsSettingCell, SwitchSettingsCell, 'SliderSettingsCellandButtonSettingsCell`. These will cover most of your basic needs, but it's trivial to create additional subclasses to handle specific options for your app.
Screenshots
Example
// Select the default skin to useSettingsSkinDelegate skinDelegate = !Platform.isIOS ? MaterialSettingsSkin() : CupertinoSettingsSkin();
// Return the configured SettingsScreen wrapped in a SettingsSkin with an assigned delegatereturnSettingsSkin(
delegate: skinDelegate,
child: SettingsScreen(
sections: [
SettingsSection(
header: 'App Settings',
footer: 'Your app preferences are set here',
cells: [
DetailsSettingsCell(
title: 'Informational',
subtitle: 'Can include simple cells',
leadingWidget: Icon(
Icons.star,
color: Colors.blue,
),
),
SwitchSettingsCell(
title: 'Toggleable option',
subtitle: 'Uses a switch to set something on or off',
value: sampleBooleanSetting,
onPressed: () {
setState(() {
sampleBooleanSetting = !sampleBooleanSetting;
});
},
onChanged: (bool value) {
setState(() {
sampleBooleanSetting = value;
});
},
),
SliderSettingsCell(
title: 'Fractional option (i.e. Volume)',
subtitle: 'Uses a slider to adjust a double',
value: sampleDoubleSetting,
onChanged: (value) {
setState(() {
sampleDoubleSetting = value;
});
},
),
DetailsSettingsCell(
title: 'Multiple choice option',
value: preferences.currentOption.description,
accessoryType: AccessoryType.Disclosure,
onPressed: () async {
// Your code goes here
},
),
ButtonSettingsCell(
type: ButtonType.Normal,
title: 'Check for updates',
onPressed: () async {
// Your code goes here
},
),
],
),
],
),
);
Please see the example app in this package for a full example.
Notes
This is my second Flutter package, and I'm still learning the Flutter way of doing things so a lot of this package may change. Specifically, I'll be looking to make use of ThemeData etc in the skins to reduce duplication of having to set specific colours for your app.