set static method
Changes the current theme to the new theme
Implementation
static set(BuildContext context, {required ThemeData theme}) async {
CurrentTheme.instance.theme = theme;
if (theme.brightness == Brightness.light) {
AdaptiveTheme.of(context).setLight();
} else if (theme.brightness == Brightness.dark) {
AdaptiveTheme.of(context).setDark();
} else {
AdaptiveTheme.of(context).setSystem();
}
}