FLUTTER ECOSYSTEM

surfstudio/flutter-swipe-refresh

Surf 에 의해 제작됨 🏄

flutter-swipe-refresh 프로젝트 이미지
Stars
13
Forks
0
최근 푸시(UTC)
2024. 4. 18.
프로젝트 상태
활성
Surf GitHub avatar
GITHUB Organization

Surf ↗

United States of America공식 웹사이트 ↗
언어DartHTMLObjective-CKotlin

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 4 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • mocktail개발 의존성^0.2.0
  • surf_lint_rules개발 의존성^2.0.0

원본 README

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

README 펼치기 / 접기

Swipe Refresh

https://raw.githubusercontent.com/surfstudio/flutter-open-source/main/assets/logo_black.png#gh-light-mode-only https://raw.githubusercontent.com/surfstudio/flutter-open-source/main/assets/logo_white.png#gh-dark-mode-only

Build Status Coverage Status Pub Version Pub Likes Pub popularity Flutter Platform

Overview

Widget for refresh by swipe.

  • :1234: Enabled on every platform - the package is fully written on Flutter side and enabled on every platform.
  • :recycle: Fully covered by tests - guaranteeing the result and expectations from this package.
  • :notebook_with_decorative_cover: End-to-end documentation - every aspect of implementation is documented, so there is full understanding.
  • :cow2: Support from the best Flutter experts - we are open to any enhancement ideas and contributions.

material cupertino

Main classes:

  1. Refresh state
  2. Widget for indicate swipe refresh
  3. Widget for indicate swipe refresh Material style
  4. Widget for indicate swipe refresh Cupertino style

Example

Material

Refresh indicator widget with Material Design style.

SwipeRefresh.material(
  stateStream: Stream<SwipeRefreshState>(),
  onRefresh: _refresh,
  padding: const EdgeInsets.symmetric(vertical: 10),
  children: <Widget>[ ... ],
);

Future<void> _refresh() async {
  // When all needed is done change state.
  _controller.sink.add(SwipeRefreshState.hidden);
}
Cupertino

Refresh indicator widget with Cupertino Design style.

SwipeRefresh.cupertino(
  stateStream: Stream<SwipeRefreshState>(),
  onRefresh: _refresh,
  padding: const EdgeInsets.symmetric(vertical: 10),
  children: <Widget>[ ... ],
);

Future<void> _refresh() async {
  // When all needed is done change state.
  _controller.sink.add(SwipeRefreshState.hidden);
}
Adaptive

Refresh indicator widget with adaptive to platform style.

SwipeRefresh.adaptive(
  stateStream: Stream<SwipeRefreshState>(),
  onRefresh: _refresh,
  padding: const EdgeInsets.symmetric(vertical: 10),
  children: <Widget>[ ... ],
);

Future<void> _refresh() async {
  // When all needed is done change state.
  _controller.sink.add(SwipeRefreshState.hidden);
}
Builder

Refresh indicator widget with adaptive to platform style, and with SliverChildBuilderDelegate in childDelegate(so as not to create more child elements than are visible through Viewport).

SwipeRefresh.builder(
  stateStream:  Stream<SwipeRefreshState>(),
  onRefresh: _refresh,
  padding: const EdgeInsets.symmetric(vertical: 10),
  itemCount: Colors.primaries.length,
  itemBuilder: (context, index) {
return Container(
 ...
   );
 },
),

Future<void> _refresh() async {
  // When all needed is done change state.
  _controller.sink.add(SwipeRefreshState.hidden);
}

Installation

Add swipe_refresh to your pubspec.yaml file:

dependencies:
  swipe_refresh: $currentVersion$

At this moment, the current version of swipe_refresh is swipe_refresh version.

Changelog

All notable changes to this project will be documented in this file.

Issues

To report your issues, submit them directly in the Issues section.

Contribute

If you would like to contribute to the package (e.g. by improving the documentation, fixing a bug or adding a cool new feature), please read our contribution guide first and send us your pull request.

Your PRs are always welcome.

How to reach us

Please feel free to ask any questions about this package. Join our community chat on Telegram. We speak English and Russian.

Telegram

License

Apache License, Version 2.0