搜索插件、代码仓与 APP 分类

插件详情v1.0.2

motion_widget

一个简单而强大的小部件,用于构建酷炫的过渡效果。它处理初始化、状态变化、代码清理以及其他所有动画样板代码,通过允许您在每个时间段控制动画,让您始终掌握主动权。

近 30 天下载
14
喜欢数
66
Pub 分数
20

安装插件

flutter pub add motion_widget

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

MotionWidget 是一个 Flutter 包,旨在简化流畅动态过渡的创建。它消除了常见的动画样板代码——如初始化、状态管理和清理——同时让开发者完全控制动画间隔。通过直观的 API,开发者可以专注于设计和行为,而不是底层的动画逻辑。非常适合构建具有流畅交互的响应式 UI,通过精致的视觉反馈提升用户体验。

适合场景

  • 创建动画按钮状态
  • 构建滑动面板过渡效果
  • 实现淡入/淡出效果
  • 设计交互式表单元素
  • 动画列表项进入
  • 向UI组件添加微交互

主要特点

  • 自动动画生命周期管理
  • 对动画间隔的细粒度控制
  • 最小化样板代码
  • 支持复杂的过渡序列
  • 与现有控件的轻松集成
  • 简洁、可读的 API

适合对象

  • 寻求高效动画解决方案的Flutter开发者
  • UI/UX 设计师实施交互式原型
  • 需要丰富、响应式动画的应用程序
  • 注重干净、可维护的动画代码的团队
  • 开发人员避免手动管理 AnimationController

使用建议

  • 需要了解基本的动画概念
  • 除了核心示例外,文档有限
  • 在简单用例中可能引入开销
  • 未针对极高频率动画进行优化
  • 最适合中等到复杂的过渡需求

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

motion_widget

A simple, powerful widget to build cool transitions

Features

  • Fine-grained control with Interval
  • Lightweight & fully customizable
  • No boilerplate code
  • Works with Row & Column
  • Support for Translate & Fade modes
  • Provides Exit transitions
  • No code clean-up required
Screenshots

Screenshot

Usage

To use this plugin :

  • Add the dependency
  dependencies:
    flutter:
      sdk: flutter
    motion_widget:
  • Use the widget as a Row or a Column
Motion<Row>(
    children: <Widget>[]
)
  • Wrap its child with MotionElement
MotionElement(
    interval: Interval(0.3, 0.9)
    mode: MotionMode.FADE
    child: Container()
    orientation: MotionOrientation.HORIZONTAL_LEFT
)
  • Provide exitConfigurations for exit transitions
Motion(
    exitConfigurations: MotionExitConfigurations(
        displacement: 200,
        orientation: MotionOrientation.HORIZONTAL_LEFT,
        durationMs: 400
    )
)

Pull Requests

All the pull requests are welcomed. Please feel free to make valuable additions in the code.

Created by

Sumeet Rukeja (LinkedIn)

License

Copyright 2020 Sumeet Rukeja

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。