当前位置: 首页 > news >正文

网站建设优化两千字搜索引擎网站入口

网站建设优化两千字,搜索引擎网站入口,实木家具全屋定制十大名牌,wordpress京豆插件需求:同一个页面的两个不同的入口,同一个控件的位置有变化,显示引导页时对应这个控件的引导内容的位置也需要改变;同时半透明底部显示出真实的页面内容。 这样的需要如果切图然后再往页面上贴位置无法精确的对准。 思路&#xff1…

需求:同一个页面的两个不同的入口,同一个控件的位置有变化,显示引导页时对应这个控件的引导内容的位置也需要改变;同时半透明底部显示出真实的页面内容。
这样的需要如果切图然后再往页面上贴位置无法精确的对准。
思路:先绘制一层半透明遮罩覆盖页面,在需要显示的控件位置绘制为全透明,然后再将引导内容绘制在遮罩上面(共有三层,真实页面、透明遮罩。控件对应的那些说明内容),获取控件的位置确定在哪里全透明。

入口一进入时:
在这里插入图片描述
入口二进入时:
在这里插入图片描述

import 'package:common/sp_util.dart';
import 'package:jade/configs/CommonConfig.dart';
import 'package:jade/configs/PathConfig.dart';
import 'package:jade/utils/JadeColors.dart';
import 'package/jade/utils/Utils.dart';
import 'package:util/navigator_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
/*
* 引导页
* */
class SharedPurchaseGuidePage extends StatelessWidget {final double width;final double height;final Offset offset;const SharedPurchaseGuidePage({this.width,this.height,this.offset});Widget build(BuildContext context) {return WillPopScope(child: Stack(children: [CustomPaint(size: Size(Utils().screenWidth(context), Utils().screenHeight(context)), // 自定义Widget的大小painter: MyCustomPainter(width,height,offset),),Positioned(left: offset.dx + width,top: offset.dy,child: _leftView(context))],),onWillPop: () async => false,);}_leftView(context){return Container(width: Utils().screenWidth(context) * 0.68,height: 210.w,padding: EdgeInsets.symmetric(vertical: 28.w),decoration: BoxDecoration(image: DecorationImage(image: AssetImage(PathConfig.imageSharedPurchaseGuideBg),fit: BoxFit.fill)),child: Column(crossAxisAlignment: CrossAxisAlignment.end,children: [Row(mainAxisAlignment: MainAxisAlignment.end,children: [Text('点击了解共享购',style: TextStyle(color: Colors.white,fontSize: 28.sp,fontWeight: FontWeight.w600)),SizedBox(width: 54.w),GestureDetector(child: Container(width: 100.w,height: 40.w,alignment: Alignment.center,margin: EdgeInsets.only(right: 20.w),decoration: BoxDecoration(color: Colors.white,borderRadius: BorderRadius.circular(20),),child: Text('知道了',style: TextStyle(color: JadeColors.blue,fontSize: 22.sp,fontWeight: FontWeight.w600),),),onTap: (){SpUtil.putBool(CommonConfig.havePostDetailSharedPurchaseGuide, true);NavigatorUtil.pop();},)],),Container(margin: EdgeInsets.only(right: 20.w,top: 26.w),child: Text('为促进交易,本版块加入了独特的共\n享购功能,与传统的团购与拼单很不\n一样,欢迎体验!',style: TextStyle(color: Colors.white,fontSize: 22.sp)))],),);}
}class MyCustomPainter extends CustomPainter {final double width;final double height;final Offset offset;const MyCustomPainter(this.width,this.height,this.offset);void paint(Canvas canvas, Size size) {//背景Paint backgroundPaint = Paint()..color = Colors.black45..style = PaintingStyle.fill;//添加背景一个路径Path path = Path()..addRect(Rect.fromLTWH(0, 0, size.width, size.height));//留白的圆角矩形路径Path holePath = Path()// ..addRect(Rect.fromLTWH(offset.dx, offset.dy, width, height));..addRRect(RRect.fromRectAndRadius(Rect.fromLTWH(offset.dx-5, offset.dy, width+5, height), Radius.circular(5)));Path combinedPath = Path.combine(PathOperation.difference, path, holePath);canvas.drawPath(combinedPath, backgroundPaint);}bool shouldRepaint(covariant CustomPainter oldDelegate) {return false; // 不需要重绘,因为我们只是绘制一次,并没有动画或状态更改}
}
GlobalKey _sharedPurchaseKey = new GlobalKey();
//需要全透明的控件
Row(key: _sharedPurchaseKey,children: [Text(S.current.sharedPurchase,style: TextStyle(color: JadeColors.blue,fontSize: 24.sp,fontWeight: FontWeight.bold)),GestureDetector(child: Container(color: Colors.transparent,padding: EdgeInsets.all(4),child: Image.asset(PathConfig.iconQuestion,width: 34.w,height: 34.w),),onTap: (){NavigatorUtil.push(SharedPurchaseDesc());},),],),//获取共享购文字加问号的坐标,跳转(这个方法需要在页面加载完成后调用)_getOffset() {if(_sharedPurchaseKey.currentContext != null){_sharedPurchaseWidth = _sharedPurchaseKey.currentContext.size.width;_sharedPurchaseHeight = _sharedPurchaseKey.currentContext.size.height;_offset = WidgetUtil.getWidgetLocalToGlobal(_sharedPurchaseKey.currentContext);bool sharedPurchaseGuide = SpUtil.getBool(CommonConfig.havePostDetailSharedPurchaseGuide,defValue: false);if(!sharedPurchaseGuide){//跳转一个透明页面NavigatorUtil.pushTransparentRoute(SharedPurchaseGuidePage(width: _sharedPurchaseWidth,height: _sharedPurchaseHeight,offset: _offset));}}}///Get the coordinates of the widget on the screen.Widgets must be rendered completely.///获取widget在屏幕上的坐标,widget必须渲染完成static Offset getWidgetLocalToGlobal(BuildContext context) {RenderBox box = context.findRenderObject();return box == null ? Offset.zero : box.localToGlobal(Offset.zero);}
http://www.mnyf.cn/news/34346.html

相关文章:

  • 网页设计怎么做网站南宁网
  • 网站目标定位概念网上电商怎么做
  • 怎么看个人做的付费视频网站甘肃搜索引擎网络优化
  • 网易企业邮箱下载官网网站优化助手
  • 网站免费建设最好的关键词排名优化软件
  • 上海网站建设 永灿广州关于进一步优化疫情防控措施
  • wordpress 页面文章做网站seo怎么赚钱
  • 网站自助建设平台百度seochinaz查询
  • 为什么网站有不同的扩展名燃灯seo
  • 昆明网站建设价格低河北网站seo
  • 电子商务网站建设选择服务器要考虑的因素有seo外链工具有用吗
  • 站长工具高清吗如何申请域名
  • Wordpress搜索html页面seo网站优化方案书
  • 德化住房和城乡建设网站软文网
  • 购物网站建设网站太原百度关键词排名
  • 返利网网站框架目录广州seo优化费用
  • 茂名网站建设托管专业营销策划团队
  • 美食网站首页设计百度打广告收费表
  • 北京海淀区今日疫情seo关键词优化排名哪家好
  • wordpress 底部导航yoast seo
  • 免费自助建站可以看封禁网站的浏览器
  • wdcp搭建网站线上推广费用预算
  • 网站建设无锡海之睿前端培训哪个机构靠谱
  • 公司网站首页导航html神起网络游戏推广平台
  • 我国政府网站建设和管理现状石家庄房价
  • 企业网站建设到底应该注意什么网站制作工具有哪些
  • 哪有那样的网站百度纯净版首页入口
  • 惠州有哪些做网站的公司百度入口网址
  • 淘宝客 网站无备案企业全网推广公司
  • 多种不同产品的网站怎么做seo推广怎么推