패키지, 저장소 및 앱 카테고리 검색

overscroll_pop 표지
패키지 상세v0.1.1

overscroll_pop

iOS의 Pinterest 및 Instagram 앱처럼 스크롤을 넘치게 했을 때 팝업되는 스크롤뷰용 플러터 위젯입니다.

AndroidiOSWeb
30일 다운로드
62
좋아요
123
Pub 점수
130

패키지 설치

flutter pub add overscroll_pop

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

스크롤 뷰에서 iOS 스타일의 오버스크롤 팝 동작을 가능하게 하는 플러터 패키지로, 핀터레스트 및 인스타그램과 같은 앱에서 볼 수 있는 인터랙티브한 스크롤-리프레시 또는 뒤로 가기 제스처를 모방합니다. 사용자가 스크롤 가능한 목록의 가장자리에서 오버스크롤함으로써 뒤로 이동할 수 있도록 하여 사용자 경험을 향상시킵니다. 안드로이드, iOS, 웹과 호환되며, 복잡한 설정 없이 기존 스크롤 가능한 위젯에 원활하게 통합됩니다. 네이티브 iOS 탐색 패턴을 재현하고자 하는 앱에 이상적입니다.

사용 사례

  • 스크롤 뷰에서 iOS 스타일의 뒤로 가기 제스처 구현하기
  • 소셜 미디어 피드에서 직관적인 탐색 만들기
  • 목록 기반 인터페이스에서 사용자 상호작용 향상
  • 모바일 앱에 자연스러운 오버스크롤 효과 추가하기
  • 스와이프하여 뒤로 가기 기능 지원

주요 기능

  • iOS 스타일 오버스크롤 팝 동작
  • ScrollView 위젯과의 원활한 통합
  • 크로스 플랫폼 지원 (Android, iOS, Web)
  • 필요한 최소 구성
  • 부드럽고 반응성이 뛰어난 제스처 감지

적합한 대상

  • 소셜 미디어 앱을 개발하는 개발자
  • 팀이 iOS 네이티브 동작을 복제하고 있습니다
  • 직관적인 스크롤 기반 탐색이 필요한 앱
  • 모바일 플랫폼을 대상으로 하는 Flutter 프로젝트
  • 사용자 경험 중심의 애플리케이션에서 제스처 피드백을 우선 고려

고려 사항

  • 다른 제스처 감지기와 충돌할 수 있습니다
  • 비 iOS 플랫폼에서 동작이 일관되지 않게 느껴질 수 있습니다
  • 다양한 기기에서 신중한 테스트가 필요합니다
  • 모든 UI 디자인에 적합하지 않습니다
  • 제스처 임계값에 대한 사용자 정의 옵션이 제한되어 있음

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

overscroll_pop

A Flutter widget for Scrollview, pop when overscroll like Instagram, Pinterest, ...

Demo Demo Demo

Getting Started

  1. Include the package to your project as dependency:
dependencies:
  	overscroll_pop: <latest version>
  1. Use the widget:

Wrap your Scaffold or top widget by OverscrollPop, every ScrollView widget (Listview, GridView, PageView, CustomScrollView, ...) which has scroll physics ClampingScrollPhysics(important) will have overscroll to pop effect.

    MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Overscroll Example'),
        ),
        body: Builder(
          builder: (c) => Center(
            child: Hero(
              tag: '${ScrollToPopOption.start}${DragToPopDirection.toRight}',
              child: ElevatedButton(
                onPressed: () => pushPage(
                  c,
                  (BuildContext context, _, __) => VerticalScrollview(
                    scrollToPopOption: ScrollToPopOption.start,
                    dragToPopDirection: DragToPopDirection.toRight,
                  ),
                ),
                child: Text('Vertical scrollview ${ScrollToPopOption.start}'),
              ),
            ),
          ),
        ),
      ),
    );

    class VerticalScrollview extends StatelessWidget {
      final ScrollToPopOption scrollToPopOption;
      final DragToPopDirection? dragToPopDirection;

      const VerticalScrollview({
        Key? key,
        this.scrollToPopOption = ScrollToPopOption.start,
        this.dragToPopDirection,
      }) : super(key: key);

      @override
      Widget build(BuildContext context) {
        return OverscrollPop(
          scrollToPopOption: scrollToPopOption,
          dragToPopDirection: dragToPopDirection,
          child: Container(
            clipBehavior: Clip.hardEdge,
            decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.0)),
            child: Scaffold(
              appBar: PreferredSize(
                preferredSize: Size.fromHeight(kToolbarHeight),
                child: Hero(
                  tag: '$scrollToPopOption${dragToPopDirection ?? ''}',
                  child: AppBar(
                    title: Text(
                      'Vertical Scrollview',
                      overflow: TextOverflow.visible,
                    ),
                  ),
                ),
              ),
              body: ListView.builder(
                physics: const ClampingScrollPhysics(),
                itemBuilder: (_, index) => Container(
                  height: 160.0,
                  margin: const EdgeInsets.symmetric(vertical: 8.0),
                  color: index % 2 == 0 ? Colors.cyanAccent : Colors.orangeAccent,
                  alignment: Alignment.center,
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Text(scrollToPopOption.toString()),
                      if (dragToPopDirection != null)
                        Text(dragToPopDirection.toString()),
                    ],
                  ),
                ),
                itemCount: MediaQuery.of(context).size.height ~/ 160.0 + 2,
              ),
            ),
          ),
        );
      }
    }

If your Scaffold does not contain any ScrollView and want to achieve drag to pop effect, wrap your Scaffold or top widget by DragToPop instead (Example).

Quick push route config helper:

pushOverscrollRoute(
    context: context,
    child: <your scaffold/widget>,
    // scrollToPopOption: <your ScrollToPopOption>,
    // dragToPopDirection: <your DragToPopDirection>,
    // other route configs
)

pushDragToPopRoute(
    context: context,
    child: <your scaffold/widget>,
    // other route configs
)
  1. Configure scroll direction and add extra drag to pop:
    • By default, the effect only apply for overscroll at the start of ScrollView (top edge of vertical scroll, left edge of horizontal scroll)

      VStart HStart

    • To enable the end edge (or both edges) for overscroll to pop, set scrollToPopOption to ScrollToPopOption.end (or ScrollToPopOption.both)

      OverscrollPop(
        scrollToPopOption: ScrollToPopOption.end, // or ScrollToPopOption.both
        ...
      )
      

      VEnd HEnd

    • Beside overscroll, you can config the other drag direction to achieve the pop effect by passing dragToPopDirection

      OverscrollPop(
        dragToPopDirection: DragToPopDirection.toTop, //  toTop, toBottom, toLeft, toRight, horizontal and vertical
        ...
      )
      
      1. Vertical scroll: drag to left, right or horizontal (both left and right) VStartToLeft VStartToLeft

      2. Horizontal scroll: drag to top, bottom or vertical (both top and bottom) HEndToTop HEndToBottom

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.