FLUTTER ECOSYSTEM

pacifio/route_transitions

一个包含有用动画和友好路由功能的 Flutter 库 🚦

route_transitions 项目封面
Stars
42
Forks
7
最近推送(UTC)
2021年7月28日
项目状态
未归档
Adib Mohsin GitHub avatar
GITHUB User

Adib Mohsin ↗

high on vector spaces

@antarys-ai Dhaka , Bangladesh 官方网站 ↗
语言DartSwiftKotlinObjective-C

技术话题

此仓库发布的插件

使用的依赖

依赖清单 1 项
  • flutter{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

Route transitions

https://raw.githubusercontent.com/pacifio/route_transitions/master/media/example.gif

Now supports latest dart null safety . This package has been rewritten to use friendly route functions to navigate even with your favourite route transition and ability to build custom animations with tansitionBuilder !

How to use

import 'package:route_transitions/route_transitions.dart';

ElevatedButton(
  onPressed: () => pushWidget(
    newPage: Dashboard(),
    context: context,
  ),
  child: Text("Push page"),
),

Friendly API

https://raw.githubusercontent.com/pacifio/route_transitions/master/media/friendly.png

For actual examples , check example/lib/main.dart

Custom animation with customAnimationWidget

customAnimationWidget(
  newPage: YourPage(),
  context: context,
  transitionBuilder:
      (context, animation, secondaryAnimation, child) {
    var begin = 0.0;
    var end = 1.0;
    var curve = Curves.easeIn;

    var tween = Tween(begin: begin, end: end)
        .chain(CurveTween(curve: curve));

    return ScaleTransition(
      scale: animation.drive(tween),
      child: child,
    );
  },
)