From e7f0cd8d2f835a22882fc906361a68b4442e21dd Mon Sep 17 00:00:00 2001 From: virskor Date: Sun, 27 Dec 2020 17:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=A8const=20constructors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/.dart_tool/package_config.json | 2 +- mobile/.flutter-plugins-dependencies | 2 +- mobile/.packages | 2 +- mobile/lib/models/attachmentsModel.dart | 2 +- mobile/lib/models/userFollowModel.dart | 2 +- mobile/lib/utils/authHelper.dart | 2 +- mobile/lib/views/accountDelegate.dart | 4 +- mobile/lib/views/forumDelegate.dart | 2 +- .../views/gallery/discuzGalleryDelegate.dart | 6 +- .../notificationListDelegate.dart | 2 +- mobile/lib/views/notificationsDelegate.dart | 4 +- .../views/reports/reportsHistoryDelegate.dart | 2 +- mobile/lib/views/search/searchSuggestion.dart | 2 +- .../lib/views/search/searchUserDelegate.dart | 4 +- .../views/threads/threadDetailDelegate.dart | 6 +- mobile/lib/views/users/blackListDelegate.dart | 2 +- .../users/follows/followerListDelegate.dart | 2 +- mobile/lib/views/users/profileDelegate.dart | 2 +- .../users/profiles/userSignatureDelegate.dart | 2 +- .../profiles/usernameModifyDelegate.dart | 2 +- mobile/lib/views/users/userHomeDelegate.dart | 8 +- mobile/lib/views/users/walletDelegate.dart | 23 ++-- .../lib/widgets/appbar/appbarSaveButton.dart | 2 +- mobile/lib/widgets/appbar/searchAppbar.dart | 6 +- .../bottomNavigator/bottomNavigator.dart | 2 +- mobile/lib/widgets/common/avatarPicker.dart | 4 +- mobile/lib/widgets/common/discuzButton.dart | 4 +- mobile/lib/widgets/common/discuzToast.dart | 8 +- mobile/lib/widgets/common/gradientText.dart | 2 +- mobile/lib/widgets/editor/discuzEditor.dart | 2 +- .../discuzEmojiTextSpan.dart | 2 +- .../toolbar/discuzEditorCategorySelector.dart | 6 +- .../editor/toolbar/discuzEditorToolbar.dart | 2 +- .../uploaders/discuzEditorImageUploader.dart | 24 ++-- mobile/lib/widgets/emoji/emoji.dart | 2 +- mobile/lib/widgets/emoji/emojiSwiper.dart | 2 +- .../lib/widgets/forum/floatLoginButton.dart | 2 +- mobile/lib/widgets/forum/forumAddButton.dart | 2 +- mobile/lib/widgets/player/discuzPlayer.dart | 10 +- mobile/lib/widgets/popmenu/popmenu.dart | 110 +++++++++--------- mobile/lib/widgets/posts/postFloorCard.dart | 6 +- .../widgets/search/searchActionButton.dart | 8 +- mobile/lib/widgets/settings/clearCache.dart | 6 +- .../lib/widgets/settings/privacyConfirm.dart | 4 +- .../widgets/settings/themeColorSetting.dart | 2 +- mobile/lib/widgets/share/shareApp.dart | 2 +- mobile/lib/widgets/skeleton/pkSkeleton.dart | 86 +++++++------- .../threads/parts/threadExtendBottomBar.dart | 2 +- .../parts/threadFavoritesAndRewards.dart | 2 +- mobile/lib/widgets/threads/theadsList.dart | 6 +- mobile/lib/widgets/threads/threadCard.dart | 12 +- mobile/lib/widgets/topics/topicListBar.dart | 4 +- mobile/lib/widgets/topics/topicsList.dart | 6 +- .../lib/widgets/users/userAccountBanner.dart | 2 +- mobile/lib/widgets/users/userFollow.dart | 6 +- .../lib/widgets/users/userFollowListTile.dart | 2 +- .../widgets/users/userHomeDelegateCard.dart | 4 +- .../lib/widgets/users/userRecentThreads.dart | 2 +- mobile/test/widget_test.dart | 4 +- 59 files changed, 223 insertions(+), 220 deletions(-) diff --git a/mobile/.dart_tool/package_config.json b/mobile/.dart_tool/package_config.json index 2ab4fcfa..61f5ad7d 100644 --- a/mobile/.dart_tool/package_config.json +++ b/mobile/.dart_tool/package_config.json @@ -770,7 +770,7 @@ "languageVersion": "2.8" } ], - "generated": "2020-12-27T04:29:31.547518Z", + "generated": "2020-12-27T07:38:50.371515Z", "generator": "pub", "generatorVersion": "2.10.4" } diff --git a/mobile/.flutter-plugins-dependencies b/mobile/.flutter-plugins-dependencies index d997a695..9450894a 100644 --- a/mobile/.flutter-plugins-dependencies +++ b/mobile/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/device_info-0.4.2+3/","dependencies":[]},{"name":"file_picker","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/file_picker-1.9.0+1/","dependencies":[]},{"name":"flutter_des","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_des-1.1.1/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-4.0.0+4/","dependencies":[]},{"name":"image_cropper","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_cropper-1.2.1/","dependencies":[]},{"name":"image_gallery_saver","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_gallery_saver-1.2.2/","dependencies":[]},{"name":"image_picker","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.6+1/","dependencies":[]},{"name":"package_info","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.0+17/","dependencies":[]},{"name":"path_provider","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.24/","dependencies":[]},{"name":"permission_handler","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/permission_handler-4.4.0+hotfix.4/","dependencies":[]},{"name":"share","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/share-0.6.4+1/","dependencies":[]},{"name":"shared_preferences","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+1/","dependencies":[]},{"name":"sqflite","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.2+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.2/","dependencies":[]},{"name":"video_player","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/video_player-0.10.10/","dependencies":[]},{"name":"wakelock","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/wakelock-0.1.4+2/","dependencies":[]},{"name":"webview_flutter","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.3/","dependencies":[]},{"name":"assets_audio_player","path":"/Users/virs/DiscuzQ/packages/flutter_assetsAudioPlayer/","dependencies":[]},{"name":"flutter_bugly","path":"/Users/virs/DiscuzQ/packages/flutter_bugly/","dependencies":[]},{"name":"clipboard_manager","path":"/Users/virs/DiscuzQ/packages/flutter_clipboardManager/","dependencies":[]},{"name":"flutter_image_compress","path":"/Users/virs/DiscuzQ/packages/flutter_image_compress/","dependencies":[]},{"name":"flutter_native_dialog","path":"/Users/virs/DiscuzQ/packages/flutter_native_dialog/","dependencies":[]},{"name":"flutter_native_loading","path":"/Users/virs/DiscuzQ/packages/flutter_native_loading/","dependencies":[]},{"name":"fluttertoast","path":"/Users/virs/DiscuzQ/packages/flutter_toast/","dependencies":[]},{"name":"flutter_user_agent","path":"/Users/virs/DiscuzQ/packages/flutter_user_agent/","dependencies":[]}],"android":[{"name":"device_info","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/device_info-0.4.2+3/","dependencies":[]},{"name":"file_picker","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/file_picker-1.9.0+1/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_des","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_des-1.1.1/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-4.0.0+4/","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.11/","dependencies":[]},{"name":"image_cropper","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_cropper-1.2.1/","dependencies":[]},{"name":"image_gallery_saver","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_gallery_saver-1.2.2/","dependencies":[]},{"name":"image_picker","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.6+1/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.0+17/","dependencies":[]},{"name":"path_provider","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.24/","dependencies":[]},{"name":"permission_handler","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/permission_handler-4.4.0+hotfix.4/","dependencies":[]},{"name":"share","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/share-0.6.4+1/","dependencies":[]},{"name":"shared_preferences","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+1/","dependencies":[]},{"name":"sqflite","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.2+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.2/","dependencies":[]},{"name":"video_player","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/video_player-0.10.10/","dependencies":[]},{"name":"wakelock","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/wakelock-0.1.4+2/","dependencies":[]},{"name":"webview_flutter","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.3/","dependencies":[]},{"name":"assets_audio_player","path":"/Users/virs/DiscuzQ/packages/flutter_assetsAudioPlayer/","dependencies":[]},{"name":"flutter_bugly","path":"/Users/virs/DiscuzQ/packages/flutter_bugly/","dependencies":[]},{"name":"clipboard_manager","path":"/Users/virs/DiscuzQ/packages/flutter_clipboardManager/","dependencies":[]},{"name":"flutter_image_compress","path":"/Users/virs/DiscuzQ/packages/flutter_image_compress/","dependencies":[]},{"name":"flutter_native_dialog","path":"/Users/virs/DiscuzQ/packages/flutter_native_dialog/","dependencies":[]},{"name":"flutter_native_loading","path":"/Users/virs/DiscuzQ/packages/flutter_native_loading/","dependencies":[]},{"name":"fluttertoast","path":"/Users/virs/DiscuzQ/packages/flutter_toast/","dependencies":[]},{"name":"flutter_user_agent","path":"/Users/virs/DiscuzQ/packages/flutter_user_agent/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+6/","dependencies":[]},{"name":"shared_preferences_macos","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+11/","dependencies":[]},{"name":"sqflite","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.2+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+9/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+4/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.0.1+3/","dependencies":[]}],"web":[{"name":"shared_preferences_web","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.5+1/","dependencies":[]},{"name":"video_player_web","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/video_player_web-0.1.4+1/","dependencies":[]}]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_des","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"image_cropper","dependencies":[]},{"name":"image_gallery_saver","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"video_player","dependencies":["video_player_web"]},{"name":"video_player_web","dependencies":[]},{"name":"wakelock","dependencies":[]},{"name":"webview_flutter","dependencies":[]},{"name":"assets_audio_player","dependencies":[]},{"name":"flutter_bugly","dependencies":[]},{"name":"clipboard_manager","dependencies":[]},{"name":"flutter_image_compress","dependencies":[]},{"name":"flutter_native_dialog","dependencies":[]},{"name":"flutter_native_loading","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"flutter_user_agent","dependencies":[]}],"date_created":"2020-12-27 15:08:13.893200","version":"1.22.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/device_info-0.4.2+3/","dependencies":[]},{"name":"file_picker","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/file_picker-1.9.0+1/","dependencies":[]},{"name":"flutter_des","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_des-1.1.1/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-4.0.0+4/","dependencies":[]},{"name":"image_cropper","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_cropper-1.2.1/","dependencies":[]},{"name":"image_gallery_saver","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_gallery_saver-1.2.2/","dependencies":[]},{"name":"image_picker","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.6+1/","dependencies":[]},{"name":"package_info","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.0+17/","dependencies":[]},{"name":"path_provider","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.24/","dependencies":[]},{"name":"permission_handler","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/permission_handler-4.4.0+hotfix.4/","dependencies":[]},{"name":"share","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/share-0.6.4+1/","dependencies":[]},{"name":"shared_preferences","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+1/","dependencies":[]},{"name":"sqflite","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.2+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.2/","dependencies":[]},{"name":"video_player","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/video_player-0.10.10/","dependencies":[]},{"name":"wakelock","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/wakelock-0.1.4+2/","dependencies":[]},{"name":"webview_flutter","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.3/","dependencies":[]},{"name":"assets_audio_player","path":"/Users/virs/DiscuzQ/packages/flutter_assetsAudioPlayer/","dependencies":[]},{"name":"flutter_bugly","path":"/Users/virs/DiscuzQ/packages/flutter_bugly/","dependencies":[]},{"name":"clipboard_manager","path":"/Users/virs/DiscuzQ/packages/flutter_clipboardManager/","dependencies":[]},{"name":"flutter_image_compress","path":"/Users/virs/DiscuzQ/packages/flutter_image_compress/","dependencies":[]},{"name":"flutter_native_dialog","path":"/Users/virs/DiscuzQ/packages/flutter_native_dialog/","dependencies":[]},{"name":"flutter_native_loading","path":"/Users/virs/DiscuzQ/packages/flutter_native_loading/","dependencies":[]},{"name":"fluttertoast","path":"/Users/virs/DiscuzQ/packages/flutter_toast/","dependencies":[]},{"name":"flutter_user_agent","path":"/Users/virs/DiscuzQ/packages/flutter_user_agent/","dependencies":[]}],"android":[{"name":"device_info","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/device_info-0.4.2+3/","dependencies":[]},{"name":"file_picker","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/file_picker-1.9.0+1/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_des","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_des-1.1.1/","dependencies":[]},{"name":"flutter_inappwebview","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_inappwebview-4.0.0+4/","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-1.0.11/","dependencies":[]},{"name":"image_cropper","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_cropper-1.2.1/","dependencies":[]},{"name":"image_gallery_saver","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_gallery_saver-1.2.2/","dependencies":[]},{"name":"image_picker","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.6+1/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/package_info-0.4.0+17/","dependencies":[]},{"name":"path_provider","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.24/","dependencies":[]},{"name":"permission_handler","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/permission_handler-4.4.0+hotfix.4/","dependencies":[]},{"name":"share","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/share-0.6.4+1/","dependencies":[]},{"name":"shared_preferences","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+1/","dependencies":[]},{"name":"sqflite","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.2+1/","dependencies":[]},{"name":"url_launcher","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.7.2/","dependencies":[]},{"name":"video_player","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/video_player-0.10.10/","dependencies":[]},{"name":"wakelock","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/wakelock-0.1.4+2/","dependencies":[]},{"name":"webview_flutter","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/webview_flutter-1.0.3/","dependencies":[]},{"name":"assets_audio_player","path":"/Users/virs/DiscuzQ/packages/flutter_assetsAudioPlayer/","dependencies":[]},{"name":"flutter_bugly","path":"/Users/virs/DiscuzQ/packages/flutter_bugly/","dependencies":[]},{"name":"clipboard_manager","path":"/Users/virs/DiscuzQ/packages/flutter_clipboardManager/","dependencies":[]},{"name":"flutter_image_compress","path":"/Users/virs/DiscuzQ/packages/flutter_image_compress/","dependencies":[]},{"name":"flutter_native_dialog","path":"/Users/virs/DiscuzQ/packages/flutter_native_dialog/","dependencies":[]},{"name":"flutter_native_loading","path":"/Users/virs/DiscuzQ/packages/flutter_native_loading/","dependencies":[]},{"name":"fluttertoast","path":"/Users/virs/DiscuzQ/packages/flutter_toast/","dependencies":[]},{"name":"flutter_user_agent","path":"/Users/virs/DiscuzQ/packages/flutter_user_agent/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+6/","dependencies":[]},{"name":"shared_preferences_macos","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+11/","dependencies":[]},{"name":"sqflite","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.2+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+9/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]},{"name":"url_launcher_linux","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-0.0.1+4/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.4+3/","dependencies":[]},{"name":"url_launcher_windows","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-0.0.1+3/","dependencies":[]}],"web":[{"name":"shared_preferences_web","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+7/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.5+1/","dependencies":[]},{"name":"video_player_web","path":"/Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/video_player_web-0.1.4+1/","dependencies":[]}]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"file_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"flutter_des","dependencies":[]},{"name":"flutter_inappwebview","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"image_cropper","dependencies":[]},{"name":"image_gallery_saver","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"video_player","dependencies":["video_player_web"]},{"name":"video_player_web","dependencies":[]},{"name":"wakelock","dependencies":[]},{"name":"webview_flutter","dependencies":[]},{"name":"assets_audio_player","dependencies":[]},{"name":"flutter_bugly","dependencies":[]},{"name":"clipboard_manager","dependencies":[]},{"name":"flutter_image_compress","dependencies":[]},{"name":"flutter_native_dialog","dependencies":[]},{"name":"flutter_native_loading","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"flutter_user_agent","dependencies":[]}],"date_created":"2020-12-27 16:52:27.326226","version":"1.22.5"} \ No newline at end of file diff --git a/mobile/.packages b/mobile/.packages index 731c8511..9ce8ae35 100644 --- a/mobile/.packages +++ b/mobile/.packages @@ -1,4 +1,4 @@ -# Generated by pub on 2020-12-27 12:29:31.492465. +# Generated by pub on 2020-12-27 15:38:50.294086. archive:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/archive-2.0.13/lib/ args:file:///Users/virs/.fvm/versions/1.22.5-stable/.pub-cache/hosted/pub.dartlang.org/args-1.6.0/lib/ assets_audio_player:../packages/flutter_assetsAudioPlayer/lib/ diff --git a/mobile/lib/models/attachmentsModel.dart b/mobile/lib/models/attachmentsModel.dart index de5036d1..982e1c11 100644 --- a/mobile/lib/models/attachmentsModel.dart +++ b/mobile/lib/models/attachmentsModel.dart @@ -31,7 +31,7 @@ class AttachmentsModel { /// 返回一个空的模型,如果为空的话 /// if (maps == null) { - return AttachmentsModel(); + return const AttachmentsModel(); } dynamic data = maps; diff --git a/mobile/lib/models/userFollowModel.dart b/mobile/lib/models/userFollowModel.dart index 0118b2c6..bbc28f89 100644 --- a/mobile/lib/models/userFollowModel.dart +++ b/mobile/lib/models/userFollowModel.dart @@ -59,7 +59,7 @@ class UserFollowModel { : data['id'], type: data['type'] ?? 'user_follow', relationships: data['relationships'] == null - ? RelationshipsModel() + ? const RelationshipsModel() : RelationshipsModel.fromMap(maps: data['relationships']), attributes: data['attributes'] == null ? const UserFollowAttributesModel() diff --git a/mobile/lib/utils/authHelper.dart b/mobile/lib/utils/authHelper.dart index 3b2741ac..2b402a58 100644 --- a/mobile/lib/utils/authHelper.dart +++ b/mobile/lib/utils/authHelper.dart @@ -20,7 +20,7 @@ class AuthHelper { expand: true, backgroundColor: Colors.transparent, context: context, - builder: (BuildContext context) => CupertinoPageScaffold( + builder: (BuildContext context) => const CupertinoPageScaffold( resizeToAvoidBottomInset: false, child: const LoginDelegate(), )); diff --git a/mobile/lib/views/accountDelegate.dart b/mobile/lib/views/accountDelegate.dart index 3971988f..2bbd9a45 100644 --- a/mobile/lib/views/accountDelegate.dart +++ b/mobile/lib/views/accountDelegate.dart @@ -104,10 +104,10 @@ class _AccountDelegateState extends State { ), ), - Padding( + const Padding( padding: const EdgeInsets.only( left: 10, right: 10, top: 20), - child: _LogoutButton()) + child: const _LogoutButton()) ], ), ), diff --git a/mobile/lib/views/forumDelegate.dart b/mobile/lib/views/forumDelegate.dart index 40c09369..7f4576ff 100644 --- a/mobile/lib/views/forumDelegate.dart +++ b/mobile/lib/views/forumDelegate.dart @@ -119,7 +119,7 @@ class _ForumDelegateState extends State return Scaffold( appBar: PreferredSize( child: _tabs, - preferredSize: Size.fromHeight(120), + preferredSize: const Size.fromHeight(120), ), body: Column( children: [ diff --git a/mobile/lib/views/gallery/discuzGalleryDelegate.dart b/mobile/lib/views/gallery/discuzGalleryDelegate.dart index 9aabcf65..14f55711 100644 --- a/mobile/lib/views/gallery/discuzGalleryDelegate.dart +++ b/mobile/lib/views/gallery/discuzGalleryDelegate.dart @@ -42,7 +42,7 @@ class _DiscuzGalleryState extends State { void initState() { super.initState(); - SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle( + SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle( statusBarBrightness: Brightness.dark, ); SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); @@ -61,7 +61,7 @@ class _DiscuzGalleryState extends State { @override void dispose() { - SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle( + SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle( statusBarBrightness: Brightness.light, ); SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle); @@ -96,7 +96,7 @@ class _DiscuzGalleryState extends State { fontWeight: FontWeight.bold, fontSize: DiscuzApp.themeOf(context).largeTextSize, ), - DiscuzText( + const DiscuzText( '/', color: Colors.white, ), diff --git a/mobile/lib/views/nofitications/notificationListDelegate.dart b/mobile/lib/views/nofitications/notificationListDelegate.dart index cf4ac9bd..91009292 100644 --- a/mobile/lib/views/nofitications/notificationListDelegate.dart +++ b/mobile/lib/views/nofitications/notificationListDelegate.dart @@ -78,7 +78,7 @@ class _NotificationDelegateState extends State { void initState() { super.initState(); - Future.delayed(Duration(milliseconds: 470)) + Future.delayed(const Duration(milliseconds: 470)) .then((_) async => await _requestData(pageNumber: 1)); } diff --git a/mobile/lib/views/notificationsDelegate.dart b/mobile/lib/views/notificationsDelegate.dart index 75dbbfb6..9634920b 100644 --- a/mobile/lib/views/notificationsDelegate.dart +++ b/mobile/lib/views/notificationsDelegate.dart @@ -33,7 +33,7 @@ class _NotificationsDelegateState extends State { /// /// 未读消息 TypeUnreadNotificationsModel _typeUnreadNotifications = - TypeUnreadNotificationsModel(); + const TypeUnreadNotificationsModel(); @override void setState(fn) { @@ -52,7 +52,7 @@ class _NotificationsDelegateState extends State { /// 这种不会从接口刷新,仅从状态刷新,如果用户要刷新还是得下拉 /// 或者其他交互逻辑涉及调用 Authhelper.refreshUser 也会自动刷新的 /// - Future.delayed(Duration(milliseconds: 500)) + Future.delayed(const Duration(milliseconds: 500)) .then((_) => _refreshMessageList(context: context)); } diff --git a/mobile/lib/views/reports/reportsHistoryDelegate.dart b/mobile/lib/views/reports/reportsHistoryDelegate.dart index 79f8d9d1..55521503 100644 --- a/mobile/lib/views/reports/reportsHistoryDelegate.dart +++ b/mobile/lib/views/reports/reportsHistoryDelegate.dart @@ -34,7 +34,7 @@ class _ReportHistoryDelegateState extends State { title: '我的投诉举报', brightness: Brightness.light, ), - body: Center( + body: const Center( child: const DiscuzText('暂无记录'), ), ); diff --git a/mobile/lib/views/search/searchSuggestion.dart b/mobile/lib/views/search/searchSuggestion.dart index 4f4273b7..6e5ac2c1 100644 --- a/mobile/lib/views/search/searchSuggestion.dart +++ b/mobile/lib/views/search/searchSuggestion.dart @@ -10,7 +10,7 @@ class SearchSuggestion extends StatelessWidget { Widget build(BuildContext context) => SizedBox.expand( child: Container( color: DiscuzApp.themeOf(context).scaffoldBackgroundColor, - child: Center( + child: const Center( child: const DiscuzText('暂无推荐'), ), )); diff --git a/mobile/lib/views/search/searchUserDelegate.dart b/mobile/lib/views/search/searchUserDelegate.dart index d26b9bb6..b5a74d22 100644 --- a/mobile/lib/views/search/searchUserDelegate.dart +++ b/mobile/lib/views/search/searchUserDelegate.dart @@ -71,7 +71,7 @@ class _SearchUserDelegateState extends State void initState() { super.initState(); - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); } @@ -94,7 +94,7 @@ class _SearchUserDelegateState extends State /// /// 如果keyword 证明用户重新输入了关键字,那么久执行重新请求 if (widget.keyword != null && oldWidget.keyword != widget.keyword) { - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); } } diff --git a/mobile/lib/views/threads/threadDetailDelegate.dart b/mobile/lib/views/threads/threadDetailDelegate.dart index 059060c4..db380c6a 100644 --- a/mobile/lib/views/threads/threadDetailDelegate.dart +++ b/mobile/lib/views/threads/threadDetailDelegate.dart @@ -107,7 +107,7 @@ class _ThreadDetailDelegateState extends State { void initState() { super.initState(); this._watchIfPostCommentSuccess(); - Future.delayed(Duration(milliseconds: 450)).then((_) async { + Future.delayed(const Duration(milliseconds: 450)).then((_) async { await _requestThreadDetail(pageNumber: 1); }); } @@ -267,7 +267,7 @@ class _ThreadDetailDelegateState extends State { } if (_threadsCacher.threads.length == 0) { - return SizedBox(); + return const SizedBox(); } /// 遍历图片 @@ -506,7 +506,7 @@ class _ThreadDetailDelegateState extends State { int.tryParse( widget.thread.relationships.firstPost['data']['id'])) .toList()[0] ?? - PostModel(); + const PostModel(); /// pageNumber 在onload传入时已经自动加1 /// 注意 主题详情中的meta需要自己生成 diff --git a/mobile/lib/views/users/blackListDelegate.dart b/mobile/lib/views/users/blackListDelegate.dart index e532fba4..93d847ab 100644 --- a/mobile/lib/views/users/blackListDelegate.dart +++ b/mobile/lib/views/users/blackListDelegate.dart @@ -66,7 +66,7 @@ class _BlackListDelegateState extends State { @override void initState() { super.initState(); - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); } diff --git a/mobile/lib/views/users/follows/followerListDelegate.dart b/mobile/lib/views/users/follows/followerListDelegate.dart index 690601ea..14a7c740 100644 --- a/mobile/lib/views/users/follows/followerListDelegate.dart +++ b/mobile/lib/views/users/follows/followerListDelegate.dart @@ -81,7 +81,7 @@ class _FollowerListDelegateState extends State { /// /// 加载数据 /// - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1, context: context)); } diff --git a/mobile/lib/views/users/profileDelegate.dart b/mobile/lib/views/users/profileDelegate.dart index aba1f7d7..05de5a59 100644 --- a/mobile/lib/views/users/profileDelegate.dart +++ b/mobile/lib/views/users/profileDelegate.dart @@ -54,7 +54,7 @@ class _ProfileDelegateState extends State { DiscuzListTile( title: const DiscuzText('头像'), trailing: AvatarPicker( - avatar: DiscuzAvatar( + avatar: const DiscuzAvatar( size: 40, ), ), diff --git a/mobile/lib/views/users/profiles/userSignatureDelegate.dart b/mobile/lib/views/users/profiles/userSignatureDelegate.dart index cc47bd33..fcb46984 100644 --- a/mobile/lib/views/users/profiles/userSignatureDelegate.dart +++ b/mobile/lib/views/users/profiles/userSignatureDelegate.dart @@ -112,7 +112,7 @@ class _UserSignatureDelegateState extends State { /// /// Initialize user's default signature to auto complete form. Future _initDefaultValue() async => - Future.delayed(Duration(milliseconds: 500)).then((_) { + Future.delayed(const Duration(milliseconds: 500)).then((_) { try { final UserModel user = context.read().user; if (user != null && user.attributes.signature != '') { diff --git a/mobile/lib/views/users/profiles/usernameModifyDelegate.dart b/mobile/lib/views/users/profiles/usernameModifyDelegate.dart index 90661585..81249f5b 100644 --- a/mobile/lib/views/users/profiles/usernameModifyDelegate.dart +++ b/mobile/lib/views/users/profiles/usernameModifyDelegate.dart @@ -107,7 +107,7 @@ class _UsernameModifyDelegateState extends State { /// /// Initialize user's default signature to auto complete form. Future _initDefaultValue() async => - Future.delayed(Duration(milliseconds: 500)).then((_) { + Future.delayed(const Duration(milliseconds: 500)).then((_) { try { final UserModel user = context.read().user; if (user != null && user.attributes.username != '') { diff --git a/mobile/lib/views/users/userHomeDelegate.dart b/mobile/lib/views/users/userHomeDelegate.dart index a9974e8d..5d7acbb8 100644 --- a/mobile/lib/views/users/userHomeDelegate.dart +++ b/mobile/lib/views/users/userHomeDelegate.dart @@ -73,7 +73,7 @@ class _UserHomeDelegateState extends State { /// /// 异步请求新的用户信息 - Future.delayed(Duration(milliseconds: 300)).then((_) { + Future.delayed(const Duration(milliseconds: 300)).then((_) { if (!widget.forceToUpdate) { return; } @@ -110,11 +110,11 @@ class _UserHomeDelegateState extends State { cardColor: DiscuzApp.themeOf(context).scaffoldBackgroundColor, ), child: PopupMenuButton( - icon: DiscuzIcon(Icons.more_vert), + icon: const DiscuzIcon(Icons.more_vert), itemBuilder: (BuildContext context) => >[ - PopupMenuItem( + const PopupMenuItem( value: 'report', child: const DiscuzText('举报')), - PopupMenuItem( + const PopupMenuItem( value: 'blackList', child: const DiscuzText('拉黑')) ], onSelected: (String value) { diff --git a/mobile/lib/views/users/walletDelegate.dart b/mobile/lib/views/users/walletDelegate.dart index 82689001..7b4cb453 100644 --- a/mobile/lib/views/users/walletDelegate.dart +++ b/mobile/lib/views/users/walletDelegate.dart @@ -32,7 +32,7 @@ class _WalletDelegateState extends State { /// /// wallet data /// - WalletModel _wallet = WalletModel(); + WalletModel _wallet = const WalletModel(); final CancelToken _cancelToken = CancelToken(); @@ -48,7 +48,7 @@ class _WalletDelegateState extends State { void initState() { super.initState(); - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _refreshWallet()); } @@ -59,8 +59,9 @@ class _WalletDelegateState extends State { } @override - Widget build(BuildContext context) => Consumer( - builder: (BuildContext context, UserProvider user, Widget child) => Scaffold( + Widget build(BuildContext context) => Consumer( + builder: (BuildContext context, UserProvider user, Widget child) => + Scaffold( appBar: DiscuzAppBar( brightness: Brightness.dark, backgroundColor: DiscuzApp.themeOf(context).primaryColor, @@ -101,15 +102,15 @@ class _WalletDelegateState extends State { /// _frozen(), const DiscuzDivider(), - DiscuzListTile( + const DiscuzListTile( title: DiscuzText('提现记录'), ), const DiscuzDivider(), - DiscuzListTile( + const DiscuzListTile( title: DiscuzText('钱包明细'), ), const DiscuzDivider(), - DiscuzListTile( + const DiscuzListTile( title: DiscuzText('订单明细'), ) ], @@ -125,7 +126,7 @@ class _WalletDelegateState extends State { /// 冻结金额 /// Widget _frozen() => DiscuzListTile( - title: DiscuzText('冻结金额'), + title: const DiscuzText('冻结金额'), trailing: DiscuzText( _wallet.freezeAmount, color: DiscuzApp.themeOf(context).greyTextColor, @@ -154,8 +155,10 @@ class _WalletDelegateState extends State { /// /// final UserModel user = context.read().user; - final String userWalletUrl = "${Urls.usersWallerData}/${user.attributes.id}"; - Response resp = await Request(context: context).getUrl(_cancelToken, url: userWalletUrl); + final String userWalletUrl = + "${Urls.usersWallerData}/${user.attributes.id}"; + Response resp = await Request(context: context) + .getUrl(_cancelToken, url: userWalletUrl); if (resp == null) { setState(() { diff --git a/mobile/lib/widgets/appbar/appbarSaveButton.dart b/mobile/lib/widgets/appbar/appbarSaveButton.dart index 948803de..1a8ab79b 100644 --- a/mobile/lib/widgets/appbar/appbarSaveButton.dart +++ b/mobile/lib/widgets/appbar/appbarSaveButton.dart @@ -15,7 +15,7 @@ class AppbarSaveButton extends StatelessWidget { padding: const EdgeInsets.only(top: 10, bottom: 10, left: 10, right: 10), child: Container( - constraints: BoxConstraints(minHeight: 40), + constraints: const BoxConstraints(minHeight: 40), padding: const EdgeInsets.only(top: 2, bottom: 2, left: 10, right: 10), alignment: Alignment.centerRight, diff --git a/mobile/lib/widgets/appbar/searchAppbar.dart b/mobile/lib/widgets/appbar/searchAppbar.dart index df6cef93..0eb42274 100644 --- a/mobile/lib/widgets/appbar/searchAppbar.dart +++ b/mobile/lib/widgets/appbar/searchAppbar.dart @@ -66,7 +66,7 @@ class _SearchAppbarState extends State { : SystemUiOverlayStyle.dark); return Container( - padding: EdgeInsets.all(5), + padding: const EdgeInsets.all(5), decoration: BoxDecoration(color: DiscuzApp.themeOf(context).backgroundColor), child: SafeArea( @@ -80,7 +80,7 @@ class _SearchAppbarState extends State { ), AnimatedContainer( - duration: Duration(milliseconds: 270), + duration: const Duration(milliseconds: 270), ///padding: EdgeInsets.only(right: _showButton ? 50 : 0), padding: EdgeInsets.only( @@ -94,7 +94,7 @@ class _SearchAppbarState extends State { ? 50 : 0), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(3)), + borderRadius: const BorderRadius.all(Radius.circular(3)), color: DiscuzApp.themeOf(context).scaffoldBackgroundColor), child: DiscuzTextfiled( controller: _controller, diff --git a/mobile/lib/widgets/bottomNavigator/bottomNavigator.dart b/mobile/lib/widgets/bottomNavigator/bottomNavigator.dart index cea8f8bd..82faa418 100644 --- a/mobile/lib/widgets/bottomNavigator/bottomNavigator.dart +++ b/mobile/lib/widgets/bottomNavigator/bottomNavigator.dart @@ -119,7 +119,7 @@ class _PublishButton extends StatelessWidget { Widget build(BuildContext context) => Container( width: _kPublishButtonSize, height: _kPublishButtonSize, - margin: EdgeInsets.only(top: 4), + margin: const EdgeInsets.only(top: 4), decoration: BoxDecoration( color: DiscuzApp.themeOf(context).primaryColor, borderRadius: const BorderRadius.all(const Radius.circular(60))), diff --git a/mobile/lib/widgets/common/avatarPicker.dart b/mobile/lib/widgets/common/avatarPicker.dart index a0e50395..6baf96af 100644 --- a/mobile/lib/widgets/common/avatarPicker.dart +++ b/mobile/lib/widgets/common/avatarPicker.dart @@ -107,14 +107,14 @@ class _AvatarPickerState extends State { aspectRatioPresets: [ CropAspectRatioPreset.square, ], - aspectRatio: CropAspectRatio(ratioX: 100, ratioY: 100), + aspectRatio: const CropAspectRatio(ratioX: 100, ratioY: 100), androidUiSettings: AndroidUiSettings( toolbarTitle: 'Cropper', toolbarColor: Theme.of(context).primaryColor, toolbarWidgetColor: Colors.white, initAspectRatio: CropAspectRatioPreset.square, lockAspectRatio: false), - iosUiSettings: IOSUiSettings( + iosUiSettings: const IOSUiSettings( minimumAspectRatio: 1.0, resetAspectRatioEnabled: false, aspectRatioPickerButtonHidden: true, diff --git a/mobile/lib/widgets/common/discuzButton.dart b/mobile/lib/widgets/common/discuzButton.dart index 9675512c..c21941d1 100644 --- a/mobile/lib/widgets/common/discuzButton.dart +++ b/mobile/lib/widgets/common/discuzButton.dart @@ -39,10 +39,10 @@ class DiscuzButton extends StatelessWidget { width: width, height: height, child: ClipRRect( - borderRadius: borderRadius ?? BorderRadius.all(Radius.circular(5)), + borderRadius: borderRadius ?? const BorderRadius.all(const Radius.circular(5)), child: FlatButton( padding: padding ?? - EdgeInsets.only(top: 5, bottom: 5, right: 10, left: 10), + const EdgeInsets.only(top: 5, bottom: 5, right: 10, left: 10), color: color ?? DiscuzApp.themeOf(context).primaryColor, child: Row( crossAxisAlignment: CrossAxisAlignment.center, diff --git a/mobile/lib/widgets/common/discuzToast.dart b/mobile/lib/widgets/common/discuzToast.dart index 9ea3333f..ed01ab66 100644 --- a/mobile/lib/widgets/common/discuzToast.dart +++ b/mobile/lib/widgets/common/discuzToast.dart @@ -42,25 +42,25 @@ class DiscuzToast { String message = '', title}) async { IconConfiguration icon = - IconConfiguration(icon: Icons.info, size: _kIconSize); + const IconConfiguration(icon: Icons.info, size: _kIconSize); /// show icon type switch (type) { case DiscuzToastType.failed: { - icon = IconConfiguration(icon: Icons.error, size: _kIconSize); + icon = const IconConfiguration(icon: Icons.error, size: _kIconSize); } break; case DiscuzToastType.info: { - icon = IconConfiguration(icon: Icons.info, size: _kIconSize); + icon = const IconConfiguration(icon: Icons.info, size: _kIconSize); } break; case DiscuzToastType.success: { - icon = IconConfiguration(icon: Icons.done, size: _kIconSize); + icon = const IconConfiguration(icon: Icons.done, size: _kIconSize); } break; diff --git a/mobile/lib/widgets/common/gradientText.dart b/mobile/lib/widgets/common/gradientText.dart index e3f2a58a..ef25e745 100644 --- a/mobile/lib/widgets/common/gradientText.dart +++ b/mobile/lib/widgets/common/gradientText.dart @@ -17,7 +17,7 @@ class GradientText extends StatelessWidget { data, textAlign: textAlign, style: (style == null) - ? TextStyle(color: Colors.white) + ? const TextStyle(color: Colors.white) : style.copyWith(color: Colors.white), ), ); diff --git a/mobile/lib/widgets/editor/discuzEditor.dart b/mobile/lib/widgets/editor/discuzEditor.dart index 6648a43c..aad50e83 100644 --- a/mobile/lib/widgets/editor/discuzEditor.dart +++ b/mobile/lib/widgets/editor/discuzEditor.dart @@ -246,7 +246,7 @@ class _DiscuzEditorState extends State { decoration: InputDecoration( border: InputBorder.none, hintText: '点击以输入内容', - contentPadding: EdgeInsets.all(12.0), + contentPadding: const EdgeInsets.all(12.0), hintStyle: TextStyle( color: DiscuzApp.themeOf(context).greyTextColor)), style: TextStyle( diff --git a/mobile/lib/widgets/editor/specialSpanBuilders/discuzEmojiTextSpan.dart b/mobile/lib/widgets/editor/specialSpanBuilders/discuzEmojiTextSpan.dart index 5700c63c..c822c587 100644 --- a/mobile/lib/widgets/editor/specialSpanBuilders/discuzEmojiTextSpan.dart +++ b/mobile/lib/widgets/editor/specialSpanBuilders/discuzEmojiTextSpan.dart @@ -22,6 +22,6 @@ class DiscuzEmojiTextSpan extends SpecialText { imageHeight: 23, actualText: emojiText, start: start, - margin: EdgeInsets.only(left: 2.0, bottom: 0.0, right: 2.0)); + margin: const EdgeInsets.only(left: 2.0, bottom: 0.0, right: 2.0)); } } diff --git a/mobile/lib/widgets/editor/toolbar/discuzEditorCategorySelector.dart b/mobile/lib/widgets/editor/toolbar/discuzEditorCategorySelector.dart index b966d3a4..b9fd61d6 100644 --- a/mobile/lib/widgets/editor/toolbar/discuzEditorCategorySelector.dart +++ b/mobile/lib/widgets/editor/toolbar/discuzEditorCategorySelector.dart @@ -122,7 +122,7 @@ class _DiscuzEditorCategorySelectorState /// /// 下拉图标 - DiscuzIcon(Icons.arrow_drop_down), + const DiscuzIcon(Icons.arrow_drop_down), ], ), onPressed: () => showModalBottomSheet( @@ -133,7 +133,7 @@ class _DiscuzEditorCategorySelectorState margin: const EdgeInsets.all(20), padding: const EdgeInsets.all(15), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(15)), + borderRadius: const BorderRadius.all(const Radius.circular(15)), color: DiscuzApp.themeOf(context).backgroundColor), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -141,7 +141,7 @@ class _DiscuzEditorCategorySelectorState children: [ Container( padding: const EdgeInsets.all(10), - child: DiscuzText( + child: const DiscuzText( '选择要发布的分类', fontWeight: FontWeight.bold, textScaleFactor: 1.3, diff --git a/mobile/lib/widgets/editor/toolbar/discuzEditorToolbar.dart b/mobile/lib/widgets/editor/toolbar/discuzEditorToolbar.dart index 1cd571ee..69494ea2 100644 --- a/mobile/lib/widgets/editor/toolbar/discuzEditorToolbar.dart +++ b/mobile/lib/widgets/editor/toolbar/discuzEditorToolbar.dart @@ -152,7 +152,7 @@ class _DiscuzEditorToolbarState extends State { padding: const EdgeInsets.all(3), animationType: BadgeAnimationType.fade, elevation: 0, - position: BadgePosition(top: 2, end: 0), + position: const BadgePosition(top: 2, end: 0), showBadge: editor.galleries == null || editor.galleries.length == 0 ? false diff --git a/mobile/lib/widgets/editor/uploaders/discuzEditorImageUploader.dart b/mobile/lib/widgets/editor/uploaders/discuzEditorImageUploader.dart index cfa89818..186b347e 100644 --- a/mobile/lib/widgets/editor/uploaders/discuzEditorImageUploader.dart +++ b/mobile/lib/widgets/editor/uploaders/discuzEditorImageUploader.dart @@ -29,7 +29,6 @@ class DiscuzEditorImageUploader extends StatefulWidget { } class _DiscuzEditorImageUploaderState extends State { - final CancelToken _cancelToken = CancelToken(); @override @@ -88,7 +87,7 @@ class _DiscuzEditorImageUploaderState extends State { /// /// 渲染图片组件 return Container( - padding: EdgeInsets.all(10), + padding: const EdgeInsets.all(10), child: Wrap( children: widgets .map((e) => SizedBox( @@ -153,8 +152,7 @@ class _DiscuzEditorImageUploaderState extends State { /// 进行图片上传并反馈上传结果 /// Future _uploadImage({@required File file}) async { - Response resp = await Request(context: context).uploadFile( - _cancelToken, + Response resp = await Request(context: context).uploadFile(_cancelToken, url: Urls.attachments, name: 'file', @@ -198,8 +196,8 @@ class _DiscuzEditorImageUploaderThumb extends StatelessWidget { child: Container( width: _imageSize, height: _imageSize, - decoration: BoxDecoration( - border: Border( + decoration: const BoxDecoration( + border: const Border( top: Global.border, right: Global.border, left: Global.border, @@ -213,7 +211,7 @@ class _DiscuzEditorImageUploaderThumb extends StatelessWidget { /// 图片缩略 /// ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), + borderRadius: const BorderRadius.all(const Radius.circular(5)), child: Image.network( attachment.attributes.thumbUrl, width: _imageSize, @@ -234,8 +232,8 @@ class _DiscuzEditorImageUploaderThumb extends StatelessWidget { height: 15, child: GestureDetector( child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(50)), + decoration: const BoxDecoration( + borderRadius: const BorderRadius.all(const Radius.circular(50)), color: Colors.white), child: const DiscuzIcon( CupertinoIcons.minus_circle_fill, @@ -265,10 +263,10 @@ class _DiscuzEditorImageUploaderAddIcon extends StatelessWidget { return Container( width: _imageSize, height: _imageSize, - decoration: - BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10))), - child: Center( - child: DiscuzIcon(Icons.add), + decoration: const BoxDecoration( + borderRadius: const BorderRadius.all(const Radius.circular(10))), + child: const Center( + child: const DiscuzIcon(Icons.add), ), ); } diff --git a/mobile/lib/widgets/emoji/emoji.dart b/mobile/lib/widgets/emoji/emoji.dart index dc2e6c49..218fa276 100644 --- a/mobile/lib/widgets/emoji/emoji.dart +++ b/mobile/lib/widgets/emoji/emoji.dart @@ -15,7 +15,7 @@ class Emoji { .toList(); if (emoji.length == 0) { - return AssetImage("assets/images/errimage.png"); + return const AssetImage("assets/images/errimage.png"); } return CachedNetworkImageProvider(emoji[0].attributes.url); diff --git a/mobile/lib/widgets/emoji/emojiSwiper.dart b/mobile/lib/widgets/emoji/emojiSwiper.dart index ff3d0ff7..9cb7d069 100644 --- a/mobile/lib/widgets/emoji/emojiSwiper.dart +++ b/mobile/lib/widgets/emoji/emojiSwiper.dart @@ -56,7 +56,7 @@ class _EmojiSwiperState extends State { Widget build(BuildContext context) { return Container( height: 200, - decoration: BoxDecoration(color: Colors.transparent), + decoration: const BoxDecoration(color: Colors.transparent), child: Scrollbar( child: SingleChildScrollView( child: Wrap( diff --git a/mobile/lib/widgets/forum/floatLoginButton.dart b/mobile/lib/widgets/forum/floatLoginButton.dart index bb555dbf..47c8ed99 100644 --- a/mobile/lib/widgets/forum/floatLoginButton.dart +++ b/mobile/lib/widgets/forum/floatLoginButton.dart @@ -13,7 +13,7 @@ class FloatLoginButton extends StatelessWidget { Widget build(BuildContext context) => Consumer( builder: (BuildContext context, UserProvider user, Widget child) { if (user.hadLogined) { - return SizedBox(); + return const SizedBox(); } return Center( child: SizedBox( diff --git a/mobile/lib/widgets/forum/forumAddButton.dart b/mobile/lib/widgets/forum/forumAddButton.dart index 50a47cc6..025ec854 100644 --- a/mobile/lib/widgets/forum/forumAddButton.dart +++ b/mobile/lib/widgets/forum/forumAddButton.dart @@ -113,7 +113,7 @@ class _ForumCreateThreadDialogState extends State<_ForumCreateThreadDialog> { child: SafeArea( child: ListView( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: const NeverScrollableScrollPhysics(), children: _menus .map((e) => GestureDetector( onTap: () => _showEditor( diff --git a/mobile/lib/widgets/player/discuzPlayer.dart b/mobile/lib/widgets/player/discuzPlayer.dart index 6a9df0fe..c9f7f6d9 100644 --- a/mobile/lib/widgets/player/discuzPlayer.dart +++ b/mobile/lib/widgets/player/discuzPlayer.dart @@ -73,7 +73,7 @@ class _DiscuzPlayerState extends State { @override void initState() { super.initState(); - Future.delayed(Duration(milliseconds: 1000)).then((_) => _init()); + Future.delayed(const Duration(milliseconds: 1000)).then((_) => _init()); } @override @@ -196,7 +196,7 @@ class _DiscuzPlayerState extends State { } if (!_loading && _playerInfo != null && _transcodeUrl == null) { - return Center( + return const Center( child: const DiscuzText('转码中,请稍后观看'), ); } @@ -228,13 +228,13 @@ class _DiscuzPlayerState extends State { Stack( children: [ AnimatedSwitcher( - duration: Duration(milliseconds: 50), - reverseDuration: Duration(milliseconds: 200), + duration: const Duration(milliseconds: 50), + reverseDuration: const Duration(milliseconds: 200), child: _controller.value.isPlaying ? const SizedBox() : Container( color: Colors.black26, - child: Center( + child: const Center( child: const DiscuzIcon( CupertinoIcons.play_fill, color: Colors.white, diff --git a/mobile/lib/widgets/popmenu/popmenu.dart b/mobile/lib/widgets/popmenu/popmenu.dart index 4398f333..4a6db4a5 100644 --- a/mobile/lib/widgets/popmenu/popmenu.dart +++ b/mobile/lib/widgets/popmenu/popmenu.dart @@ -27,7 +27,7 @@ class MenuItem extends MenuItemProvider { @override TextStyle get menuTextStyle => - textStyle ?? TextStyle(color: Color(0xffc5c5c5), fontSize: 10.0); + textStyle ?? const TextStyle(color: const Color(0xffc5c5c5), fontSize: 10.0); } enum MenuType { big, oneLine } @@ -43,10 +43,10 @@ class PopupMenu { List items; /// row count - int _row; + int _row; /// col count - int _col; + int _col; /// The left top point of this menu. Offset _offset; @@ -55,7 +55,7 @@ class PopupMenu { Rect _showRect; /// if false menu is show above of the widget, otherwise menu is show under the widget - bool _isDown = true; + bool _isDown = true; /// The max column count, default is 4. int _maxColumn; @@ -66,10 +66,10 @@ class PopupMenu { PopupMenuStateChanged stateChanged; Size _screenSize; // 屏幕的尺寸 - + /// Cannot be null static BuildContext context; - + /// style Color _backgroundColor; Color _highlightColor; @@ -77,7 +77,7 @@ class PopupMenu { /// It's showing or not. bool _isShow = false; - bool get isShow => _isShow; + bool get isShow => _isShow; PopupMenu( {MenuClickCallback onClickMenu, @@ -94,9 +94,9 @@ class PopupMenu { this.stateChanged = stateChanged; this.items = items; this._maxColumn = maxColumn ?? 4; - this._backgroundColor = backgroundColor ?? Color(0xff232323); - this._lineColor = lineColor ?? Color(0xff353535); - this._highlightColor = highlightColor ?? Color(0x55000000); + this._backgroundColor = backgroundColor ?? const Color(0xff232323); + this._lineColor = lineColor ?? const Color(0xff353535); + this._highlightColor = highlightColor ?? const Color(0x55000000); if (context != null) { PopupMenu.context = context; } @@ -106,11 +106,11 @@ class PopupMenu { if (rect == null && widgetKey == null) { print("'rect' and 'key' can't be both null"); return; - } + } this.items = items ?? this.items; this._showRect = rect ?? PopupMenu.getWidgetGlobalRect(widgetKey); - this._screenSize = window.physicalSize/window.devicePixelRatio; + this._screenSize = window.physicalSize / window.devicePixelRatio; this.dismissCallback = dismissCallback; _calculatePosition(PopupMenu.context); @@ -119,7 +119,6 @@ class PopupMenu { return buildPopupMenuLayout(_offset); }); - Overlay.of(PopupMenu.context).insert(_entry); _isShow = true; if (this.stateChanged != null) { @@ -146,9 +145,9 @@ class PopupMenu { dx = 10.0; } - if(dx + menuWidth() > _screenSize.width && dx > 10.0) { - double tempDx = _screenSize.width- menuWidth() - 10; - if(tempDx > 10) dx = tempDx; + if (dx + menuWidth() > _screenSize.width && dx > 10.0) { + double tempDx = _screenSize.width - menuWidth() - 10; + if (tempDx > 10) dx = tempDx; } double dy = _showRect.top - menuHeight(); @@ -194,43 +193,46 @@ class PopupMenu { }, child: Container( child: Stack( - children: [ - // triangle arrow - Positioned( - left: _showRect.left + _showRect.width / 2.0 - 7.5, - top: _isDown ? offset.dy + menuHeight() : offset.dy - arrowHeight, - child: CustomPaint( - size: Size(15.0, arrowHeight), - painter: TrianglePainter(isDown: _isDown, color: _backgroundColor), - ), - ), - // menu content - Positioned( - left: offset.dx, - top: offset.dy, - child: Container( - width: menuWidth(), - height: menuHeight(), - child: Column( - children: [ - ClipRRect( - borderRadius: BorderRadius.circular(5.0), - child: Container( - width: menuWidth(), - height: menuHeight(), - decoration: BoxDecoration( - color: _backgroundColor, - borderRadius: BorderRadius.circular(5.0)), - child: Column( - children: _createRows(), - ), - )), - ], + children: [ + // triangle arrow + Positioned( + left: _showRect.left + _showRect.width / 2.0 - 7.5, + top: _isDown + ? offset.dy + menuHeight() + : offset.dy - arrowHeight, + child: CustomPaint( + size: Size(15.0, arrowHeight), + painter: + TrianglePainter(isDown: _isDown, color: _backgroundColor), ), ), - ) - ], - ), + // menu content + Positioned( + left: offset.dx, + top: offset.dy, + child: Container( + width: menuWidth(), + height: menuHeight(), + child: Column( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(5.0), + child: Container( + width: menuWidth(), + height: menuHeight(), + decoration: BoxDecoration( + color: _backgroundColor, + borderRadius: BorderRadius.circular(5.0)), + child: Column( + children: _createRows(), + ), + )), + ], + ), + ), + ) + ], + ), ), ); }); @@ -354,7 +356,7 @@ class PopupMenu { // Remove method should only be called once return; } - + _entry.remove(); _isShow = false; if (dismissCallback != null) { @@ -392,8 +394,8 @@ class _MenuItemWidget extends StatefulWidget { } class _MenuItemWidgetState extends State<_MenuItemWidget> { - var highlightColor = Color(0x55000000); - var color = Color(0xff232323); + var highlightColor = const Color(0x55000000); + var color = const Color(0xff232323); @override void initState() { diff --git a/mobile/lib/widgets/posts/postFloorCard.dart b/mobile/lib/widgets/posts/postFloorCard.dart index 20ccf2e8..8b7d4df0 100644 --- a/mobile/lib/widgets/posts/postFloorCard.dart +++ b/mobile/lib/widgets/posts/postFloorCard.dart @@ -77,7 +77,7 @@ class _PostFloorCardState extends State /// post.relationships.user会存在为null的情况,这是因为数据中存在fistPost,但这不是一个回复 /// if (widget.post.relationships.user == null) { - return SizedBox(); + return const SizedBox(); } final List user = widget.threadsCacher.users @@ -107,7 +107,7 @@ class _PostFloorCardState extends State /// /// 找不到相关用户 if (user.length == 0 || user == null) { - return SizedBox(); + return const SizedBox(); } return Container( @@ -256,7 +256,7 @@ class _PostFloorCardState extends State widget.post.attributes.canEdit ? IconButton( padding: const EdgeInsets.only(top: 2), - icon: DiscuzIcon( + icon: const DiscuzIcon( CupertinoIcons.trash, size: 20, ), diff --git a/mobile/lib/widgets/search/searchActionButton.dart b/mobile/lib/widgets/search/searchActionButton.dart index 1080c260..6a938adb 100644 --- a/mobile/lib/widgets/search/searchActionButton.dart +++ b/mobile/lib/widgets/search/searchActionButton.dart @@ -38,7 +38,7 @@ class DiscuzAppSearchDelegate extends DiscuzCustomSearchDelegate { ///显示在最右边的控件列表 return [ IconButton( - icon: Icon(Icons.clear), + icon: const Icon(Icons.clear), onPressed: () { query = ""; @@ -47,7 +47,7 @@ class DiscuzAppSearchDelegate extends DiscuzCustomSearchDelegate { }, ), IconButton( - icon: Icon(Icons.search), + icon: const Icon(Icons.search), onPressed: () { this.showResults(context); }, @@ -83,8 +83,8 @@ class DiscuzAppSearchDelegate extends DiscuzCustomSearchDelegate { )); } - return Center( - child: Text('暂不支持'), + return const Center( + child: const Text('暂不支持'), ); } diff --git a/mobile/lib/widgets/settings/clearCache.dart b/mobile/lib/widgets/settings/clearCache.dart index d0a333cc..97e941af 100644 --- a/mobile/lib/widgets/settings/clearCache.dart +++ b/mobile/lib/widgets/settings/clearCache.dart @@ -12,7 +12,7 @@ class ClearCacheDialog { static Future build({BuildContext context}) { return showCupertinoModalPopup( context: context, - builder: (BuildContext context) => Material( + builder: (BuildContext context) => const Material( color: Colors.transparent, child: const ClearCache(), )); @@ -113,7 +113,7 @@ class _ClearCacheState extends State { Theme.of(context).primaryColor.withOpacity(.66), Theme.of(context).primaryColor.withOpacity(.46), ]), - style: TextStyle( + style: const TextStyle( textBaseline: TextBaseline.ideographic, fontSize: 40, fontFamily: 'Roboto Condensed'), @@ -125,7 +125,7 @@ class _ClearCacheState extends State { Colors.grey.withOpacity(.66), Colors.grey.withOpacity(.46), ]), - style: TextStyle( + style: const TextStyle( textBaseline: TextBaseline.ideographic, fontSize: 30, fontFamily: 'Roboto Condensed'), diff --git a/mobile/lib/widgets/settings/privacyConfirm.dart b/mobile/lib/widgets/settings/privacyConfirm.dart index 135eaaad..fc2ef185 100644 --- a/mobile/lib/widgets/settings/privacyConfirm.dart +++ b/mobile/lib/widgets/settings/privacyConfirm.dart @@ -38,9 +38,9 @@ class PrivacyConfirm extends StatelessWidget { )), /// Context - Padding( + const Padding( padding: const EdgeInsets.all(10), - child: DiscuzText( + child: const DiscuzText( "请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。并了解详细信息。如果你同意请点击下面按钮开始接受我们的服务。")), Padding( padding: const EdgeInsets.all(10), diff --git a/mobile/lib/widgets/settings/themeColorSetting.dart b/mobile/lib/widgets/settings/themeColorSetting.dart index a3d1fae2..72039819 100644 --- a/mobile/lib/widgets/settings/themeColorSetting.dart +++ b/mobile/lib/widgets/settings/themeColorSetting.dart @@ -76,7 +76,7 @@ class ThemeColorSetting extends StatelessWidget { child: Color(conf.appConf['themeColor']) != color ? const SizedBox() : Container( - child: Icon( + child: const Icon( Icons.check, size: 20, color: Colors.white, diff --git a/mobile/lib/widgets/share/shareApp.dart b/mobile/lib/widgets/share/shareApp.dart index eaf55400..6237c4c1 100644 --- a/mobile/lib/widgets/share/shareApp.dart +++ b/mobile/lib/widgets/share/shareApp.dart @@ -38,7 +38,7 @@ class _ShareAppView extends StatelessWidget { padding: const EdgeInsets.all(15), decoration: BoxDecoration( color: Theme.of(context).backgroundColor, - borderRadius: BorderRadius.all(Radius.circular(15))), + borderRadius: const BorderRadius.all(const Radius.circular(15))), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, diff --git a/mobile/lib/widgets/skeleton/pkSkeleton.dart b/mobile/lib/widgets/skeleton/pkSkeleton.dart index 5c80fdcf..8e1a0339 100644 --- a/mobile/lib/widgets/skeleton/pkSkeleton.dart +++ b/mobile/lib/widgets/skeleton/pkSkeleton.dart @@ -8,9 +8,9 @@ Decoration myBoxDec(animation, {isCircle = false}) { begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [ - Color(0xfff6f7f9), - Color(0xffe9ebee), - Color(0xfff6f7f9), + const Color(0xfff6f7f9), + const Color(0xffe9ebee), + const Color(0xfff6f7f9), // Color(0xfff6f7f9), ], stops: [ @@ -44,7 +44,7 @@ class _PKCardSkeletonState extends State super.initState(); _controller = AnimationController( vsync: this, - duration: Duration(seconds: 1), + duration: const Duration(seconds: 1), ); animation = Tween(begin: -1.0, end: 2.0).animate( @@ -77,10 +77,10 @@ class _PKCardSkeletonState extends State return Padding( padding: const EdgeInsets.only(top: 5.0), child: Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(3))), - padding: EdgeInsets.all(10), + borderRadius: const BorderRadius.all(Radius.circular(3))), + padding: const EdgeInsets.all(10), child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, @@ -95,7 +95,7 @@ class _PKCardSkeletonState extends State decoration: myBoxDec(animation, isCircle: widget.isCircularImage), ), - SizedBox( + const SizedBox( width: 20, ), Container( @@ -123,7 +123,7 @@ class _PKCardSkeletonState extends State ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( + const SizedBox( height: 20, ), Container( @@ -131,7 +131,7 @@ class _PKCardSkeletonState extends State width: width * 0.7, decoration: myBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -139,7 +139,7 @@ class _PKCardSkeletonState extends State width: width * 0.8, decoration: myBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -149,7 +149,7 @@ class _PKCardSkeletonState extends State ), ], ) - : Offstage() + : const Offstage() ], ), ), @@ -202,7 +202,7 @@ class _PKDarkCardSkeletonState extends State super.initState(); _controller = AnimationController( vsync: this, - duration: Duration(seconds: 1), + duration: const Duration(seconds: 1), ); animation = Tween(begin: -1.0, end: 2.0).animate( @@ -235,10 +235,10 @@ class _PKDarkCardSkeletonState extends State return Padding( padding: const EdgeInsets.only(top: 5.0), child: Container( - padding: EdgeInsets.all(10), - decoration: BoxDecoration( + padding: const EdgeInsets.all(10), + decoration: const BoxDecoration( color: Global.backgroundColorDark, - borderRadius: BorderRadius.all(Radius.circular(3))), + borderRadius: const BorderRadius.all(Radius.circular(3))), child: Column( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.start, @@ -253,7 +253,7 @@ class _PKDarkCardSkeletonState extends State decoration: myDarkBoxDec(animation, isCircle: widget.isCircularImage), ), - SizedBox( + const SizedBox( width: 20, ), Container( @@ -281,7 +281,7 @@ class _PKDarkCardSkeletonState extends State ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( + const SizedBox( height: 20, ), Container( @@ -289,7 +289,7 @@ class _PKDarkCardSkeletonState extends State width: width * 0.7, decoration: myDarkBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -297,7 +297,7 @@ class _PKDarkCardSkeletonState extends State width: width * 0.8, decoration: myDarkBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -307,7 +307,7 @@ class _PKDarkCardSkeletonState extends State ), ], ) - : Offstage() + : const Offstage() ], ), ), @@ -386,7 +386,7 @@ class _PKCardProfileSkeletonState extends State super.initState(); _controller = AnimationController( vsync: this, - duration: Duration(seconds: 1), + duration: const Duration(seconds: 1), ); animation = Tween(begin: -1.0, end: 2.0).animate( @@ -420,7 +420,7 @@ class _PKCardProfileSkeletonState extends State padding: const EdgeInsets.only(top: 5.0), child: Container( color: Colors.white, - padding: EdgeInsets.all(10), + padding: const EdgeInsets.all(10), child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -446,7 +446,7 @@ class _PKCardProfileSkeletonState extends State decoration: myBoxDec(animation, isCircle: widget.isCircularImage), ), - SizedBox( + const SizedBox( width: 20, ), Container( @@ -477,7 +477,7 @@ class _PKCardProfileSkeletonState extends State ? Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox( + const SizedBox( height: 20, ), Container( @@ -485,7 +485,7 @@ class _PKCardProfileSkeletonState extends State width: width * 0.7, decoration: myBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -493,7 +493,7 @@ class _PKCardProfileSkeletonState extends State width: width * 0.8, decoration: myBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -503,7 +503,7 @@ class _PKCardProfileSkeletonState extends State ), ], ) - : Offstage() + : const Offstage() ], ), ), @@ -533,7 +533,7 @@ class _PKDarkCardProfileSkeletonState extends State super.initState(); _controller = AnimationController( vsync: this, - duration: Duration(seconds: 1), + duration: const Duration(seconds: 1), ); animation = Tween(begin: -1.0, end: 2.0).animate( @@ -567,7 +567,7 @@ class _PKDarkCardProfileSkeletonState extends State padding: const EdgeInsets.only(top: 5.0), child: Container( color: Colors.grey[800], - padding: EdgeInsets.all(10), + padding: const EdgeInsets.all(10), child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -593,7 +593,7 @@ class _PKDarkCardProfileSkeletonState extends State decoration: myDarkBoxDec(animation, isCircle: widget.isCircularImage), ), - SizedBox( + const SizedBox( width: 20, ), Container( @@ -624,7 +624,7 @@ class _PKDarkCardProfileSkeletonState extends State ? Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox( + const SizedBox( height: 20, ), Container( @@ -632,7 +632,7 @@ class _PKDarkCardProfileSkeletonState extends State width: width * 0.7, decoration: myDarkBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -640,7 +640,7 @@ class _PKDarkCardProfileSkeletonState extends State width: width * 0.8, decoration: myDarkBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -650,7 +650,7 @@ class _PKDarkCardProfileSkeletonState extends State ), ], ) - : Offstage() + : const Offstage() ], ), ), @@ -677,7 +677,7 @@ class _PKCardPageSkeletonState extends State super.initState(); _controller = AnimationController( vsync: this, - duration: Duration(seconds: 1), + duration: const Duration(seconds: 1), ); animation = Tween(begin: -1.0, end: 2.0).animate( @@ -711,7 +711,7 @@ class _PKCardPageSkeletonState extends State padding: const EdgeInsets.only(top: 5.0), child: Container( color: Colors.white, - padding: EdgeInsets.all(10), + padding: const EdgeInsets.all(10), child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -725,7 +725,7 @@ class _PKCardPageSkeletonState extends State width: width * 0.7, decoration: myBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -733,7 +733,7 @@ class _PKCardPageSkeletonState extends State width: width * 0.8, decoration: myBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -767,7 +767,7 @@ class _PKDarkCardPageSkeletonState extends State super.initState(); _controller = AnimationController( vsync: this, - duration: Duration(seconds: 1), + duration: const Duration(seconds: 1), ); animation = Tween(begin: -1.0, end: 2.0).animate( @@ -801,7 +801,7 @@ class _PKDarkCardPageSkeletonState extends State padding: const EdgeInsets.only(top: 5.0), child: Container( color: Colors.grey[800], - padding: EdgeInsets.all(10), + padding: const EdgeInsets.all(10), child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -815,7 +815,7 @@ class _PKDarkCardPageSkeletonState extends State width: width * 0.7, decoration: myDarkBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( @@ -823,7 +823,7 @@ class _PKDarkCardPageSkeletonState extends State width: width * 0.8, decoration: myDarkBoxDec(animation), ), - SizedBox( + const SizedBox( height: 10, ), Container( diff --git a/mobile/lib/widgets/threads/parts/threadExtendBottomBar.dart b/mobile/lib/widgets/threads/parts/threadExtendBottomBar.dart index 48db5ae1..5faf285d 100644 --- a/mobile/lib/widgets/threads/parts/threadExtendBottomBar.dart +++ b/mobile/lib/widgets/threads/parts/threadExtendBottomBar.dart @@ -103,7 +103,7 @@ class _ThreadExtendBottomBarState extends State { width: MediaQuery.of(context).size.width, padding: const EdgeInsets.only(left: 15, right: 15, top: 10, bottom: 10), decoration: BoxDecoration( - border: Border(top: Global.border), + border: const Border(top: Global.border), color: DiscuzApp.themeOf(context).backgroundColor), child: SafeArea( top: false, diff --git a/mobile/lib/widgets/threads/parts/threadFavoritesAndRewards.dart b/mobile/lib/widgets/threads/parts/threadFavoritesAndRewards.dart index f83b4059..d4fc6e4a 100644 --- a/mobile/lib/widgets/threads/parts/threadFavoritesAndRewards.dart +++ b/mobile/lib/widgets/threads/parts/threadFavoritesAndRewards.dart @@ -42,7 +42,7 @@ class ThreadFavoritesAndRewards extends StatelessWidget { /// 如果点赞和打赏都没有,那么久直接返回 sizedbox 好了 /// if (likedUsers.length == 0 && rewardedUsers.length == 0) { - return SizedBox(); + return const SizedBox(); } /// 生成打赏列表 diff --git a/mobile/lib/widgets/threads/theadsList.dart b/mobile/lib/widgets/threads/theadsList.dart index 786398eb..8cef1348 100644 --- a/mobile/lib/widgets/threads/theadsList.dart +++ b/mobile/lib/widgets/threads/theadsList.dart @@ -120,14 +120,14 @@ class _ForumCategoryState extends State /// 如果 filter 发生变化,和上次filter不同那么就是发生变化 /// 这时候刷新请求变化 if (oldWidget.filter != widget.filter) { - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); } /// /// 如果keyword 证明用户重新输入了关键字,那么久执行重新请求 if (widget.keyword != null && oldWidget.keyword != widget.keyword) { - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); } } @@ -136,7 +136,7 @@ class _ForumCategoryState extends State void initState() { super.initState(); - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); } diff --git a/mobile/lib/widgets/threads/threadCard.dart b/mobile/lib/widgets/threads/threadCard.dart index f5949a82..b8bc9f17 100644 --- a/mobile/lib/widgets/threads/threadCard.dart +++ b/mobile/lib/widgets/threads/threadCard.dart @@ -61,10 +61,10 @@ class ThreadCard extends StatefulWidget { class _ThreadCardState extends State with AutomaticKeepAliveClientMixin { /// 当前帖子的作者 - UserModel _author = UserModel(); + UserModel _author = const UserModel(); /// firstPost 指定的是主题第一个帖子,其他的是回复 - PostModel _firstPost = PostModel(); + PostModel _firstPost = const PostModel(); /// /// 是否需要支付才能查看 @@ -79,14 +79,14 @@ class _ThreadCardState extends State _author = widget.threadsCacher.users.lastWhere((UserModel it) => it.id == int.tryParse(widget.thread.relationships.user['data']['id'])) ?? - UserModel(); + const UserModel(); /// 查找firstPost _firstPost = widget.threadsCacher.posts.lastWhere((PostModel it) => it.id == int.tryParse( widget.thread.relationships.firstPost['data']['id'])) ?? - PostModel(); + const PostModel(); /// 查找附件图片 } @@ -202,7 +202,7 @@ class _ThreadCardState extends State author: _author, ), Container( - padding: EdgeInsets.only(top: 10), + padding: const EdgeInsets.only(top: 10), alignment: Alignment.topLeft, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -282,7 +282,7 @@ class _ThreadCardState extends State padding: const EdgeInsets.only(bottom: 10), child: Row( children: [ - DiscuzText('发布了:'), + const DiscuzText('发布了:'), DiscuzText( widget.thread.attributes.title.length <= _kFlatTitleLength diff --git a/mobile/lib/widgets/topics/topicListBar.dart b/mobile/lib/widgets/topics/topicListBar.dart index 0340d77e..06d682e4 100644 --- a/mobile/lib/widgets/topics/topicListBar.dart +++ b/mobile/lib/widgets/topics/topicListBar.dart @@ -52,10 +52,10 @@ class _TopicListBarState extends State { color: DiscuzApp.themeOf(context).textColor), itemBuilder: (BuildContext context) => >[ - PopupMenuItem( + const PopupMenuItem( value: TopicListSortType.viewCount, child: const DiscuzText('热度')), - PopupMenuItem( + const PopupMenuItem( value: TopicListSortType.threadCount, child: const DiscuzText('内容数')) ], diff --git a/mobile/lib/widgets/topics/topicsList.dart b/mobile/lib/widgets/topics/topicsList.dart index 0bd07086..7ce63a0e 100644 --- a/mobile/lib/widgets/topics/topicsList.dart +++ b/mobile/lib/widgets/topics/topicsList.dart @@ -103,7 +103,7 @@ class _ForumCategoryState extends State /// /// 如果用户切换了排序方式 if (widget.sort != null && oldWidget.sort != widget.sort) { - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); return; } @@ -111,7 +111,7 @@ class _ForumCategoryState extends State /// /// 如果keyword 证明用户重新输入了关键字,那么久执行重新请求 if (widget.keyword != null && oldWidget.keyword != widget.keyword) { - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); } } @@ -120,7 +120,7 @@ class _ForumCategoryState extends State void initState() { super.initState(); - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); } diff --git a/mobile/lib/widgets/users/userAccountBanner.dart b/mobile/lib/widgets/users/userAccountBanner.dart index c61810e5..b7225168 100644 --- a/mobile/lib/widgets/users/userAccountBanner.dart +++ b/mobile/lib/widgets/users/userAccountBanner.dart @@ -26,7 +26,7 @@ class _UserAccountBannerState extends State { crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - DiscuzAvatar(), + const DiscuzAvatar(), /// const SizedBox(height: 20), diff --git a/mobile/lib/widgets/users/userFollow.dart b/mobile/lib/widgets/users/userFollow.dart index dc02ba57..28299513 100644 --- a/mobile/lib/widgets/users/userFollow.dart +++ b/mobile/lib/widgets/users/userFollow.dart @@ -35,7 +35,7 @@ class _UserFollowState extends State { /// states /// 从远端获取当前查看的用户,可查询是否我已经关注他 /// 默认数据为空,将在接口请求后,进行覆盖处理 - UserModel _user = UserModel(); + UserModel _user = const UserModel(); /// _loading bool _loading = true; @@ -78,7 +78,7 @@ class _UserFollowState extends State { /// build body Widget _buildBody({BuildContext context, UserModel user}) { if (_loading) { - return DiscuzIndicator(); + return const DiscuzIndicator(); } return user.attributes.id == widget.user.id @@ -91,7 +91,7 @@ class _UserFollowState extends State { /// 动态文案 onPressed: () => _requestFollow(context: context), - borderRadius: BorderRadius.all(Radius.circular(30)), + borderRadius: const BorderRadius.all(const Radius.circular(30)), ), ); } diff --git a/mobile/lib/widgets/users/userFollowListTile.dart b/mobile/lib/widgets/users/userFollowListTile.dart index b1b9d25f..92621fd4 100644 --- a/mobile/lib/widgets/users/userFollowListTile.dart +++ b/mobile/lib/widgets/users/userFollowListTile.dart @@ -48,7 +48,7 @@ class _UserFollowListTileState extends State { /// /// 用于存储最新用户状态的 - UserModel _user = UserModel(); + UserModel _user = const UserModel(); @override void setState(fn) { diff --git a/mobile/lib/widgets/users/userHomeDelegateCard.dart b/mobile/lib/widgets/users/userHomeDelegateCard.dart index b012e925..10199594 100644 --- a/mobile/lib/widgets/users/userHomeDelegateCard.dart +++ b/mobile/lib/widgets/users/userHomeDelegateCard.dart @@ -33,7 +33,7 @@ class _UserHomeDelegateCardState extends State { /// /// state /// 关注组件传入的新的用户模型 - UserModel _user = UserModel(); + UserModel _user = const UserModel(); @override void setState(fn) { @@ -57,7 +57,7 @@ class _UserHomeDelegateCardState extends State { @override Widget build(BuildContext context) => AnimatedContainer( - duration: Duration(milliseconds: 300), + duration: const Duration(milliseconds: 300), decoration: BoxDecoration( border: const Border(top: Global.border, bottom: Global.border), color: DiscuzApp.themeOf(context).backgroundColor), diff --git a/mobile/lib/widgets/users/userRecentThreads.dart b/mobile/lib/widgets/users/userRecentThreads.dart index 57b2c590..a918d537 100644 --- a/mobile/lib/widgets/users/userRecentThreads.dart +++ b/mobile/lib/widgets/users/userRecentThreads.dart @@ -89,7 +89,7 @@ class _UserRecentThreadsState extends State { /// /// 加载数据 /// - Future.delayed(Duration(milliseconds: 450)) + Future.delayed(const Duration(milliseconds: 450)) .then((_) async => await _requestData(pageNumber: 1)); } diff --git a/mobile/test/widget_test.dart b/mobile/test/widget_test.dart index a42f2946..82ad199d 100644 --- a/mobile/test/widget_test.dart +++ b/mobile/test/widget_test.dart @@ -8,12 +8,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:zhangxiaogou/main.dart'; +import 'package:discuzq/discuz.dart'; void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); + await tester.pumpWidget(const Discuz()); // Verify that our counter starts at 0. expect(find.text('0'), findsOneWidget);