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

wordpress门户b2b插件seo搜索引擎优化薪资水平

wordpress门户b2b插件,seo搜索引擎优化薪资水平,长沙做网站推荐,山东网站域名备案时间功能:CustomPaint 相当于在一个画布上面画画,可以自己绘制不同的颜色形状等 在各种widget 或者是插件不能满足到需求的时候,可以自己定义一些形状 使用实例和代码: CustomPaint: 能使你绘制的东西显示在你的ui 上面&a…

在这里插入图片描述

功能:CustomPaint

  • 相当于在一个画布上面画画,可以自己绘制不同的颜色形状等
  • 在各种widget 或者是插件不能满足到需求的时候,可以自己定义一些形状

使用实例和代码:

CustomPaint: 能使你绘制的东西显示在你的ui 上面,
painter=》child=》oregroundPainter,foregroundPainter最外面的一层会覆盖painter,child 层里面的widget.

 return Container(//painter 绘制完成之后需要再CustomPaint 里面构建称为widgetchild: Center(child: CustomPaint(child: Icon(Icons.abc,size: 40,color: Colors.red,),painter: MybackGroudnPaiter(), //最内一层//  child: ,//子组件,在中间foregroundPainter: ForegroundPainter(), //最外面一层,也是  CustomPainter),),);

CustomPainter 绘制

class MybackGroudnPaiter extends CustomPainter {void paint(Canvas canvas, Size size) {//canvas 画布,size 画布的尺寸//在这边绘制// canvas.drawColor(Colors.red, BlendMode.color);var centerp = size / 2;//定义画笔是什么颜色,样式,画笔的宽度var paint = Paint()..color = Colors.teal..style = PaintingStyle.fill..strokeWidth = 2.0;canvas.drawRect(Rect.fromLTWH(centerp.width - 100, centerp.height - 100, 200, 200),paint);}bool shouldRepaint(covariant CustomPainter oldDelegate) {return true;}
}class ForegroundPainter extends CustomPainter {void paint(Canvas canvas, Size size) {var centerp = size / 2;//定义画笔是什么颜色,样式,画笔的宽度var paint = Paint()..color = Colors.pink..style = PaintingStyle.fill..strokeWidth = 2.0;canvas.drawRect(Rect.fromLTWH(centerp.width - 130, centerp.height - 130, 200, 200),paint);}bool shouldRepaint(covariant CustomPainter oldDelegate) {// TODO: implement shouldRepaintreturn true;}
}

绘制完成之后显示的图片


绘画的能力

我们绘制1000个彩色点点,从上往下掉落,看看性能,没有任何的卡顿,真给力

import 'dart:math';
import 'package:flutter/material.dart';void main() => runApp(const MyApp());class MyApp extends StatelessWidget {const MyApp({Key? key}) : super(key: key);Widget build(BuildContext context) {return const MaterialApp(home: Scaffold(backgroundColor: Colors.white,body: MyHomePage(title: 'jack ma',),),);}
}class MyHomePage extends StatefulWidget {const MyHomePage({Key? key, required this.title}) : super(key: key);final String title;State<MyHomePage> createState() => _MyHomePageState();
}class _MyHomePageState extends State<MyHomePage>with SingleTickerProviderStateMixin {late AnimationController _controller;final List<Snowflake> _snowflakes =List.generate(1000, (index) => Snowflake());void initState() {;_controller =AnimationController(vsync: this, duration: const Duration(seconds: 5))..repeat();super.initState();}Widget build(BuildContext context) {return Scaffold(body: Center(child: SizedBox(width: double.infinity,height: double.infinity,child: AnimatedBuilder(animation: _controller,builder: (BuildContext context, Widget? child) {//一直在这边build,5s 动画运行时间for (var snow in _snowflakes) {snow.fall();}return CustomPaint(painter: MyPainter(_snowflakes),);},),),));}
}class MyPainter extends CustomPainter {final List<Snowflake> _snowflakes;MyPainter(this._snowflakes);void paint(Canvas canvas, Size size) {final whitePaint = Paint()..color = Colors.grey;for (int i = 0; i < 1000; i++) {whitePaint.color = Colors.primaries[i % Colors.primaries.length];canvas.drawCircle(Offset(_snowflakes[i].x, _snowflakes[i].y),_snowflakes[i].radius, whitePaint);}}bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}class Snowflake {double x = Random().nextDouble() * 400;double y = Random().nextDouble() * 800;double radius = Random().nextDouble() * 2 + 2;double velocity = Random().nextDouble() * 4 + 2;void fall() {y += velocity;if (y > 800) {y = 0;x = Random().nextDouble() * 400;radius = Random().nextDouble() * 2 + 2;velocity = Random().nextDouble() * 4 + 2;}}
}

在这里插入图片描述

http://www.hkea.cn/news/294615/

相关文章:

  • 做美工要开通什么网站的会员呢新网站友链
  • 网站集约化建设推进情况推广app赚钱
  • 番禺大石做网站域名污染查询网站
  • 长沙市在建工程项目免费seo快速排名工具
  • 南宁定制网站制作电话图片外链生成工具
  • 哪些网站做的海报比较高大上百度客服电话是多少
  • 菏泽网站建设电话常州seo外包
  • 做木皮的网站裂变营销五种模式十六种方法
  • 精美 企业网站模板微信软文推广怎么做
  • 怎么建立一个网站里面可以查询资料百度权重域名
  • 网站建设顺序镇江交叉口优化
  • 低价企业网站搭建软文新闻发布网站
  • 创造与魔法官方网站做自己喜欢的事seo视频
  • 淘宝联盟推广网站怎么做吉安seo招聘
  • 工程招聘网站如何免费制作自己的网站
  • 网站建设调研问卷搜易网托管模式的特点
  • 在哪个网站可以做java面试题宁德市蕉城区疫情
  • 2021年重大新闻事件seo快速工具
  • 拼多多网店南宁优化推广服务
  • 洛阳建筑公司排名长沙官网seo服务
  • 网站关键词优化公司哪家好企业网站seo点击软件
  • 做网站有必要?优化师培训
  • 网站怎么发布信息百度推广优化技巧
  • 西安软件培训百度百科优化排名
  • 网站上文章加入音乐是怎么做的网页代码
  • 深圳公布最新出行政策徐州seo招聘
  • wordpress的漏洞seo优化知识
  • 网站建设高端seo和sem分别是什么
  • 成交功能网站怎么推广自己的产品
  • 北京宣传片网站seo综合查询