更新版本

This commit is contained in:
toly
2020-11-17 18:23:27 +08:00
parent de34289f54
commit ab88857b47
3 changed files with 40 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
#### Flutter Unit 周边
- 🔥 [《Flutter之旅》源码下载地址 ](https://gitee.com/toly1994328/FlutterUnit/attach_files/466731/download)
- 🔥 [实体书 - 《Flutter之旅》源码下载地址 ](https://gitee.com/toly1994328/FlutterUnit/attach_files/466731/download)
- 🔥 [掘金小册 -《Flutter绘制指南》 3.28元 ](https://juejin.im/book/6844733827265331214)
- 🔥 [Flutter环境配置](https://github.com/toly1994328/FlutterUnit/issues/22)
- 🔥 [Flutter实用插件集录 ](https://github.com/toly1994328/FlutterUnit/issues/41)
@@ -32,10 +32,10 @@
```
a1@toly ~ % flutter --version
Flutter 1.22.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d408d302e2 (5 days ago) • 2020-09-29 11:49:17 -0700
Engine • revision 5babba6c4d
Tools • Dart 2.10.0
Flutter 1.22.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 1aafb3a8b9 (4 days ago) • 2020-11-13 09:59:28 -0800
Engine • revision 2c956a31c0
Tools • Dart 2.10.4
```
---

View File

@@ -12,7 +12,6 @@ import 'package:flutter/material.dart';
class TechnoShapeBorder extends ShapeBorder {
final Path outLinePath = Path();
final Paint _paint = Paint();
final Path innerLinePath = Path();
final Path innerLinePathTop = Path();
final Color color;
@@ -45,30 +44,30 @@ class TechnoShapeBorder extends ShapeBorder {
@override
Path getOuterPath(Rect rect, {TextDirection textDirection}) {
double width = rect.width;
outLinePath
..moveTo(cornerWidth, 0)
..lineTo(rect.width - cornerWidth, 0)
..lineTo(rect.width, cornerWidth)
..lineTo(rect.width, rect.height - cornerWidth)
..lineTo(rect.width - cornerWidth, rect.height)
..lineTo(cornerWidth, rect.height)
..relativeLineTo(width - cornerWidth*2, 0)
..relativeLineTo(cornerWidth, cornerWidth)
..relativeLineTo(0,rect.height - cornerWidth*2)
..relativeLineTo( - cornerWidth, cornerWidth)
..relativeLineTo(-((width-innerRate*2*width)/2-cornerWidth-2*spanWidth), 0)
..relativeLineTo(-spanWidth*2, -spanWidth)
..relativeLineTo(-rect.width * innerRate * 2, 0)
..relativeLineTo(-spanWidth * 2, spanWidth)
..relativeLineTo(-((width-innerRate*2*width)/2-cornerWidth-2*spanWidth), 0)
..lineTo(0, rect.height - cornerWidth)
..lineTo(0, cornerWidth)
..close();
innerLinePath
..moveTo(rect.width / 2, rect.height)
..relativeLineTo(rect.width * innerRate, 0)
..relativeLineTo(-spanWidth * 2, -spanWidth)
..relativeLineTo(-rect.width * innerRate * 2, 0)
..relativeLineTo(-spanWidth * 2, spanWidth)
..close();
return Path.combine(PathOperation.difference, outLinePath, innerLinePath);
return outLinePath;
}
@override
void paint(Canvas canvas, Rect rect, {TextDirection textDirection}) {
canvas.drawPath(
Path.combine(PathOperation.difference, outLinePath, innerLinePath),
outLinePath,
_paint..style = PaintingStyle.stroke);
innerLinePathTop
@@ -78,7 +77,7 @@ class TechnoShapeBorder extends ShapeBorder {
..relativeLineTo(-rect.width * innerRate * 2, 0)
..relativeLineTo(-spanWidth * 2, -spanWidth)
..close();
canvas.drawPath(innerLinePathTop, _paint..style = PaintingStyle.fill);
canvas.drawPath(innerLinePathTop.shift(Offset(spanWidth*2,0)), _paint..style = PaintingStyle.fill);
}
@override

View File

@@ -126,23 +126,26 @@ class OverlayToolWrapperState extends State<OverlayToolWrapper>
offset = Offset(x, y - boxHeight / 2);
entry.markNeedsBuild();
},
child: Container(
width: outWidth,
height: outWidth,
padding: EdgeInsets.all(4),
child: Image.asset('assets/images/icon_head.webp'),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
boxShadow: [
BoxShadow(
color:
Theme.of(context).primaryColor.withAlpha(128),
offset: Offset(.5, .5),
spreadRadius: .5,
blurRadius: .5)
],
borderRadius:
BorderRadius.all(Radius.circular(outWidth / 2))),
child: Opacity(
opacity: 0.7,
child: Container(
width: outWidth,
height: outWidth,
padding: EdgeInsets.all(4),
child: Image.asset('assets/images/icon_head.webp'),
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
boxShadow: [
BoxShadow(
color:
Theme.of(context).primaryColor.withAlpha(128),
offset: Offset(.5, .5),
spreadRadius: .5,
blurRadius: .5)
],
borderRadius:
BorderRadius.all(Radius.circular(outWidth / 2))),
),
)),
PictureFrame(
alignment: Alignment.center,