FLUTTER ECOSYSTEM

pskink/matrix_gesture_detector

トランスレーション/ローテーション/スケールのジェスチャーをMatrix4オブジェクトにマッピングするジェスチャーデテクター。

matrix_gesture_detector のプロジェクト画像
Stars
137
Forks
106
最終プッシュ(UTC)
2024/04/04
プロジェクト状態
公開中
pskink GitHub avatar
GITHUB User

pskink ↗

言語DartObjective-CShellJava

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 3 件
  • flutter{"sdk":"flutter"}
  • vector_math^2.1.0
  • flutter_test開発用{"sdk":"flutter"}

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

matrix_gesture_detector

MatrixGestureDetector detects translation, scale and rotation gestures and combines them into Matrix4 object that can be used by Transform widget or by low level CustomPainter code. You can customize types of reported gestures by passing shouldTranslate, shouldScale and shouldRotate parameters.

Getting Started

The usage is as follows:

  MatrixGestureDetector(
    onMatrixUpdate: (Matrix4 m, Matrix4 tm, Matrix4 sm, Matrix4 rm) {
      setState(() {
        matrix = m;
      });
    },
    child: SomeWidgetThatUsesMatrix(
      matrix: matrix,
      ...
    )
  )

here: SomeWidgetThatUsesMatrix could be a Transform widget (transform_demo.dart) or a CustomPaint widget which CustomPainter uses Matrix4 in its low level drawing code (custom_painter_demo.dart).

Examples

bounded demo gif grid rotation demo gif blur demo gif