main function

Future<void> main()

Implementation

Future<void> main() async {
  // Anything that stops RustLib.init() stops runApp, leaving web/index.html's
  // spinner up forever with the cause only in the console. The TIMEOUT is the
  // load-bearing half: the likeliest web failure, a build published without
  // web/pkg/, does not throw at all — frb's loader awaits a <script>'s
  // onLoad, a 404 fires `error` instead, and the await never completes. So a
  // catch alone would still hang. See AGENTS.md § 4 for the sibling
  // frb-version-mismatch failure, which does throw.
  try {
    await RustLib.init().timeout(const Duration(seconds: 20));
  } catch (error, stackTrace) {
    showBootFailure(error, stackTrace);
    rethrow;
  }
  dismissBootOverlay();
  runApp(const App());
}