previewImage function
void
previewImage({
- int index = 0,
- required BuildContext context,
- required List<
ChatImageListUtils> imageList, - void onTapMenu()?,
- void customLongPress(
- BuildContext context
预览图片
context
BuildContextimageList
图片列表index
当前加载展示图片索引menuList
菜单列表onTapMenu
点击菜单选项的回调customLongPress
自定义长按显示菜单回调
Implementation
void previewImage(
{int index = 0,
List<String>? menuList,
required BuildContext context,
required List<ChatImageListUtils> imageList,
void Function(String data, int index, List<String> menuList)? onTapMenu,
void Function(BuildContext context)? customLongPress}) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.transparent,
builder: (context) => GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: _PreviewImageWidget(
imageList: imageList,
index: index,
menuList: menuList,
onTapMenu: onTapMenu,
customLongPress: customLongPress),
));
}