feat:预览图片组件新增编辑按钮及事件

This commit is contained in:
2025-11-14 09:51:16 +08:00
parent 5d5e4297c1
commit 94a356994e
2 changed files with 8 additions and 1 deletions

View File

@@ -121,7 +121,6 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
);
print(editedImage);
}
}

View File

@@ -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,