|
...
|
...
|
@@ -47,6 +47,8 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
|
|
// 全局key
|
|
|
|
final GlobalKey _rootWidgetKey = GlobalKey();
|
|
|
|
|
|
|
|
final GlobalKey globalKey = GlobalKey();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
// TODO: implement initState
|
|
...
|
...
|
@@ -74,9 +76,11 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
|
|
|
|
|
|
/// 截图
|
|
|
|
Future<Uint8List> _capturePng(
|
|
|
|
GlobalKey globalKey, {
|
|
|
|
double pixelRatio = 2.0, //截屏的图片与原图的比例
|
|
|
|
}) async {
|
|
|
|
GlobalKey globalKey,
|
|
|
|
// {
|
|
|
|
// double pixelRatio = 2.0, //截屏的图片与原图的比例
|
|
|
|
// }
|
|
|
|
) async {
|
|
|
|
try {
|
|
|
|
RenderRepaintBoundary boundary =
|
|
|
|
globalKey.currentContext?.findRenderObject() as RenderRepaintBoundary;
|
|
...
|
...
|
@@ -142,6 +146,12 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
|
|
// title = "${widget.couponSunModel.aname}";
|
|
|
|
name = "${widget.couponSunModel.aname}";
|
|
|
|
}
|
|
|
|
double _height = w(64);
|
|
|
|
Future.delayed(Duration(milliseconds: 200)).then((e) {
|
|
|
|
_height = globalKey.currentContext.size.height;
|
|
|
|
debugPrint('Height is ${context.size.height}');
|
|
|
|
setState(() {});
|
|
|
|
});
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
appBar: SystemAppBar('优惠券详情'),
|
|
...
|
...
|
@@ -161,24 +171,26 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
|
|
Stack(
|
|
|
|
clipBehavior: Clip.none,
|
|
|
|
children: [
|
|
|
|
// user.sellerimage != null &&
|
|
|
|
// user.sellerimage != ''
|
|
|
|
// ? CachedNetworkImage(
|
|
|
|
// imageUrl: user.sellerimage,
|
|
|
|
// width: double.infinity,
|
|
|
|
// height: w(280),
|
|
|
|
// fit: BoxFit.cover,
|
|
|
|
// )
|
|
|
|
// :
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('no_image'),
|
|
|
|
width: double.infinity,
|
|
|
|
height: w(280),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
),
|
|
|
|
user.sellerimage != null &&
|
|
|
|
user.sellerimage != ''
|
|
|
|
? CachedNetworkImage(
|
|
|
|
imageUrl: user.sellerimage,
|
|
|
|
width: double.infinity,
|
|
|
|
height: w(280),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
)
|
|
|
|
: Image.asset(
|
|
|
|
Utils.getImgPath('no_image'),
|
|
|
|
width: double.infinity,
|
|
|
|
height: w(280),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
bottom: -w(64),
|
|
|
|
bottom: _height / 2,
|
|
|
|
child: Container(
|
|
|
|
key: globalKey,
|
|
|
|
width: ScreenUtil().screenWidth -
|
|
|
|
w(20) * 2,
|
|
|
|
// width: double.infinity,
|
|
|
|
// height: w(128),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
...
|
...
|
@@ -193,6 +205,8 @@ class _CouponPosterPageState extends State<CouponPosterPage> { |
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(r(8))),
|
|
|
|
child: Column(
|
|
|
|
// mainAxisSize: ,
|
|
|
|
// main
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
...
|
...
|
|