FLUTTER ECOSYSTEM

PiN73/cupertino_back_gesture

iOS 뒤로 가기 스와이프 제스처 영역의 사용자 정의 너비를 설정하는 Flutter 패키지

cupertino_back_gesture 프로젝트 이미지
Stars
30
Forks
18
최근 푸시(UTC)
2021. 10. 19.
프로젝트 상태
활성
PiN73 GitHub avatar
GITHUB User

PiN73 ↗

Flutter developer

언어DartObjective-CJava

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

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