ZZ constructor

const ZZ({
  1. required Widget child,
  2. void onTap()?,
  3. EdgeInsets? margin,
  4. EdgeInsets? padding,
  5. Decoration? decoration,
  6. double? height,
  7. double? width,
  8. int? flex,
  9. bool? canScroll,
  10. Key? key,
})

Creates the desired Widget hierarchy based on the provided arguments.

Widgets are created in the following order

  • Padding (margin)
  • DecoratedBox
  • Padding (padding)
  • GestureDetector
  • SingleChildScrollView
  • Expanded / SizedBox

Understanding the order is helpful in understanding the outcome when multiple properties are defined.

Implementation

const ZZ(
    {required this.child,
    this.onTap,
    this.margin,
    this.padding,
    this.decoration,
    this.height,
    this.width,
    this.flex,
    this.canScroll,
    Key? key})
    : super(key: key);