Skip to content

Commit

Permalink
update : 支持空安全检查
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh.Lu committed Mar 30, 2022
1 parent ede3c70 commit ef1a9cd
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 177 deletions.
9 changes: 3 additions & 6 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 20 additions & 52 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,20 @@
## 3.2.0

1.更新pub依赖以及flutter版本2.10.1

## 3.1.0

1.更新pub依赖以及flutter版本
2.更新photo_view到0.12.0

## 3.0.0

1.更新pub依赖以及flutter版本
2.更新cached_network_image至3.0.0

## 2.0.0

1.更新pub依赖以及flutter版本
2.支持图片加载失败自定义显示

## 1.3.4

1.更新pub依赖以及flutter版本

## 1.3.3

1.修复相同图片地址Hero动画tag相同问题


## 1.3.2

1.图片Hero动画相同地址不能加载

2.修复Hero动画黑屏显示

## 1.3.1

1.图片长按回调图片位置

2.修复图片显示错位bug

## 1.3.0

1.增加查看图片长按事件回调

2.支持自定义加载框,以及更多图片文字样式


## 1.2.0

1.适配屏幕宽高显示

2.支持动态显示9+以上图片
## Version 3.2.1
1. Update pub dependency and fluent version 2.10.1

2. Fix the same picture address hero animation tag problem

3. The same address of the picture hero animation cannot be loaded

4. Fix the black screen display of hero animation

5. Long press the picture to recall the picture position

6. Fix the image display dislocation bug

7. Add long press event callback for viewing pictures

8. Support custom loading box and more picture text styles

9. Adapt to screen width and height display

10. Support dynamic picture display
54 changes: 11 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,67 +14,35 @@
```
dependencies:
...
nineold: ^3.2.0
nineold: ^3.2.1
```

关于如何运行flutter项目, 参考官方文档[documentation](https://flutter.io/).



# 版本更新
## 3.2.0
## 3.2.1

1.更新pub依赖以及flutter版本2.10.1

## 3.1.0
2.修复相同图片地址Hero动画tag相同问题

1.更新pub依赖以及flutter版本
2.更新photo_view到0.12.0
3.图片Hero动画相同地址不能加载

## 3.0.0
4.修复Hero动画黑屏显示

1.更新pub依赖以及flutter版本
2.更新cached_network_image至3.0.0
5.图片长按回调图片位置

## 2.0.0
6.修复图片显示错位bug

1.更新pub依赖以及flutter版本
2.支持图片加载失败自定义显示
7.增加查看图片长按事件回调

8.支持自定义加载框,以及更多图片文字样式

## 1.3.4

1.更新pub依赖以及flutter版本

## 1.3.3

1.修复相同图片地址Hero动画tag相同问题

## 1.3.2

1.图片Hero动画相同地址不能加载

2.修复Hero动画黑屏显示

## 1.3.1

1.图片长按回调图片位置

2.修复图片显示错位bug

## 1.3.0

1.增加查看图片长按事件回调

2.支持自定义加载框,以及更多图片文字样式


## 1.2.0

1.适配屏幕宽高显示

2.支持动态显示9+以上图片
9.适配屏幕宽高显示

10.支持动态显示9+以上图片

# 使用方法

Expand Down
11 changes: 2 additions & 9 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.2.0"
version: "3.2.1"
octo_image:
dependency: transitive
description:
Expand Down Expand Up @@ -324,13 +324,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.8"
transparent_image:
dependency: transitive
description:
name: transparent_image
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -368,4 +361,4 @@ packages:
version: "0.2.0"
sdks:
dart: ">=2.14.0 <3.0.0"
flutter: ">=1.24.0-10.2.pre"
flutter: ">=2.0.4"
11 changes: 5 additions & 6 deletions lib/loader/image_with_loader.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import 'package:cached_network_image/cached_network_image.dart';
import "package:flutter/material.dart";
import 'package:transparent_image/transparent_image.dart';

class ImageWithLoader extends StatelessWidget {
const ImageWithLoader(
{@required this.url,
@required this.backgroundColor,
@required this.strokeWidth,
@required this.valueColor,
this.errorWidget,
{required this.url,
required this.backgroundColor,
required this.strokeWidth,
required this.valueColor,
required this.errorWidget,
this.fit = BoxFit.cover,
this.loaderSize = 48.0});

Expand Down
28 changes: 11 additions & 17 deletions lib/watcher/gallery_watcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@ typedef OnLongPressCallback = void Function(int position);

class GalleryPhotoViewWrapper extends StatefulWidget {
GalleryPhotoViewWrapper({
this.loadingBuilder,
this.backgroundDecoration,
this.minScale,
this.maxScale,
this.initialIndex,
@required this.thumbGalleryItems,
@required this.tagItems,
this.originGalleryItems,
required this.backgroundDecoration,
required this.initialIndex,
required this.thumbGalleryItems,
required this.tagItems,
required this.originGalleryItems,
this.scrollDirection = Axis.horizontal,
this.onLongPressListener,
required this.onLongPressListener,
}) : pageController = PageController(initialPage: initialIndex);

final LoadingBuilder loadingBuilder;
final Decoration backgroundDecoration;
final dynamic minScale;
final dynamic maxScale;
final int initialIndex;
final PageController pageController;
final List<String> thumbGalleryItems;
Expand All @@ -39,7 +33,7 @@ class GalleryPhotoViewWrapper extends StatefulWidget {
}

class _GalleryPhotoViewWrapperState extends State<GalleryPhotoViewWrapper> {
int currentIndex;
late int currentIndex;

@override
void initState() {
Expand Down Expand Up @@ -68,8 +62,9 @@ class _GalleryPhotoViewWrapperState extends State<GalleryPhotoViewWrapper> {
scrollPhysics: const BouncingScrollPhysics(),
builder: _buildItem,
itemCount: widget.thumbGalleryItems.length,
loadingBuilder: widget.loadingBuilder,
backgroundDecoration: widget.backgroundDecoration,
backgroundDecoration: BoxDecoration(
color: Colors.black,
),
pageController: widget.pageController,
onPageChanged: onPageChanged,
scrollDirection: widget.scrollDirection,
Expand Down Expand Up @@ -112,8 +107,7 @@ class _GalleryPhotoViewWrapperState extends State<GalleryPhotoViewWrapper> {

PhotoViewGalleryPageOptions _buildItem(BuildContext context, int index) {
String item = "";
if (null == widget.originGalleryItems ||
widget.originGalleryItems.length == 0) {
if (widget.originGalleryItems.length == 0) {
item = widget.thumbGalleryItems[index];
} else {
item = widget.originGalleryItems[index];
Expand Down
Loading

0 comments on commit ef1a9cd

Please sign in to comment.