easy_refresh_squats 2.0.0 copy "easy_refresh_squats: ^2.0.0" to clipboard
easy_refresh_squats: ^2.0.0 copied to clipboard

Squats Indicator on EasyRefresh. Provides SquatsHeader and SquatsFooter. Animation with Rive.

Squats Indicator on EasyRefresh. #

License Pub

Online demo #

Animation from Lumberjack Squats

Features #

SquatsHeader and SquatsFooter.

Getting started #

Requires Flutter >=3.47 and Dart ^3.13.

dependencies:
  flutter:
    sdk: flutter
  easy_refresh: ^4.0.0
  easy_refresh_squats: ^2.0.0
  material_ui: ^1.5.0
  rive: ^0.14.11

Usage #

Initialize Rive before runApp. Assets are bundled with the package; no app asset declarations are needed. These indicators support vertical scrolling.

import 'package:easy_refresh/easy_refresh.dart';
import 'package:easy_refresh_squats/easy_refresh_squats.dart';
import 'package:material_ui/material_ui.dart';
import 'package:rive/rive.dart' show RiveNative;

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await RiveNative.init();
  runApp(const MaterialApp(home: StyleExample()));
}

class StyleExample extends StatefulWidget {
  const StyleExample({super.key});

  @override
  State<StyleExample> createState() => _StyleExampleState();
}

class _StyleExampleState extends State<StyleExample> {
  int _count = 30;

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(title: const Text('Squats indicators')),
    body: EasyRefresh(
      header: const SquatsHeader(),
      footer: const SquatsFooter(),
      onRefresh: () async {
        await Future<void>.delayed(const Duration(milliseconds: 600));
        if (!mounted) return IndicatorResult.fail;
        setState(() => _count = 30);
        return IndicatorResult.success;
      },
      onLoad: () async {
        await Future<void>.delayed(const Duration(milliseconds: 600));
        if (!mounted) return IndicatorResult.fail;
        if (_count < 90) setState(() => _count += 30);
        return _count >= 90 ? IndicatorResult.noMore : IndicatorResult.success;
      },
      child: ListView.builder(
        itemCount: _count,
        itemBuilder: (_, index) => ListTile(title: Text('Item $index')),
      ),
    ),
  );
}

AI agent skill #

Usage guide covers supported parameters and limitations. Run in your app after adding the dependency:

dart run skills@ get
0
likes
160
points
91
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Squats Indicator on EasyRefresh. Provides SquatsHeader and SquatsFooter. Animation with Rive.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

easy_refresh, flutter, material_ui, rive

More

Packages that depend on easy_refresh_squats