feat(flutter): 剧场搜索框改白底并新增榜单新剧预约页
This commit is contained in:
1 parent
7a75ee6de8
commit
bfba2b7c72
15 files changed
+588
-9
No files matched your search
@@ -0,0 +1,43 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../core/data/services/catalog_controller.dart';
|
||||
import '../../core/widgets/empty_state.dart';
|
||||
import '../../core/widgets/plain_page_scaffold.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../discover/widgets/drama_grid.dart';
|
||||
import '../drama_detail/drama_detail_view.dart';
|
||||
|
||||
/// 剧场新剧页:按 id 倒序展示最新上架短剧。
|
||||
class NewReleasesPage extends StatelessWidget {
|
||||
const NewReleasesPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final dramas = [...context.read<CatalogController>().dramas]
|
||||
..sort((a, b) => b.id.compareTo(a.id));
|
||||
return PlainPageScaffold(
|
||||
pageKey: const Key('new-releases-page'),
|
||||
backKey: const Key('new-releases-back'),
|
||||
title: l10n.rankingNew,
|
||||
subtitle: l10n.newReleasesSubtitle,
|
||||
child: dramas.isEmpty
|
||||
? EmptyState(icon: Icons.fiber_new_outlined, title: l10n.noStories)
|
||||
: SingleChildScrollView(
|
||||
padding: const EdgeInsets.only(top: 4, bottom: 24),
|
||||
child: DramaGrid(
|
||||
l10n: l10n,
|
||||
dramas: dramas,
|
||||
onOpen: (drama) => Navigator.of(context).push<void>(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => DramaDetailPage(drama: drama),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user