set static method

Future<void> set(
  1. BuildContext context, {
  2. required String id,
  3. bool remember = false,
})

Changes the current theme.

Standard light theme id is "light_theme". Standard dark theme id is "dark_theme".

remember - If true, sets this theme as the preferred theme for its type (light or dark). This is used when following system theme.

Note: This will automatically disable system theme following. To re-enable, call NyTheme.setFollowSystem(true).

Implementation

static Future<void> set(BuildContext context,
    {required String id, bool remember = false}) async {
  await NyThemeManager.instance.setTheme(id, remember: remember);
}