charge_points 1.0.1 copy "charge_points: ^1.0.1" to clipboard
charge_points: ^1.0.1 copied to clipboard

A Charge Points client dart wrapper. For more information about API, go to https://openchargemap.org/site/develop/api#/

example/charge_points_example.dart

import 'package:charge_points/charge_points.dart';

void main() async {
  final String key = '<your-key>';
  final ChargePointsClient client = ChargePointsClient(key);
  final RetivePoiParams params = RetivePoiParams();
  final List<POI> list = await client.retrievePoiList(
    params.boundingBox,
    params.countryCode,
    params.countryID,
  );
  print(list);
}

class RetivePoiParams {
  final BoundingBox boundingBox;
  final String countryCode;
  final List<String> countryID;

  RetivePoiParams()
      : boundingBox = _setUpBoundingBox(),
        countryCode = 'IT',
        countryID = ['IT', 'US'];

  static _setUpBoundingBox() {
    final Corner topLeft = Corner(90, -180);
    final Corner bottomRight = Corner(-90, 180);
    return BoundingBox(topLeft, bottomRight);
  }
}
1
likes
160
pub points
15%
popularity

Publisher

unverified uploader

A Charge Points client dart wrapper. For more information about API, go to https://openchargemap.org/site/develop/api#/

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on charge_points