Lens<Whole extends Object?, Part extends Object?> constructor

const Lens<Whole extends Object?, Part extends Object?>({
  1. required Part get(
    1. Whole
    ),
  2. required Whole set(
    1. Whole,
    2. Part
    ),
})

Creates a lens with the given get and set functions.

Both functions are required. For this to be a valid lens, they should satisfy the lens laws (see Lens documentation).

Implementation

const Lens({required this.get, required this.set});