advices_slip_api 1.0.0 advices_slip_api: ^1.0.0 copied to clipboard
An unofficial wrapper around the AdvicesSlip JSON API for providing random advice slips.
example/advices_slip_api_example.dart
import "package:advices_slip_api/advices_slip_api.dart";
void main() async {
(await AdviceSlipsApi.randomAdvice())
.onSuccess((AdviceSlip advice) => print(advice))
.onFailure((Exception e) => print(e));
(await AdviceSlipsApi.findAdvice("life"))
.onSuccess((List<AdviceSlip> advice) => print(advice))
.onFailure((Exception e) => print(e));
(await AdviceSlipsApi.findAdvice("life"))
.onSuccess((List<AdviceSlip> advice) => print(advice))
.onFailure((Exception e) => print(e));
}