feat:预览图片组件新增编辑按钮及事件
This commit is contained in:
@@ -7,6 +7,7 @@ class LookImagesTool {
|
||||
static lookImages({
|
||||
required List<String> listData,
|
||||
int? currentPage,
|
||||
Function? editCallback,
|
||||
}) async {
|
||||
showDialog(
|
||||
context: Get.context!,
|
||||
@@ -15,6 +16,7 @@ class LookImagesTool {
|
||||
return LookImagesWidget(
|
||||
listData: listData,
|
||||
currentPage: currentPage,
|
||||
editCallback: editCallback,
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -23,11 +25,13 @@ class LookImagesTool {
|
||||
class LookImagesWidget extends StatefulWidget {
|
||||
final List<String> listData;
|
||||
final int? currentPage;
|
||||
final Function? editCallback;
|
||||
|
||||
const LookImagesWidget({
|
||||
super.key,
|
||||
required this.listData,
|
||||
this.currentPage,
|
||||
this.editCallback,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -77,6 +81,10 @@ class _LookImagesWidgetState extends State<LookImagesWidget> {
|
||||
left: 15,
|
||||
top: 50,
|
||||
child: GestureDetector(onTap: () => Get.back(), child: Icon(Icons.arrow_back_ios, color: Colors.white))),
|
||||
Positioned(
|
||||
right: 15,
|
||||
top: 50,
|
||||
child: GestureDetector(onTap: () => widget.editCallback?.call(), child: Icon(Icons.edit, color: Colors.white))),
|
||||
//图片张数指示器
|
||||
Positioned(
|
||||
left: 0,
|
||||
|
||||
Reference in New Issue
Block a user