snapchat_refresh 1.0.4 copy "snapchat_refresh: ^1.0.4" to clipboard
snapchat_refresh: ^1.0.4 copied to clipboard

A smooth and customizable pull-to-refresh widget with Lottie animation

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:snapchat_refresh/snapchatrefresh_component.dart';

/// Example application demonstrating the dropdown_component package.
class MyApp extends StatelessWidget {
  /// Creates a [MyApp] instance.
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'smooth refresh Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Smooth Refresh Example')),
      body: SnapchatRefresh(
        lottiePath: "assets/default_animation.json",
        onRefresh: () async {
          await Future.delayed(Duration(seconds: 4));
        },
        child: SingleChildScrollView(
          child: Column(
            children: List.generate(
              30,
              (index) => ListTile(
                title: Text('Item $index'),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
3
likes
145
points
39
downloads

Publisher

unverified uploader

Weekly Downloads

A smooth and customizable pull-to-refresh widget with Lottie animation

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, lottie

More

Packages that depend on snapchat_refresh