Skip to content

Commit

Permalink
Merge pull request #28 from hacktons/f-prepare-release
Browse files Browse the repository at this point in the history
Changelog update
  • Loading branch information
avenwu committed Feb 12, 2020
2 parents ec7e110 + 7687e64 commit 45020de
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.0.2]

* Add new config parameter for initial active index;

## [2.0.1]

* Update usage instructions in README.md;
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Scaffold(
TabItem(icon: Icons.message, title: 'Message'),
TabItem(icon: Icons.people, title: 'Profile'),
],
initialActiveIndex: 2,//optional, default as 0
onTap: (int i) => print('click index=$i'),
)
);
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: convex_bottom_bar
description: A Flutter package which implements a ConvexAppBar to show a convex tab in the bottom bar. Theming supported.
version: 2.0.1
version: 2.0.2
homepage: https://github.com/hacktons/convex_bottom_bar

environment:
Expand Down
16 changes: 16 additions & 0 deletions test/widget_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:convex_bottom_bar/convex_bottom_bar.dart';
import 'package:convex_bottom_bar/src/style/blend_image_icon.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

Expand Down Expand Up @@ -192,6 +193,21 @@ void main() {
assert(true, e.toString().contains('provide custom buidler'));
}
});
test('test invalid initialActiveIndex', () {
try {
ConvexAppBar.builder(
itemBuilder: null,
count: 3,
initialActiveIndex: 3,
top: -20,
onTap: (i) {
assert(i == 1);
},
);
} catch (e) {
assert(true, e.toString().contains('initial index should'));
}
});
}

class Builder extends DelegateBuilder {
Expand Down

0 comments on commit 45020de

Please sign in to comment.