视频直播系统源码,自定义背景和状态管理
1.源码
Future<T> showModalBottomSheet<T>({
@required BuildContext context,
@required WidgetBuilder builder,
Color backgroundColor, //面板背景颜色
double elevation,
ShapeBorder shape,
Clip clipBehavior,
Color barrierColor, //非面板的背景颜色
bool isScrollControlled = false,
bool useRootNavigator = false,
bool isDismissible = true, //点击外部是否消失
bool enableDrag = true, //是否拖拽消失
RouteSettings routeSettings,
})
2.解决点击面板消失问题
/**
* 底部面板,相当于弹出了一个新页面
* 默认点击消失,可以给子组件外面包一层GestureDetector并设置onTap返回false,拦截点击事件使点击底部面板区域,面板不消失。
*/
showModalBottomSheet(
context: context,
builder: (context) {
return StatefulBuilder(
builder: (context, setStateBottomSheet) {
return GestureDetector(
onTap: () {
return false;
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
color: Colors.white),
height: ScreenAdapter.setHeight(500),
padding: EdgeInsets.fromLTRB(20, 20, 20, 0),
),
);
},
);
},
);
以上就是 视频直播系统源码,自定义背景和状态管理,更多内容欢迎关注之后的文章
标签:false,自定义,直播,bool,context,面板,源码 From: https://www.cnblogs.com/yunbaomengnan/p/17836077.html