Skip to content

This package provides a refresh indicator widget that is far more flexible and native-like than the default Flutter one, built on top of flutter_appbar.

License

Notifications You must be signed in to change notification settings

MTtankkeo/flutter_refresh_indicator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This package provides a refresh indicator widget that is far more flexible and native-like than the default Flutter one, built on top of flutter_appbar.

Preview

The gif image below may appear distorted and choppy due to compression.

clamping bouncing

Usage

The following explains the basic usage of this package.

When Context

import 'package:flutter/material.dart' hide RefreshIndicator;

// Other Alias: PullToRefresh and SwipeToRefresh
RefreshIndicator(
    onRefresh: ..., // AsyncCallback
    child: ...
),

When Android

This widget for ClampingScrollPhysics.

ClampingRefreshIndicator(
    onRefresh: ..., // AsyncCallback
    child: ...
),

When IOS

This widget for BouncingScrollPhysics.

BouncingRefreshIndicator(
    onRefresh: ..., // AsyncCallback
    child: ...
),

How to define the style globally.

Using Material Theme

This is the traditional way to define themes in Flutter.

MaterialApp(
    theme: ThemeData(
        progressIndicatorTheme: ProgressIndicatorThemeData(
            color: ..., // foregroundColor
            refreshBackgroundColor: ... // backgroundColor
        )
    ),
);

Using PrimaryRefreshIndicator widget

PrimaryRefreshIndicator defines the style of its descendant related refresh indicator widgets, similar to how PrimaryScrollController defines the controller for its descendant widgets.

PrimaryRefreshIndicator(
    clamping: RefreshIndicatorStyle(...),
    bouncing: RefreshIndicatorStyle(...)
)

About

This package provides a refresh indicator widget that is far more flexible and native-like than the default Flutter one, built on top of flutter_appbar.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages