generated from dellevin/template
优化代码,删除无用代码
This commit is contained in:
@@ -359,17 +359,6 @@ class _EpubDetailPageState extends State<EpubDetailPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTag(String label, ColorScheme colors) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: colors.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text(label, style: TextStyle(fontSize: 11, color: colors.onSurface.withValues(alpha: 0.5))),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLinkedBookCard(ColorScheme colors) {
|
||||
final linkedBookId = _book['book_id'] as String? ?? '';
|
||||
if (linkedBookId.isEmpty) {
|
||||
|
||||
@@ -166,7 +166,6 @@ class _GameTabPageState extends State<GameTabPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final isWideContent = Breakpoint.isWideContent(context);
|
||||
final provider = context.watch<AppProvider>();
|
||||
final isWallMode = provider.gameWallMode;
|
||||
|
||||
@@ -826,48 +826,6 @@ class _CityPainter extends CustomPainter {
|
||||
bool shouldRepaint(_CityPainter old) => old.t != t;
|
||||
}
|
||||
|
||||
// ─── 不拦截滑动手势的弹窗路由 ──────────────────────────────
|
||||
|
||||
class _NoSwipeDialogRoute<T> extends PageRoute<T> {
|
||||
final WidgetBuilder builder;
|
||||
|
||||
_NoSwipeDialogRoute({required this.builder});
|
||||
|
||||
@override
|
||||
bool get popGestureEnabled => false; // 关键:禁止拖拽关闭,不拦截水平手势
|
||||
|
||||
@override
|
||||
bool get barrierDismissible => true;
|
||||
|
||||
@override
|
||||
Color? get barrierColor => Colors.black54;
|
||||
|
||||
@override
|
||||
String? get barrierLabel => 'Dismiss';
|
||||
|
||||
@override
|
||||
Duration get transitionDuration => const Duration(milliseconds: 200);
|
||||
|
||||
@override
|
||||
Duration get reverseTransitionDuration => const Duration(milliseconds: 150);
|
||||
|
||||
@override
|
||||
Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
|
||||
return builder(context);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget buildTransitions(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
||||
return FadeTransition(opacity: animation, child: child);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get opaque => false;
|
||||
|
||||
@override
|
||||
bool get maintainState => true;
|
||||
}
|
||||
|
||||
// ─── 漫步弹窗 ──────────────────────────────────────────
|
||||
|
||||
class _StrollDialog extends StatefulWidget {
|
||||
@@ -4451,7 +4409,6 @@ class _DesktopNoteItem extends StatelessWidget {
|
||||
|
||||
void _showContextMenu(BuildContext context, TapUpDetails details) {
|
||||
final provider = context.read<AppProvider>();
|
||||
final overlay = Overlay.of(context);
|
||||
final renderBox = context.findRenderObject() as RenderBox;
|
||||
final position = renderBox.localToGlobal(details.localPosition);
|
||||
|
||||
|
||||
@@ -194,7 +194,6 @@ class _MovieTabPageState extends State<MovieTabPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final isWideContent = Breakpoint.isWideContent(context);
|
||||
final provider = context.watch<AppProvider>();
|
||||
final isWallMode = provider.movieWallMode;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
import 'epub_stream_service.dart';
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
/// Dart ARGB 颜色字符串转换为 JS RGBA 格式
|
||||
/// dartColor: "FF0066FF" (AARRGGBB) → jsColor: "0066FFFF" (RRGGBBAA)
|
||||
String convertDartColorToJs(String dartColor) {
|
||||
if (dartColor.length < 8) return dartColor;
|
||||
return dartColor.substring(2) + dartColor.substring(0, 2);
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
/// 极简主义主题配置
|
||||
class AppTheme {
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 自定义下拉刷新包装器 — 统一使用品牌色
|
||||
class AppRefreshIndicator extends StatelessWidget {
|
||||
final Future<void> Function() onRefresh;
|
||||
final Widget child;
|
||||
final String? semanticsLabel;
|
||||
|
||||
const AppRefreshIndicator({
|
||||
super.key,
|
||||
required this.onRefresh,
|
||||
required this.child,
|
||||
this.semanticsLabel,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
return RefreshIndicator(
|
||||
onRefresh: onRefresh,
|
||||
color: colors.primary,
|
||||
backgroundColor: colors.surface,
|
||||
strokeWidth: 2.5,
|
||||
displacement: 60,
|
||||
semanticsLabel: semanticsLabel,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user