flutter_swr 0.3.0 copy "flutter_swr: ^0.3.0" to clipboard
flutter_swr: ^0.3.0 copied to clipboard

A Flutter Hooks port of SWR: cache-then-revalidate data fetching with dedup, retry, polling, and app-resume revalidation.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_swr_example/src/cache/sqflite_swr_cache.dart';
import 'package:flutter_swr_example/src/cache/swr_model.dart';

import 'src/app.dart';
import 'src/models/product.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final cache = await SqfliteSwrCache.open(
    fromJson: {...swrModel<Product>(Product.fromJson)},
  );

  runApp(StoreApp(cache: cache));
}
1
likes
160
points
195
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter Hooks port of SWR: cache-then-revalidate data fetching with dedup, retry, polling, and app-resume revalidation.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

collection, flutter, flutter_hooks

More

Packages that depend on flutter_swr