setMode static method

bool setMode(
  1. BuildContext context,
  2. ThemeMode mode
)

Sets theme mode to the provided mode.

Returns true if successful, false if no NakiThemeProvider is in the component tree.

Implementation

static bool setMode(BuildContext context, ThemeMode mode) {
  final state = of(context);
  if (state == null) return false;
  state.setMode(mode);
  return true;
}