feat(flutter): 增加榜单新剧分页与预约刷新

This commit is contained in:
Zhou Weidong committed 2026-10-20 16:53:07 +08:00
1 parent 805762f761
commit c4dcb714ab
12 files changed
+611 -96

No files matched your search

+34 -21
View File
@@ -1,8 +1,11 @@
// Author: fruit.com.cn
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../core/data/services/catalog_controller.dart';
import '../../core/theme/app_colors.dart';
import '../../core/widgets/app_pull_to_refresh.dart';
import '../../core/widgets/subpage_header.dart';
import '../../l10n/app_localizations.dart';
import '../new_releases/new_releases_page.dart';
@@ -41,32 +44,42 @@ class _ReservePageState extends State<ReservePage> {
key: const Key('reserve-page'),
backgroundColor: AppColors.ink,
body: SafeArea(
child: ListView(
padding: const EdgeInsets.fromLTRB(0, 4, 0, 24),
children: [
AppSubpageHeader(
title: l10n.reserveTitle,
subtitle: l10n.reserveSubtitle,
backKey: const Key('reserve-back'),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
child: _weekStrip(l10n),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
child: _ticketCard(context, l10n),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 24, 16, 0),
child: _steps(l10n),
),
],
child: AppPullToRefresh(
key: const Key('reserve-refresh'),
onRefresh: _refresh,
child: ListView(
key: const Key('reserve-list'),
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.fromLTRB(0, 4, 0, 24),
children: [
AppSubpageHeader(
title: l10n.reserveTitle,
subtitle: l10n.reserveSubtitle,
backKey: const Key('reserve-back'),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
child: _weekStrip(l10n),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
child: _ticketCard(context, l10n),
),
Padding(
padding: const EdgeInsets.fromLTRB(16, 24, 16, 0),
child: _steps(l10n),
),
],
),
),
),
);
}
Future<void> _refresh() async {
await context.read<CatalogController>().refresh();
}
Widget _weekStrip(AppLocalizations l10n) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,