SnapComponentWithOffsetFraction constructor
const
SnapComponentWithOffsetFraction({
- required Components component,
- double fraction = 0.0,
- double size = 1.0,
Represents a snap component with a size and an fraction, where the fraction is a fraction of viewport.
component: The component to associate with this snap size and fraction.fraction: A fraction (0.0 to 1.0) of viewport to add to the size.size: A multiplier for the component's base size. Must be non-negative.
Implementation
const SnapComponentWithOffsetFraction({
required this.component,
this.fraction = 0.0,
this.size = 1.0,
}) : assert(size >= 0.0, 'Component size can not be negative'),
assert(
fraction >= 0.0 || fraction <= 1.0,
'Fraction should be in the range from `0.0` to `1.0`',
);