Callback triggered when the First Contentful Paint (FCP) occurs.
FCP is a Core Web Vitals metric that measures the time from when the page starts loading
to when any part of the page's content is rendered on the screen.
The callback provides the FCP time in milliseconds since navigation start.
Callback triggered when the First Paint (FP) occurs.
FP measures the time from when the page starts loading to when the browser renders
anything visually different from what was on the screen before navigation.
This includes non-default background colors, borders, box shadows, or any visible content.
The callback provides the FP time in milliseconds since navigation start.
Callback triggered when the Largest Contentful Paint (LCP) occurs.
LCP is a Core Web Vitals metric that measures loading performance.
This callback may be called multiple times as larger content elements are rendered.
The callback provides the LCP time in milliseconds since navigation start.
Callback triggered when LCP is finalized and content verification is performed.
This callback provides content information about what was actually rendered when LCP occurred.
Callback triggered once when the Largest Contentful Paint (LCP) metric is finalized.
This happens when user interaction occurs (click, tap, keyboard input) or when the page is hidden.
The callback provides the final LCP time in milliseconds since navigation start.
If true the content should size itself to avoid the onscreen keyboard
whose height is defined by the ambient FlutterView's
FlutterView.viewInsetsbottom property.
The height of WebF Widget.
Default: the value of max-height in constraints.
This allows you to explicitly set the height of the WebF rendering area regardless of parent constraints.
The width of WebF Widget.
Default: the value of max-width in constraints.
This allows you to explicitly set the width of the WebF rendering area regardless of parent constraints.
Preloads remote resources into memory and begins execution when the WebF widget is mounted into the Flutter tree.
If the entrypoint is an HTML file, the HTML will be parsed, and its elements will be organized into a DOM tree.
CSS files loaded through <style> and <link> elements will be parsed and the calculated styles applied to the corresponding DOM elements.
However, JavaScript code will not be executed in this mode.
If the entrypoint is a JavaScript file, WebF only do loading until the WebF widget is mounted into the Flutter tree.
Using this mode can save up to 50% of loading time, while maintaining a high level of compatibility with the standard mode.
It's safe and recommended to use this mode for all types of pages.
The aggressive mode is a step further than preloading, cutting down up to 90% of loading time for optimal performance.
This mode simulates the instantaneous response of native Flutter pages but may require modifications in the existing web codes for compatibility.
In this mode, all remote resources are loaded and executed similarly to the standard mode, but with an offline-like behavior.
Given that JavaScript is executed in this mode, properties like clientWidth and clientHeight from the viewModule always return 0. This is because
no layout or paint processes occur during preRendering.
If your application depends on viewModule properties, ensure that the related code is placed within the load and DOMContentLoaded or prerendered event callbacks of the window.
These callbacks are triggered once the WebF widget is mounted into the Flutter tree.
Apps optimized for this mode remain compatible with both standard and preloading modes.
Aggressively preloads and prerenders content from the provided WebFBundle.
Reports First Contentful Paint (FCP) when the first content is rendered.
This should be called when the first text, image, SVG, or non-white canvas content is painted.
Reports First Paint (FP) when the first visual change is rendered.
This includes any non-default background colors, borders, box shadows, or any visible content.
FP always occurs before or at the same time as FCP.
Reports a potential LCP candidate.
@param element The element being reported as an LCP candidate
@param contentSize The visible area of the element in pixels