flutter_barrage 0.4.2 copy "flutter_barrage: ^0.4.2" to clipboard
flutter_barrage: ^0.4.2 copied to clipboard

outdated

A new barrage package project. Used to send bullet(danmu) to a container.

flutter_barrage #

[![Join the chat at https://gitter.im/flutter_barrage/community](https://badges.gitter.im/flutter_barrage/community.svg)](https://gitter.im/flutter_barrage/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A barrage wall flutter plugin. 一个弹幕墙插件。

Getting Started #

more examples

  • show barrage only
List<Bullet> bullets = List<Bullet>.generate(100, (i) {
  final showTime = random.nextInt(60000); // in 60s
  return Bullet(child: Text('$i-$showTime}'), showTime: showTime);
});
Stack(
  children: <Widget>[
    Positioned(
      top: 200,
      width: MediaQuery.of(context).size.width,
      height:
          MediaQuery.of(context).size.width * MediaQuery.of(context).size.aspectRatio + 200,
      child: BarrageWall(
        massiveMode: false, // disabled by default
        timelineNotifier: timelineNotifier, // send a BarrageValue notifier let bullet fires using your own timeline
        bullets: bullets,
        child: new Container(),
      ),
    )
  ],
);
  • show barrage with send bullet function
Column(
  children: <Widget>[
    Expanded(
      flex: 9,
      child: Stack(
        children: <Widget>[
          Positioned(
//                    top: 20,
            width: MediaQuery.of(context).size.width,
            height: MediaQuery.of(context).size.width *
                    MediaQuery.of(context).size.aspectRatio +
                100,
            child: BarrageWall(
              debug: true, // show debug panel
              speed: 4, // speed of bullet show in screen (seconds)
              /*
              speed: 8,
              speedCorrectionInMilliseconds: 3000,*/
              /*
                timelineNotifier: timelineNotifier, // send a BarrageValue notifier let bullet fires using your own timeline*/
              bullets: bullets,
              child: new Container(),
              controller: barrageWallController,
            ),
          ),
        ],
      ),
    ),
    Expanded(
      child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: TextField(
//                    controller: textEditingController,
              maxLength: 20,
              onSubmitted: (text) {
//                      textEditingController.clear();
                barrageWallController.send([new Bullet(child: Text(text))]);
              })),
    ),
  ],
)
12
likes
0
pub points
84%
popularity

Publisher

unverified uploader

A new barrage package project. Used to send bullet(danmu) to a container.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, quiver

More

Packages that depend on flutter_barrage