fix:调整ios端渲染白边问题
This commit is contained in:
parent
3db24c3303
commit
4c47b65b0e
@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
@ -58,7 +59,6 @@ class _TalkViewNativeDecodePageState extends State<TalkViewNativeDecodePage>
|
|||||||
state.animationController.forward();
|
state.animationController.forward();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -97,35 +97,40 @@ class _TalkViewNativeDecodePageState extends State<TalkViewNativeDecodePage>
|
|||||||
final double scaleWidth = physicalWidth / rotatedImageWidth;
|
final double scaleWidth = physicalWidth / rotatedImageWidth;
|
||||||
final double scaleHeight = physicalHeight / rotatedImageHeight;
|
final double scaleHeight = physicalHeight / rotatedImageHeight;
|
||||||
max(scaleWidth, scaleHeight); // 选择较大的缩放比例
|
max(scaleWidth, scaleHeight); // 选择较大的缩放比例
|
||||||
return Column(
|
return state.isLoading.isTrue
|
||||||
children: [
|
? Image.asset(
|
||||||
Expanded(
|
'images/main/monitorBg.png',
|
||||||
child: state.isLoading.isTrue
|
width: screenWidth,
|
||||||
? Image.asset(
|
height: screenHeight,
|
||||||
'images/main/monitorBg.png',
|
fit: BoxFit.cover,
|
||||||
width: screenWidth,
|
)
|
||||||
height: screenHeight,
|
: Positioned.fill(
|
||||||
fit: BoxFit.cover,
|
child: PopScope(
|
||||||
)
|
canPop: false,
|
||||||
: PopScope(
|
child: RepaintBoundary(
|
||||||
canPop: false,
|
key: state.globalKey,
|
||||||
child: RepaintBoundary(
|
child: SizedBox.expand(
|
||||||
key: state.globalKey,
|
child: RotatedBox(
|
||||||
child: SizedBox.expand(
|
// 解码器不支持硬件旋转,使用RotatedBox
|
||||||
child: RotatedBox(
|
quarterTurns:
|
||||||
// 解码器不支持硬件旋转,使用RotatedBox
|
startChartManage.rotateAngle ~/ 90,
|
||||||
quarterTurns: startChartManage.rotateAngle ~/ 90,
|
child: Platform.isIOS
|
||||||
child: Texture(
|
? Transform.scale(
|
||||||
textureId: state.textureId.value!,
|
scale: 1.008, // 轻微放大,消除iOS白边
|
||||||
filterQuality: FilterQuality.medium,
|
child: Texture(
|
||||||
),
|
textureId: state.textureId.value!,
|
||||||
),
|
filterQuality: FilterQuality.medium,
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
: Texture(
|
||||||
|
textureId: state.textureId.value!,
|
||||||
|
filterQuality: FilterQuality.medium,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user