serverInit top-level constant

ServerInit const serverInit

Marks a method to run on the server before rendering.

@serverInit
Future<void> load() async {
  data = await fetchData();
}

Implementation

const serverInit = ServerInit();