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

套件詳情v0.1.5

clean_settings

具有合理預設值的設定 UI 產生器。消除樣板程式碼的需求,並提供豐富且高度主觀的小部件。

近 30 天下載
68
喜歡數
62
Pub 分數
40

安裝套件

flutter pub add clean_settings

套件介紹

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

Clean Settings 是一個 Flutter 套件,透過提供預先設計、具備明確風格的元件與合理的預設值,簡化設定介面的建立。它透過提供結構化、一致的 UI 消除重複的樣板程式碼,讓開發者能快速建構出精緻、專業的設定畫面。此套件著重於易用性與視覺和諧,減少設定時間,同時維持自訂的彈性。非常適合需要直覺、條理分明的設定面板之應用。

適用情境

  • 建構應用設定螢幕
  • 建立使用者偏好面板
  • 配置介面的快速原型設計
  • 減少設定中的UI樣板程式碼
  • 設計一致的設定佈局

主要特色

  • 有明確意見的、開箱即用的組件
  • 合理的預設樣式
  • 最小化樣板程式碼
  • 一致的 UI 模式
  • 與現有應用的輕鬆整合

適合對象

  • 尋求快速設定 UI 的 Flutter 開發人員
  • 具有複雜使用者偏好設定的專案
  • 需要乾淨現代設定介面的應用程式
  • 重視設計一致性的團隊
  • 開發人員避免手動建構 widget 範本

使用建議

  • 有限的自定義靈活性
  • 強烈且有主見的設計選擇
  • 可能需要針對高度獨特的使用者介面進行調整
  • 不適用於非設定使用案例
  • 依賴 GitHub 源進行更新

原始 README

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

pub package

clean_settings

Settings UI generator with sane defaults.

Creating a settings screen requires the same boiler plate code over and over. Settings also need a rich set of widgets to cover all possible cases. This library aims to provide sane defaults while creating a setting screen.

Features

  • Setting Sections
  • Out-of-the-box widgets for multiple types
  • Read-only items

Widgets supported

  • Checkbox

Checkbox Widget


SettingCheckboxItem(
    title: 'Smart Reply',
    value: smartReply,
    onChanged: (v) => setState(() => smartReply = v),
    description: 'Show suggested replies when available'),
  • Switch

Switch Widget


SettingSwitchItem(
  title: 'Smart Compose',
  value: smartCompose,
  onChanged: (v) => setState(() => smartCompose = v),
  description: 'Show predictive writing suggestions',
  priority: ItemPriority.high,
),
  • Radio Picker

Radio Picker


SettingRadioItem<String>(
  title: 'Theme',
  displayValue: '$theme theme',
  selectedValue: theme,
  items: [
    SettingRadioValue('Light', 'Light'),
    SettingRadioValue('Dark', 'Dark'),
    SettingRadioValue('System Default', 'System Default'),
  ],
  onChanged: (v) => setState(() => theme = v),
),

  • Text Input

Text Input

SettingTextItem(
  title: 'Auto Reply Message',
  displayValue: autoReplyMessage,
  initialValue: autoReplyMessage,
  hintText: 'Sent by system on away',
  onChanged: (v) => setState(() => autoReplyMessage = v),
),

  • Date and Time Picker

Date Time Picker

SettingDateTimeItem<DateTime>(
  title: 'Next Scheduled Email At',
  displayValue: scheduledEmailSlug,
  onChanged: (v) => setState(() => scheduledEmailDateTime = v),
),
  • Date Picker

Date Picker

SettingDateTimeItem<DateTime>(
  title: 'Date of birth',
  displayValue: dateOfBirthSlug,
  onChanged: (v) => setState(() => dateOfBirth = v),
  timePicker: false,
),
  • Time Picker

Time Picker

SettingDateTimeItem<TimeOfDay>(
  title: 'Daily wake up email',
  displayValue: dailyEmailAt.format(context),
  onChanged: (v) => setState(() => dailyEmailAt = v),
  datePicker: false,
),
  • Wheel - Number List

Wheel Number

SettingWheelPickerItem(
  title: 'Days of mail to sync',
  displayValue: daysOfMailToSync.toString(),
  initialValueIndex: daysOfMailToSync,
  items: List.generate(10, (index) => index.toString()),
  onChanged: (v) => setState(() => daysOfMailToSync = v),
),
  • Wheel - Text

Wheel Text

var replyOptions = ['Reply', 'Reply All', 'Last Chosen', 'None'];
SettingWheelPickerItem(
  title: 'Default reply action',
  displayValue: replyOptions[chosenReplyOptionIndex],
  initialValueIndex: chosenReplyOptionIndex,
  items: replyOptions,
  onChanged: (v) => setState(() => chosenReplyOptionIndex = v),
),

  • Confirm Dialog

Confirm Dialog

SettingConfirmItem(
  title: 'Delete account',
  displayValue: 'Permanently deletes your account',
  alertTitle: 'Delete your account',
  alertMessage: 'Are you sure?',
  priority: ItemPriority.high,
  onConfirm: () => {},
  onCancel: () => {},
),

  • Custom Handler

Custom Handler

SettingItem(
  title: 'Simple Counter',
  displayValue: counter.toString(),
  onTap: () => setState(() => counter++),
),

Structure


Root - SettingContainer
         \
          \_ SettingSection
                 \
                  \_ SettingItem (or Variants) 

Common Options

  • priority

Set the priority of the item to one of:

  • ItemPriority.high - Shows red color
  • ItemPriority.normal - Default color
  • ItemPriority.low - Shows in green color
  • ItemPriority.disabled - Disables the item

Example

Creates a simple Checkbox setting item

SettingContainer(
  sections: [
    SettingSection(
      title: 'Appearance',
      items: [
        SettingCheckboxItem(
            title: 'Smart Reply',
            value: smartReply,
            onChanged: (v) => setState(() => smartReply = v),
            description: 'Show suggested replies when available'),
      ],
    ),
  ],
)

Notes

  • Early version
  • API bound to change as more widgets get added
  • Please report bugs/issues/features

Buy Me A Coffee

Buy Me A Coffee

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。