PopupSizeProviderDirective constructor
PopupSizeProviderDirective(
- @Attribute('popupMinHeight') String? minHeight,
- @Attribute('popupMinWidth') String? minWidth,
- @Attribute('popupMaxHeight') String? maxHeight,
- @Attribute('popupMaxWidth') String? maxWidth,
- @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);
}
}