themeSettingWidget method
Widget
themeSettingWidget(
{ - required void onItemSelected(
- int
),
- required int themesCount,
- required (AppTheme, bool) itemBuilder(
- int
),
})
Implementation
Widget themeSettingWidget({
required void Function(int) onItemSelected,
required int themesCount,
required (AppTheme theme, bool isSelected) Function(int) itemBuilder,
}) => Column(
children: [
MenuItemWidget(
icon: Icons.palette_sharp,
text: tr('theme'),
description: tr('theme_description'),
theme: theme,
),
const SizedBox(height: 8),
SizedBox(
height: 40,
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: themesCount,
itemBuilder: (_, index) {
final (themeItem, selected) = itemBuilder(index);
return _themeItemSelectorWidget(
theme: themeItem,
isSelected: selected,
onPressed: () => onItemSelected(index),
);
},
separatorBuilder: (_, __) => const SizedBox(width: 8),
),
),
],
);