v0.1.0cupertino_back_gesture
一個用於設定 iOS 回上一頁滑動手勢區域自定義寬度的套件。
69喜歡 1300近 30 天下載150Pub 分數
AndroidiOSWebmacOSWindowsLinux
Flutter 套件,用於設定 iOS 回上一頁滑動手勢區域的自訂寬度
{"sdk":"flutter"}{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
A Flutter package to set custom width of iOS back swipe gesture area.
To use this package, add cupertino_back_gesture as a dependency in your pubspec.yaml file.
To change width of area where the user can start back swipe for the whole app
MaterialApp with BackGestureWidthTheme with desired backGestureWidthpageTransitionsTheme to CupertinoPageTransitionsBuilderCustomBackGestureWidthimport 'package:cupertino_back_gesture/cupertino_back_gesture.dart';
BackGestureWidthTheme(
backGestureWidth: BackGestureWidth.fraction(1 / 2),
child: MaterialApp(
theme: ThemeData(
pageTransitionsTheme: PageTransitionsTheme(
builders: {
TargetPlatform.android: FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilderCustomBackGestureWidth(),
},
),
),
home: MainPage(),
),
)
Possible variants for backGestureWidth are
BackGestureWidth.fixed(w) where w is width in logical pixelsBackGestureWidth.fraction(f) where f is fraction of screen width from 0.0 to 1.0Areas where back swipe gesture can be started are shaded with hatching
| Default Flutter | BackGestureWidth.fraction(1 / 2) |
|---|---|
| before | after |
Complete example can be found in example folder