only<T> static method

T only<T>({
  1. required BuildContext context,
  2. required T light,
  3. required T? dark,
})

Returns a Mode with the same value but with the given context.

final value = Mode<bool>(
context: context,
light: true,
dark: false,
);

Implementation

static T only<T>({
  required BuildContext context,
  required T light,
  required T? dark,
}) {
  return Mode<T>(
    context: context,
    light: light,
    dark: dark,
  ).value;
}