Last updated:
0 purchases
flutter banner
flutter_banner #
A Flutter banner widget, only build once after created.
Getting Started #
1、add dependency to you pubspec.yaml #
flutter_banner: ^1.1.0
copied to clipboard
2、user guide, see example/example_main.dart #
import 'package:flutter_banner/banner_widget.dart'
BannerWidget banner = BannerWidget(
delegate: BannerDelegate(
childAtIndex: (idx) => Container(),
numberOfBanners: 5,
),
pageIndicator: PageIndicator(),
);
banner.delegate.numberOfBanners.value = data.length;
banner.pageIndicator.numberOfPages.value = data.length;
return Container(
child: banner,
width: 200,
height: 80,
);
copied to clipboard
PageIndicator style
①Replace PageIndicator default style
PageIndicator.normalIndicatorStyle = IndicatorStyle(Size(), BoxDecoration());
PageIndicator.selectedIndicatorStyle = IndicatorStyle(Size(), BoxDecoration());
copied to clipboard
②Custom PageIndicator style
static Widget indicatorBuilder() {
return Container();
}
static Widget selectedIndicatorBuilder() {
return Container();
}
PageIndicator(indicatorBuilder: indicatorBuilder, selectedIndicatorBuilder: selectedIndicatorBuilder,);
copied to clipboard
3、support autoloop,user draging #
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.