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