Pārlūkot izejas kodu

1.增加图片预览组件

tags/0.0.2+1
杨华轩 pirms 4 gadiem
vecāks
revīzija
3ed60e08ea
5 mainītis faili ar 348 papildinājumiem un 80 dzēšanām
  1. +98
    -80
      .dart_tool/package_config.json
  2. +14
    -0
      example/lib/main.dart
  3. +231
    -0
      lib/util/photo_preview/photo_preview.dart
  4. +1
    -0
      lib/zhiying_comm.dart
  5. +4
    -0
      pubspec.yaml

+ 98
- 80
.dart_tool/package_config.json Parādīt failu

@@ -3,475 +3,493 @@
"packages": [
{
"name": "archive",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/archive-2.0.13",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.12",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "convert",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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+9",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/device_info-0.4.2+10",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/equatable-1.2.5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "ffi",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/ffi-0.1.3",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "flutter_alibc",
"rootUri": "file:///Users/fnuser/.pub-cache/git/zhiying_flutter_alibc-6e02aaf22b9798f4b01554a9153d2c66591da8c1/",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/git/zhiying_flutter_alibc-ba413f84090cd58b8b769ca43ff3ef65a0e53274/",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "flutter_bloc",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_bloc-4.0.1",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_cache_manager-1.4.2",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "flutter_native_image",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_native_image-0.0.5+2",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_native_image-0.0.5+3",
"packageUri": "lib/",
"languageVersion": "1.19"
},
{
"name": "flutter_screenutil",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-1.1.0",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_screenutil-1.1.0",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "flutter_test",
"rootUri": "file:///Users/fnuser/Documents/flutter-sdk/packages/flutter_test",
"rootUri": "file:///Users/fnuser02/flutter/packages/flutter_test",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "flutter_update_dialog",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_update_dialog-1.0.0",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "flutter_web_plugins",
"rootUri": "file:///Users/fnuser/Documents/flutter-sdk/packages/flutter_web_plugins",
"rootUri": "file:///Users/fnuser02/flutter/packages/flutter_web_plugins",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "flutter_xupdate",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/git/flutter_xupdate-d17c695461ee4588dec990533d7467c11884cd0f/",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "fluttertoast",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/fluttertoast-4.0.1",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/image-2.1.12",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "intl",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/intl-0.16.1",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/package_info-0.4.3+2",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.4",
"rootUri": "file:///Users/fnuser02/flutter/.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.21",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider-1.6.24",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider_macos-0.0.4+6",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider_platform_interface-1.0.4",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider_windows-0.0.4+3",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "pedantic",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/pedantic-1.9.0",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/pedantic-1.9.0",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "petitparser",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/petitparser-2.4.0",
"packageUri": "lib/",
"languageVersion": "2.4"
},
{
"name": "photo_view",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/photo_view-0.10.2",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "platform",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/platform-2.2.1",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/provider-4.3.2+2",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "quiver",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/quiver-2.1.3",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/rxdart-0.24.1",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "shared_preferences",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.5.12+2",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.5.12+4",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_linux-0.0.2+4",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_macos-0.0.1+11",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences_windows-0.0.1+3",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "shimmer",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/shimmer-1.1.2",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/shimmer-1.1.2",
"packageUri": "lib/",
"languageVersion": "1.20"
},
{
"name": "sky_engine",
"rootUri": "file:///Users/fnuser/Documents/flutter-sdk/bin/cache/pkg/sky_engine",
"rootUri": "file:///Users/fnuser02/flutter/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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/sqflite-1.3.1+2",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.5",
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "synchronized",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/synchronized-2.2.0+2",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/synchronized-2.2.0+2",
"packageUri": "lib/",
"languageVersion": "2.8"
},
{
"name": "term_glyph",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.15",
"packageUri": "lib/",
"languageVersion": "2.4"
},
{
"name": "typed_data",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6",
"rootUri": "file:///Users/fnuser02/flutter/.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.4",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/url_launcher-5.7.6",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_linux-0.0.1+4",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_macos-0.0.1+9",
"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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_windows-0.0.1+3",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "uuid",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/uuid-2.2.2",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.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",
"rootUri": "file:///Users/fnuser02/flutter/.pub-cache/hosted/pub.flutter-io.cn/xml-3.6.1",
"packageUri": "lib/",
"languageVersion": "2.6"
},
@@ -482,7 +500,7 @@
"languageVersion": "2.1"
}
],
"generated": "2020-10-17T07:39:42.872292Z",
"generated": "2020-11-12T02:35:06.599944Z",
"generator": "pub",
"generatorVersion": "2.8.2"
}

+ 14
- 0
example/lib/main.dart Parādīt failu

@@ -192,6 +192,20 @@ class HomePage extends StatelessWidget {
},
child: Text('打印日志'),
),
RaisedButton(
onPressed: () async {
List<PreviewImageData> previewImageDatas = List();
for (var index = 0; index < 5; index++) {
previewImageDatas.add(PreviewImageData(
previewImageType: PreviewImageType.netUrl,
data:
"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1604924972652&di=2849a989df574db3fbb7a8994ea87fc3&imgtype=0&src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2Fc%2F574420055d0b9.jpg"));
}

PhotoPreview.showPhotoPreview(context, previewImageDatas,currentIndex: 0);
},
child: Text('预览图片'),
),
],
),
),


+ 231
- 0
lib/util/photo_preview/photo_preview.dart Parādīt failu

