Skip to content

Commit

Permalink
v1.0.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Sky24n committed Jul 9, 2020
1 parent 9a812ec commit 81cd4fe
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.5

* TODO: space param support QQ Group.

## 1.0.3

* TODO: add QQ Group avatar effects.
Expand Down
2 changes: 1 addition & 1 deletion README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Language: [English](https://github.com/flutterchina/nine_grid_view) | 中文简
### Pub
```yaml
dependencies:
nine_grid_view: ^1.0.3
nine_grid_view: ^1.0.5
```
### Example
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Similar to Weibo/WeChat release dynamic picture selection nine grid view. Suppor
### Pub
```yaml
dependencies:
nine_grid_view: ^1.0.3
nine_grid_view: ^1.0.5
```
### Example
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class _HomePageState extends State<HomePage> {
margin: EdgeInsets.all(5),
alignment: Alignment.center,
space: 2,
arcAngle: 60,
//arcAngle: 60,
type: _gridType,
decoration: _gridType == NineGridType.dingTalkGp ? null : decoration,
itemCount: i % total + 1,
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.3"
version: "1.0.5"
path:
dependency: transitive
description:
Expand Down
16 changes: 11 additions & 5 deletions lib/src/nine_grid_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class NineGridView extends StatefulWidget {
Key key,
this.width,
this.height,
this.space: 3,
this.arcAngle: 60,
this.space: 2,
this.arcAngle: 0,
this.initIndex: 1,
this.padding: EdgeInsets.zero,
this.margin: EdgeInsets.zero,
Expand Down Expand Up @@ -78,7 +78,7 @@ class NineGridView extends StatefulWidget {
/// The number of logical pixels between each child.
final double space;

/// QQ group arc angle (0 ~ 180). def 60.
/// QQ group arc angle (0 ~ 180).
final double arcAngle;

/// QQ group init index (0 or 1). def 1.
Expand Down Expand Up @@ -371,6 +371,7 @@ class _NineGridViewState extends State<NineGridView> {
previousY: previousY,
degree: degree,
arcAngle: widget.arcAngle,
space: widget.space,
),
child: widget.itemBuilder(context, i),
),
Expand Down Expand Up @@ -503,7 +504,8 @@ class QQClipper extends CustomClipper<Path> {
this.previousX,
this.previousY,
this.degree,
this.arcAngle: 60,
this.arcAngle: 0,
this.space,
}) : assert(arcAngle != null && arcAngle >= 0 && arcAngle <= 180);

final int total;
Expand All @@ -513,6 +515,7 @@ class QQClipper extends CustomClipper<Path> {
final double previousY;
final double degree;
final double arcAngle;
final double space;

@override
Path getClip(Size size) {
Expand All @@ -523,7 +526,10 @@ class QQClipper extends CustomClipper<Path> {
if (total == 2 && index == initIndex) {
path.addOval(Rect.fromLTRB(0, 0, size.width, size.height));
} else {
double spaceA = arcAngle / 2;
/// arcAngle and space, prefer to use arcAngle.
double spaceA = arcAngle > 0
? (arcAngle / 2)
: (math.acos((r - math.min(r, space)) / r) / math.pi * 180);
double startA = degree + spaceA;
double endA = degree - spaceA;
for (double i = startA; i <= 360 + endA; i = i + 1) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: nine_grid_view
description: Flutter NineGridView & DragSortView, Similar to Weibo / WeChat nine grid view controls to display pictures.
version: 1.0.3
version: 1.0.5
author: Sky24n <[email protected]>
homepage: https://github.com/flutterchina/nine_grid_view

Expand Down

0 comments on commit 81cd4fe

Please sign in to comment.