摘要: const base64Str: string = await new Promise(resolve => { const img = new Image() img.crossOrigin = 'anonymous'; img.src = url; // 图片链接 img.onload = fu 阅读全文
posted @ 2024-04-02 10:02 桃李子 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 1、pubspec.yaml文件引入插件 dependencies: ... video_player: ^2.8.1 2、页面使用(这里我是宽度百分百,高度自适应了) late VideoPlayerController _controller; Container( width: MediaQu 阅读全文
posted @ 2023-12-20 15:31 桃李子 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 1、新建routeObser.dart文件: import 'package:flutter/material.dart'; class AppRouteObserver { //这是实际上的路由监听器 static final RouteObserver<ModalRoute<void>> _ro 阅读全文
posted @ 2023-11-27 17:08 桃李子 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1、pubspec.yaml添加get依赖,再更新项目包依赖 dependencies: get: ^4.6.5 2、更改main文件如下: import 'package:flutter/material.dart'; import 'package:get/get.dart';import 'p 阅读全文
posted @ 2023-11-06 17:10 桃李子 阅读(366) 评论(0) 推荐(0) 编辑
摘要: // 获取当前时间,替换成表针角度的方法的一种实现const getAngle = () => { const date = new Date() const h = date.getHours() const m = date.getMinutes() const s = date.getSeco 阅读全文
posted @ 2023-10-31 17:29 桃李子 阅读(38) 评论(0) 推荐(0) 编辑
摘要: // 简体字const zh_s = '关系肮袄碍爱皑蔼碍爱翱袄奥坝罢摆败颁办绊帮绑镑谤剥饱宝报鲍辈贝钡狈备惫绷笔毕毙闭边编贬变辩辫鳖瘪濒滨宾摈饼拨钵铂驳卜补参蚕残惭惨灿苍舱仓沧厕侧册测层诧搀掺蝉馋谗缠铲产阐颤场尝长偿肠厂畅钞车彻尘陈衬撑称惩诚骋痴迟驰耻齿炽冲虫宠畴踌筹绸丑橱厨锄雏础储触处传疮闯创锤 阅读全文
posted @ 2023-10-24 18:01 桃李子 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1、有状态和无状态的控件 // StatefulWidget 有状态(更新)的控件 class MyText extends StatefulWidget {} // 由两个类组成如:Test类和_Test类 // StatelessWidget 无状态(更新)的控件 class MyText ex 阅读全文
posted @ 2023-08-31 15:42 桃李子 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 1、透明底小图标换色 .iconBox { position: relative; width: 19px; height: 19px; overflow: hidden; // 隐藏原本颜色的图片 .icon { position: absolute; left: -100%; width: 19 阅读全文
posted @ 2023-02-22 15:16 桃李子 阅读(22) 评论(0) 推荐(0) 编辑
摘要: /** * 根据图片链接下载图片 */ const downloadImg = () => { const canvas = document.createElement('canvas'); const img = document.createElement('img'); img.onload 阅读全文
posted @ 2023-01-05 17:37 桃李子 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1.安装所需插件:html2canvas; 2.引入插件: import html2canvas from 'html2canvas'; 3.使用: const creatImg = () => { // 绑定在某个点击事件 html2canvas(document.getElementById(' 阅读全文
posted @ 2022-07-14 17:05 桃李子 阅读(945) 评论(0) 推荐(0) 编辑