├── .gitignore ├── README.md ├── banner_gallery_library ├── .flutter-plugins ├── .gitignore ├── .idea │ ├── codeStyles │ │ └── Project.xml │ ├── inspectionProfiles │ │ └── Project_Default.xml │ ├── libraries │ │ ├── Dart_Packages.xml │ │ ├── Dart_SDK.xml │ │ └── Flutter_Plugins.xml │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── banner_gallery_library.iml ├── lib │ ├── banner_gallery_library.dart │ ├── bean │ │ └── banner_gallery_bean.dart │ └── page_view_indicator.dart ├── pubspec.yaml └── test │ └── banner_gallery_library_test.dart └── photos └── Screenshot_v1.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://www.dartlang.org/guides/libraries/private-files 2 | 3 | # Files and directories created by pub 4 | .dart_tool/ 5 | .packages 6 | .pub/ 7 | build/ 8 | # If you're building an application, you may want to check-in your pubspec.lock 9 | pubspec.lock 10 | 11 | # Directory created by dartdoc 12 | # If you don't generate documentation locally you can remove this line. 13 | doc/api/ 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BannerGalleryInFlutter 2 | 用Flutter实现的无限滑动Banner。 3 | 4 | ![Screenshot](https://github.com/h3clikejava/BannerGalleryInFlutter/blob/master/photos/Screenshot_v1.gif?raw=true) 5 | 6 | 可配置的属性 7 | 8 | |参数名|参数说明| 9 | |-----|--------| 10 | |customViewPageItemWidget|自定义内容布局| 11 | |autoScrollDurationSeconds|自动滑动时间间隔[单位s]| 12 | |bannerScrollDirection|Banner滑动方向[水平/垂直]| 13 | |bannerMargin|Banner之间间距| 14 | |bannerBorderRadius|Banner圆角| 15 | |bannerDefaultBGColor|Banner默认背景颜色| 16 | |bannerTextAlignment|Banner文字位置| 17 | |bannerTextPadding|Banner文字Padding| 18 | |bannerTextColor|Banner文字颜色| 19 | |bannerTextBGColor|Banner文字背景颜色| 20 | |onPageTap|点击的事件监听| 21 | |height|View高度| 22 | |indicatorPositioned|指示器位置| 23 | |indicatorScrollDirection|指示器方向 [水平/垂直]| 24 | |indicatorNormalColor|指示器默认颜色| 25 | |indicatorSelectedColor|指示器选中颜色| 26 | |indicatorNormalSize|指示器点默认大小| 27 | |indicatorScaleSize|指示器点选中放大倍数,默认1.4倍| 28 | |indicatorSpacing|指示器点的间距| 29 | |indicatorStyle|指示器样式[circle: 圆形, square: 方形]| 30 | |indicatorAnimStyle|指示器动画样式[normal: 选中变色, scaled:选中放大]| 31 | 32 | 33 | 使用示例 34 | 35 | ``` 36 | /// 构建数据 37 | List _createTestData() { 38 | List list = new List(); 39 | for (int n = 0; n < IMGS.length; n++) { 40 | list.add(BannerGalleryBean( 41 | id: n.toString(), 42 | photoUrl: https://www.baidu.com/img/bd_logo1.png?where=super, 43 | description: n.toString); 44 | } 45 | return list; 46 | } 47 | 48 | /// 构建Widget 49 | BannerGalleryWidget( 50 | data: _createTestData(), 51 | indicatorSelectedColor: Theme.of(context).primaryColor, 52 | ) 53 | ``` 54 | -------------------------------------------------------------------------------- /banner_gallery_library/.flutter-plugins: -------------------------------------------------------------------------------- 1 | path_provider=/Users/H3c/.pub-cache/hosted/pub.flutter-io.cn/path_provider-0.4.1/ 2 | shared_preferences=/Users/H3c/.pub-cache/hosted/pub.flutter-io.cn/shared_preferences-0.4.2/ 3 | -------------------------------------------------------------------------------- /banner_gallery_library/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | ios/.generated/ 9 | ios/Flutter/Generated.xcconfig 10 | ios/Runner/GeneratedPluginRegistrant.* 11 | -------------------------------------------------------------------------------- /banner_gallery_library/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /banner_gallery_library/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /banner_gallery_library/.idea/libraries/Dart_Packages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | -------------------------------------------------------------------------------- /banner_gallery_library/.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /banner_gallery_library/.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /banner_gallery_library/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 27 | 28 | -------------------------------------------------------------------------------- /banner_gallery_library/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /banner_gallery_library/.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | environment 40 | 41 | 42 | 43 | 46 | 47 | 48 | 55 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |