ImageExtension constructor

ImageExtension({
  1. AssetBundle? assetBundle,
  2. String? assetPackage,
  3. String assetSchema = "asset:",
  4. String? dataEncoding,
  5. Set<String>? fileExtensions,
  6. Set<String>? mimeTypes,
  7. Set<String>? networkDomains,
  8. Map<String, String>? networkHeaders,
  9. Set<String> networkSchemas = const {"http", "https"},
  10. bool handleAssetImages = true,
  11. bool handleDataImages = true,
  12. bool handleNetworkImages = true,
  13. Widget? child,
  14. Widget builder(
    1. ExtensionContext
    )?,
})

ImageExtension allows you to extend the built-in support by providing a custom way to render a specific selection of attributes or providing headers or asset package/bundle specifications.

Implementation

ImageExtension({
  super.assetBundle,
  super.assetPackage,
  super.assetSchema = "asset:",
  super.dataEncoding,
  super.fileExtensions,
  super.mimeTypes,
  super.networkDomains,
  super.networkHeaders,
  super.networkSchemas = const {"http", "https"},
  super.handleAssetImages = true,
  super.handleDataImages = true,
  super.handleNetworkImages = true,
  Widget? child,
  Widget Function(ExtensionContext)? builder,
}) {
  if (child != null) {
    this.builder = (_) => WidgetSpan(child: child);
  } else {
    this.builder = (context) => WidgetSpan(child: builder!.call(context));
  }
}