flutter_banner 1.0.1

  • Readme
  • Changelog
  • Installing
  • 69

flutter_banner #

A Flutter banner widget, only build once after created.

Getting Started #

1、add dependency to you pubspec.yaml #

    flutter_banner: ^1.0.0

2、user guide, see example/example_main.dart #

    import 'package:flutter_banner/banner_widget.dart'

    var delegate = BannerDelegate(
        childAtIndex: (idx) => Container(),
        numberOfBanners: 5,
        width: 200,
        hight: 60,
    );
    var banner = BannerWidget(
        delegate: delegate,
        pageIndicator: PageIndicator(numberOfPages: 5),
    );

PageIndicator style

①Replace PageIndicator default style

    PageIndicator.normalIndicatorStyle = IndicatorStyle(Size(), BoxDecoration());
    PageIndicator.selectedIndicatorStyle = IndicatorStyle(Size(), BoxDecoration());

②Custom PageIndicator style

    static Widget indicatorBuilder() {
        return Container();
    }

    static Widget selectedIndicatorBuilder() {
        return Container();
    }
    PageIndicator(indicatorBuilder: indicatorBuilder, selectedIndicatorBuilder: selectedIndicatorBuilder,);

3、support autoloop,user draging #

banner自动滚动 auto

向左拖拽 drag_left

向右拖拽 drag_right

[1.0.0] - banner widget 支持手势、自动滚动. #

[1.0.1] - banner widget 暴露停止、启动自动滚动接口. #

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_banner: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_banner/banner_widget.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
50
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Jul 9, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • flutter_banner that is a package requiring null.

Health suggestions

Format lib/banner_widget.dart.

Run flutter format to format lib/banner_widget.dart.

Format lib/src/banner_delegate.dart.

Run flutter format to format lib/src/banner_delegate.dart.

Format lib/src/banner_widget.dart.

Run flutter format to format lib/src/banner_widget.dart.

Format lib/src/page_indicator_widget.dart.

Run flutter format to format lib/src/page_indicator_widget.dart.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and flutter_banner.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test