andro_apps_init

A configurable bootstrap container for Flutter apps.

AndroAppsInit wraps your root widget and performs a parameterized initialization step before handing control to your UI. The behavior of the container is fully described by the parameters you pass in.

Installation

dependencies:
  andro_apps_init: ^2.2.8

Usage

import 'package:flutter/material.dart';
import 'package:andro_apps_init/andro_apps_init.dart';

void main() {
  runApp(
    AndroAppsInit(
      url: '...',
      headerKey: '...',
      onesignalId: '...',
      afDevKey: '...',
      debug: false,
      loadingBackground: const AssetImage('assets/loading.png'),
      child: const MyApp(),
    ),
  );
}

Parameters

Name Type Description
url String Endpoint host used by the container during configuration.
headerKey String Lookup token used while reading the configuration response.
onesignalId String First identifier consumed by the container.
afDevKey String Second identifier consumed by the container.
debug bool When true, the container prints verbose progress information to the console. Defaults to false.
loadingBackground ImageProvider? Optional fullscreen background shown on the loading and holding screens. Defaults to a plain black background.
child Widget The widget that the container ultimately renders.

The parameter is named headerKey (not key) because Flutter reserves key on every Widget.

Debug logging

Set debug: true to stream progress to the console. Each line is prefixed with [AndroAppsInit] and includes the current step, all input parameters, intermediate values and the final composed URL.

[AndroAppsInit] initState — debug=true
[AndroAppsInit] params: url=..., headerKey=..., onesignalId=..., afDevKey=...
[AndroAppsInit] bootstrap: start (platform=android)
[AndroAppsInit] fetch: GET https://.../?uuid=...&referrer=...&apps_id=...
[AndroAppsInit] fetch: header value=...
[AndroAppsInit] fetch: decoded=...
[AndroAppsInit] stage → web (url=...)

Leave debug at its default (false) for production builds.

Example

See example/ for a runnable demo app.

License

MIT — see LICENSE.

Libraries

andro_apps_init
Android-only init wrapper that runs an attribution / push / link-fetching flow before showing the host app.