Skip to content

Commit

Permalink
update : 支持flutter 2.0版本
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh.Lu committed Mar 24, 2021
1 parent b72b06b commit c3a1d6d
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 160 deletions.
1 change: 1 addition & 0 deletions .idea/vcs.xml

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

41 changes: 31 additions & 10 deletions .idea/workspace.xml

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

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.0

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

## 1.3.4

1.更新pub依赖以及flutter版本
Expand Down
79 changes: 44 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@
```
dependencies:
...
nineold: ^1.3.4
nineold: ^2.0.0
```

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


# 版本更新
## 2.0.0

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


## 1.3.4

Expand Down Expand Up @@ -103,39 +108,42 @@ class _MyHomePageState extends State<MyHomePage> {
}
Widget _buildActiveItem(int index, List<String> photos) {
return Container(
margin: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_buildActiveItemHeader(index),
null != photos || photos.isNotEmpty
? NineOldWidget(
images: photos,
//必填
onLongPressListener: (position) {
//可选
//长按事件回调
print("长按事件回调当前位置 : $position");
},
backgroundColor: Colors.white,
//可选
//加载背景颜色
valueColor: Colors.red,
//可选
//加载进度条颜色
strokeWidth: 4,
//可选
//加载进度条宽度
moreStyle:
TextStyle(fontSize: 28, color: Colors.orange), //更多加号样式
)
: SizedBox()
],
),
);
}
return Container(
margin: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_buildActiveItemHeader(index),
null != photos || photos.isNotEmpty
? NineOldWidget(
images: photos,
//必填
onLongPressListener: (position) {
//可选
//长按事件回调
print("长按事件回调当前位置 : $position");
},
backgroundColor: Colors.white,
//可选
//加载背景颜色
valueColor: Colors.red,
//可选
//加载进度条颜色
strokeWidth: 4,
//可选
//加载进度条宽度
moreStyle:
TextStyle(fontSize: 28, color: Colors.orange), //更多加号样式
//可选
//资源加载失败显示
errorWidget: Icon(Icons.error_outline_rounded),
)
: SizedBox()
],
),
);
}
Widget _buildActiveItemHeader(int index) {
return Container(
Expand Down Expand Up @@ -211,7 +219,8 @@ NineOldWidget控件构造方法以及参数设置
this.backgroundColor = Colors.white,
this.strokeWidth = 3,
this.valueColor = Colors.tealAccent,
this.onLongPressListener});
this.onLongPressListener,
this.errorWidget});
```


Expand Down
3 changes: 3 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class _MyHomePageState extends State<MyHomePage> {
//加载进度条宽度
moreStyle:
TextStyle(fontSize: 28, color: Colors.orange), //更多加号样式
//可选
//资源加载失败显示
errorWidget: Icon(Icons.error_outline_rounded),
)
: SizedBox()
],
Expand Down
Loading

0 comments on commit c3a1d6d

Please sign in to comment.