PopupSizeProviderDirective constructor

PopupSizeProviderDirective(
  1. @Attribute('popupMinHeight') String? minHeight,
  2. @Attribute('popupMinWidth') String? minWidth,
  3. @Attribute('popupMaxHeight') String? maxHeight,
  4. @Attribute('popupMaxWidth') String? maxWidth,
  5. @Optional() @SkipSelf() PopupSizeProvider? _parentPopupSizeProvider,
)

Implementation

PopupSizeProviderDirective(
    @Attribute('popupMinHeight') String? minHeight,
    @Attribute('popupMinWidth') String? minWidth,
    @Attribute('popupMaxHeight') String? maxHeight,
    @Attribute('popupMaxWidth') String? maxWidth,
    @Optional() @SkipSelf() this._parentPopupSizeProvider) {
  _minHeight =
      minHeight == null ? null : _SizeDefinition.fromString(minHeight);
  _minWidth = minWidth == null ? null : _SizeDefinition.fromString(minWidth);
  _maxHeight =
      maxHeight == null ? null : _SizeDefinition.fromString(maxHeight);
  _maxWidth = maxWidth == null ? null : _SizeDefinition.fromString(maxWidth);

  // Define a reasonable default if for some reason a parent
  // PopupSizeProvider is not injected.
  if ((_minHeight == null ||
          _minWidth == null ||
          _maxHeight == null ||
          _maxWidth == null) &&
      _parentPopupSizeProvider == null) {
    _parentPopupSizeProvider = PercentagePopupSizeProvider(0.7, 0.5);
  }
}