ImageSpan constructor

ImageSpan(
  1. ImageProvider<Object> image, {
  2. Key? key,
  3. required double imageWidth,
  4. required double imageHeight,
  5. EdgeInsets? margin,
  6. int start = 0,
  7. PlaceholderAlignment alignment = ui.PlaceholderAlignment.middle,
  8. String? actualText,
  9. TextBaseline? baseline,
  10. BoxFit fit = BoxFit.scaleDown,
  11. ImageLoadingBuilder? loadingBuilder,
  12. ImageFrameBuilder? frameBuilder,
  13. String? semanticLabel,
  14. bool excludeFromSemantics = false,
  15. Color? color,
  16. BlendMode? colorBlendMode,
  17. AlignmentGeometry imageAlignment = Alignment.center,
  18. ImageRepeat repeat = ImageRepeat.noRepeat,
  19. Rect? centerSlice,
  20. bool matchTextDirection = false,
  21. bool gaplessPlayback = false,
  22. FilterQuality filterQuality = FilterQuality.low,
  23. GestureTapCallback? onTap,
  24. HitTestBehavior behavior = HitTestBehavior.deferToChild,
})

Implementation

ImageSpan(
  ImageProvider image, {
  Key? key,
  required double imageWidth,
  required double imageHeight,
  EdgeInsets? margin,
  int start = 0,
  ui.PlaceholderAlignment alignment = ui.PlaceholderAlignment.middle,
  String? actualText,
  TextBaseline? baseline,
  BoxFit fit = BoxFit.scaleDown,
  ImageLoadingBuilder? loadingBuilder,
  ImageFrameBuilder? frameBuilder,
  String? semanticLabel,
  bool excludeFromSemantics = false,
  Color? color,
  BlendMode? colorBlendMode,
  AlignmentGeometry imageAlignment = Alignment.center,
  ImageRepeat repeat = ImageRepeat.noRepeat,
  Rect? centerSlice,
  bool matchTextDirection = false,
  bool gaplessPlayback = false,
  FilterQuality filterQuality = FilterQuality.low,
  GestureTapCallback? onTap,
  HitTestBehavior behavior = HitTestBehavior.deferToChild,
})  : width = imageWidth + (margin == null ? 0 : margin.horizontal),
      height = imageHeight + (margin == null ? 0 : margin.vertical),
      super(
        child: Container(
          padding: margin,
          child: GestureDetector(
            onTap: onTap,
            behavior: behavior,
            child: Image(
              key: key,
              image: image,
              width: imageWidth,
              height: imageHeight,
              fit: fit,
              loadingBuilder: loadingBuilder,
              frameBuilder: frameBuilder,
              semanticLabel: semanticLabel,
              excludeFromSemantics: excludeFromSemantics,
              color: color,
              colorBlendMode: colorBlendMode,
              alignment: imageAlignment,
              repeat: repeat,
              centerSlice: centerSlice,
              matchTextDirection: matchTextDirection,
              gaplessPlayback: gaplessPlayback,
              filterQuality: filterQuality,
            ),
          ),
        ),
        baseline: baseline,
        alignment: alignment,
        start: start,
        deleteAll: true,
        actualText: actualText,
      );