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

A library that helps to perform actions with some periodicity

Auto Reload #

Build Status Coverage Status Pub Version Pub Likes Pub popularity Flutter Platform

This package made by Surf.

Description #

A library that helps to perform actions with some periodicity

AutoReload #

main classes:

usage:

  1. Create abstract class that should be able to reload data should implement [AutoReloader]
  2. Apply mixin on a child (that implements [AutoReloader])
  3. override [autoReload]
  4. call [startAutoReload] for start and [cancelAutoReload] for dispose

AutoRequestManager #

main classes:

Main feature of [AutoRequestManager] that requests will only start restarting when a connection is made. It implemented by a third-party library names connectivity.

usage:

  1. Add your request in [autoReload]
  2. Wait callback about successful completion

Example #

  1. Call function startAutoReload():
int _countOfReload = 0;

@override
void initState() {
  super.initState();
  startAutoReload();
}
  1. Override function autoReload():
@override
void autoReload() {
  setState(() {
    _countOfReload = _countOfReload + 1;
  });
}
  1. Display _countOfReload:
@override
Widget build(BuildContext context) {
  return Column(
    children: <Widget>[
      const Spacer(),
      const Text(
        'auto reload example:',
        style: TextStyle(
          fontStyle: FontStyle.normal,
          fontWeight: FontWeight.bold,
        ),
      ),
      Text('count of reload $_countOfReload'),
      const Spacer(),
    ],
  );
}

Installation #

Add auto_reload to your pubspec.yaml file:

dependencies:
  auto_reload: ^1.0.0

You can use both stable and dev versions of the package listed above in the badges bar.

Changelog #

All notable changes to this project will be documented in this file.

Issues #

For issues, file directly in the Issues section.

Contribute #

If you would like to contribute to the package (e.g. by improving the documentation, solving a bug or adding a cool new feature), please review our contribution guide first and send us your pull request.

Your PRs are always welcome.

How to reach us #

Please feel free to ask any questions about this package. Join our community chat on Telegram. We speak English and Russian.

Telegram

License #

Apache License, Version 2.0

19
likes
130
pub points
83%
popularity

Publisher

verified publishersurf.ru

A library that helps to perform actions with some periodicity

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

connectivity_plus, flutter

More

Packages that depend on auto_reload