处理上传图片的问题
This commit is contained in:
parent
ed30fc6240
commit
138b4bb767
|
|
@ -82,7 +82,6 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
|
|
||||||
appBarHeight = MediaQuery.of(Get.context!).padding.top;
|
appBarHeight = MediaQuery.of(Get.context!).padding.top;
|
||||||
print("appBarHeight :$appBarHeight");
|
print("appBarHeight :$appBarHeight");
|
||||||
// WidgetsFlutterBinding.ensureInitialized();
|
// WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
@ -109,7 +108,6 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
|
|
||||||
state.studentQuestions.value = e.studentQuestions; // 赋值试题集合
|
state.studentQuestions.value = e.studentQuestions; // 赋值试题集合
|
||||||
|
|
||||||
|
|
||||||
final currentTemplateId = zoomState.zoomFile.value?.templateId; // 获取旧题号ID
|
final currentTemplateId = zoomState.zoomFile.value?.templateId; // 获取旧题号ID
|
||||||
if (currentTemplateId != null && currentTemplateId != e.templateId) {
|
if (currentTemplateId != null && currentTemplateId != e.templateId) {
|
||||||
// zoom 题号判断是否有变 有变就需要清空 zoom文件
|
// zoom 题号判断是否有变 有变就需要清空 zoom文件
|
||||||
|
|
@ -239,9 +237,9 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
// double dpr = MediaQuery.of(context).devicePixelRatio;
|
// double dpr = MediaQuery.of(context).devicePixelRatio;
|
||||||
|
|
||||||
/// 此图片在设备中的像素比例
|
/// 此图片在设备中的像素比例
|
||||||
double? pixelRatio = zoomLogic.zoomState.zoomFile.value?.scaleRatio ?? MediaQuery.of(context).devicePixelRatio;
|
// double? pixelRatio = zoomLogic.zoomState.zoomFile.value?.scaleRatio ?? MediaQuery.of(context).devicePixelRatio;
|
||||||
|
|
||||||
ui.Image image = await boundary.toImage(pixelRatio: pixelRatio);
|
ui.Image image = await boundary.toImage();
|
||||||
ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png);
|
ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png);
|
||||||
if (byteData == null) return null;
|
if (byteData == null) return null;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue