diff --git a/.dart_tool/build_resolvers/sdk.sum b/.dart_tool/build_resolvers/sdk.sum deleted file mode 100644 index a788675..0000000 Binary files a/.dart_tool/build_resolvers/sdk.sum and /dev/null differ diff --git a/.dart_tool/build_resolvers/sdk.sum.deps b/.dart_tool/build_resolvers/sdk.sum.deps deleted file mode 100644 index 1c10e44..0000000 --- a/.dart_tool/build_resolvers/sdk.sum.deps +++ /dev/null @@ -1 +0,0 @@ -{"sdk":"2.7.2 (Mon Mar 23 22:11:27 2020 +0100) on \"macos_x64\"","analyzer":"/Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.39.14","build_resolvers":"/Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/build_resolvers-1.3.11"} \ No newline at end of file diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json deleted file mode 100644 index d4befa7..0000000 --- a/.dart_tool/package_config.json +++ /dev/null @@ -1,620 +0,0 @@ -{ - "configVersion": 2, - "packages": [ - { - "name": "archive", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/archive-2.0.13", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "args", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/args-1.6.0", - "packageUri": "lib/", - "languageVersion": "2.3" - }, - { - "name": "async", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/async-2.4.1", - "packageUri": "lib/", - "languageVersion": "2.2" - }, - { - "name": "bloc", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/bloc-4.0.0", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "boolean_selector", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.0.0", - "packageUri": "lib/", - "languageVersion": "2.4" - }, - { - "name": "cached_network_image", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/cached_network_image-2.2.0+1", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "charcode", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.3", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "clock", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/clock-1.0.1", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "collection", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.12", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "connectivity", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity-0.4.9+3", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "connectivity_for_web", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_for_web-0.3.1+2", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "connectivity_macos", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_macos-0.1.0+5", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "connectivity_platform_interface", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_platform_interface-1.0.6", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "convert", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1", - "packageUri": "lib/", - "languageVersion": "1.17" - }, - { - "name": "crypto", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.1.4", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "device_info", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/device_info-0.4.2+8", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "device_info_platform_interface", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/device_info_platform_interface-1.0.1", - "packageUri": "lib/", - "languageVersion": "2.7" - }, - { - "name": "dio", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/dio-3.0.10", - "packageUri": "lib/", - "languageVersion": "2.4" - }, - { - "name": "equatable", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/equatable-1.2.5", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "event_bus", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/event_bus-1.1.1", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "ffi", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/ffi-0.1.3", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "file", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/file-5.2.1", - "packageUri": "lib/", - "languageVersion": "2.2" - }, - { - "name": "flutter", - "rootUri": "file:///Users/fnuser/Documents/flutter-sdk/packages/flutter", - "packageUri": "lib/", - "languageVersion": "2.2" - }, - { - "name": "flutter_alibc", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_alibc-0.0.15", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "flutter_bloc", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_bloc-4.0.1", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "flutter_cache_manager", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_cache_manager-1.4.2", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "flutter_cupertino_date_picker", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_cupertino_date_picker-1.0.26+2", - "packageUri": "lib/", - "languageVersion": "1.19" - }, - { - "name": "flutter_native_image", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_native_image-0.0.5+2", - "packageUri": "lib/", - "languageVersion": "1.19" - }, - { - "name": "flutter_page_indicator", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_page_indicator-0.0.3", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "flutter_plugin_android_lifecycle", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_plugin_android_lifecycle-1.0.11", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "flutter_screenutil", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-1.1.0", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "flutter_swiper", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_swiper-1.1.6", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "flutter_test", - "rootUri": "file:///Users/fnuser/Documents/flutter-sdk/packages/flutter_test", - "packageUri": "lib/", - "languageVersion": "2.2" - }, - { - "name": "flutter_web_plugins", - "rootUri": "file:///Users/fnuser/Documents/flutter-sdk/packages/flutter_web_plugins", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "fluttertoast", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/fluttertoast-4.0.1", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "http", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/http-0.12.2", - "packageUri": "lib/", - "languageVersion": "2.4" - }, - { - "name": "http_parser", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/http_parser-3.1.4", - "packageUri": "lib/", - "languageVersion": "2.3" - }, - { - "name": "image", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.12", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "image_cropper", - "rootUri": "file:///Users/fnuser/.pub-cache/git/Image_Cropper-e32f2264f86a27a2f5d7a7a5e26c6154eaf5798e/", - "packageUri": "lib/", - "languageVersion": "1.20" - }, - { - "name": "image_picker", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/image_picker-0.6.7+11", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "image_picker_platform_interface", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/image_picker_platform_interface-1.1.1", - "packageUri": "lib/", - "languageVersion": "2.5" - }, - { - "name": "intl", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/intl-0.16.1", - "packageUri": "lib/", - "languageVersion": "2.5" - }, - { - "name": "jdsdk", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/jdsdk-0.0.1", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "matcher", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.6", - "packageUri": "lib/", - "languageVersion": "2.2" - }, - { - "name": "meta", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.8", - "packageUri": "lib/", - "languageVersion": "1.12" - }, - { - "name": "nested", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/nested-0.0.4", - "packageUri": "lib/", - "languageVersion": "2.2" - }, - { - "name": "package_info", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/package_info-0.4.3", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "path", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "path_provider", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider-1.6.18", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "path_provider_linux", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_linux-0.0.1+2", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "path_provider_macos", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_macos-0.0.4+4", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "path_provider_platform_interface", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_platform_interface-1.0.3", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "path_provider_windows", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path_provider_windows-0.0.4+1", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "pedantic", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/pedantic-1.9.0", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "permission_handler", - "rootUri": "file:///Users/fnuser/.pub-cache/git/permission_handler-b8c45c4c20221ac39fe083113fc360cc632f33a4/", - "packageUri": "lib/", - "languageVersion": "2.7" - }, - { - "name": "permission_handler_platform_interface", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/permission_handler_platform_interface-2.0.1", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "petitparser", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0", - "packageUri": "lib/", - "languageVersion": "2.4" - }, - { - "name": "platform", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/platform-2.2.1", - "packageUri": "lib/", - "languageVersion": "1.24" - }, - { - "name": "plugin_platform_interface", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/plugin_platform_interface-1.0.3", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "process", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/process-3.0.13", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "provider", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/provider-4.3.2+2", - "packageUri": "lib/", - "languageVersion": "2.7" - }, - { - "name": "pull_to_refresh", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-1.6.2", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "quiver", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/quiver-2.1.3", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "rxdart", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/rxdart-0.24.1", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "save_image", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/save_image-1.0.1", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "share_extend", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/share_extend-1.1.9", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "shared_preferences", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.5.12", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "shared_preferences_linux", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_linux-0.0.2+2", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "shared_preferences_macos", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_macos-0.0.1+10", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "shared_preferences_platform_interface", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_platform_interface-1.0.4", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "shared_preferences_web", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_web-0.1.2+7", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "shared_preferences_windows", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_windows-0.0.1+1", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "sharesdk_plugin", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/sharesdk_plugin-1.2.8", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "shimmer", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shimmer-1.1.1", - "packageUri": "lib/", - "languageVersion": "1.20" - }, - { - "name": "sky_engine", - "rootUri": "file:///Users/fnuser/Documents/flutter-sdk/bin/cache/pkg/sky_engine", - "packageUri": "lib/", - "languageVersion": "1.11" - }, - { - "name": "source_span", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.7.0", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "sqflite", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/sqflite-1.3.1+1", - "packageUri": "lib/", - "languageVersion": "2.7" - }, - { - "name": "sqflite_common", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/sqflite_common-1.0.2+1", - "packageUri": "lib/", - "languageVersion": "2.7" - }, - { - "name": "stack_trace", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3", - "packageUri": "lib/", - "languageVersion": "1.23" - }, - { - "name": "stream_channel", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "string_scanner", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "string_validator", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/string_validator-0.1.4", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "synchronized", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/synchronized-2.2.0+2", - "packageUri": "lib/", - "languageVersion": "2.8" - }, - { - "name": "tab_indicator_styler", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/tab_indicator_styler-1.0.0", - "packageUri": "lib/", - "languageVersion": "2.7" - }, - { - "name": "term_glyph", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0", - "packageUri": "lib/", - "languageVersion": "1.8" - }, - { - "name": "test_api", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.15", - "packageUri": "lib/", - "languageVersion": "2.4" - }, - { - "name": "transformer_page_view", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/transformer_page_view-0.1.6", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "typed_data", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "url_launcher", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher-5.7.2", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "url_launcher_linux", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_linux-0.0.1+1", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "url_launcher_macos", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_macos-0.0.1+8", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "url_launcher_platform_interface", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_platform_interface-1.0.8", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "url_launcher_web", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_web-0.1.4+1", - "packageUri": "lib/", - "languageVersion": "2.2" - }, - { - "name": "url_launcher_windows", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_windows-0.0.1+1", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "uuid", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/uuid-2.2.2", - "packageUri": "lib/", - "languageVersion": "2.2" - }, - { - "name": "vector_math", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8", - "packageUri": "lib/", - "languageVersion": "2.0" - }, - { - "name": "webview_flutter", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.24", - "packageUri": "lib/", - "languageVersion": "2.7" - }, - { - "name": "win32", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/win32-1.7.3", - "packageUri": "lib/", - "languageVersion": "2.7" - }, - { - "name": "xdg_directories", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/xdg_directories-0.1.0", - "packageUri": "lib/", - "languageVersion": "2.3" - }, - { - "name": "xml", - "rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/xml-3.6.1", - "packageUri": "lib/", - "languageVersion": "2.6" - }, - { - "name": "zhiying_comm", - "rootUri": "../../zhiying_comm", - "packageUri": "lib/", - "languageVersion": "2.1" - }, - { - "name": "zhiying_base_widget", - "rootUri": "../", - "packageUri": "lib/", - "languageVersion": "2.1" - } - ], - "generated": "2020-10-09T05:51:18.485612Z", - "generator": "pub", - "generatorVersion": "2.8.2" -} diff --git a/example/android/tmpmob/ShareSDK/assets/ShareSDK.xml b/example/android/tmpmob/ShareSDK/assets/ShareSDK.xml new file mode 100644 index 0000000..8f35cfb --- /dev/null +++ b/example/android/tmpmob/ShareSDK/assets/ShareSDK.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/pages/favorite_page/favorite_page.dart b/lib/pages/favorite_page/favorite_page.dart index f0b8405..37daef6 100644 --- a/lib/pages/favorite_page/favorite_page.dart +++ b/lib/pages/favorite_page/favorite_page.dart @@ -32,6 +32,7 @@ class _FavoritePageState extends State { child: Transform.scale( scale: 0.2, child: GoodsShareTemplate( + null, contentKey: _globalKey, ), ), diff --git a/lib/pages/goods_share_page/goods_share_bloc.dart b/lib/pages/goods_share_page/goods_share_bloc.dart index b397da3..16d83d1 100644 --- a/lib/pages/goods_share_page/goods_share_bloc.dart +++ b/lib/pages/goods_share_page/goods_share_bloc.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_poster_model.dart'; import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_temp_add_model.dart'; import 'package:zhiying_comm/util/base_bloc.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; @@ -7,6 +8,7 @@ import 'package:zhiying_comm/zhiying_comm.dart'; class GoodsShareData { List> tabs; List datas; + GoodsSharePosterModel poster; } class GoodsShareBloc extends BlocBase { @@ -31,6 +33,8 @@ class GoodsShareBloc extends BlocBase { return GoodsShareTempDataModel.fromJson(Map.from(item)); }).toList(); + _data.poster = await _loadPoster(params); + NetUtil.request( '/api/v1/mod/pub.flutter.share?share_type=${shopType.toString()}', method: NetMethod.GET, @@ -54,4 +58,12 @@ class GoodsShareBloc extends BlocBase { Logger.error(err); } } + + // 请求分享海报 + Future _loadPoster(Map params) async { + var json = await NetUtil.post('/api/v1/share/poster', params: params); + Map data = Map.from(json['data']); + + return GoodsSharePosterModel.fromJson(data); + } } diff --git a/lib/pages/goods_share_page/goods_share_editor/goods_share_preview.dart b/lib/pages/goods_share_page/goods_share_editor/goods_share_preview.dart index 1ad776f..7b90f3e 100644 --- a/lib/pages/goods_share_page/goods_share_editor/goods_share_preview.dart +++ b/lib/pages/goods_share_page/goods_share_editor/goods_share_preview.dart @@ -49,6 +49,7 @@ class _GoodsSharePreviewState extends State { GoodsShareItem( child: GoodsShareEdit( '至高减600【24期免息】xiaomi/小米10Pro 5G手机骁龙865智能游戏拍照手机官方旗舰店小米10青春正品k305g现货\n\n原价】3999元\n券后价】3989元\n【用智莺生活再省】19.74元\n-------------\n復製(FRH51Lu9hYF),\n用【Tao·寳】下单\n-------------\n商品链接】\nhttp://hsrj3.cn/ps/FRH51Lu9hYF.html)\n', + null, ), ), Padding( diff --git a/lib/pages/goods_share_page/goods_share_image/goods_share_image.dart b/lib/pages/goods_share_page/goods_share_image/goods_share_image.dart index 1edc153..90a1d7e 100644 --- a/lib/pages/goods_share_page/goods_share_image/goods_share_image.dart +++ b/lib/pages/goods_share_page/goods_share_image/goods_share_image.dart @@ -1,19 +1,23 @@ import 'dart:convert' as convert; import 'dart:io'; import 'dart:typed_data'; +import 'dart:ui' as ui; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:save_image/save_image.dart'; import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_editor/goods_share_editor.dart'; import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_image/goods_share_image_model.dart'; +import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_poster_model.dart'; import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_temp_add_model.dart'; import 'package:zhiying_base_widget/pages/goods_share_page/widgets/good_share_msg.dart'; import 'package:zhiying_base_widget/pages/goods_share_page/widgets/goods_share_edit.dart'; import 'package:zhiying_base_widget/pages/goods_share_page/widgets/goods_share_image.dart'; import 'package:zhiying_base_widget/pages/goods_share_page/widgets/goods_share_item.dart'; +import 'package:zhiying_base_widget/template/goods_share_template/goods_share_template.dart'; import 'package:zhiying_base_widget/utils/image_download_util/image_download_util.dart'; import 'package:zhiying_base_widget/widgets/public/custom_button/custom_bottom.dart'; import 'package:zhiying_base_widget/widgets/public/custom_button/custom_button_model.dart'; @@ -23,22 +27,32 @@ import 'package:zhiying_base_widget/widgets/share/share_alert.dart'; class GoodsShareImage extends StatefulWidget { final Map model; final GoodsShareTempDataModel datas; + final GoodsSharePosterModel poster; - const GoodsShareImage(this.model, this.datas, {Key key}) : super(key: key); + const GoodsShareImage(this.model, this.datas, {Key key, this.poster}) + : super(key: key); @override _GoodsShareImageState createState() => _GoodsShareImageState(); } -class _GoodsShareImageState extends State { +class _GoodsShareImageState extends State + with AutomaticKeepAliveClientMixin { + GlobalKey _globalKey = GlobalKey(); GoodsShareImageModel _style; Map _images = Map(); List widgets = List(); String _content = ''; + bool _isContentSelected = false; + bool _isPosterSelected = false; // 分享数据 final ShareDataModel _shareModel = ShareDataModel(); + @override + // 切换Tab导航栏保持页面状态 + bool get wantKeepAlive => true; + @override void initState() { String data = widget.model['data']; @@ -57,6 +71,7 @@ class _GoodsShareImageState extends State { imgCheckSelected: _style.cssList.chooseImage, child: GoodsShareEdit( _content, + widget.datas, imgCheck: _style.cssList.unChooseImage, imgCheckSelected: _style.cssList.chooseImage, onCopyClick: () { @@ -69,9 +84,15 @@ class _GoodsShareImageState extends State { Navigator.push(context, MaterialPageRoute(builder: (context) => GoodsShareEditor())); }, + onTempChange: (temp) { + setState(() { + _content = widget.datas.shareContent + temp; + }); + }, ), onSelected: (isSelected) { - _shareModel.content = isSelected ? _content : ''; + _isContentSelected = isSelected; + // _shareModel.content = isSelected ? _content : ''; }, )); for (String message in _style.customContent) { @@ -85,6 +106,31 @@ class _GoodsShareImageState extends State { ), ); } + widgets.add( + GoodsShareItem( + imgHeader: _style.cssList.headerImage, + imgCheck: _style.cssList.unChooseImage, + imgCheckSelected: _style.cssList.chooseImage, + enabled: true, + child: Container( + // color: Colors.redAccent, + width: 100, + height: 140, + padding: EdgeInsets.only(left: 25), + child: Transform.scale( + alignment: Alignment.centerLeft, + scale: 0.2, + child: GoodsShareTemplate( + widget.poster, + contentKey: _globalKey, + ), + ), + ), + onSelected: (isSelected) { + _isPosterSelected = isSelected; + }, + ), + ); for (int index = 0; index < _style.customImage.length; index++) { String image = _style.customImage[index]; // 分享图片 @@ -201,6 +247,8 @@ class _GoodsShareImageState extends State { } void _saveImages() async { + _updateModel(); + List images = List(); for (int index = 0; index < _style.customImage.length; index++) { if (_images.containsKey(index)) { @@ -213,25 +261,48 @@ class _GoodsShareImageState extends State { _shareModel.image = null; } - if ((_shareModel.image == null || _shareModel.image.length == 0)) { + if ((_shareModel.image == null || _shareModel.image.length == 0) && + _shareModel.poster == null) { Fluttertoast.showToast(msg: '请选择要保存的图片'); return; } + bool isSaveSuccess = false; + if (_shareModel.poster != null) { + isSaveSuccess = await SaveImage.save(imageBytes: _shareModel.poster); + } List paths = await ImageDownloadUtil.download(images); paths.forEach((path) async { Uint8List data = File(path).readAsBytesSync(); - bool isSaveSuccess = await SaveImage.save(imageBytes: data); - if (!isSaveSuccess) { - Fluttertoast.showToast(msg: '保存失败'); - return; - } + isSaveSuccess = await SaveImage.save(imageBytes: data); }); - Fluttertoast.showToast(msg: '保存成功'); + if (isSaveSuccess) + Fluttertoast.showToast(msg: '保存成功'); + else + Fluttertoast.showToast(msg: '保存失败'); + } + + void _updateModel() async { + if (_isPosterSelected) { + BuildContext buildContext = _globalKey.currentContext; + if (null != buildContext) { + RenderRepaintBoundary boundary = buildContext.findRenderObject(); + ui.Image image = await boundary.toImage(pixelRatio: 2.0); + // 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba + ByteData byteData = + await image.toByteData(format: ui.ImageByteFormat.png); + Uint8List pngBytes = byteData.buffer.asUint8List(); + _shareModel.poster = pngBytes; + } + } else { + _shareModel.poster = null; + } + _shareModel.content = _isContentSelected ? _content : ''; } // 弹出分享框 void _showShareAlert() async { + _updateModel(); List images = List(); for (int index = 0; index < _style.customImage.length; index++) { if (_images.containsKey(index)) { @@ -247,7 +318,8 @@ class _GoodsShareImageState extends State { if ((_shareModel.title == null || _shareModel.title == '') && (_shareModel.image == null || _shareModel.image.length == 0) && (_shareModel.content == null || _shareModel.content == '') && - (_shareModel.url == null || _shareModel.url == '')) { + (_shareModel.url == null || _shareModel.url == '') && + (_shareModel.poster == null)) { Fluttertoast.showToast(msg: '请选择要分享的内容'); return; } diff --git a/lib/pages/goods_share_page/goods_share_link/goods_share_link.dart b/lib/pages/goods_share_page/goods_share_link/goods_share_link.dart index 1d0a612..9943f19 100644 --- a/lib/pages/goods_share_page/goods_share_link/goods_share_link.dart +++ b/lib/pages/goods_share_page/goods_share_link/goods_share_link.dart @@ -27,7 +27,8 @@ class GoodsShareLink extends StatefulWidget { _GoodsShareLinkState createState() => _GoodsShareLinkState(); } -class _GoodsShareLinkState extends State { +class _GoodsShareLinkState extends State + with AutomaticKeepAliveClientMixin { GoodsShareImageModel _style; Map _images = Map(); List widgets = List(); @@ -35,6 +36,10 @@ class _GoodsShareLinkState extends State { // 分享数据 final ShareDataModel _shareModel = ShareDataModel(); + @override + // 切换Tab导航栏保持页面状态 + bool get wantKeepAlive => true; + @override void initState() { String data = widget.model['data']; @@ -66,6 +71,7 @@ class _GoodsShareLinkState extends State { enabled: false, child: GoodsShareEdit( _style.content, + widget.datas, onCopyClick: () { Fluttertoast.showToast(msg: '复制成功'); }, diff --git a/lib/pages/goods_share_page/goods_share_miniprogram/goods_share_miniprogram.dart b/lib/pages/goods_share_page/goods_share_miniprogram/goods_share_miniprogram.dart index 2918e34..363ebba 100644 --- a/lib/pages/goods_share_page/goods_share_miniprogram/goods_share_miniprogram.dart +++ b/lib/pages/goods_share_page/goods_share_miniprogram/goods_share_miniprogram.dart @@ -15,7 +15,12 @@ class GoodsShareMiniprogram extends StatefulWidget { _GoodsShareMiniprogramState createState() => _GoodsShareMiniprogramState(); } -class _GoodsShareMiniprogramState extends State { +class _GoodsShareMiniprogramState extends State + with AutomaticKeepAliveClientMixin { + @override + // 切换Tab导航栏保持页面状态 + bool get wantKeepAlive => true; + @override Widget build(BuildContext context) { return Container( diff --git a/lib/pages/goods_share_page/goods_share_page.dart b/lib/pages/goods_share_page/goods_share_page.dart index b28f4bf..64f52e7 100644 --- a/lib/pages/goods_share_page/goods_share_page.dart +++ b/lib/pages/goods_share_page/goods_share_page.dart @@ -83,7 +83,11 @@ class _GoodsShareContainerState extends State<_GoodsShareContainer> _tabs.add(_createTabItem(item['title'])); String mod_name = item['mod_name']; if (mod_name == 'share_goods_image.taobao') { - _contents.add(GoodsShareImage(item, model)); + _contents.add(GoodsShareImage( + item, + model, + poster: data.poster, + )); } else if (mod_name == 'share_goods_link.taobao') { _contents.add(GoodsShareLink(item, model)); } else if (mod_name == 'share_goods_mini.taobao') { diff --git a/lib/pages/goods_share_page/models/goods_share_poster_model.dart b/lib/pages/goods_share_page/models/goods_share_poster_model.dart new file mode 100644 index 0000000..3e0a826 --- /dev/null +++ b/lib/pages/goods_share_page/models/goods_share_poster_model.dart @@ -0,0 +1,52 @@ +class GoodsSharePosterModel { + String qrcode; + String avatar; + String title; + String provider; + String posterImage; + String inviteCode; + String couponPrice; + String coupon; + String marketPrice; + String style; + + GoodsSharePosterModel( + {this.qrcode, + this.avatar, + this.title, + this.provider, + this.posterImage, + this.inviteCode, + this.couponPrice, + this.coupon, + this.marketPrice, + this.style}); + + GoodsSharePosterModel.fromJson(Map json) { + qrcode = json['qrcode']; + avatar = json['avatar']; + title = json['title']; + provider = json['provider']; + posterImage = json['poster_image']; + inviteCode = json['invite_code']; + couponPrice = json['coupon_price']; + coupon = json['coupon']; + marketPrice = json['market_price']; + style = json['style']; + } + + Map toJson() { + final Map data = new Map(); + data['qrcode'] = this.qrcode; + data['avatar'] = this.avatar; + data['title'] = this.title; + data['provider'] = this.provider; + data['poster_image'] = this.posterImage; + data['invite_code'] = this.inviteCode; + data['coupon_price'] = this.couponPrice; + data['coupon'] = this.coupon; + data['market_price'] = this.marketPrice; + data['style'] = this.style; + return data; + } +} diff --git a/lib/pages/goods_share_page/models/goods_share_poster_style_model.dart b/lib/pages/goods_share_page/models/goods_share_poster_style_model.dart new file mode 100644 index 0000000..e4036b5 --- /dev/null +++ b/lib/pages/goods_share_page/models/goods_share_poster_style_model.dart @@ -0,0 +1,68 @@ +class GoodsSharePosterStyleModel { + String inviteCodeFontColor; + String inviteCodeBgColor; + String providerNameColor; + String providerBgColor; + String titleColor; + String couponpriceColor; + String couponpriceBgColor; + String couponColor; + String couponBgColor; + String marketPriceColor; + String fingerprintImg; + String fingerprintText; + String fingerprintTextColor; + String applogImg; + + GoodsSharePosterStyleModel( + {this.inviteCodeFontColor, + this.inviteCodeBgColor, + this.providerNameColor, + this.providerBgColor, + this.titleColor, + this.couponpriceColor, + this.couponpriceBgColor, + this.couponColor, + this.couponBgColor, + this.marketPriceColor, + this.fingerprintImg, + this.fingerprintText, + this.fingerprintTextColor, + this.applogImg}); + + GoodsSharePosterStyleModel.fromJson(Map json) { + inviteCodeFontColor = json['invite_code_font_color']; + inviteCodeBgColor = json['invite_code_bg_color']; + providerNameColor = json['provider_name_color']; + providerBgColor = json['provider_bg_color']; + titleColor = json['title_color']; + couponpriceColor = json['couponprice_color']; + couponpriceBgColor = json['couponprice_bg_color']; + couponColor = json['coupon_color']; + couponBgColor = json['coupon_bg_color']; + marketPriceColor = json['market_price_color']; + fingerprintImg = json['fingerprint_img']; + fingerprintText = json['fingerprint_text']; + fingerprintTextColor = json['fingerprint_text_color']; + applogImg = json['applog_img']; + } + + Map toJson() { + final Map data = new Map(); + data['invite_code_font_color'] = this.inviteCodeFontColor; + data['invite_code_bg_color'] = this.inviteCodeBgColor; + data['provider_name_color'] = this.providerNameColor; + data['provider_bg_color'] = this.providerBgColor; + data['title_color'] = this.titleColor; + data['couponprice_color'] = this.couponpriceColor; + data['couponprice_bg_color'] = this.couponpriceBgColor; + data['coupon_color'] = this.couponColor; + data['coupon_bg_color'] = this.couponBgColor; + data['market_price_color'] = this.marketPriceColor; + data['fingerprint_img'] = this.fingerprintImg; + data['fingerprint_text'] = this.fingerprintText; + data['fingerprint_text_color'] = this.fingerprintTextColor; + data['applog_img'] = this.applogImg; + return data; + } +} diff --git a/lib/pages/goods_share_page/widgets/goods_share_edit.dart b/lib/pages/goods_share_page/widgets/goods_share_edit.dart index 523686c..6c98eb9 100644 --- a/lib/pages/goods_share_page/widgets/goods_share_edit.dart +++ b/lib/pages/goods_share_page/widgets/goods_share_edit.dart @@ -1,28 +1,80 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; +import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_temp_add_model.dart'; -class GoodsShareEdit extends StatelessWidget { +class GoodsShareEdit extends StatefulWidget { final String message; + final GoodsShareTempDataModel model; final VoidCallback onEditorClick; final VoidCallback onCopyClick; + final ValueChanged onTempChange; + final String imgCheck; final String imgCheckSelected; final String imgEdit; final String imgCopy; - const GoodsShareEdit(this.message, + const GoodsShareEdit(this.message, this.model, {Key key, this.onEditorClick, this.onCopyClick, + this.onTempChange, this.imgCheck, this.imgCheckSelected, this.imgEdit, this.imgCopy}) : super(key: key); + @override + _GoodsShareEditState createState() => _GoodsShareEditState(); +} + +class _GoodsShareEditState extends State { + List _isItemSelected; + + @override + void initState() { + _isItemSelected = List.generate( + widget.model?.shareTemplate?.length ?? 0, (index) => false); + + super.initState(); + } + + void _checkSelected() { + String result = ''; + for (int index = 0; + index < widget.model.shareTemplate.length && + index < _isItemSelected.length; + index++) { + if (_isItemSelected[index]) { + result += '\n' + widget.model.shareTemplate[index].temp; + } + } + if (widget.onTempChange != null) { + widget.onTempChange(result); + } + } + @override Widget build(BuildContext context) { + List widgets = List.generate( + widget.model?.shareTemplate?.length ?? 0, + (index) => GestureDetector( + behavior: HitTestBehavior.opaque, + child: GoodsShareCheckButton( + widget.model.shareTemplate[index].name, + imgIcon: widget.imgCheck, + imgIconSelected: widget.imgCheckSelected, + isSelected: _isItemSelected[index], + ), + onTap: () { + setState(() { + _isItemSelected[index] = !_isItemSelected[index]; + }); + _checkSelected(); + }, + )).toList(); return Container( margin: EdgeInsets.only(left: 10, right: 10), // padding: EdgeInsets.only(left: 16, top: 10, right: 16, bottom: 10), @@ -35,89 +87,64 @@ class GoodsShareEdit extends StatelessWidget { padding: const EdgeInsets.only(left: 16, top: 10, right: 16, bottom: 10), child: Text( - message, + widget.message, style: TextStyle( fontSize: 11, fontWeight: FontWeight.bold, ), ), ), - // Container( - // padding: - // const EdgeInsets.only(left: 16, top: 6, bottom: 6, right: 16), - // width: double.infinity, - // child: Wrap( - // spacing: 10, - // runSpacing: 6, - // children: [ - // GoodsShareCheckButton( - // '标题', - // imgIcon: this.imgCheck, - // imgIconSelected: this.imgCheckSelected, - // isSelected: false, - // ), - // GoodsShareCheckButton( - // '收益', - // imgIcon: this.imgCheck, - // imgIconSelected: this.imgCheckSelected, - // isSelected: false, - // ), - // GoodsShareCheckButton( - // '邀请码', - // imgIcon: this.imgCheck, - // imgIconSelected: this.imgCheckSelected, - // isSelected: false, - // ), - // GoodsShareCheckButton( - // '链接', - // imgIcon: this.imgCheck, - // imgIconSelected: this.imgCheckSelected, - // isSelected: false, - // ), - // ], - // ), - // ), - // Container( - // width: double.infinity, - // height: 0.5, - // color: Color(0xffececec), - // ), - // Container( - // height: 44, - // child: Row( - // children: [ - // Expanded( - // child: GestureDetector( - // child: Container( - // color: Colors.transparent, - // child: GoodsShareCheckButton( - // '编辑模版', - // isSelected: true, - // ), - // ), - // onTap: onEditorClick, - // ), - // ), - // Container( - // width: 0.5, - // height: 20, - // color: Color(0xffececec), - // ), - // Expanded( - // child: GestureDetector( - // child: Container( - // color: Colors.transparent, - // child: GoodsShareCheckButton( - // '复制文案', - // isSelected: false, - // ), - // ), - // onTap: onCopyClick, - // ), - // ), - // ], - // ), - // ) + Container( + padding: + const EdgeInsets.only(left: 16, top: 6, bottom: 6, right: 16), + width: double.infinity, + child: Wrap( + spacing: 10, + runSpacing: 6, + children: widgets, + ), + ), + Container( + width: double.infinity, + height: 0.5, + color: Color(0xffececec), + ), + Container( + height: 44, + child: Row( + children: [ + Expanded( + child: GestureDetector( + child: Container( + color: Colors.transparent, + child: GoodsShareCheckButton( + '编辑模版', + isSelected: true, + ), + ), + onTap: widget.onEditorClick, + ), + ), + Container( + width: 0.5, + height: 20, + color: Color(0xffececec), + ), + Expanded( + child: GestureDetector( + child: Container( + color: Colors.transparent, + child: GoodsShareCheckButton( + '复制文案', + isSelected: false, + ), + ), + onTap: widget.onCopyClick, + ), + ), + ], + ), + ) ], ), ); diff --git a/lib/template/goods_share_template/goods_share_template.dart b/lib/template/goods_share_template/goods_share_template.dart index cd08192..17377b0 100644 --- a/lib/template/goods_share_template/goods_share_template.dart +++ b/lib/template/goods_share_template/goods_share_template.dart @@ -1,12 +1,24 @@ +import 'dart:convert' as convert; + import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; +import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_poster_model.dart'; +import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_poster_style_model.dart'; +import 'package:zhiying_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart'; import 'package:zhiying_comm/zhiying_comm.dart'; // 商品详情分享,合成模板 class GoodsShareTemplate extends StatelessWidget { final GlobalKey contentKey; + final GoodsSharePosterModel model; + GoodsSharePosterStyleModel _style; - const GoodsShareTemplate({Key key, this.contentKey}) : super(key: key); + GoodsShareTemplate(this.model, {Key key, this.contentKey}) : super(key: key) { + String data = model.style; + Map json = + Map.from(convert.jsonDecode(data)); + _style = GoodsSharePosterStyleModel.fromJson(json); + } @override Widget build(BuildContext context) { @@ -35,18 +47,16 @@ class GoodsShareTemplate extends StatelessWidget { Widget _createHeader() { return Row( children: [ - Container( - width: 30, - height: 30, - decoration: BoxDecoration( - color: Colors.redAccent, borderRadius: BorderRadius.circular(15)), - ), Expanded( child: Container( margin: EdgeInsets.only(left: 10, right: 10), height: 30, width: 80, - color: Colors.redAccent, + child: CachedNetworkImage( + alignment: Alignment.centerLeft, + fit: BoxFit.fitHeight, + imageUrl: _style?.applogImg ?? '', + ), ), ), Container( @@ -55,7 +65,7 @@ class GoodsShareTemplate extends StatelessWidget { color: Color(0xfff7f7f7), borderRadius: BorderRadius.circular(30)), child: Text( - '邀请码 SDWE45', + '邀请码 ' + (model?.inviteCode ?? ''), style: TextStyle(fontSize: 11, fontWeight: FontWeight.bold), ), ) @@ -71,10 +81,12 @@ class GoodsShareTemplate extends StatelessWidget { aspectRatio: 1, child: Container( width: double.infinity, - child: CachedNetworkImage( - imageUrl: - 'https://img.alicdn.com/bao/uploaded/i1/2200818126974/O1CN01HvqWcg21O8mq9EPwf_!!0-item_pic.jpg_500x500.jpg', - fit: BoxFit.fitWidth, + child: ClipRRect( + borderRadius: BorderRadius.circular(12), + child: CachedNetworkImage( + imageUrl: model.posterImage, + fit: BoxFit.fitWidth, + ), ), // color: Colors.redAccent, ), @@ -109,10 +121,7 @@ class GoodsShareTemplate extends StatelessWidget { width: 124, height: 124, // color: Colors.redAccent, - child: CachedNetworkImage( - imageUrl: - 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1410436569,3239963707&fm=26&gp=0.jpg', - ), + child: Image.memory(convert.base64Decode(model.qrcode)), ), Container( child: Row( @@ -120,8 +129,9 @@ class GoodsShareTemplate extends StatelessWidget { Container( width: 14, height: 16, - color: Colors.redAccent, - margin: EdgeInsets.only(right: 4), + child: CachedNetworkImage( + imageUrl: _style?.fingerprintImg ?? '', + ), ), Text( '长按识别领取优惠', @@ -146,7 +156,7 @@ class GoodsShareTemplate extends StatelessWidget { padding: EdgeInsets.only(left: 2, right: 2, top: 3, bottom: 3), margin: EdgeInsets.only(right: 4), child: Text( - '淘宝', + model?.provider ?? '', style: TextStyle( fontSize: 9, height: 1, @@ -158,7 +168,7 @@ class GoodsShareTemplate extends StatelessWidget { ), )); list.add(TextSpan( - text: '小米10至尊纪念版5g手机120X变焦骁龙865小米官方旗舰店小米手机', + text: model?.title ?? '', style: TextStyle( fontSize: 14, color: HexColor.fromHex('#333333'), @@ -210,7 +220,7 @@ class GoodsShareTemplate extends StatelessWidget { borderRadius: BorderRadius.circular(2.5), ), child: Text( - '700元券', + model.coupon + '元券', textAlign: TextAlign.center, maxLines: 1, style: TextStyle( @@ -231,7 +241,7 @@ class GoodsShareTemplate extends StatelessWidget { return Padding( padding: EdgeInsets.only(bottom: 2), child: Text( - '¥5999', + '¥' + (model?.marketPrice ?? ''), style: TextStyle( fontSize: 11, height: 1, @@ -260,7 +270,7 @@ class GoodsShareTemplate extends StatelessWidget { ), ), TextSpan( - text: '5299', + text: model.couponPrice, style: TextStyle( fontSize: 20, color: HexColor.fromHex('#ff4242'), diff --git a/lib/widgets/share/models/share_data_model.dart b/lib/widgets/share/models/share_data_model.dart index 1e001de..6b9969e 100644 --- a/lib/widgets/share/models/share_data_model.dart +++ b/lib/widgets/share/models/share_data_model.dart @@ -1,7 +1,10 @@ +import 'dart:typed_data'; + class ShareDataModel { String title; String content; - List image; + Uint8List poster; // 海报 + List image; // 图片地址列表 String url; ShareDataModel({ @@ -9,5 +12,6 @@ class ShareDataModel { this.content, this.image, this.url, + this.poster, }); } diff --git a/lib/widgets/share/share_alert.dart b/lib/widgets/share/share_alert.dart index a152492..882db39 100644 --- a/lib/widgets/share/share_alert.dart +++ b/lib/widgets/share/share_alert.dart @@ -63,10 +63,10 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { void initState() { NetUtil.request('/api/v1/mod/${widget.skipIdentifier}', method: NetMethod.GET, onCache: (data) { - _parseData(data); - }, onSuccess: (data) { - _parseData(data); - }, onError: (err) {}); + _parseData(data); + }, onSuccess: (data) { + _parseData(data); + }, onError: (err) {}); super.initState(); } @@ -118,7 +118,7 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { ), Container( margin: - EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10), + EdgeInsets.only(left: 12, right: 12, top: 10, bottom: 10), child: _createIcons(), ), GestureDetector( @@ -213,27 +213,70 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { } void _shareByMob(ShareSDKPlatform plateform) async { - // dynamic image; - if (widget.model.image != null && widget.model.image.length > 1) { + int count = 0; + if (widget.model.poster != null) { + count++; + } + count += (widget.model?.image?.length ?? 0); + // 多图分享 + if (count > 1) { _shareMultipleImages(); return; } + SSDKMap params; + if (widget.model.poster != null) { + // 检查并请求权限 + // PermissionStatus status = await PermissionHandler().checkPermissionStatus( + // PermissionGroup.storage); + // if (PermissionStatus.granted != status) { + // PermissionHandler().requestPermissions([ + // PermissionGroup.storage, + // ]); + // } + + // final result = await ImageGallerySaver.saveImage(widget.model.poster); - //单独公共分享 - SSDKMap params = SSDKMap() - ..setGeneral( - widget.model.title, - widget.model.content, - widget.model.image, - null, - null, - widget.model.url, - null, - null, - null, - null, - SSDKContentTypes.auto, - ); + // var appDocDir = await getTemporaryDirectory(); + // String savePath = appDocDir.path + "/temp.mp4"; + // await Dio().download( + // "http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4", savePath); + // final result = await ImageGallerySaver.saveFile(savePath); + // print(result); + // List paths = await ImageDownloadUtil.download([ + // 'https://upload-images.jianshu.io/upload_images/19714621-fe7d422703eb7e70.jpeg?imageMogr2/auto-orient/strip|imageView2/1/w/360/h/240' + // ]); + // params = SSDKMap() + // ..setGeneral( + // widget.model.title, + // widget.model.content, + // [ + // 'https://upload-images.jianshu.io/upload_images/19714621-fe7d422703eb7e70.jpeg?imageMogr2/auto-orient/strip|imageView2/1/w/360/h/240' + // ], + // null, + // null, + // widget.model.url, + // null, + // null, + // null, + // null, + // SSDKContentTypes.auto, + // ); + } else { + params = SSDKMap() + ..setGeneral( + widget.model.title, + widget.model.content, + widget.model.image, + null, + null, + widget.model.url, + null, + null, + null, + null, + SSDKContentTypes.auto, + ); + } SharesdkPlugin.share(plateform, params, (SSDKResponseState state, Map userdata, Map contentEntity, SSDKError error) {