FLUTTER ECOSYSTEM

nekocode/drag-down-to-pop-flutter

支援拖曳向下滑動以關閉的頁面轉場效果。

下拉返回-flutter 專案封面
Stars
18
Forks
5
最近推送(UTC)
2021年10月1日
專案狀態
未封存
nekocode GitHub avatar
GITHUB User

nekocode ↗

Hack the world!

AI & CryptoGuangdong, China官方網站 ↗
語言DartKotlinSwiftObjective-C

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 2 項
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

drag_down_to_pop

build status pub package

A page transition which supports drag-down-to-pop gesture. The main source code is copied from the cupertino/route.dart in Flutter SDK with some modifications.

https://github.com/nekocode/drag-down-to-pop-flutter/blob/master/image/preview.gif?raw=true

Simplest Usage

Create a new PageRoute to use this page transiaction.

import 'package:drag_down_to_pop/drag_down_to_pop.dart';

class ImageViewerPageRoute extends MaterialPageRoute {
  ImageViewerPageRoute({@required WidgetBuilder builder})
      : super(builder: builder);

  @override
  Widget buildTransitions(BuildContext context, Animation<double> animation,
      Animation<double> secondaryAnimation, Widget child) {
    return const DragDownToPopPageTransitionsBuilder()
        .buildTransitions(this, context, animation, secondaryAnimation, child);
  }
}

// Push to a new page using ImageViewerPageRoute
Navigator.push(
  context,
  ImageViewerPageRoute(builder: (context) => ImageViewerPage()),
);