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

circular_reveal_animation のカバー
パッケージ詳細v2.0.2

circular_reveal_animation

円形リービールアニメーションをFlutterウィジェットとして!AndroidのViewAnimationUtils.createCircularReveal(...)にインスパイアされています。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
4300
いいね数
271
Pub ポイント
160

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

flutter pub add circular_reveal_animation

パッケージ概要

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

Android の ViewAnimationUtils.createCircularReveal をインスパイアした、円形のリベールアニメーションを可能にする Flutter ウィジェットです。ターゲットウィジェットに滑らかな拡大または収縮する円形効果を作成し、コンテンツを自然で流れるような動きで表示または非表示にするのに最適です。アニメーションはプラットフォームに依存せず、Android、iOS、Web、macOS、Windows、Linux で動作します。既存の Flutter アプリにシームレスに統合され、UI の遷移やユーザー参加度を向上させます。

用途

  • リップル効果で隠されたコンテンツを明らかにする
  • 閉じる円形アニメーションでウィジェットを非表示にする
  • ダイナミックリーブ効果を備えたインタラクティブボタンの作成
  • アニメーションエントリーでスプラッシュスクリーンを強化する
  • 滑らかな外観を持つモーダルダイアログのデザイン
  • ナビゲーション遷移での視覚フィードバックの追加

主な機能

  • クロスプラットフォーム互換性
  • 滑らかでカスタマイズ可能な円形リービール
  • 展開および収縮アニメーションの両方をサポートしています
  • 既存のウィジェットとの簡単な統合
  • 組み込みのアニメーションタイミング制御
  • 任意の子ウィジェットと連携可能

適している対象

  • 魅力的なトランジションを求めるUIデザイナー
  • インタラクティブなFlutterアプリを開発する開発者
  • マテリアルデザイン風のアニメーションを必要とするアプリ
  • 動的なコンテンツを含むプロジェクトはニーズを明らかにする
  • 一貫した動作を備えた複数のプラットフォームをターゲットにするチーム

注意事項

  • 複雑な子ウィジェットによってパフォーマンスが異なる場合があります
  • 最良の視覚的結果を得るためには、正確な配置が必要です
  • 半径と中心以外のカスタマイズは限定的
  • 高頻度のアニメーションには適していません
  • フルスクリーン効果を実現するためには、追加のレイアウトラッピングが必要になる場合があります

元の README

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

Circular Reveal Animation

pub package

Circular Reveal Animation as Flutter widget!

Inspired by Android's ViewAnimationUtils.createCircularReveal(...).

Статья с описанием (русский).

Article with description (english).

Demo web-site

Usage

CircularRevealAnimation(
  // @required
  child: Container(color: Colors.red),
  // @required [Animation<double>]
  animation: animation,
  // child's center if not specified
  centerAlignment: Alignment.centerRight,
  // 0 if not specified
  minRadius: 12,
  // distance from center to further child's corner if not specified
  maxRadius: 200,
);

Example

import 'package:circular_reveal_animation/circular_reveal_animation.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'CRA Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage>
    with SingleTickerProviderStateMixin {
  AnimationController animationController;
  Animation<double> animation;

  @override
  void initState() {
    super.initState();
    animationController = AnimationController(
      vsync: this,
      duration: Duration(milliseconds: 1000),
    );
    animation = CurvedAnimation(
      parent: animationController,
      curve: Curves.easeIn,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("CRA Demo"),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              MaterialButton(
                child: Text("show reveal dialog"),
                onPressed: () => showRevealDialog(context),
                color: Colors.amber,
              ),
              SizedBox(height: 16),
              CircularRevealAnimation(
                child: Image.asset('assets/ocv.jpg'),
                animation: animation,
//                centerAlignment: Alignment.centerRight,
                centerOffset: Offset(130, 100),
//                minRadius: 12,
//                maxRadius: 200,
              ),
            ],
          ),
        ),
      ),
      floatingActionButton: FloatingActionButton(onPressed: () {
        if (animationController.status == AnimationStatus.forward ||
            animationController.status == AnimationStatus.completed) {
          animationController.reverse();
        } else {
          animationController.forward();
        }
      }),
    );
  }

  Future<void> showRevealDialog(BuildContext context) async {
    showGeneralDialog(
      barrierLabel: "Label",
      barrierDismissible: true,
      barrierColor: Colors.black.withOpacity(0.5),
      transitionDuration: Duration(milliseconds: 700),
      context: context,
      pageBuilder: (context, anim1, anim2) {
        return Align(
          alignment: Alignment.bottomCenter,
          child: Container(
            child: Padding(
              padding: const EdgeInsets.all(12.0),
              child: Image.asset('assets/klimt.png'),
            ),
            margin: EdgeInsets.only(top: 50, left: 12, right: 12, bottom: 0),
            decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.circular(5),
            ),
          ),
        );
      },
      transitionBuilder: (context, anim1, anim2, child) {
        return CircularRevealAnimation(
          child: child,
          animation: anim1,
          centerAlignment: Alignment.bottomCenter,
        );
      },
    );
  }
}

カテゴリー

ソースリポジトリ

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