目前弹幕库已经上传到Pub上,支持一般的移动弹幕,静止弹幕,用户发的单条弹幕,定制弹幕速度,行数,可以是任意类型的弹幕,包括文字,图片等。
第一步添加依赖yzl_flutter_bulletchat:^0.0.2
第二步导入
import 'package:yzl_flutter_bulletchat/bulletchat.dart';import 'package:yzl_flutter_bulletchat/bulletchat_data.dart';import 'package:yzl_flutter_bulletchat/bulletchat_item.dart';import 'package:yzl_flutter_bulletchat/bulletchat_item_child.dart';import 'package:yzl_flutter_bulletchat/flutterbulletchat.dart';
第三步 使用
```Container( width: width, height: height,
```
child: BulletChat.builder( builder: (context, data) {returnText( (dataasBulletChatData).contentasString, style: TextStyle(color: Colors.orange), ); }, width: width, height: height, maxLine:5, globalKey: globalKey, data: list, option: AvoidOption.AVOIDCOLLISION, savageBulletItemBuilder: (context, data) {returnText( (dataasBulletChatData).contentasString, style: TextStyle(color: Colors.red), ); }, ), ),~~~
网友评论