toggleMode static method

bool toggleMode(
  1. BuildContext context
)

Toggles the current theme mode.

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

Implementation

static bool toggleMode(BuildContext context) {
  final state = of(context);
  if (state == null) return false;
  state.toggleMode();
  return true;
}