Skip to content

Commit

Permalink
sliver palette list
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Oct 18, 2023
1 parent 6bf3d42 commit a8a75b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions lib/design/widgets/entry_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ class EntryCard extends StatelessWidget {
? null
: () async {
Navigator.of(context, rootNavigator: true).pop();
await Future.delayed(const Duration(milliseconds: 336));
await callback();
},
child: action.label.text(),
Expand All @@ -178,6 +179,7 @@ class EntryCard extends StatelessWidget {
trailingIcon: CupertinoIcons.delete,
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop();
await Future.delayed(const Duration(milliseconds: 336));
await deleteAction.action?.call();
},
isDestructiveAction: true,
Expand Down
28 changes: 16 additions & 12 deletions lib/timetable/page/p13n.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,22 @@ class _TimetableP13nPageState extends State<TimetableP13nPage> with SingleTicker

Widget buildPaletteList(List<int> idList) {
final selectedId = TimetableInit.storage.palette.selectedId ?? BuiltinTimetablePalettes.classic.id;
return ListView.builder(
itemCount: idList.length,
itemBuilder: (ctx, i) {
final id = idList[i];
final palette = TimetableInit.storage.palette[id];
if (palette == null) return const SizedBox();
return buildPaletteCard(
id,
palette,
selected: selectedId == id,
).padH(6);
},
return CustomScrollView(
slivers: [
SliverList.builder(
itemCount: idList.length,
itemBuilder: (ctx, i) {
final id = idList[i];
final palette = TimetableInit.storage.palette[id];
if (palette == null) return const SizedBox();
return buildPaletteCard(
id,
palette,
selected: selectedId == id,
).padH(6);
},
),
],
);
}

Expand Down

0 comments on commit a8a75b4

Please sign in to comment.