图片查看
This commit is contained in:
parent
36af3eb367
commit
5c6e2a573f
@ -161,7 +161,6 @@
|
|||||||
F8A7AFE61E77B491119ECA54 /* Pods-RunnerTests.release.xcconfig */,
|
F8A7AFE61E77B491119ECA54 /* Pods-RunnerTests.release.xcconfig */,
|
||||||
2502563898FB261B809E8C44 /* Pods-RunnerTests.profile.xcconfig */,
|
2502563898FB261B809E8C44 /* Pods-RunnerTests.profile.xcconfig */,
|
||||||
);
|
);
|
||||||
name = Pods;
|
|
||||||
path = Pods;
|
path = Pods;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@ -471,7 +470,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = Z2Z2H7XT5K;
|
DEVELOPMENT_TEAM = 8DQD6BV6H9;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
@ -654,7 +653,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = Z2Z2H7XT5K;
|
DEVELOPMENT_TEAM = 8DQD6BV6H9;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
@ -677,7 +676,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = Z2Z2H7XT5K;
|
DEVELOPMENT_TEAM = 8DQD6BV6H9;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
|||||||
@ -2,6 +2,10 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:wallpaper/models/imgnetodel.dart';
|
import 'package:wallpaper/models/imgnetodel.dart';
|
||||||
|
|
||||||
|
import 'package:photo_view/photo_view.dart';
|
||||||
|
import 'package:photo_view/photo_view_gallery.dart';
|
||||||
|
|
||||||
|
|
||||||
class ImgScanPageView extends GetView {
|
class ImgScanPageView extends GetView {
|
||||||
final NetImgCategory dataModel;
|
final NetImgCategory dataModel;
|
||||||
final int currentIndex;
|
final int currentIndex;
|
||||||
@ -14,9 +18,39 @@ class ImgScanPageView extends GetView {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text("查看大图"),
|
title: const Text("查看大图"),
|
||||||
),
|
),
|
||||||
body: const Center(
|
body: Container(
|
||||||
child: Text("下载的..."),
|
child: PhotoViewGallery.builder(
|
||||||
),
|
scrollPhysics: const BouncingScrollPhysics(),
|
||||||
|
builder: (BuildContext context, int index) {
|
||||||
|
return PhotoViewGalleryPageOptions(
|
||||||
|
imageProvider: NetworkImage(dataModel.data![index].original!),
|
||||||
|
initialScale: PhotoViewComputedScale.contained * 0.8,
|
||||||
|
minScale: PhotoViewComputedScale.contained*0.4,
|
||||||
|
maxScale: PhotoViewComputedScale.contained * 4,
|
||||||
|
// heroAttributes: PhotoViewHeroAttributes(tag: galleryItems[index].id),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: dataModel.data!.length,
|
||||||
|
loadingBuilder: (context, event) => Center(
|
||||||
|
child: Container(
|
||||||
|
width: 20.0,
|
||||||
|
height: 20.0,
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
value: event == null
|
||||||
|
? 0
|
||||||
|
: event.cumulativeBytesLoaded / event.expectedTotalBytes!,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// backgroundDecoration: widget.backgroundDecoration,
|
||||||
|
// pageController: widget.pageController,
|
||||||
|
onPageChanged: onPageChanged,
|
||||||
|
)
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onPageChanged(int index){
|
||||||
|
print("点击了图片....");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -232,6 +232,14 @@ packages:
|
|||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.9.0"
|
||||||
|
photo_view:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: photo_view
|
||||||
|
sha256: "1fc3d970a91295fbd1364296575f854c9863f225505c28c46e0a03e48960c75e"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "0.15.0"
|
||||||
plugin_platform_interface:
|
plugin_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -43,6 +43,9 @@ dependencies:
|
|||||||
# 加载、进度、提示框
|
# 加载、进度、提示框
|
||||||
flutter_easyloading: ^3.0.5
|
flutter_easyloading: ^3.0.5
|
||||||
|
|
||||||
|
#图片查看浏览器
|
||||||
|
photo_view: ^0.15.0
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.6
|
cupertino_icons: ^1.0.6
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user