auto_reload 1.1.0 auto_reload: ^1.1.0 copied to clipboard
A library that helps to perform actions with some periodicity
Auto Reload #
This package made by Surf.
Description #
A library that helps to perform actions with some periodicity
AutoReload #
main classes:
usage:
- Create abstract class that should be able to reload data should implement [AutoReloader]
- Apply mixin on a child (that implements [AutoReloader])
- override [autoReload]
- 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:
- Add your request in [autoReload]
- Wait callback about successful completion
Example #
- Call function
startAutoReload()
:
int _countOfReload = 0;
@override
void initState() {
super.initState();
startAutoReload();
}
- Override function
autoReload()
:
@override
void autoReload() {
setState(() {
_countOfReload = _countOfReload + 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.