pihole_api 0.1.4 copy "pihole_api: ^0.1.4" to clipboard
pihole_api: ^0.1.4 copied to clipboard

outdated

Provides models and endpoint wrappers for the Pi-hole API (summary, queries, versions etc.).

Pi-hole API #

Pub Build codecov License

A Flutter library for the Pi-hole API.

Used in the FlutterHole app.

Example #

The following example prints the summary information after fetching it.

Note: Do not forget to add your own API token.

final dio = Dio();
final pihole = PiholeRepositoryDio(PiholeRepositoryParams(
  dio: dio,
  baseUrl: "http://pi.hole",
  apiPath: "/admin/api.php",
  apiPort: 80,
  apiTokenRequired: true,
  apiToken: "API_TOKEN",
  allowSelfSignedCertificates: false,
  adminHome: "/admin",
));
pihole.fetchSummary(CancelToken()).then((summary) => print(summary.toString()));

Development #

The models are built by freezed. To build the models, use build_runner:

flutter pub run build_runner build
# or
flutter pub run build_runner build --delete-conflicting-outputs
0
likes
0
pub points
0%
popularity

Publisher

verified publishertster.nl

Provides models and endpoint wrappers for the Pi-hole API (summary, queries, versions etc.).

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

clock, dio, freezed_annotation, html, http_mock_adapter, json_annotation

More

Packages that depend on pihole_api