fix(flutter): 修复导航白线与观看记录错误透传
This commit is contained in:
1 parent
ac706a42a5
commit
732483465c
8 files changed
+85
-3
No files matched your search
@@ -5,6 +5,7 @@ import 'package:flutter/foundation.dart';
|
||||
import '../models/drama.dart';
|
||||
import '../models/watch_progress.dart';
|
||||
import '../models/watch_record.dart';
|
||||
import '../remote/api_client.dart';
|
||||
import '../repositories/catalog_repository.dart';
|
||||
import '../repositories/watch_history_repository.dart';
|
||||
|
||||
@@ -47,8 +48,18 @@ class WatchRecordsController extends ChangeNotifier {
|
||||
records = _uniqueRecords(recent);
|
||||
_notify();
|
||||
await _hydrate(records.map((record) => record.dramaId).toList());
|
||||
} catch (_) {
|
||||
if (!_disposed) error = 'progressError';
|
||||
} catch (failure, stackTrace) {
|
||||
debugPrint(
|
||||
'[WatchRecordsController] recent failed '
|
||||
'${failure.runtimeType}: $failure',
|
||||
);
|
||||
debugPrintStack(
|
||||
stackTrace: stackTrace,
|
||||
label: '[WatchRecordsController] recent failed',
|
||||
);
|
||||
if (!_disposed) {
|
||||
error = failure is ApiException ? failure.message : 'progressError';
|
||||
}
|
||||
} finally {
|
||||
if (!_disposed) {
|
||||
loading = false;
|
||||
@@ -169,7 +180,15 @@ class WatchRecordsController extends ChangeNotifier {
|
||||
detailFailed: false,
|
||||
),
|
||||
);
|
||||
} catch (_) {
|
||||
} catch (failure, stackTrace) {
|
||||
debugPrint(
|
||||
'[WatchRecordsController] detail failed dramaId=$dramaId '
|
||||
'${failure.runtimeType}: $failure',
|
||||
);
|
||||
debugPrintStack(
|
||||
stackTrace: stackTrace,
|
||||
label: '[WatchRecordsController] detail failed dramaId=$dramaId',
|
||||
);
|
||||
if (_disposed) return;
|
||||
final current = _recordIndex(dramaId);
|
||||
if (current < 0) return;
|
||||
|
||||
@@ -17,4 +17,8 @@ abstract final class AppColors {
|
||||
static const bar = Color(0xFF101114);
|
||||
static const card = Color(0xFF17191F);
|
||||
static const muted = Color(0xFFB7BDC9);
|
||||
static const outlineDark = Color(0xFF3A3C45);
|
||||
static const outlineVariantDark = Color(0xFF242329);
|
||||
static const outlineLight = Color(0xFF8A8E99);
|
||||
static const outlineVariantLight = Color(0xFFD6D9E2);
|
||||
}
|
||||
@@ -41,6 +41,8 @@ abstract final class AppTheme {
|
||||
onSecondaryContainer: AppColors.onPrimary,
|
||||
surface: _darkBackground,
|
||||
onSurface: Colors.white,
|
||||
outline: AppColors.outlineDark,
|
||||
outlineVariant: AppColors.outlineVariantDark,
|
||||
surfaceTint: AppColors.blueSoft,
|
||||
inversePrimary: AppColors.blueSoft,
|
||||
)
|
||||
@@ -55,6 +57,8 @@ abstract final class AppTheme {
|
||||
onSecondaryContainer: AppColors.ink,
|
||||
surface: _lightBackground,
|
||||
onSurface: AppColors.ink,
|
||||
outline: AppColors.outlineLight,
|
||||
outlineVariant: AppColors.outlineVariantLight,
|
||||
surfaceTint: AppColors.blue,
|
||||
inversePrimary: AppColors.blueSoft,
|
||||
);
|
||||
|
||||
@@ -371,6 +371,7 @@ class _FailureState extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
FilledButton(
|
||||
key: const Key('watch-records-retry'),
|
||||
onPressed: () => unawaited(onRetry()),
|
||||
child: Text(l10n.retry),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user