From 159ea0722b129a3e88260d15fe93bd58f3d7e8e4 Mon Sep 17 00:00:00 2001 From: perol Date: Wed, 15 Jul 2020 23:21:01 +0800 Subject: [PATCH] fix bug --- .flutter-plugins-dependencies | 2 +- android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- lib/component/illust_card.dart | 2 +- lib/component/selectable_html.dart | 5 +- lib/component/spotlight_card.dart | 2 - lib/component/star_icon.dart | 42 +-- lib/network/api_client.dart | 2 +- lib/page/Init/init_page.dart | 1 - lib/page/comment/comment_page.dart | 243 +++++++++--------- lib/page/comment/comment_store.dart | 4 +- lib/page/follow/follow_list.dart | 62 ++--- lib/page/history/history_page.dart | 12 +- lib/page/painter/painter_list.dart | 17 +- lib/page/painter/painter_list_store.dart | 1 - lib/page/picture/illust_about_grid.dart | 24 +- lib/page/soup/soup_page.dart | 67 ++--- lib/page/soup/soup_store.dart | 5 +- lib/page/splash/splash_page.dart | 1 - lib/page/spotlight/spotlight_page.dart | 61 ++--- lib/page/user/bookmark/bookmark_page.dart | 84 ++++-- lib/page/user/users_page.dart | 2 +- lib/page/zoom/photo_viewer_page.dart | 115 +++++---- lib/page/zoom/zoom_page.dart | 1 - pubspec.lock | 57 ++-- pubspec.yaml | 18 +- 26 files changed, 486 insertions(+), 352 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index c97e8a698..7f30adb7f 100644 --- a/.flutter-plugins-dependencies +++ b/.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":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\device_info-0.4.2+4\\\\","dependencies":[]},{"name":"flutter_inapp_purchase","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_inapp_purchase-2.2.0\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\image_picker-0.6.7+3\\\\","dependencies":[]},{"name":"package_info","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.11\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\permission_handler-5.0.1\\\\","dependencies":[]},{"name":"receive_sharing_intent","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\receive_sharing_intent-1.4.0+2\\\\","dependencies":[]},{"name":"save_in_gallery","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\save_in_gallery-0.1.3\\\\","dependencies":[]},{"name":"screen","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\screen-0.0.5\\\\","dependencies":[]},{"name":"share","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\share-0.6.4+3\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-0.5.7+3\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1\\\\","dependencies":[]},{"name":"uni_links","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\uni_links-0.4.0\\\\","dependencies":[]},{"name":"url_launcher","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-5.4.11\\\\","dependencies":[]},{"name":"video_player","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player-0.10.11+2\\\\","dependencies":[]},{"name":"wakelock","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\wakelock-0.1.4+2\\\\","dependencies":[]},{"name":"webview_flutter","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\webview_flutter-0.3.22+1\\\\","dependencies":[]}],"android":[{"name":"device_info","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\device_info-0.4.2+4\\\\","dependencies":[]},{"name":"flutter_displaymode","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_displaymode-0.1.0\\\\","dependencies":[]},{"name":"flutter_inapp_purchase","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_inapp_purchase-2.2.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_plugin_android_lifecycle-1.0.8\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\image_picker-0.6.7+3\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.11\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\permission_handler-5.0.1\\\\","dependencies":[]},{"name":"receive_sharing_intent","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\receive_sharing_intent-1.4.0+2\\\\","dependencies":[]},{"name":"save_in_gallery","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\save_in_gallery-0.1.3\\\\","dependencies":[]},{"name":"screen","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\screen-0.0.5\\\\","dependencies":[]},{"name":"share","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\share-0.6.4+3\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-0.5.7+3\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1\\\\","dependencies":[]},{"name":"uni_links","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\uni_links-0.4.0\\\\","dependencies":[]},{"name":"url_launcher","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-5.4.11\\\\","dependencies":[]},{"name":"video_player","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player-0.10.11+2\\\\","dependencies":[]},{"name":"wakelock","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\wakelock-0.1.4+2\\\\","dependencies":[]},{"name":"webview_flutter","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\webview_flutter-0.3.22+1\\\\","dependencies":[]}],"macos":[{"name":"package_info","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.1\\\\","dependencies":[]},{"name":"path_provider_macos","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_macos-0.0.4+3\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_macos-0.0.1+10\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_macos-0.0.1+7\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]}],"windows":[],"web":[{"name":"shared_preferences_web","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_web-0.1.2+7\\\\","dependencies":[]},{"name":"url_launcher_web","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_web-0.1.2\\\\","dependencies":[]},{"name":"video_player_web","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player_web-0.1.3+2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"flutter_displaymode","dependencies":[]},{"name":"flutter_inapp_purchase","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"receive_sharing_intent","dependencies":[]},{"name":"save_in_gallery","dependencies":[]},{"name":"screen","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":"uni_links","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"video_player","dependencies":["video_player_web"]},{"name":"video_player_web","dependencies":[]},{"name":"wakelock","dependencies":[]},{"name":"webview_flutter","dependencies":[]}],"date_created":"2020-07-14 10:45:12.798256","version":"1.17.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":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\device_info-0.4.2+4\\\\","dependencies":[]},{"name":"flutter_inapp_purchase","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_inapp_purchase-2.2.0\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\image_picker-0.6.7+4\\\\","dependencies":[]},{"name":"package_info","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.11\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\permission_handler-5.0.1+1\\\\","dependencies":[]},{"name":"receive_sharing_intent","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\receive_sharing_intent-1.4.0+2\\\\","dependencies":[]},{"name":"save_in_gallery","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\save_in_gallery-0.1.3\\\\","dependencies":[]},{"name":"screen","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\screen-0.0.5\\\\","dependencies":[]},{"name":"share","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\share-0.6.4+3\\\\","dependencies":[]},{"name":"share_extend","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\share_extend-1.1.9\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-0.5.8\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1\\\\","dependencies":[]},{"name":"uni_links","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\uni_links-0.4.0\\\\","dependencies":[]},{"name":"url_launcher","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-5.5.0\\\\","dependencies":[]},{"name":"video_player","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player-0.10.11+2\\\\","dependencies":[]},{"name":"wakelock","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\wakelock-0.1.4+2\\\\","dependencies":[]},{"name":"webview_flutter","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\webview_flutter-0.3.22+1\\\\","dependencies":[]}],"android":[{"name":"device_info","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\device_info-0.4.2+4\\\\","dependencies":[]},{"name":"flutter_displaymode","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_displaymode-0.1.0\\\\","dependencies":[]},{"name":"flutter_inapp_purchase","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_inapp_purchase-2.2.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\flutter_plugin_android_lifecycle-1.0.8\\\\","dependencies":[]},{"name":"image_picker","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\image_picker-0.6.7+4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.1\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.11\\\\","dependencies":[]},{"name":"permission_handler","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\permission_handler-5.0.1+1\\\\","dependencies":[]},{"name":"receive_sharing_intent","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\receive_sharing_intent-1.4.0+2\\\\","dependencies":[]},{"name":"save_in_gallery","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\save_in_gallery-0.1.3\\\\","dependencies":[]},{"name":"screen","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\screen-0.0.5\\\\","dependencies":[]},{"name":"share","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\share-0.6.4+3\\\\","dependencies":[]},{"name":"share_extend","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\share_extend-1.1.9\\\\","dependencies":[]},{"name":"shared_preferences","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-0.5.8\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1\\\\","dependencies":[]},{"name":"uni_links","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\uni_links-0.4.0\\\\","dependencies":[]},{"name":"url_launcher","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-5.5.0\\\\","dependencies":[]},{"name":"video_player","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player-0.10.11+2\\\\","dependencies":[]},{"name":"wakelock","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\wakelock-0.1.4+2\\\\","dependencies":[]},{"name":"webview_flutter","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\webview_flutter-0.3.22+1\\\\","dependencies":[]}],"macos":[{"name":"package_info","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.1\\\\","dependencies":[]},{"name":"path_provider_macos","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_macos-0.0.4+3\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_macos-0.0.1+10\\\\","dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_macos-0.0.1+7\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_linux-0.0.2+1\\\\","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_linux-0.0.1+1\\\\","dependencies":[]}],"windows":[],"web":[{"name":"shared_preferences_web","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_web-0.1.2+7\\\\","dependencies":[]},{"name":"url_launcher_web","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_web-0.1.2\\\\","dependencies":[]},{"name":"video_player_web","path":"C:\\\\Users\\\\Perol\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.flutter-io.cn\\\\video_player_web-0.1.3+2\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"flutter_displaymode","dependencies":[]},{"name":"flutter_inapp_purchase","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"permission_handler","dependencies":[]},{"name":"receive_sharing_intent","dependencies":[]},{"name":"save_in_gallery","dependencies":[]},{"name":"screen","dependencies":[]},{"name":"share","dependencies":[]},{"name":"share_extend","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"uni_links","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_linux","url_launcher_macos"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"video_player","dependencies":["video_player_web"]},{"name":"video_player_web","dependencies":[]},{"name":"wakelock","dependencies":[]},{"name":"webview_flutter","dependencies":[]}],"date_created":"2020-07-15 23:18:35.169005","version":"1.17.5"} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 2cefe4427..7784ffecd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -22,10 +22,11 @@ buildscript { maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url "https://jitpack.io" } + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.0.0' + classpath 'com.android.tools.build:gradle:3.6.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } @@ -38,6 +39,7 @@ allprojects { maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url "https://jitpack.io" } + mavenCentral() } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index f02dc53f4..5f6570c94 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Jul 12 15:00:58 CST 2020 +#Wed Jul 15 21:07:33 CST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/lib/component/illust_card.dart b/lib/component/illust_card.dart index ada84a971..73c325860 100644 --- a/lib/component/illust_card.dart +++ b/lib/component/illust_card.dart @@ -27,7 +27,7 @@ import 'package:pixez/page/picture/picture_list_page.dart'; class IllustCard extends StatefulWidget { final IllustStore store; final List iStores; - bool needToBan; + final bool needToBan; IllustCard({ @required this.store, this.iStores, diff --git a/lib/component/selectable_html.dart b/lib/component/selectable_html.dart index 01b42846d..91f6ba2d4 100644 --- a/lib/component/selectable_html.dart +++ b/lib/component/selectable_html.dart @@ -17,6 +17,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_html/flutter_html.dart'; +import 'package:pixez/generated/l10n.dart'; import 'package:share/share.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -34,7 +35,7 @@ class _SelectableHtmlState extends State { Widget build(BuildContext context) { return InkWell( onLongPress: () async { - final result = await showDialog( + await showDialog( context: context, builder: (context) { return AlertDialog( @@ -42,7 +43,7 @@ class _SelectableHtmlState extends State { content: SelectableText(widget.data ?? ""), actions: [ FlatButton( - child: Text("OK"), + child: Text(I18n.of(context).OK), onPressed: () { Navigator.of(context).pop("OK"); }, diff --git a/lib/component/spotlight_card.dart b/lib/component/spotlight_card.dart index b0fa57458..6d6861ed5 100644 --- a/lib/component/spotlight_card.dart +++ b/lib/component/spotlight_card.dart @@ -30,8 +30,6 @@ class SpotlightCard extends StatelessWidget { padding: EdgeInsets.all(4.0), child: GestureDetector( onTap: () async { - print(spotlight.articleUrl); -// final int result = await platform.invokeMethod('getBatteryLevel'); Navigator.of(context) .push(MaterialPageRoute(builder: (BuildContext context) { return SoupPage(url: spotlight.articleUrl, spotlight: spotlight); diff --git a/lib/component/star_icon.dart b/lib/component/star_icon.dart index a57ae5ce7..3fdba21b7 100644 --- a/lib/component/star_icon.dart +++ b/lib/component/star_icon.dart @@ -94,6 +94,7 @@ class _StarIconState extends State { } return result; } else {} + return false; } @override @@ -101,28 +102,27 @@ class _StarIconState extends State { return Container( width: 36, child: LikeButton( - size: 24, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - circleColor: - CircleColor(start: Colors.transparent, end: Colors.red), - bubblesColor: BubblesColor( - dotPrimaryColor: Colors.red, - dotSecondaryColor: Colors.redAccent, - ), - isLiked: widget.illustStore.isBookmark, - likeBuilder: (context) { - return Icon( - widget.illustStore.isBookmark - ? Icons.favorite - : Icons.favorite_border, - color: widget.illustStore.isBookmark ? Colors.red : Colors.grey, - ); - }, - onTap: (v) { - return widget.illustStore.star(); - }, + size: 24, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + circleColor: CircleColor(start: Colors.transparent, end: Colors.red), + bubblesColor: BubblesColor( + dotPrimaryColor: Colors.red, + dotSecondaryColor: Colors.redAccent, ), + isLiked: widget.illustStore.isBookmark, + likeBuilder: (context) { + return Icon( + widget.illustStore.isBookmark + ? Icons.favorite + : Icons.favorite_border, + color: widget.illustStore.isBookmark ? Colors.red : Colors.grey, + ); + }, + onTap: (v) { + return widget.illustStore.star(); + }, + ), ); } } diff --git a/lib/network/api_client.dart b/lib/network/api_client.dart index d8de24c7f..ca0276341 100644 --- a/lib/network/api_client.dart +++ b/lib/network/api_client.dart @@ -67,7 +67,7 @@ class ApiClient { "App-Version": "5.0.166", "Host": BASE_API_URL_HOST } - ..options.connectTimeout = 10000 + // ..options.connectTimeout = 10000 ..interceptors.add(LogInterceptor(requestBody: true, responseBody: true)) ..interceptors.add(RefreshTokenInterceptor()); (httpClient.httpClientAdapter as DefaultHttpClientAdapter) diff --git a/lib/page/Init/init_page.dart b/lib/page/Init/init_page.dart index 1d34bd812..e0967c1b3 100644 --- a/lib/page/Init/init_page.dart +++ b/lib/page/Init/init_page.dart @@ -17,7 +17,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:pixez/main.dart'; -import 'package:pixez/network/api_client.dart'; import 'package:pixez/page/hello/android_hello_page.dart'; import 'package:shared_preferences/shared_preferences.dart'; diff --git a/lib/page/comment/comment_page.dart b/lib/page/comment/comment_page.dart index 58713f007..edee49aa2 100644 --- a/lib/page/comment/comment_page.dart +++ b/lib/page/comment/comment_page.dart @@ -14,7 +14,6 @@ * */ - import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; @@ -22,6 +21,7 @@ import 'package:pixez/component/painter_avatar.dart'; import 'package:pixez/generated/l10n.dart'; import 'package:pixez/network/api_client.dart'; import 'package:pixez/page/comment/comment_store.dart'; +import 'package:flutter_mobx/flutter_mobx.dart'; class CommentPage extends StatefulWidget { final int id; @@ -42,142 +42,139 @@ class _CommentPageState extends State { void initState() { _editController = TextEditingController(); easyRefreshController = EasyRefreshController(); - _store = CommentStore(easyRefreshController,widget.id); + _store = CommentStore(easyRefreshController, widget.id); super.initState(); } @override void dispose() { - _editController?.dispose(); + _editController?.dispose(); easyRefreshController?.dispose(); super.dispose(); - } @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(I18n.of(context).View_Comment), - ), - body: SafeArea( - child: Column( - children: [ - Expanded( - child: EasyRefresh( - controller: easyRefreshController, - enableControlFinishLoad: true, - enableControlFinishRefresh: true, - firstRefresh: true, - onRefresh: () => _store.fetch(), - onLoad: () => _store.next(), - child: _store.comments.isNotEmpty - ? ListView.builder( - shrinkWrap: true, - itemCount: _store.comments.length, - itemBuilder: (context, index) { - var comment = _store.comments[index]; - return ListTile( - leading: PainterAvatar( - url: _store.comments[index] - .user - .profileImageUrls - .medium, - id: _store.comments[index].user.id, - ), - title: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - comment.user.name, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - FlatButton( - onPressed: () { - parentCommentId = comment.id; - setState(() { - parentCommentName = - comment.user.name; - }); - }, - child: Text( - "Reply", - style: TextStyle( - color: Theme.of(context) - .primaryColor), - )) - ], - ), - ...comment.parentComment.user != null - ? [ - Text( - 'To ${comment.parentComment.user.name}') - ] - : [] - ], - ), - subtitle: SelectableText(comment.comment), - ); - }) - : Container(), - ), + return Observer( + builder: (context) { + return Scaffold( + appBar: AppBar( + title: Text(I18n.of(context).View_Comment), + ), + body: SafeArea( + child: Column( + children: [ + Expanded( + child: EasyRefresh( + controller: easyRefreshController, + enableControlFinishLoad: true, + enableControlFinishRefresh: true, + firstRefresh: true, + onRefresh: () => _store.fetch(), + onLoad: () => _store.next(), + child: _store.comments.isNotEmpty + ? ListView.builder( + shrinkWrap: true, + itemCount: _store.comments.length, + itemBuilder: (context, index) { + var comment = _store.comments[index]; + return ListTile( + leading: PainterAvatar( + url: _store + .comments[index].user.profileImageUrls.medium, + id: _store.comments[index].user.id, + ), + title: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + comment.user.name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + FlatButton( + onPressed: () { + parentCommentId = comment.id; + setState(() { + parentCommentName = + comment.user.name; + }); + }, + child: Text( + "Reply", + style: TextStyle( + color: Theme.of(context) + .primaryColor), + )) + ], + ), + ...comment.parentComment.user != null + ? [ + Text( + 'To ${comment.parentComment.user.name}') + ] + : [] + ], + ), + subtitle: SelectableText(comment.comment), + ); + }) + : Container(), ), - Container( - color: Theme.of(context).dialogBackgroundColor, - child: Row( - children: [ - IconButton( - icon: Icon(Icons.book), - onPressed: () { - setState(() { - parentCommentName = null; - parentCommentId = null; - }); - }, - ), - Expanded( - child: Padding( - padding: - const EdgeInsets.only(bottom: 2.0, right: 8.0), - child: TextField( - controller: _editController, - decoration: InputDecoration( - labelText: - "Reply to ${parentCommentName == null ? "illust" : parentCommentName}", - suffixIcon: IconButton( - icon: Icon(Icons.reply), - onPressed: () async { - final client = apiClient; - String txt = - _editController.text.trim(); - try { - if (txt.isNotEmpty) - Response reponse = - await client.postIllustComment( - widget.id, txt, - parent_comment_id: - parentCommentId); - _editController.clear(); - _store.fetch(); - } catch (e) { - print(e); - } - })), - ), + ), + Container( + color: Theme.of(context).dialogBackgroundColor, + child: Row( + children: [ + IconButton( + icon: Icon(Icons.book), + onPressed: () { + setState(() { + parentCommentName = null; + parentCommentId = null; + }); + }, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(bottom: 2.0, right: 8.0), + child: TextField( + controller: _editController, + decoration: InputDecoration( + labelText: + "Reply to ${parentCommentName == null ? "illust" : parentCommentName}", + suffixIcon: IconButton( + icon: Icon(Icons.reply), + onPressed: () async { + final client = apiClient; + String txt = _editController.text.trim(); + try { + if (txt.isNotEmpty) + Response reponse = await client + .postIllustComment(widget.id, txt, + parent_comment_id: + parentCommentId); + _editController.clear(); + _store.fetch(); + } catch (e) { + print(e); + } + })), ), ), - ], - ), - ) - ], - ), + ), + ], + ), + ) + ], ), - ); + ), + ); + } + ); } } diff --git a/lib/page/comment/comment_store.dart b/lib/page/comment/comment_store.dart index 5cab5f1ea..4cbfccbfb 100644 --- a/lib/page/comment/comment_store.dart +++ b/lib/page/comment/comment_store.dart @@ -22,9 +22,9 @@ abstract class _CommentStoreBase with Store { nextUrl = commentResponse.nextUrl; comments.clear(); comments.addAll(commentResponse.comments); - _controller.finishLoad(success: true); + _controller.finishRefresh(success: true); } catch (e) { - _controller.finishLoad(success: false); + _controller.finishRefresh(success: false); } } diff --git a/lib/page/follow/follow_list.dart b/lib/page/follow/follow_list.dart index 8b2ecac41..0644ddec9 100644 --- a/lib/page/follow/follow_list.dart +++ b/lib/page/follow/follow_list.dart @@ -39,7 +39,7 @@ class _FollowListState extends State { @override void initState() { - futureGet = ()=>apiClient.getFollowUser(restrict); + futureGet = () => apiClient.getFollowUser(restrict); super.initState(); } @@ -48,7 +48,7 @@ class _FollowListState extends State { Widget buildHeader() { return Observer(builder: (_) { return Visibility( - visible: int.parse(accountStore.now.userId) != widget.id, + visible: int.parse(accountStore.now.userId) == widget.id, child: Align( alignment: Alignment.centerRight, child: IconButton( @@ -61,31 +61,33 @@ class _FollowListState extends State { ), ), context: context, - builder: (context1) => Column( - mainAxisSize: MainAxisSize.min, - children: [ - ListTile( - title: Text(I18n.of(context).public), - onTap: () { - setState(() { - futureGet = () => apiClient.getUserFollowing( - widget.id, 'public'); - }); - Navigator.of(context1).pop(); - }, - ), - ListTile( - title: Text(I18n.of(context).private), - onTap: () { - setState(() { - futureGet = () => apiClient.getUserFollowing( - widget.id, 'private'); - }); - Navigator.of(context1).pop(); - }, - ), - ], - )); + builder: (context1) => SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ListTile( + title: Text(I18n.of(context).public), + onTap: () { + setState(() { + futureGet = () => apiClient.getUserFollowing( + widget.id, 'public'); + }); + Navigator.of(context1).pop(); + }, + ), + ListTile( + title: Text(I18n.of(context).private), + onTap: () { + setState(() { + futureGet = () => apiClient.getUserFollowing( + widget.id, 'private'); + }); + Navigator.of(context1).pop(); + }, + ), + ], + ), + )); }), ), ); @@ -97,8 +99,10 @@ class _FollowListState extends State { return Column( children: [ buildHeader(), - PainterList( - futureGet: futureGet, + Expanded( + child: PainterList( + futureGet: futureGet, + ), ), ], ); diff --git a/lib/page/history/history_page.dart b/lib/page/history/history_page.dart index 46218fc8d..e589d6839 100644 --- a/lib/page/history/history_page.dart +++ b/lib/page/history/history_page.dart @@ -15,6 +15,7 @@ */ import 'package:flutter/material.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:pixez/component/pixiv_image.dart'; import 'package:pixez/generated/l10n.dart'; @@ -24,7 +25,7 @@ import 'package:pixez/page/picture/illust_page.dart'; import 'package:pixez/page/picture/illust_store.dart'; class HistoryPage extends StatelessWidget { - final HistoryStore _store = historyStore; + final HistoryStore _store = historyStore..fetch(); Widget buildAppBarUI(context) => Container( child: Padding( child: Text( @@ -47,8 +48,9 @@ class HistoryPage extends StatelessWidget { onTap: () { Navigator.of(context, rootNavigator: true).push( MaterialPageRoute(builder: (BuildContext context) { - - return IllustPage(id:reIllust[index].illustId,store: IllustStore(reIllust[index].illustId,null)); + return IllustPage( + id: reIllust[index].illustId, + store: IllustStore(reIllust[index].illustId, null)); })); }, onLongPress: () async { @@ -88,7 +90,6 @@ class HistoryPage extends StatelessWidget { @override Widget build(BuildContext context) { - _store.fetch(); return Scaffold( appBar: AppBar( title: Text(I18n.of(context).History), @@ -100,7 +101,8 @@ class HistoryPage extends StatelessWidget { context: context, builder: (context) { return AlertDialog( - title: Text("${I18n.of(context).Delete} ${I18n.of(context).All}?"), + title: Text( + "${I18n.of(context).Delete} ${I18n.of(context).All}?"), actions: [ FlatButton( child: Text(I18n.of(context).OK), diff --git a/lib/page/painter/painter_list.dart b/lib/page/painter/painter_list.dart index 33e3fc9b7..4cc05f229 100644 --- a/lib/page/painter/painter_list.dart +++ b/lib/page/painter/painter_list.dart @@ -37,7 +37,7 @@ class _PainterListState extends State { void initState() { _easyRefreshController = EasyRefreshController(); _painterListStore = - PainterListStore(_easyRefreshController, widget.futureGet)..fetch(); + PainterListStore(_easyRefreshController, widget.futureGet); super.initState(); } @@ -45,6 +45,7 @@ class _PainterListState extends State { void didUpdateWidget(PainterList oldWidget) { super.didUpdateWidget(oldWidget); if (oldWidget.futureGet != widget.futureGet) { + _painterListStore.source = widget.futureGet; _painterListStore.fetch(); } } @@ -63,12 +64,16 @@ class _PainterListState extends State { enableControlFinishRefresh: true, controller: _easyRefreshController, header: MaterialHeader(), + firstRefresh: true, child: _painterListStore.users.isNotEmpty - ? ListView.builder(itemBuilder: (context, index) { - return PainterCard( - user: _painterListStore.users[index], - ); - },itemCount: _painterListStore.users.length,) + ? ListView.builder( + itemBuilder: (context, index) { + return PainterCard( + user: _painterListStore.users[index], + ); + }, + itemCount: _painterListStore.users.length, + ) : Container(), ); }); diff --git a/lib/page/painter/painter_list_store.dart b/lib/page/painter/painter_list_store.dart index f47b8697e..37462a765 100644 --- a/lib/page/painter/painter_list_store.dart +++ b/lib/page/painter/painter_list_store.dart @@ -1,5 +1,4 @@ import 'package:dio/dio.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:mobx/mobx.dart'; import 'package:pixez/lighting/lighting_store.dart'; diff --git a/lib/page/picture/illust_about_grid.dart b/lib/page/picture/illust_about_grid.dart index 4cb68ae2d..b2a60af27 100644 --- a/lib/page/picture/illust_about_grid.dart +++ b/lib/page/picture/illust_about_grid.dart @@ -1,8 +1,25 @@ +/* + * Copyright (C) 2020. by perol_notsf, All rights reserved + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + */ + import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:pixez/component/pixiv_image.dart'; import 'package:pixez/page/picture/illust_about_store.dart'; import 'package:pixez/page/picture/illust_page.dart'; + class IllustAboutGrid extends StatefulWidget { final int id; @@ -65,8 +82,11 @@ class _IllustAboutGridState extends State { child: PixivImage(_store.illusts[index].imageUrls.squareMedium), ); }); - return Center( - child: CircularProgressIndicator(), + return Container( + height: 200, + child: Center( + child: CircularProgressIndicator(), + ), ); }); diff --git a/lib/page/soup/soup_page.dart b/lib/page/soup/soup_page.dart index c9319906e..8531a6f6c 100644 --- a/lib/page/soup/soup_page.dart +++ b/lib/page/soup/soup_page.dart @@ -15,6 +15,7 @@ */ import 'package:flutter/material.dart'; +import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:pixez/component/painter_avatar.dart'; import 'package:pixez/component/pixiv_image.dart'; import 'package:pixez/models/amwork.dart'; @@ -35,36 +36,44 @@ class SoupPage extends StatefulWidget { class _SoupPageState extends State { final SoupStore _soupStore = SoupStore(); + @override + void initState() { + _soupStore.fetch(widget.url); + super.initState(); + } + @override Widget build(BuildContext context) { - return Scaffold( - body: NestedScrollView( - body: buildBlocProvider(), - headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverAppBar( - pinned: true, - expandedHeight: 200.0, - flexibleSpace: FlexibleSpaceBar( - centerTitle: true, - title: Text(widget.spotlight.pureTitle), - background: PixivImage(widget.spotlight.thumbnail)), - actions: [ - IconButton( - icon: Icon(Icons.share), - onPressed: () async { - var url = widget.spotlight.articleUrl; - if (await canLaunch(url)) { - await launch(url); - } else {} - }, - ) - ], - ) - ]; - }, - ), - ); + return Observer(builder: (_) { + return Scaffold( + body: NestedScrollView( + body: buildBlocProvider(), + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { + return [ + SliverAppBar( + pinned: true, + expandedHeight: 200.0, + flexibleSpace: FlexibleSpaceBar( + centerTitle: true, + title: Text(widget.spotlight.pureTitle), + background: PixivImage(widget.spotlight.thumbnail)), + actions: [ + IconButton( + icon: Icon(Icons.share), + onPressed: () async { + var url = widget.spotlight.articleUrl; + if (await canLaunch(url)) { + await launch(url); + } else {} + }, + ) + ], + ) + ]; + }, + ), + ); + }); } Widget buildBlocProvider() { @@ -74,7 +83,7 @@ class _SoupPageState extends State { return Card( child: Padding( padding: const EdgeInsets.all(8.0), - child: Text(_soupStore.description??''), + child: Text(_soupStore.description ?? ''), ), ); AmWork amWork = _soupStore.amWorks[index - 1]; diff --git a/lib/page/soup/soup_store.dart b/lib/page/soup/soup_store.dart index 47dc998e2..a1c40a0d5 100644 --- a/lib/page/soup/soup_store.dart +++ b/lib/page/soup/soup_store.dart @@ -25,7 +25,7 @@ abstract class _SoupStoreBase with Store { var workInfo = document.getElementsByClassName("am__body"); var nodes = workInfo.first.nodes; var amWorkGtmDocument = parse(workInfo.first.innerHtml); - description = document + description = document .getElementsByClassName('am__description _medium-editor-text') .first .innerHtml @@ -33,6 +33,7 @@ abstract class _SoupStoreBase with Store { .replaceAll('

