showThemesSelectionBorderSheet static method
void
showThemesSelectionBorderSheet(
- BuildContext context, {
- bool autoSave = true,
- VoidCallback? onChanged,
Show a bottom sheet with ability to change the app theme
onChanged
A callback function that fired when the app theme is changed
Usually used to save the new theme preferences
Implementation
static void showThemesSelectionBorderSheet(BuildContext context,
{bool autoSave = true, VoidCallback? onChanged}) {
showQudsModalBorderSheet(
context,
(c) => QudsThemesListView(
onChanged: () async {
if (autoSave) {
await QudsInteractiveApp.qudsAppController
.saveStateInSharedPreferences();
}
onChanged?.call();
},
),
title: QudsProviderWatcher<QudsThemeProvider>(
builder: (p) => Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
child:
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
QudsAnimatedCombinedIcons(
curve: Curves.fastLinearToSlowEaseIn,
showStartIcon: p!.isDark.v,
duration: const Duration(milliseconds: 700),
startIcon: Icons.brightness_3_rounded,
endIconColor: Colors.black54,
endIcon: Icons.brightness_7_rounded),
const SizedBox(
width: 10,
),
Text(
'Select Theme'.tr,
style: const TextStyle(fontSize: 20),
)
]))),
);
}