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,
    );
  },
)