Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.58 KB

README.md

File metadata and controls

62 lines (42 loc) · 1.58 KB

Credits builder

A simple package to generate a credit page of your dependencies. The best way to thank and appreciate the work of third party libraries.

Configuration

Setup the dependency:

dependencies:
  credits_builder: ^0.0.3                 # android   ios   linux   macos   web   windows

credits_builder:
  outputFile: "assets/dependencies.json"  # default value

Usage

Generate the dependencies file

By running this command you will create/update your dependencies file in the assets folder (assets/dependencies.json):

dart run credits_builder:start

Runtime side

Basic way to retrieve dependencies at runtime:

Future<List<Dependency>> getDependencies(BuildContext context) =>
      CreditsBuilder().config().get(context);

If you defined a dependency file name different from the default you can retrieve the information like this:

 Future<List<Dependency>> getDependencies(BuildContext context) =>
    CreditsBuilder()
        .config(
          path: 'assets/other_file_name.json',
        )
        .get(context);

If you want to preprocess the file information before using it (for example to deobfuscate the file with Stringcare) you can do it like this:

 Future<List<Dependency>> getDependencies(BuildContext context) =>
    CreditsBuilder()
        .config(
          process: (data) async => Stringcare().revealData(data) ?? data,
        )
        .get(context);

Sample

Checkout this sample: https://landamessenger.com/credits