hrk_nasa_apis 0.4.2 copy "hrk_nasa_apis: ^0.4.2" to clipboard
hrk_nasa_apis: ^0.4.2 copied to clipboard

A library to integrate NASA Open APIs based on dio HTTP client

ci codecov pub package

A library to integrate NASA Open APIs based on dio HTTP client.

Features #

Getting started #

dart pub add hrk_nasa_apis

Usage #

import 'package:hrk_nasa_apis/hrk_nasa_apis.dart';

void main() async {
  final sbdbCadApi = SbdbCadApi();
  try {
    // default example
    Response<SbdbCadBody> response = await sbdbCadApi.get();
    SbdbCadBody sbdbCadBody = response.data!;
    print('count = ${sbdbCadBody.count}');

    // If new fields are added in the upcoming versions of the API then
    // consumers won't have to wait till the release of new version of this
    // client library
    print('count from rawBody = ${sbdbCadBody.rawBody!['count']}');

    // queryParameters example
    SbdbCadQueryParameters queryParameters = SbdbCadQueryParameters();
    queryParameters.dateMin = dateFormatter.format(DateTime(2023, 7, 1));
    response = await sbdbCadApi.get(
      queryParameters: queryParameters.toJson(),
    );
  } on Exception catch (e) {
    print(e);
  }
}

1
likes
0
points
261
downloads

Publisher

verified publisherhrishikesh-kadam.dev

Weekly Downloads

A library to integrate NASA Open APIs based on dio HTTP client

Repository (GitHub)
View/report issues

Topics

#nasa

License

unknown (license)

Dependencies

dio, freezed_annotation, hrk_batteries, hrk_logging, intl, json_annotation

More

Packages that depend on hrk_nasa_apis