Import the new Dart library
    with the deferred keyword in your app and
    call loadLibrary() (see lazily loading a library).
    The following example uses FutureBuilder
    to wait for the loadLibrary Future (created in
    initState) to complete and display a
    CircularProgressIndicator as a placeholder.
    When the Future completes, it returns the DeferredBox widget.
    SomeWidget can then be used in the app as normal and
    won’t ever attempt to access the deferred Dart code until
    it has successfully loaded.

    
import 'package:flutter/material.dart';
import 'box.dart' deferred as box;

class SomeWidget extends StatefulWidget {
  const SomeWidget({super.key});

  @override
  State<SomeWidget> createState() => _SomeWidgetState();
}

class _SomeWidgetState extends State<SomeWidget> {
  late Future<void> _libraryFuture;