Future initializeApplication(ApplicationConfiguration config)

One-time setup method for an application.

This method is invoked as the first step during application startup. It is only invoked once per application, whereas other initialization methods are invoked once per isolate. Implement this method in an application's RequestSink subclass. If you are sharing some resource across isolates, it must be instantiated in this method.

    class MyRequestSink extends RequestSink {
      static Future initializeApplication(ApplicationConfiguration config) async {

      }

Any modifications to config are available in each RequestSink and therefore must be isolate-safe data. Do not configure types like HTTPCodecRepository or any other types that are referenced by your code. If it can't be safely passed in ApplicationConfiguration, it shouldn't be modified.

  • Note that static methods are not inherited in Dart and therefore you are not overriding this method. The declaration of this method in the base RequestSink classis for documentation purposes.

Source

static Future initializeApplication(ApplicationConfiguration config) async {}