match<R> method

  1. @override
R match<R>({
  1. required R some(
    1. T value
    ),
  2. required R none(),
})
override

Pattern matches this option.

final label = const Some<int>(42).match(
  some: (value) => 'count=$value',
  none: () => 'missing',
);

Implementation

@override
R match<R>({
  required R Function(T value) some,
  required R Function() none,
}) {
  return some(value);
}