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

GitHub 저장소mattrltrent/scrollable

스크롤 가능한

하프틱, 키보드 숨기기 등이 포함된 강력한 스크롤 가능한 위젯 세트입니다. Pub 패키지.

스크롤 가능한 프로젝트 이미지
스타
2
포크
0
최근 푸시(UTC)
2023. 12. 2.
프로젝트 상태
활성

원본 README

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

🔥 A powerful set of scrollable widgets: haptics, keyboard dismissing, and more 🔥

  • Submit an issue here.
  • Create a pull request here.
  • Contact me via email [here](mailto:me@matthewtrent.me).

3 Widgets in this package 📚

💥 ScrollHaptics
  • Applies haptic feedback when its child is scrolled (during scroll & reaching edge of scroll view).
💥 KeyboardDismiss
  • Dismisses the soft-keyboard when its child is scrolled, tapped, or swiped.
💥 ScrollableView
  • The above 2 widgets combined into 1 widget for ease-of-use.

Example Gif 📸

It's hard to display haptics in a gif, but they're there.

Installing 🧑‍🏫

  • Install the package from the pub.
    • flutter pub add scrollable
  • Import the package.
    • import 'package:scrollable/exports.dart';

Quick Start 💨

Simply wrap whatever you want inside the ScrollHaptics, KeyboardDismiss, or ScrollableView widgets, then edit whatever of their properties you want!

Short Examples of the 3 Widgets 📜

For a full example with context, view the examples tab. It shows just the ScrollableView, but it's the same layout for all 3 widgets.

Scroll Haptics

ScrollHaptics

ScrollHaptics(
        // <Assorted Properties Here>
        child: SingleChildScrollView(
          child: Column(
            children: [
              Container(height: 100, width: 100, color: Colors.redAccent),
              Container(height: 100, width: 100, color: Colors.blue),
              Container(height: 100, width: 100, color: Colors.purple),
            ],
          ),
        ),
      );
Keyboard Dismiss

KeyboardDismiss

KeyboardDismiss(
          // <Assorted Properties Here>
        child: SingleChildScrollView(
          child: Column(
            children: [
              Container(height: 100, width: 100, color: Colors.redAccent),
              Container(height: 100, width: 100, color: Colors.blue),
              Container(height: 100, width: 100, color: Colors.purple),
            ],
          ),
        ),
      );
Scrollable View

ScrollableView

ScrollableView(
          // <Assorted Properties Here>
        controller: ScrollController(),
        child: SingleChildScrollView(
          child: Column(
            children: [
              Container(height: 100, width: 100, color: Colors.redAccent),
              Container(height: 100, width: 100, color: Colors.blue),
              Container(height: 100, width: 100, color: Colors.purple),
            ],
          ),
        ),
      );

Properties of the 3 Widgets 📜

Scroll Haptics

ScrollHaptics

Highly reccomended to use ClampingScrollPhysics for the physics of whatever scrollable you're wrapping, as it works best with haptics.

  • child (required): This widget's child.
  • bubbleUpScrollNotifications: Whether the widget should bubble up scroll notifications, or block them.
  • heavyHapticsAtEdgeEnabled: When a scroll reaches the edge, if there should be a haptic effect emitted.
  • hapticEffectAtEdge: Which kind of haptic effect should be emitted when the scroll edge is reached?
  • hapticEffectDuringScroll: Which kind of haptic effect should be emitted during the scroll.
  • distancebetweenHapticEffectsDuringScroll: The distance, in pixels, that should be scrolled before emitting a new haptic scroll effect.
Keyboard Dismiss

KeyboardDismiss

  • child (required): This widget's child.
  • bubbleUpScrollNotifications: Whether the widget should bubble up scroll notifications, or block them.
  • closeKeyboardOnTap: If the keyboard should also be closed just on the widget being tapped.
  • closeKeyboardOnVerticalSwipe: If the keyboard should be closed when a vertical swipe occurs.
  • onKeyboardDismissed: Callback triggered when a dismiss occurs.
Scrollable View

ScrollableView

  • child (required): This widget's child.
  • controller (required): A ScrollController to manage the scrolling of the widget.
  • bubbleUpScrollNotifications: Whether the widget should bubble up scroll notifications, or block them.
  • closeKeyboardOnScroll: Whether the keyboard should be automatically closed on the widget being scrolled.
  • closeKeyboardOnTap: If the keyboard should also be closed just on the widget being tapped.
  • physics: Physics of the scroll view. Highly reccomended to use ClampingScrollPhysics as it works best with haptics.
  • scrollDirection: Direction of the scroll.
  • inlineBottomOrRightPadding: Inline padding of the scroll view. This is a clean substitute to having to add SizedBox widgets inside your scroll view. For the bottom (if vertical) or right (if horizontal) of the scroll view.
  • inlineTopOrLeftPadding: Inline padding of the scroll view. This is a clean substitute to having to add SizedBox widgets inside your scroll view. For the top (if vertical) or left (if horizontal) of the scroll view.
  • padding: Outer padding of the widget.
  • hapticsEnabled: If haptics should be enabled.
  • distancebetweenHapticEffectsDuringScroll: The distance, in pixels, that should be scrolled before emitting a new haptic scroll effect.
  • heavyHapticsAtEdgeEnabled: If the haptics when the edge of the scroll is reached should be enabled or not.
  • hapticEffectAtEdge: Which kind of haptic effect should be emitted when the scroll edge is reached?
  • hapticEffectDuringScroll: Which kind of haptic effect should be emitted during the scroll.
  • primary: Whether this is the primary scroll view associated with the parent PrimaryScrollController.
  • dragStartBehavior: Determines the way that drag start behavior is handled.
  • restorationId: Restoration ID to save and restore the scroll offset of the scrollable.
  • reverse: Whether the scroll view scrolls in the reading direction.
  • closeKeyboardOnVerticalSwipe: If the keyboard should be closed when a vertical swipe occurs.

Additional Info 📣

analytics

Matthew Trent GitHub avatar
GitHub 작성자

Matthew Trent ↗

SWE @ Sorce (YC F25) | MS CS @ Columbia | Prev. @ Probe, Magi, Confesi (Founder) | Honors BS CS w/ Distinction

Sorce (YC F25)San Francisco, CA
언어C++CMakeDartHTMLCSwiftKotlinObjective-C

분류

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개

  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^2.0.0

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