MContainer constructor

MContainer({
  1. Key? key,
  2. double? size,
  3. double? width,
  4. double? height,
  5. BoxConstraints? constraints,
  6. AlignmentGeometry? alignment,
  7. BoxBorder? border,
  8. BorderRadius? borderRadius,
  9. Widget? child,
  10. Clip clipBehavior = Clip.none,
  11. Color? color,
  12. Decoration? decoration,
  13. BoxFit? fit,
  14. Decoration? foregroundDecoration,
  15. Gradient? gradient,
  16. String? image,
  17. AlignmentGeometry? imageAlignment,
  18. ImageProvider<Object>? imageProvider,
  19. EdgeInsetsGeometry? margin,
  20. EdgeInsetsGeometry? padding,
  21. double? radius,
  22. ImageRepeat repeat = ImageRepeat.noRepeat,
  23. double scale = 1.0,
  24. List<BoxShadow>? shadows,
  25. BorderSide? side,
  26. Matrix4? transform,
  27. AlignmentGeometry? transformAlignment,
  28. Rect? centerSlice,
  29. double? maxHeight,
  30. double? maxWidth,
  31. double? minHeight,
  32. double? minWidth,
  33. MBoxShape? shape,
  34. AssetBundle? bundle,
  35. String? package,
  36. Map<String, String>? headers,
})

创建一个 Container 组件, 可以设置宽高,边框,圆角等属性 width 宽度 height 高度 size 尺寸 child 子组件 alignment 对齐方式 border 边框 borderRadius 圆角 clipBehavior 裁剪 color 背景色 decoration 装饰 fit 图片填充模式 foregroundDecoration 前景装饰 gradient 渐变 image 图片 imageAlignment 图片对齐方式 imageProvider 图片提供者 margin 外边距 padding 内边距 radius 圆角 repeat 图片重复模式 scale 图片缩放 shadows 阴影 side 边框 transform 旋转 transformAlignment 旋转对齐方式 centerSlice 图片切片 maxHeight 最大高度 maxWidth 最大宽度 minHeight 最小高度 minWidth 最小宽度 shape 形状 constraints 约束

Implementation

MContainer({
  super.key,
  double? size,
  double? width,
  double? height,
  BoxConstraints? constraints,
  this.alignment,
  this.border,
  this.borderRadius,
  this.child,
  this.clipBehavior = Clip.none,
  this.color,
  this.decoration,
  this.fit,
  this.foregroundDecoration,
  this.gradient,
  this.image,
  this.imageAlignment,
  this.imageProvider,
  this.margin,
  this.padding,
  this.radius,
  this.repeat = ImageRepeat.noRepeat,
  this.scale = 1.0,
  this.shadows,
  this.side,
  this.transform,
  this.transformAlignment,
  this.centerSlice,
  this.maxHeight,
  this.maxWidth,
  this.minHeight,
  this.minWidth,
  this.shape,
  this.bundle,
  this.package,
  this.headers,
})  : assert(margin == null || margin.isNonNegative),
      assert(padding == null || padding.isNonNegative),
      assert(decoration == null || decoration.debugAssertIsValid()),
      assert(constraints == null || constraints.debugAssertIsValid()),
      assert(decoration != null || clipBehavior == Clip.none),
      constraints = (width != null || height != null || size != null)
          ? constraints?.tighten(width: width ?? size, height: height ?? size) ??
              BoxConstraints.tightFor(width: width ?? size, height: height ?? size)
          : constraints;