pihole_api

Last updated:

0 purchases

pihole_api Image
pihole_api Images
Add to Cart

Description:

pihole api

Pi-hole API #




A Flutter library for the Pi-hole API.
Example #
The following example prints the summary information after fetching it.
Note: Do not forget to add your own API token if you use authenticated requests.
import 'package:pihole_api/pihole_api.dart';

final pihole = PiholeRepositoryDio(PiholeRepositoryParams(
baseUrl: "http://pi.hole",
apiPath: "/admin/api.php",
apiTokenRequired: true,
// Find the API token from your Pi-hole admin dashboard while signed in,
// e.g. from http://pi.hole/admin/scripts/pi-hole/php/api_token.php.
apiToken: const String.fromEnvironment(
"PIHOLE_API_TOKEN",
defaultValue: "MY_TOKEN",
),
allowSelfSignedCertificates: false,
adminHome: "/admin",
));
pihole.fetchSummary(CancelToken()).then((summary) => print(summary.toString()));
copied to clipboard
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
copied to clipboard
Changelog #
standard-version --release-as x.y.z
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.