', '') .replaceAll('
', '') .replaceAll('
', ''); + amWorks.clear(); for (int i = 1; i <= nodes.length; i++) { try { AmWork amWork = AmWork(); @@ -62,7 +63,7 @@ abstract class _SoupStoreBase with Store { mainDoc.first.getElementsByTagName('a').first.attributes['href']; amWork.showImage = mainDoc.first.getElementsByTagName('img').first.attributes['src']; - amWorks.clear(); + amWorks.add(amWork); } catch (e) { print(e); diff --git a/lib/page/splash/splash_page.dart b/lib/page/splash/splash_page.dart index 8461734eb..b55b75718 100644 --- a/lib/page/splash/splash_page.dart +++ b/lib/page/splash/splash_page.dart @@ -15,7 +15,6 @@ */ import 'dart:io'; - import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:mobx/mobx.dart'; diff --git a/lib/page/spotlight/spotlight_page.dart b/lib/page/spotlight/spotlight_page.dart index 457f3ac6e..86660fba4 100644 --- a/lib/page/spotlight/spotlight_page.dart +++ b/lib/page/spotlight/spotlight_page.dart @@ -14,10 +14,10 @@ * */ - import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/material_header.dart'; +import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:pixez/component/spotlight_card.dart'; import 'package:pixez/generated/l10n.dart'; @@ -28,33 +28,36 @@ class SpotLightPage extends StatelessWidget { final ScrollController _controller = ScrollController(); @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(I18n.of(context).Spotlight), - actions: [ - IconButton( - icon: Icon(Icons.arrow_upward), - onPressed: () { - _controller.animateTo(0, - duration: Duration(seconds: 1), curve: Curves.ease); - }, - ) - ], - ), - body: EasyRefresh( - onLoad: () => _spotlightStore.next(), - onRefresh: () => _spotlightStore.fetch(), - firstRefresh: true, - header: MaterialHeader(), - child: StaggeredGridView.countBuilder( - crossAxisCount: 3, - controller: _controller, - itemBuilder: (BuildContext context, int index) { - return SpotlightCard(spotlight: _spotlightStore.articles[index]); - }, - staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemCount: _spotlightStore.articles.length, - )), - ); + return Observer(builder: (_) { + return Scaffold( + appBar: AppBar( + title: Text(I18n.of(context).Spotlight), + actions: [ + IconButton( + icon: Icon(Icons.arrow_upward), + onPressed: () { + _controller.animateTo(0, + duration: Duration(seconds: 1), curve: Curves.ease); + }, + ) + ], + ), + body: EasyRefresh( + onLoad: () => _spotlightStore.next(), + onRefresh: () => _spotlightStore.fetch(), + firstRefresh: true, + header: MaterialHeader(), + child: StaggeredGridView.countBuilder( + crossAxisCount: 3, + controller: _controller, + itemBuilder: (BuildContext context, int index) { + return SpotlightCard( + spotlight: _spotlightStore.articles[index]); + }, + staggeredTileBuilder: (int index) => StaggeredTile.fit(1), + itemCount: _spotlightStore.articles.length, + )), + ); + }); } } diff --git a/lib/page/user/bookmark/bookmark_page.dart b/lib/page/user/bookmark/bookmark_page.dart index ae2a1b222..e0a9f9949 100644 --- a/lib/page/user/bookmark/bookmark_page.dart +++ b/lib/page/user/bookmark/bookmark_page.dart @@ -16,6 +16,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; +import 'package:pixez/generated/l10n.dart'; import 'package:pixez/lighting/lighting_page.dart'; import 'package:pixez/lighting/lighting_store.dart'; import 'package:pixez/main.dart'; @@ -52,23 +53,72 @@ class _BookmarkPageState extends State { return LightingList( source: futureGet, header: Container( - child: Align( - alignment: Alignment.topRight, - child: IconButton( - icon: Icon(Icons.toys), - onPressed: () async { - final result = await Navigator.of(context).push( - MaterialPageRoute( - builder: (_) => UserBookmarkTagPage())); - if (result != null) { - String tag = result['tag']; - String restrict = result['restrict']; - setState(() { - futureGet = () => apiClient.getBookmarksIllust( - widget.id, restrict, tag); - }); - } - }), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + IconButton( + icon: Icon(Icons.toys), + onPressed: () async { + final result = await Navigator.of(context).push( + MaterialPageRoute( + builder: (_) => UserBookmarkTagPage())); + if (result != null) { + String tag = result['tag']; + String restrict = result['restrict']; + setState(() { + futureGet = () => apiClient.getBookmarksIllust( + widget.id, restrict, tag); + }); + } + }), + IconButton(icon: Icon(Icons.list), onPressed: (){ + showModalBottomSheet( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16), + ), + ), + context: context, + builder: (context) => SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ListTile( + title: Text(I18n.of(context).All), + onTap: () { + Navigator.of(context).pop(); + setState(() { + futureGet = + () => apiClient.getFollowIllusts('all'); + }); + }, + ), + ListTile( + title: Text(I18n.of(context).public), + onTap: () { + Navigator.of(context).pop(); + setState(() { + futureGet = () => + apiClient.getFollowIllusts('public'); + }); + }, + ), + ListTile( + title: Text(I18n.of(context).private), + onTap: () { + Navigator.of(context).pop(); + setState(() { + futureGet = () => + apiClient.getFollowIllusts('private'); + }); + }, + ), + ], + ), + )); + + }), + ], ), ), ); diff --git a/lib/page/user/users_page.dart b/lib/page/user/users_page.dart index 3f3d898a4..b508b8004 100644 --- a/lib/page/user/users_page.dart +++ b/lib/page/user/users_page.dart @@ -220,7 +220,7 @@ class _UsersPageState extends State break; case 2: { - Clipboard.setData(ClipboardData(text: 'user:${userStore.userDetail?.user?.name??''}\npid:${widget.id}')); + Clipboard.setData(ClipboardData(text: 'painter:${userStore.userDetail?.user?.name??''}\npid:${widget.id}')); break; } default: diff --git a/lib/page/zoom/photo_viewer_page.dart b/lib/page/zoom/photo_viewer_page.dart index d01debf42..452edeb5c 100644 --- a/lib/page/zoom/photo_viewer_page.dart +++ b/lib/page/zoom/photo_viewer_page.dart @@ -15,12 +15,14 @@ */ import 'package:flutter/material.dart'; +import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view_gallery.dart'; import 'package:pixez/component/pixiv_image.dart'; import 'package:pixez/generated/l10n.dart'; import 'package:pixez/main.dart'; import 'package:pixez/models/illust.dart'; +import 'package:share_extend/share_extend.dart'; class PhotoViewerPage extends StatefulWidget { final int index; @@ -59,30 +61,42 @@ class _PhotoViewerPageState extends State { Widget _buildMuti() => InkWell( onLongPress: () async { - String result = await showDialog( + final url = userSetting.zoomQuality == 0 + ? widget.illusts.metaPages[index].imageUrls.large + : widget.illusts.metaPages[index].imageUrls.original; + FileInfo fileInfo = await DefaultCacheManager().getFileFromCache(url); + showModalBottomSheet( context: context, - builder: (context) { - return AlertDialog( - title: Text(I18n.of(context).Save), - actions: [ - FlatButton( - onPressed: () { - Navigator.of(context).pop('OK'); + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.vertical(top: Radius.circular(16.0))), + builder: (_) { + return SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ListTile( + title: Text(I18n.of(context).Save), + onTap: () { + saveStore.saveImage(widget.illusts, index: index); }, - child: Text('OK')), - FlatButton( - onPressed: () { - Navigator.of(context).pop('CANCEL'); - }, - child: Text('CANCEL')), - ], + ), + fileInfo != null + ? ListTile( + title: Text(I18n.of(context).Share), + onTap: () async { + if (fileInfo != null) + ShareExtend.share( + fileInfo.file.path, "image"); + }, + ) + : Container( + height: 0, + ), + ], + ), ); }); - if (result != null) { - if (result == 'OK') { - saveStore.saveImage(widget.illusts, index: index); - } - } }, child: PhotoViewGallery.builder( onPageChanged: (i) { @@ -93,12 +107,13 @@ class _PhotoViewerPageState extends State { pageController: PageController(initialPage: widget.index), itemCount: widget.illusts.metaPages.length, builder: (context, index) { + final url = userSetting.zoomQuality == 0 + ? widget.illusts.metaPages[index].imageUrls.large + : widget.illusts.metaPages[index].imageUrls.original; return PhotoViewGalleryPageOptions( - imageProvider: PixivProvider.url( - widget.illusts.metaPages[index].imageUrls.large), + imageProvider: PixivProvider.url(url), initialScale: PhotoViewComputedScale.contained * 1, - heroAttributes: PhotoViewHeroAttributes( - tag: widget.illusts.metaPages[index].imageUrls.large), + heroAttributes: PhotoViewHeroAttributes(tag: url), ); }), ); @@ -129,30 +144,42 @@ class _PhotoViewerPageState extends State { body: widget.illusts.pageCount == 1 ? InkWell( onLongPress: () async { - String result = await showDialog( + final url = userSetting.zoomQuality == 0 + ? widget.illusts.imageUrls.large + : widget.illusts.metaSinglePage.originalImageUrl; + FileInfo fileInfo = + await DefaultCacheManager().getFileFromCache(url); + showModalBottomSheet( context: context, - builder: (context) { - return AlertDialog( - title: Text(I18n.of(context).Save), - actions: [ - FlatButton( - onPressed: () { - Navigator.of(context).pop('OK'); - }, - child: Text('OK')), - FlatButton( - onPressed: () { - Navigator.of(context).pop('CANCEL'); + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(16.0))), + builder: (_) { + return SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ListTile( + title: Text(I18n.of(context).Save), + onTap: () { + saveStore.saveImage(widget.illusts); }, - child: Text('CANCEL')), - ], + ), + fileInfo != null + ? ListTile( + title: Text(I18n.of(context).Share), + onTap: () async { + ShareExtend.share( + fileInfo.file.path, "image"); + }, + ) + : Container( + height: 0, + ), + ], + ), ); }); - if (result != null) { - if (result == 'OK') { - saveStore.saveImage(widget.illusts); - } - } }, child: PhotoView( imageProvider: PixivProvider.url(userSetting.zoomQuality == 0 diff --git a/lib/page/zoom/zoom_page.dart b/lib/page/zoom/zoom_page.dart index 654aadf7c..154e14416 100644 --- a/lib/page/zoom/zoom_page.dart +++ b/lib/page/zoom/zoom_page.dart @@ -15,7 +15,6 @@ */ import 'dart:ui'; - import 'package:flutter/material.dart'; import 'package:pixez/component/pixiv_image.dart'; diff --git a/pubspec.lock b/pubspec.lock index 8e488f145..dfffd5444 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,7 +14,7 @@ packages: name: analyzer url: "https://pub.flutter-io.cn" source: hosted - version: "0.39.11" + version: "0.39.13" archive: dependency: "direct main" description: @@ -84,7 +84,7 @@ packages: name: build_resolvers url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.9" + version: "1.3.10" build_runner: dependency: "direct dev" description: @@ -161,7 +161,7 @@ packages: name: code_builder url: "https://pub.flutter-io.cn" source: hosted - version: "3.3.0" + version: "3.4.0" collection: dependency: transitive description: @@ -198,7 +198,7 @@ packages: source: hosted version: "0.16.1" cupertino_icons: - dependency: "direct main" + dependency: transitive description: name: cupertino_icons url: "https://pub.flutter-io.cn" @@ -231,7 +231,7 @@ packages: name: extended_nested_scroll_view url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.0" + version: "1.0.1" file: dependency: transitive description: @@ -286,6 +286,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" + flutter_hooks: + dependency: "direct main" + description: + name: flutter_hooks + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.12.0" flutter_html: dependency: "direct main" description: @@ -350,13 +357,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" - google_fonts: - dependency: "direct main" - description: - name: google_fonts - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.0" graphs: dependency: transitive description: @@ -405,7 +405,7 @@ packages: name: image_picker url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.7+3" + version: "0.6.7+4" image_picker_platform_interface: dependency: transitive description: @@ -601,7 +601,7 @@ packages: name: permission_handler url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.1" + version: "5.0.1+1" permission_handler_platform_interface: dependency: transitive description: @@ -664,7 +664,7 @@ packages: name: provider url: "https://pub.flutter-io.cn" source: hosted - version: "4.1.3" + version: "4.3.1" pub_semver: dependency: transitive description: @@ -728,13 +728,27 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.6.4+3" + share_extend: + dependency: "direct main" + description: + name: share_extend + url: "https://pub.flutter-io.cn" + source: hosted + version: "1.1.9" shared_preferences: dependency: "direct main" description: name: shared_preferences url: "https://pub.flutter-io.cn" source: hosted - version: "0.5.7+3" + version: "0.5.8" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.0.2+1" shared_preferences_macos: dependency: transitive description: @@ -781,7 +795,7 @@ packages: name: source_gen url: "https://pub.flutter-io.cn" source: hosted - version: "0.9.5" + version: "0.9.6" source_span: dependency: transitive description: @@ -879,7 +893,14 @@ packages: name: url_launcher url: "https://pub.flutter-io.cn" source: hosted - version: "5.4.11" + version: "5.5.0" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.0.1+1" url_launcher_macos: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 24a6078c8..f919c5f54 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,33 +24,30 @@ dependencies: dio: 3.0.9 crypto: any sqflite: ^1.3.1 - path_provider: ^1.6.10 - shared_preferences: ^0.5.7+3 + path_provider: ^1.6.11 + shared_preferences: ^0.5.8 flutter_staggered_grid_view: path: plugins/flutter_staggered_grid_view cached_network_image: ^2.2.0+1 flutter_cache_manager: ^1.4.1 flutter_easyrefresh: ^2.1.1 share: ^0.6.4+3 - permission_handler: 5.0.1 + share_extend: ^1.1.9 + permission_handler: ^5.0.1+1 save_in_gallery: ^0.1.3 flutter_cupertino_date_picker: ^1.0.26+2 - google_fonts: ^1.1.0 - archive: any - url_launcher: ^5.4.11 + archive: ^2.0.13 + url_launcher: ^5.5.0 bot_toast: ^3.0.0 package_info: ^0.4.1 json_serializable: ^3.3.0 uni_links: ^0.4.0 mobx: ^1.2.1+1 flutter_mobx: ^1.1.0+1 - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.3 flutter_inapp_purchase: ^2.1.2 photo_view: ^0.9.2 flutter_html: ^1.0.0 - image_picker: ^0.6.7+2 + image_picker: ^0.6.7+4 extended_nested_scroll_view: ^1.0.0 scrollable_positioned_list: ^0.1.6 flutter_date_pickers: ^0.1.0 @@ -60,6 +57,7 @@ dependencies: receive_sharing_intent: ^1.4.0+2 like_button: ^1.0.1 badges: ^1.1.1 + flutter_hooks: ^0.12.0 #dependency_overrides: # flutter_svg: ^0.17.4