搜尋套件、儲存庫與 APP 分類

cupertino_back_gesture 封面
套件詳情v0.1.0

cupertino_back_gesture

一個用於設定 iOS 回上一頁滑動手勢區域自定義寬度的套件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1800
喜歡數
69
Pub 分數
150

安裝套件

flutter pub add cupertino_back_gesture

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

cupertino_back_gesture 套件允許開發者自訂 Flutter 應用程式中 iOS 風格返回滑動手勢區域的寬度。這對於微調導航的互動邊緣特別有用,確保在 iOS 平台上提供更直覺的使用者體驗。此套件擴充 Flutter 的預設 CupertinoPageRoute 行為,無需進行深入的平台特定修改。它支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,讓跨平台應用在重視一致 iOS 導航模式方面更具彈性。

適用情境

  • 自訂 iOS 回上一頁手勢區域寬度
  • 改進 iOS 上的導航使用者體驗
  • 跨平台 iOS 風格導航
  • 微調滑動靈敏度
  • 增強手勢回應性
  • 針對特定UI佈局調整手勢

主要特色

  • 可調整的返回滑動寬度
  • iOS 原生手勢行為
  • 跨平台相容性
  • 所需的設定最少
  • 無需自定義路由實作
  • 與 CupertinoPageRoute 相容

適合對象

  • 針對 iOS 使用者的開發人員
  • 具有複雜導航流程的應用程式
  • 尋求 iOS 一致性的團隊
  • 需要手勢自定義的專案
  • 具備深度連結的 Flutter 應用程式
  • 以使用者體驗為導向的行動開發

使用建議

  • 僅限 iOS 風格的返回手勢
  • 可能需要在多個設備上進行測試
  • 標準手勢行為不需要
  • 不會影響 Android 回上一頁行為
  • 最佳搭配 Cupertino 實作導航
  • 與其他觸控偵測器的潛在衝突

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

cupertino_back_gesture

pub package

A Flutter package to set custom width of iOS back swipe gesture area.

Usage

To use this package, add cupertino_back_gesture as a dependency in your pubspec.yaml file.

Example

To change width of area where the user can start back swipe for the whole app

  • Wrap your MaterialApp with BackGestureWidthTheme with desired backGestureWidth
  • set iOS builder of pageTransitionsTheme to CupertinoPageTransitionsBuilderCustomBackGestureWidth
import '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 pixels
  • BackGestureWidth.fraction(f) where f is fraction of screen width from 0.0 to 1.0

Screenshots

Areas where back swipe gesture can be started are shaded with hatching

Default Flutter BackGestureWidth.fraction(1 / 2)
before after

Example app

Complete example can be found in example folder

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。