Pattern2d.from constructor

const Pattern2d.from(
  1. double get(
    1. double x,
    2. double y
    )
)

Creates a new pattern that delegates to a function to calculate the output value.

The get function should be pure and side-effect free.

Example

final pattern = Pattern2d.from((x, y) => x + y);
print(pattern.get(1, 2)); // 3.0

Implementation

const factory Pattern2d.from(double Function(double x, double y) get) =
    _DelegatePattern2d;