diff --git a/lib/common/constant.dart b/lib/common/constant.dart index 28ed87ef..bd450324 100644 --- a/lib/common/constant.dart +++ b/lib/common/constant.dart @@ -434,8 +434,7 @@ class Constant { textButtonTheme: TextButtonThemeData( style: TextButton.styleFrom(foregroundColor: const Color(0xFF007AFF)), ), - dialogBackgroundColor: const Color.fromRGBO(28, 28, 30, 1.0), - textTheme: Typography.whiteCupertino, + textTheme: Typography.whiteCupertino, dialogTheme: DialogThemeData(backgroundColor: const Color.fromRGBO(28, 28, 30, 1.0)), ); } return ThemeData( diff --git a/lib/page/subpage_timetable.dart b/lib/page/subpage_timetable.dart index ebcb2eed..eb6cb167 100644 --- a/lib/page/subpage_timetable.dart +++ b/lib/page/subpage_timetable.dart @@ -39,6 +39,7 @@ import 'package:dan_xi/util/public_extension_methods.dart'; import 'package:dan_xi/util/retrier.dart'; import 'package:dan_xi/util/stream_listener.dart'; import 'package:dan_xi/util/timetable_converter_impl.dart'; +import 'package:dan_xi/widget/dialogs/manually_add_course_dialog.dart'; import 'package:dan_xi/widget/libraries/error_page_widget.dart'; import 'package:dan_xi/widget/libraries/future_widget.dart'; import 'package:dan_xi/widget/libraries/platform_context_menu.dart'; @@ -55,8 +56,6 @@ import 'package:provider/provider.dart'; import 'package:share_plus/share_plus.dart'; import 'package:tutorial_coach_mark/tutorial_coach_mark.dart'; -import '../widget/dialogs/manually_add_course_dialog.dart'; - /// Keys to locate buttons in the interactive tutorial. GlobalKey keyButton = GlobalKey(); GlobalKey keyButton1 = GlobalKey(); @@ -524,7 +523,7 @@ class TimetableSubPageState extends PlatformSubpageState { key: indicatorKey, edgeOffset: MediaQuery.of(context).padding.top, color: Theme.of(context).colorScheme.secondary, - backgroundColor: Theme.of(context).dialogBackgroundColor, + backgroundColor: Theme.of(context).dialogTheme.backgroundColor, onRefresh: () async { forceLoadFromRemote = true; HapticFeedback.mediumImpact(); diff --git a/lib/util/webvpn_proxy.dart b/lib/util/webvpn_proxy.dart index 73d74334..012195f7 100644 --- a/lib/util/webvpn_proxy.dart +++ b/lib/util/webvpn_proxy.dart @@ -148,7 +148,7 @@ class WebvpnProxy { } finally { loginSession = null; } - // Any exception thrown won't be catched and will be propagated to widgets + // Any exception thrown won't be caught and will be propagated to widgets } } diff --git a/lib/widget/forum/auto_bbs_image.dart b/lib/widget/forum/auto_bbs_image.dart index fcb73a41..6e1a4551 100644 --- a/lib/widget/forum/auto_bbs_image.dart +++ b/lib/widget/forum/auto_bbs_image.dart @@ -17,9 +17,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:dan_xi/util/io/cache_manager_with_webvpn.dart'; -import 'package:dan_xi/util/io/dio_utils.dart'; import 'package:dan_xi/widget/forum/render/base_render.dart'; -import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; import 'package:nil/nil.dart'; @@ -49,13 +47,11 @@ class BBSImagePlaceholder extends StatelessWidget { /// A network image loader that will show the image from network, and /// fit the image's size to at most [maxWidth]. class AutoBBSImage extends StatelessWidget { - final Dio dio = - DioUtils.newDioWithProxy(BaseOptions(responseType: ResponseType.bytes)); final String src; final double? maxWidth; final ImageTapCallback? onTapImage; - AutoBBSImage({super.key, required this.src, this.maxWidth, this.onTapImage}); + const AutoBBSImage({super.key, required this.src, this.maxWidth, this.onTapImage}); @override Widget build(BuildContext context) {