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

touchable_opacity のカバー
パッケージ詳細v1.2.0

touchable_opacity

このウィジェットを使用すると、React Native の TouchableOpacity と同様に、ユーザーがアプリとやり取りする際により視覚的なフィードバックを提供できます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
7000
いいね数
17
Pub ポイント
140

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

flutter pub add touchable_opacity

パッケージ概要

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

touchable_opacity パッケージは、ユーザーが UI 要素とインタラクションする際に視覚フィードバックを提供する Flutter ウィジェットを提供します。React Native の TouchableOpacity の動作を模倣しています。押下時に不透明度をわずかに変化させることで、操作の応答性を高め、ユーザー体験を向上させます。Android、iOS、Web、macOS、Windows、Linux などすべての主要プラットフォームで互換性があり、既存の Flutter プロジェクトにスムーズに統合できます。パッケージは軽量でシンプルな設計となっており、追加の複雑さを避けながら直感的なタッチフィードバックに焦点を当てています。

用途

  • ボタンにインタラクティブなフィードバックを追加する
  • モバイルおよびウェブアプリにおけるUXの向上
  • 応答性のあるUI要素の作成
  • 視覚的サインを通じたアクセシビリティの向上
  • フォーム内のジェスチャー処理の簡素化

主な機能

  • 透過度に基づくタップフィードバック
  • クロスプラットフォーム互換性
  • 最小限のセットアップが必要
  • React Native の TouchableOpacity の動作と一致
  • 軽量でパフォーマンスに優れる

適している対象

  • React Native に精通した Flutter 開発者
  • 一貫したタッチフィードバックを必要とするアプリ
  • UI中心のアプリケーション
  • シンプルなジェスチャー拡張機能を求める開発者
  • 複数のプラットフォームをターゲットにするプロジェクト

注意事項

  • 不透明度の変更のみ(他のアニメーションはなし)
  • 複雑なジェスチャー操作には向いていない
  • カスタム効果を実現するには、追加のスタイル設定が必要になる場合があります
  • 外部のソースコードリポジトリに依存しています
  • ハプティックフィードバックの組み込みサポートなし

元の README

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

touchable_opacity

Version Build Status codecov

This package gives you access to the Touchableopacity widget. This widget uses the GestureDetector to allow interaction and animated to opacity of the widget on touch events.

Installing

Add the package to your pubspec.yaml file

dependencies:
	touchable_opacity: 1.2.0
Usage

Import the package using

import 'package:touchable_opacity/touchable_opacity.dart';

And simply use it as any other widget.

Container(
	child: TouchableOpacity(
		activeOpacity: 0.4,
		child: FlutterLogo(),
	),
),
Configuration

TouchableOpacity uses gestureDetector internally and tries to maintain all the different behaviours and interactions that gesture detector enables. To understand the different touch events that you can configure please visit the GestureDetector API docs here.

activeOpacity: double value that TouchableOpacity uses to animate the opacity of the child when a touch down event is received. The value must be between 1.0 and 0.0, the default value is 0.2 .

Example

The code found in the example folder of this repo shows how to use this package to render the content shown in the sample GIF. The folder contains a Flutter application that you can run yourself. Go here to jump into the code.

Support

If you have any issues with using this package, or have any ideas you thnk are good additions please create an issue here

Known Issues

Because of the way GestureDetector renders, TouchableOpacity fills its parent. If you want to bound the size to that of its child simply place the TouchableOpacity widget in any one of the Layout widgets, you can see a list of layout widgets available in flutter here

カテゴリー

ソースリポジトリ

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