@@ -0,0 +1,231 @@
import 'dart:io';
import 'package:flutter/material.dart';

import 'package:photo_view/photo_view.dart';
import 'package:photo_view/photo_view_gallery.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

///图片预览控件
class PhotoPreview extends StatefulWidget {
List<PreviewImageData> previewImageDatas;
int index;

PhotoPreview({Key key, this.previewImageDatas, this.index = 0})
: super(key: key);

PhotoPreview._showPhotoViewByData(
{Key key, this.previewImageDatas, this.index})
: super(key: key);

PhotoPreview._showPhotoViewByImages(
{Key key, List<String> images, this.index})
: super(key: key) {
if (images != null) {
previewImageDatas = List();
for (var img in images) {
previewImageDatas.add(PreviewImageData(
previewImageType: PreviewImageType.netUrl, data: img));
}
}
}

///显示类型的一些预览
static showPhotoPreview(
BuildContext context, List<PreviewImageData> previewImageDatas,
{int currentIndex = 0}) {
Navigator.of(context).push(new FadeRoute(
page: PhotoPreview._showPhotoViewByData(
previewImageDatas: previewImageDatas,
index: currentIndex,
)));
}

///显示仅仅是一组list<String>类型的图片预览
static showPhotoPreviewByimages(BuildContext context, List<String> images,
{int currentIndex = 0}) {
Navigator.of(context).push(new FadeRoute(
page: PhotoPreview._showPhotoViewByImages(
images: images,
index: currentIndex,
)));
}

@override
_PhotoPreviewState createState() => _PhotoPreviewState();
}

class _PhotoPreviewState extends State<PhotoPreview> {
PageController pageController;

@override
void initState() {
pageController = PageController(keepPage: true, initialPage: widget.index);
super.initState();
}

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
body: PhotoViewGalleryScreen(
images: widget.previewImageDatas,
index: widget.index,
controller: pageController,
heroTag: "",
));
}
}

///图片预览数据
class PreviewImageData {
PreviewImageType previewImageType;
String data;
bool isSelect;
String tag;

PreviewImageData(
{this.previewImageType, this.data, this.isSelect = false, this.tag});
}

///预览类型
enum PreviewImageType {
netUrl,

///网络图片
filePath

///本地文件路径
}

class PhotoViewGalleryScreen extends StatefulWidget {
List<PreviewImageData> images = [];
int index = 0;
String heroTag;
PageController controller;

PhotoViewGalleryScreen(
{Key key,
@required this.images,
this.index,
this.controller,
this.heroTag})
: super(key: key) {
controller = PageController(initialPage: index);
}

@override
_PhotoViewGalleryScreenState createState() => _PhotoViewGalleryScreenState();
}

class _PhotoViewGalleryScreenState extends State<PhotoViewGalleryScreen> {
int currentIndex = 0;

@override
void initState() {
// TODO: implement initState
super.initState();
currentIndex = widget.index;
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Container(
color: Colors.black,
child: PhotoViewGallery.builder(
scrollPhysics: const BouncingScrollPhysics(),
builder: (BuildContext context, int index) {
return PhotoViewGalleryPageOptions(
imageProvider: _buildPage(context, index),
heroAttributes: widget.heroTag.isNotEmpty
? PhotoViewHeroAttributes(tag: widget.heroTag)
: null,
);
},
itemCount: widget.images.length,
loadFailedChild: Container(
child: Text("加载失败"),
),
backgroundDecoration: BoxDecoration(color: Colors.black),
pageController: widget.controller,
enableRotation: true,
onPageChanged: (index) {
setState(() {
currentIndex = index;
});
},
)),
),
Positioned(
//图片index显示
top: MediaQuery.of(context).padding.top + 15,
width: MediaQuery.of(context).size.width,
child: Container(
child: Center(
child: Text("${currentIndex + 1}/${widget.images.length}",
style: TextStyle(color: Colors.white, fontSize: 16)),
),
),
),
Positioned(
//右上角关闭按钮
right: 10,
top: MediaQuery.of(context).padding.top,
child: IconButton(
icon: Icon(
Icons.close,
size: 30,
color: Colors.white,
),
onPressed: () {
Navigator.of(context).pop();
},
),
),
],
),
);
}

ImageProvider _buildPage(BuildContext context, int index) {
var item = widget.images[index];
if (item.previewImageType == PreviewImageType.netUrl) {
return CachedNetworkImageProvider(item.data);
} else if (item.previewImageType == PreviewImageType.filePath) {
return Image.file(File(item.data)).image;
}
}
}

class FadeRoute extends PageRouteBuilder {
final Widget page;

FadeRoute({this.page})
: super(
pageBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
) =>
page,
transitionsBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child,
) =>
ScaleTransition(
scale: animation,
child: FadeTransition(
opacity: animation,
child: child,
),
),
);
}

+ 1
- 0
lib/zhiying_comm.dart Parādīt failu

@@ -33,4 +33,5 @@ export 'util/taobao/taobao_loader.dart';
export 'util/widget_creater.dart';
export 'util/widget_factory.dart';
export 'package:cached_network_image/cached_network_image.dart';
export 'util/photo_preview/photo_preview.dart';


+ 4
- 0
pubspec.yaml Parādīt failu

@@ -44,6 +44,10 @@ dependencies:
ref: 0.0.3
url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_flutter_alibc.git
url_launcher: ^5.6.0
#图片预览控件
photo_view: ^0.10.2




dev_dependencies:


Notiek ielāde…
Atcelt
Saglabāt