パッケージ、リポジトリ、アプリカテゴリを検索

switch_up のカバー
パッケージ詳細v0.0.2+1

switch_up

希望する幅、色、テキスト、角の半径、アニメーションなど、完全にカスタマイズ可能なアニメーショントグルスイッチです。選択状態も維持します。

30日間ダウンロード
4
いいね数
23
Pub ポイント
70

パッケージをインストール

flutter pub add switch_up

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

SwitchUp は、Flutter アプリケーション向けに高レベルでカスタマイズ可能なアニメーションスイッチです。幅、色、テキストラベル、コーナーラウンド、滑らかなアニメーション効果などを調整することで、スイッチの外観をカスタマイズできます。ウィジェットは選択状態を自動的に保持し、ユーザーとのインタラクションをスムーズに保ちます。シンプルさと柔軟性を重視して設計されており、フォームや設定パネル、または任意のトグル機能が必要なUIに簡単に統合できます。クリーンなAPIにより、ライトモードとダークモードの両方に対応しており、現代的なアプリデザインに最適です。

用途

  • ユーザー設定のトグル
  • 設定スイッチ
  • フォーム入力コントロール
  • ダークモードの有効化/無効化
  • オン/オフ状態インジケーター

主な機能

  • 完全にカスタマイズ可能な外観
  • スムーズなアニメーション遷移
  • 状態の永続化
  • 調整可能な幅とコーナー半径
  • カスタムテキストラベルをサポート
  • ライトモードおよびダークモード対応

適している対象

  • シンプルなトグルインターフェース
  • カスタマイズ可能な UI コンポーネント
  • 設定画面
  • モバイルアプリ開発
  • Flutter の初心者とエキスパート

注意事項

  • プラットフォーム固有の統合について言及されていません
  • 視覚的なカスタマイズに限定
  • 組み込みのアクセシビリティ機能は確認されませんでした
  • フォーカスと意味の手動処理が必要です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

README

Switch Up

An animated toggle switch which can be fully customized with desired width, colors, text, corner radius, animation etc. It also maintains selection state.

Getting Started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:  ...  switch_up: latest_version

Import it:

import 'package:switch_up/switch_up.dart';

Usage Examples

// Here, default theme color are used for selected item.
SwitchUp<String>(
  backgroundColor: Colors.grey.shade200,
  items: const <String>['Home', 'Chat', 'Settings'],
  onChanged: (String value) {
    print(value);
  },
  value: 'Settings',
),

ezgif.com-gif-maker(3).gif

Switch Up with custom Height, Color and Animation
SwitchUp(
  backgroundColor: Colors.grey.shade200,
  color: Colors.amber,
  radius: 0,
	height: 50,
	curves: Curves.easeInOutBack,
  items: const ['Active', 'Pending'],
  onChanged: (value) {
    print(value);
  },
  value: 'Pending',
),

ezgif.com-gif-maker(4).gif

Switch Up with a Gradient Color
SwitchUp(
  gradient: const LinearGradient(
    begin: Alignment.topLeft,
    end: Alignment.bottomRight,
    colors: [
      Color(0xFF941F37),
      Color(0xFF590012),
    ],
  ),
  curves: Curves.bounceOut,
  backgroundColor: Colors.grey.shade200,
  items: const ['Male', 'Female', 'Other'],
  onChanged: (value) {
    print(value);
  },
  value: 'Female',
),

ezgif.com-gif-maker(5).gif

SwitchUp(
  backgroundColor: Colors.grey.shade200,
  radius: 40,
  gradient: const RadialGradient(
    radius: 10,
    colors: [
      Color(0xFF941F37),
      Color(0xFF590012),
    ],
  ),
  curves: Curves.easeInOutQuart,
  items: const ['Normal', 'Bold', 'Italic'],
  onChanged: (value) {
    log(value);
  },
  value: 'Bold',
),

ezgif.com-gif-maker(6).gif

Switch Up with Custom Models

// Add toString() to your Custom model class
//   @override
//   String toString() {
//     return name;
//   } 
SwitchUp<States>(
  backgroundColor: Colors.pink.withOpacity(.1),
  radius: 10,
  height: 60,`
  gradient: const LinearGradient(
    begin: Alignment.topLeft,
    end: Alignment.bottomRight,
    colors: [
      Color(0xFFFC466B),
      Color(0xFF3F5EFB),
    ],
  ),
  curves: Curves.easeInOutQuart,
  items: states,
  onChanged: (States value) {
    if (kDebugMode) {
      print(value);
    }
  },
  value: states[2],
),

ezgif.com-gif-maker(7).gif

With icons, text and different active background colors

Example code with explanation

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。