generated from dellevin/template
新增毛玻璃主题
This commit is contained in:
@@ -13,6 +13,7 @@ import '../../models/data_models.dart';
|
||||
import '../../utils/toast_util.dart';
|
||||
import '../../utils/image_path_helper.dart';
|
||||
import '../../widgets/genre_selector_page.dart';
|
||||
import '../../widgets/app_overlay.dart';
|
||||
|
||||
class BookAddPage extends StatefulWidget {
|
||||
final VoidCallback? onCancel;
|
||||
@@ -271,7 +272,7 @@ class _BookAddPageState extends State<BookAddPage> {
|
||||
|
||||
void _showCoverOptions() {
|
||||
final c = Theme.of(context).colorScheme;
|
||||
showModalBottomSheet(context: context, backgroundColor: c.surface,
|
||||
appModalBottomSheet(context: context, backgroundColor: c.surface,
|
||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(16))),
|
||||
builder: (ctx) => SafeArea(child: Padding(padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
@@ -301,7 +302,7 @@ class _BookAddPageState extends State<BookAddPage> {
|
||||
|
||||
Future<void> _pickCoverFromUrl() async {
|
||||
final ctrl = TextEditingController();
|
||||
final ok = await showDialog<bool>(context: context, builder: (ctx) {
|
||||
final ok = await appDialog<bool>(context: context, builder: (ctx) {
|
||||
final c = Theme.of(ctx).colorScheme;
|
||||
return AlertDialog(backgroundColor: c.surface, elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
title: Text('添加网络图片', style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: c.onSurface)),
|
||||
|
||||
@@ -25,6 +25,7 @@ import '../character/character_list_page.dart';
|
||||
import '../../data/epub/reader_dao.dart';
|
||||
import '../epub_reader/epub_highlights_page.dart';
|
||||
import '../epub_reader/reader_screen.dart';
|
||||
import '../../widgets/app_overlay.dart';
|
||||
|
||||
/// 书籍详情页 - 极简主义设计
|
||||
class BookDetailPage extends StatefulWidget {
|
||||
@@ -627,7 +628,7 @@ class _BookDetailPageState extends State<BookDetailPage> {
|
||||
|
||||
void _showEditCoverOptions() {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
showModalBottomSheet(context: context, backgroundColor: colors.surface,
|
||||
appModalBottomSheet(context: context, backgroundColor: colors.surface,
|
||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(16))),
|
||||
builder: (ctx) => SafeArea(child: Padding(padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
@@ -661,7 +662,7 @@ class _BookDetailPageState extends State<BookDetailPage> {
|
||||
|
||||
Future<void> _pickEditCoverFromUrl() async {
|
||||
final urlCtrl = TextEditingController();
|
||||
final confirmed = await showDialog<bool>(context: context, builder: (ctx) {
|
||||
final confirmed = await appDialog<bool>(context: context, builder: (ctx) {
|
||||
final colors = Theme.of(ctx).colorScheme;
|
||||
return AlertDialog(backgroundColor: colors.surface, elevation: 0,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
@@ -1312,7 +1313,7 @@ class _BookDetailPageState extends State<BookDetailPage> {
|
||||
const names = ['默认样式', '毛玻璃层叠'];
|
||||
const icons = [Icons.article_outlined, Icons.blur_on_outlined];
|
||||
const subtitles = ['标准封面顶部布局', '封面背景 + 毛玻璃卡片'];
|
||||
showModalBottomSheet(
|
||||
appModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: colors.surface,
|
||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(16))),
|
||||
@@ -2173,7 +2174,7 @@ class _BookDetailPageState extends State<BookDetailPage> {
|
||||
|
||||
void _showDeleteDialog(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
showDialog(
|
||||
appDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
backgroundColor: colors.surface,
|
||||
|
||||
@@ -7,6 +7,7 @@ import '../../utils/toast_util.dart';
|
||||
import '../../data/epub/reader_dao.dart';
|
||||
import '../../widgets/fade_in_local_image.dart';
|
||||
import 'book_excerpt_form_page.dart';
|
||||
import '../../widgets/app_overlay.dart';
|
||||
|
||||
/// 书籍摘抄列表页面
|
||||
class BookExcerptsPage extends StatefulWidget {
|
||||
@@ -363,7 +364,7 @@ class _BookExcerptsPageState extends State<BookExcerptsPage> {
|
||||
|
||||
Future<bool?> _showDeleteDialog(BookExcerpt excerpt) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
return showDialog<bool>(
|
||||
return appDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
@@ -407,7 +408,7 @@ class _BookExcerptsPageState extends State<BookExcerptsPage> {
|
||||
|
||||
void _showDeleteAllDialog() {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
showDialog(
|
||||
appDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
@@ -449,7 +450,7 @@ class _BookExcerptsPageState extends State<BookExcerptsPage> {
|
||||
|
||||
void _showImportSheet() {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
showModalBottomSheet(
|
||||
appModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: Colors.transparent,
|
||||
isScrollControlled: true,
|
||||
@@ -532,7 +533,7 @@ class _BookExcerptsPageState extends State<BookExcerptsPage> {
|
||||
void _showWechatReadImport() {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
|
||||
showModalBottomSheet(
|
||||
appModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: Colors.transparent,
|
||||
isScrollControlled: true,
|
||||
|
||||
@@ -15,6 +15,7 @@ import '../../utils/image_path_helper.dart';
|
||||
import '../../widgets/genre_selector_page.dart';
|
||||
import '../../widgets/text_input_panel.dart';
|
||||
import '../../widgets/alternate_titles_dialog.dart';
|
||||
import '../../widgets/app_overlay.dart';
|
||||
|
||||
/// 从多值字段列表中提取去重排序的唯一值(供 compute 使用)
|
||||
List<String> _collectUnique(List<List<String>> lists) {
|
||||
@@ -394,7 +395,7 @@ class _BookFormPageState extends State<BookFormPage> {
|
||||
|
||||
Future<void> _pickCover() async {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
await showModalBottomSheet(
|
||||
await appModalBottomSheet(
|
||||
context: context,
|
||||
backgroundColor: colors.surface,
|
||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(16))),
|
||||
@@ -447,7 +448,7 @@ class _BookFormPageState extends State<BookFormPage> {
|
||||
|
||||
Future<void> _pickCoverFromUrl() async {
|
||||
final urlController = TextEditingController();
|
||||
final confirmed = await showDialog<bool>(
|
||||
final confirmed = await appDialog<bool>(
|
||||
context: context,
|
||||
builder: (ctx) {
|
||||
final c = Theme.of(ctx).colorScheme;
|
||||
@@ -567,7 +568,7 @@ class _BookFormPageState extends State<BookFormPage> {
|
||||
/// 编辑书名(弹窗)
|
||||
Future<void> _editTitle() async {
|
||||
final controller = TextEditingController(text: _titleController.text);
|
||||
final result = await showDialog<String>(
|
||||
final result = await appDialog<String>(
|
||||
context: context,
|
||||
builder: (ctx) {
|
||||
final colors = Theme.of(ctx).colorScheme;
|
||||
@@ -615,7 +616,7 @@ class _BookFormPageState extends State<BookFormPage> {
|
||||
|
||||
/// 编辑别名(弹窗 + 标签式输入)
|
||||
Future<void> _editAlternateTitles() async {
|
||||
final result = await showDialog<List<String>>(
|
||||
final result = await appDialog<List<String>>(
|
||||
context: context,
|
||||
builder: (ctx) => AlternateTitlesDialog(initial: _alternateTitles),
|
||||
);
|
||||
@@ -643,7 +644,7 @@ class _BookFormPageState extends State<BookFormPage> {
|
||||
|
||||
Future<void> _editReadCount() async {
|
||||
final controller = TextEditingController(text: _readCount > 0 ? '$_readCount' : '');
|
||||
final result = await showDialog<String>(
|
||||
final result = await appDialog<String>(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: const Text('阅读次数'),
|
||||
@@ -689,7 +690,7 @@ class _BookFormPageState extends State<BookFormPage> {
|
||||
Future<bool> _confirmLeave() async {
|
||||
if (!_hasContent()) return true;
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final result = await showDialog<bool>(
|
||||
final result = await appDialog<bool>(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
backgroundColor: colors.surface, elevation: 0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
|
||||
@@ -4,6 +4,7 @@ import '../../models/data_models.dart';
|
||||
import '../../providers/app_provider.dart';
|
||||
import '../../utils/toast_util.dart';
|
||||
import 'book_review_form_page.dart';
|
||||
import '../../widgets/app_overlay.dart';
|
||||
|
||||
/// 书评详情页
|
||||
class BookReviewDetailPage extends StatefulWidget {
|
||||
@@ -174,7 +175,7 @@ class _BookReviewDetailPageState extends State<BookReviewDetailPage> {
|
||||
|
||||
Future<void> _deleteReview() async {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final confirmed = await showDialog<bool>(
|
||||
final confirmed = await appDialog<bool>(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
backgroundColor: colors.surface,
|
||||
|
||||
@@ -6,6 +6,7 @@ import '../../models/data_models.dart';
|
||||
import '../../utils/toast_util.dart';
|
||||
import 'book_review_form_page.dart';
|
||||
import 'book_review_detail_page.dart';
|
||||
import '../../widgets/app_overlay.dart';
|
||||
|
||||
/// 书籍书评列表页面
|
||||
class BookReviewsPage extends StatefulWidget {
|
||||
@@ -286,7 +287,7 @@ class _BookReviewsPageState extends State<BookReviewsPage> {
|
||||
}
|
||||
|
||||
void _showDeleteDialog(BookReview review) {
|
||||
showDialog(
|
||||
appDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
|
||||
@@ -14,6 +14,7 @@ import '../../widgets/master_detail_scaffold.dart';
|
||||
import '../../widgets/detail_placeholder.dart';
|
||||
import 'book_detail_page.dart';
|
||||
import 'book_add_page.dart';
|
||||
import '../../widgets/app_overlay.dart';
|
||||
|
||||
/// 状态索引 → 状态值
|
||||
const _bookStatusMap = {0: 'read', 1: 'reading', 2: 'want_to_read', 3: 'abandoned'};
|
||||
@@ -412,7 +413,7 @@ class _BookTabViewState extends State<_BookTabView>
|
||||
|
||||
void _showDeleteDialog(BuildContext context, Book book) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
showDialog(
|
||||
appDialog(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
backgroundColor: colors.surface, elevation: 0,
|
||||
|
||||
Reference in New Issue
Block a user