cynic 0.1.1 cynic: ^0.1.1 copied to clipboard
Utilities for offline-first development.
cynic #
Utilities for offline-first development.
Warning: This is not an official Google or Dart project.
Usage #
This library works in Flutter and the standalone Dart VM.
dependencies:
cynic: ^0.1.1
Determine online status #
import 'package:cynic/cynic.dart';
main() async {
print('Connected: ${await isOnline()}');
}
Create and monitor a list of services #
final servers = const [
const Service.ipAddress('256.257.258.1', name: 'Server A'),
const Service.ipAddress('256.257.258.2', name: 'Server B'),
const Service.ipAddress('256.257.258.3', name: 'Server C'),
];
main() async {
print(await Service.allOnline(servers));
}