MenuSizeConfiguration constructor

const MenuSizeConfiguration({
  1. double? maxWidthFraction,
  2. double? maxHeightFraction,
  3. double? minWidthFraction,
  4. double? minHeightFraction,
  5. double? minWidth,
  6. double? minHeight,
  7. double? maxWidth,
  8. double? maxHeight,
  9. double? width,
  10. double? height,
  11. double? widthFraction,
  12. double? heightFraction,
  13. bool enforceMinWidthToMatchTrigger = false,
  14. bool enforceMaxWidthToMatchTrigger = false,
  15. bool requestConstantHeight = false,
  16. bool requestAvoidBottomInset = true,
})

Implementation

const MenuSizeConfiguration({
  this.maxWidthFraction,
  this.maxHeightFraction,
  this.minWidthFraction,
  this.minHeightFraction,
  this.minWidth,
  this.minHeight,
  this.maxWidth,
  this.maxHeight,
  this.width,
  this.height,
  this.widthFraction,
  this.heightFraction,
  this.enforceMinWidthToMatchTrigger = false,
  this.enforceMaxWidthToMatchTrigger = false,
  this.requestConstantHeight = false,
  this.requestAvoidBottomInset = true,
})  : assert(minWidth != null || minWidthFraction != null,
          '''No minimum width provided.
      At least one of minWidth or minWidthFraction must not be null.'''),
      assert(maxWidth != null || maxWidthFraction != null,
          '''No maximum width provided.
      At least one of maxWidth or maxWidthFraction must not be null.'''),
      assert(minHeight != null || minHeightFraction != null,
          '''No minimum height provided.
      At least one of minHeight or minHeightFraction must not be null.'''),
      assert(maxHeight != null || maxHeightFraction != null,
          '''No maximum height provided.
      At least one of maxHeight or maxHeightFraction must not be null.'''),
      assert(
          (maxWidthFraction == null ||
                  minWidthFraction == null ||
                  maxWidthFraction >= minWidthFraction) &&
              (maxHeightFraction == null ||
                  minHeightFraction == null ||
                  maxHeightFraction >= minHeightFraction),
          "Max Width and Max Height should be lesser or equal to Min Width and Min Height respectively.\n"
          "AKA, the contrainsts should be normalized.\n"),
      assert(minWidth == null || maxWidth == null || minWidth <= maxWidth,
          """minWidth should be less than or equal to maxWidth."""),
      assert(minHeight == null || maxHeight == null || minHeight <= maxHeight,
          """minHeight should be less than or equal to maxHeight.""");