Box.rand constructor Null safety

  1. @Deprecated("Use this for debugging purposes only.")
const Box.rand(
  1. {Key? key,
  2. bool show = true,
  3. Color? color,
  4. EdgeInsetsGeometry? padding,
  5. double? width,
  6. double? height,
  7. AlignmentGeometry? alignment,
  8. Widget? child}
)

Use the Box.rand constructor to see when the widget rebuilds. It will change its color to a random one, whenever its build method is called. This constructor is marked as deprecated so that you don't forget to remove it.

Implementation

@Deprecated("Use this for debugging purposes only.")
const Box.rand({
  Key? key,
  this.show = true,
  this.color,
  this.padding,
  this.width,
  this.height,
  this.alignment,
  this.child,
})  : _random = true,
      super(key: key);