credentials_helper 1.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 51

credentials_helper #

The idea behind this package is to provide a simple way to use various credentials in a project (particularly during development/testing) that is less prone to result in a private API key or the like being commited or published along with your code.

You can store your API keys, usernames, passwords, etc. in a JSON file that is either listed in your .gitignore or completely outside the project directory and load them into this class. You could also retrieve them from other JSON sources.

Example #

credentials.json #

  "api_key": "YOUR-API-KEY",
  "username": "yourUsername",
  "password": "yourPassword"

Dart code #

import 'package:credentials_helper/credentials_helper.dart';

void main() {

  Credentials credentials = Credentials.fromFile('credentials.json');

  myApiCall(apiKey: credentials.apiKey);


v1.0.4 - 2019-08-07 #

  • Updated packages

v1.0.3 - 2018-07-26 #

  • Updated to support Dart 2

v1.0.2 - 2018-07-25 #

  • Updated to use json_serializable v1.0.0

v1.0.1 - 2018-07-14 #

  • Changed Credentials class serializer to use "api_key" as the key name even though the property name is "apiKey"
  • Added JSON example to README

v1.0.0 - 2018-07-13 #

  • Initial release.


import 'package:credentials_helper/credentials_helper.dart';

void main() {

  Credentials credentials = Credentials.fromFile('credentials.json');

  myApiCall(apiKey: credentials.apiKey);


Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  credentials_helper: ^1.0.4

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:credentials_helper/credentials_helper.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21


Detected platforms: Flutter, other

Primary library: package:credentials_helper/credentials_helper.dart with components: io.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (json_annotation).


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.0 <3.0.0
json_annotation ^2.3.0 2.4.0 3.0.0
Dev dependencies
build_runner ^1.6.5
json_serializable ^2.3.0
test ^1.6.5