flutter_gen icon indicating copy to clipboard operation
flutter_gen copied to clipboard

AssetGetImage generating Image contructor with default scale

Open bziembanski opened this issue 3 years ago • 2 comments

Image image({
    Key? key,
    AssetBundle? bundle,
    ImageFrameBuilder? frameBuilder,
    ImageErrorWidgetBuilder? errorBuilder,
    String? semanticLabel,
    bool excludeFromSemantics = false,
    double? scale = 1.0,
    double? width,
    double? height,
    Color? color,
    Animation<double>? opacity,
    BlendMode? colorBlendMode,
    BoxFit? fit,
    AlignmentGeometry alignment = Alignment.center,
    ImageRepeat repeat = ImageRepeat.noRepeat,
    Rect? centerSlice,
    bool matchTextDirection = false,
    bool gaplessPlayback = false,
    bool isAntiAlias = false,
    String? package = 'core',
    FilterQuality filterQuality = FilterQuality.low,
    int? cacheWidth,
    int? cacheHeight,
  })

Because of this, flutter always uses the smallest image. Is there a way to generate code without this default value?

bziembanski avatar Jul 01 '22 08:07 bziembanski

This should be fixed in 4.3.0. Can you give it a try?

lcdsmao avatar Jul 01 '22 11:07 lcdsmao

Yep, that was the solution, thanks!

bziembanski avatar Jul 05 '22 08:07 bziembanski