fix(recommend): 统一全部短剧筛选左对齐
This commit is contained in:
1 parent
64bc1997ba
commit
57c9e6b477
4 files changed
+156
-33
No files matched your search
@@ -142,9 +142,9 @@ class _AllDramasFilterGridState extends State<AllDramasFilterGrid> {
|
||||
final genres = _availableGenres(l10n);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
AppDimens.feedPageHorizontal,
|
||||
AppDimens.allDramasHorizontal,
|
||||
0,
|
||||
AppDimens.allDramasFilterRight,
|
||||
AppDimens.allDramasHorizontal,
|
||||
AppDimens.allDramasFilterToGridGap,
|
||||
),
|
||||
child: Column(
|
||||
@@ -184,37 +184,45 @@ class _AllDramasFilterGridState extends State<AllDramasFilterGrid> {
|
||||
required String selected,
|
||||
required ValueChanged<String> onSelected,
|
||||
}) {
|
||||
return Padding(
|
||||
key: Key('all-filter-row-$row'),
|
||||
padding: const EdgeInsets.only(bottom: AppDimens.filterRowGap),
|
||||
child: SizedBox(
|
||||
height: AppDimens.filterChipHeight,
|
||||
child: SingleChildScrollView(
|
||||
key: Key('all-filter-scroll-$row'),
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
for (var index = 0; index < options.length; index++) ...[
|
||||
_chip(
|
||||
key: Key('all-filter-${options[index].id}'),
|
||||
label: options[index].label,
|
||||
selected: selected == options[index].id,
|
||||
onTap: () => onSelected(options[index].id),
|
||||
),
|
||||
if (index < options.length - 1)
|
||||
const SizedBox(width: AppDimens.filterItemGap),
|
||||
],
|
||||
return _filterRow(
|
||||
row: row,
|
||||
child: SingleChildScrollView(
|
||||
key: Key('all-filter-scroll-$row'),
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
for (var index = 0; index < options.length; index++) ...[
|
||||
_chip(
|
||||
key: Key('all-filter-${options[index].id}'),
|
||||
label: options[index].label,
|
||||
selected: selected == options[index].id,
|
||||
onTap: () => onSelected(options[index].id),
|
||||
),
|
||||
if (index < options.length - 1)
|
||||
const SizedBox(width: AppDimens.filterItemGap),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _filterRow({
|
||||
required int row,
|
||||
required Widget child,
|
||||
double height = AppDimens.filterChipHeight,
|
||||
}) {
|
||||
return Padding(
|
||||
key: Key('all-filter-row-$row'),
|
||||
padding: EdgeInsets.only(bottom: row < 3 ? AppDimens.filterRowGap : 0),
|
||||
child: SizedBox(height: height, child: child),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _genreRow(
|
||||
int row,
|
||||
List<({String id, String label})> options,
|
||||
@@ -270,8 +278,8 @@ class _AllDramasFilterGridState extends State<AllDramasFilterGrid> {
|
||||
}
|
||||
|
||||
Widget _sortRow(AppLocalizations l10n) {
|
||||
return SizedBox(
|
||||
key: const Key('all-filter-row-3'),
|
||||
return _filterRow(
|
||||
row: 3,
|
||||
height: AppDimens.allDramasFilterButton,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
||||
Reference in new issue
Block a user