HybridImage.asset constructor

HybridImage.asset(
  1. String assetPath, {
  2. Key? key,
  3. double? width,
  4. double? height,
  5. BoxFit fit = BoxFit.contain,
  6. AlignmentGeometry alignment = Alignment.center,
})

Factory for HybridImage that returns a widget with an asset image for both svg and other image types. assetPath is the local path of the image and is required.

Implementation

factory HybridImage.asset(
  String assetPath, {
  Key? key,
  double? width,
  double? height,
  BoxFit fit = BoxFit.contain,
  AlignmentGeometry alignment = Alignment.center,
}) =>
    HybridImage._(
      key: key,
      type: HybridImageType.asset,
      assetPath: assetPath,
      width: width,
      height: height,
      fit: fit,
      alignment: alignment,
    );