|
1 | 1 | # BannerGalleryInFlutter |
2 | | -It's an infinity banner gallery widget in flutter. |
| 2 | +用Flutter实现的无限滑动Banner。 |
3 | 3 |
|
4 | | - |
| 4 | + |
| 5 | + |
| 6 | +可配置的属性 |
| 7 | +|参数名|参数说明| |
| 8 | +|-----|--------| |
| 9 | +|customViewPageItemWidget|自定义内容布局| |
| 10 | +|autoScrollDurationSeconds|自动滑动时间间隔[单位s]| |
| 11 | +|bannerScrollDirection|Banner滑动方向[水平/垂直]| |
| 12 | +|bannerMargin|Banner之间间距| |
| 13 | +|bannerBorderRadius|Banner圆角| |
| 14 | +|bannerDefaultBGColor|Banner默认背景颜色| |
| 15 | +|bannerTextAlignment|Banner文字位置| |
| 16 | +|bannerTextPadding|Banner文字Padding| |
| 17 | +|bannerTextColor|Banner文字颜色| |
| 18 | +|bannerTextBGColor|Banner文字背景颜色| |
| 19 | +|onPageTap|点击的事件监听| |
| 20 | +|height|View高度| |
| 21 | +|indicatorPositioned|指示器位置| |
| 22 | +|indicatorScrollDirection|指示器方向 [水平/垂直]| |
| 23 | +|indicatorNormalColor|指示器默认颜色| |
| 24 | +|indicatorSelectedColor|指示器选中颜色| |
| 25 | +|indicatorNormalSize|指示器点默认大小| |
| 26 | +|indicatorScaleSize|指示器点选中放大倍数,默认1.4倍| |
| 27 | +|indicatorSpacing|指示器点的间距| |
| 28 | +|indicatorStyle|指示器样式[circle: 圆形, square: 方形]| |
| 29 | +|indicatorAnimStyle|指示器动画样式[normal: 选中变色, scaled:选中放大]| |
| 30 | + |
| 31 | + |
| 32 | +使用示例 |
| 33 | +``` |
| 34 | +/// 构建数据 |
| 35 | +List<BannerGalleryBean> _createTestData() { |
| 36 | + List<BannerGalleryBean> list = new List<BannerGalleryBean>(); |
| 37 | + for (int n = 0; n < IMGS.length; n++) { |
| 38 | + list.add(BannerGalleryBean( |
| 39 | + id: n.toString(), |
| 40 | + photoUrl: https://www.baidu.com/img/bd_logo1.png?where=super, |
| 41 | + description: n.toString); |
| 42 | + } |
| 43 | + return list; |
| 44 | + } |
| 45 | + |
| 46 | +/// 构建Widget |
| 47 | +BannerGalleryWidget( |
| 48 | + data: _createTestData(), |
| 49 | + indicatorSelectedColor: Theme.of(context).primaryColor, |
| 50 | +) |
| 51 | +``` |
0 commit comments