flutter_delay_fetch 1.1.0 copy "flutter_delay_fetch: ^1.1.0" to clipboard
flutter_delay_fetch: ^1.1.0 copied to clipboard

discontinued

A flutter plugin to put a delay between fetch request and parsing data with a mixin, during page route navigation to avoid laggy animations.

Flutter Delay Fetch #

pub package

A flutter plugin to put a delay between fetch request and parsing data with a mixin, during page route navigation to avoid laggy animations.

Usage #

Import #

import 'package:flutter_delay_fetch/flutter_delay_fetch.dart';

Basic Page #

class FetchPage extends StatefulWidget {
  @override
  _FetchPageState createState() => _FetchPageState();
}

class _FetchPageState extends State<FetchPage> with DelayedFetchMixin<Response, FetchPage> {
  bool _loading = true;
  List<TodoModel> _todos;

  @override
  Future<Response> fetch() async => await Dio().get('https://jsonplaceholder.typicode.com/posts');

  @override
  void onSuccess(Response response) {
    setState(() {
      _todos = (response.data as List).map((data) => TodoModel.fromJson(data)).toList();
      _loading = false;
    });
  }

  @override
  void onError(error) { ... }

  @override
  Widget build(BuildContext context) { ... }
}
2
likes
30
pub points
0%
popularity

Publisher

verified publisherjroussel.fr

A flutter plugin to put a delay between fetch request and parsing data with a mixin, during page route navigation to avoid laggy animations.

Homepage
Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_delay_fetch