SankofaBootstrap class
One-call bootstrap that does everything main would otherwise
hand-wire:
- Read
sankofa.yamlfrom the asset bundle. - Call
Sankofa.instance.initwith the parsed apiKey + endpoint. - If Deploy is enabled and a
loaderwas provided, apply any KBC patch staged on disk viaSankofa.instance.deploy.tryApplyStagedKbcPatch. - Schedule
notifyKbcPatchReadyafter the first frame (so the time-window crash detector treats this boot as healthy when rendering succeeds).
Returns a SankofaBootstrapResult the host can inspect to drive custom UI (e.g. show a "Patch applied" banner). Boilerplate-free:
import 'package:dynamic_modules/dynamic_modules.dart';
import 'package:sankofa_flutter/sankofa_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final boot = await Sankofa.bootstrap(
options: SankofaBootstrapOptions(loader: loadModuleFromBytes),
);
runApp(MyApp(bootResult: boot));
}
This is the Option-B path for engine-auto-init: the engine doesn't inject anything before the Dart main isolate, but the SDK collapses all the boilerplate into one Dart call. Phase 2 of engine-auto-init (full pre-isolate apply in the engine) is gated on multi-day engine work and is not required for v1 customers.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
run(
{SankofaBootstrapOptions options = const SankofaBootstrapOptions()}) → Future< SankofaBootstrapResult> - Run the bootstrap. Idempotent — calling twice is harmless (the second call is a no-op because Sankofa.instance is already initialized).