Skip to content

Commit ab88857

Browse files
committed
✨ 更新版本
1 parent de34289 commit ab88857

File tree

3 files changed

+40
-38
lines changed

3 files changed

+40
-38
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

4141
---

lib/app/res/style/shape/techno_shape.dart

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import 'package:flutter/material.dart';
1212
class TechnoShapeBorder extends ShapeBorder {
1313
final Path outLinePath = Path();
1414
final Paint _paint = Paint();
15-
final Path innerLinePath = Path();
1615
final Path innerLinePathTop = Path();
1716
final Color color;
1817

@@ -45,30 +44,30 @@ class TechnoShapeBorder extends ShapeBorder {
4544

4645
@override
4746
Path getOuterPath(Rect rect, {TextDirection textDirection}) {
47+
double width = rect.width;
48+
4849
outLinePath
4950
..moveTo(cornerWidth, 0)
50-
..lineTo(rect.width - cornerWidth, 0)
51-
..lineTo(rect.width, cornerWidth)
52-
..lineTo(rect.width, rect.height - cornerWidth)
53-
..lineTo(rect.width - cornerWidth, rect.height)
54-
..lineTo(cornerWidth, rect.height)
55-
..lineTo(0, rect.height - cornerWidth)
56-
..lineTo(0, cornerWidth)
57-
..close();
58-
innerLinePath
59-
..moveTo(rect.width / 2, rect.height)
60-
..relativeLineTo(rect.width * innerRate, 0)
61-
..relativeLineTo(-spanWidth * 2, -spanWidth)
51+
..relativeLineTo(width - cornerWidth*2, 0)
52+
..relativeLineTo(cornerWidth, cornerWidth)
53+
..relativeLineTo(0,rect.height - cornerWidth*2)
54+
..relativeLineTo( - cornerWidth, cornerWidth)
55+
..relativeLineTo(-((width-innerRate*2*width)/2-cornerWidth-2*spanWidth), 0)
56+
..relativeLineTo(-spanWidth*2, -spanWidth)
6257
..relativeLineTo(-rect.width * innerRate * 2, 0)
6358
..relativeLineTo(-spanWidth * 2, spanWidth)
59+
..relativeLineTo(-((width-innerRate*2*width)/2-cornerWidth-2*spanWidth), 0)
60+
..lineTo(0, rect.height - cornerWidth)
61+
..lineTo(0, cornerWidth)
6462
..close();
65-
return Path.combine(PathOperation.difference, outLinePath, innerLinePath);
63+
64+
return outLinePath;
6665
}
6766

6867
@override
6968
void paint(Canvas canvas, Rect rect, {TextDirection textDirection}) {
7069
canvas.drawPath(
71-
Path.combine(PathOperation.difference, outLinePath, innerLinePath),
70+
outLinePath,
7271
_paint..style = PaintingStyle.stroke);
7372

7473
innerLinePathTop
@@ -78,7 +77,7 @@ class TechnoShapeBorder extends ShapeBorder {
7877
..relativeLineTo(-rect.width * innerRate * 2, 0)
7978
..relativeLineTo(-spanWidth * 2, -spanWidth)
8079
..close();
81-
canvas.drawPath(innerLinePathTop, _paint..style = PaintingStyle.fill);
80+
canvas.drawPath(innerLinePathTop.shift(Offset(spanWidth*2,0)), _paint..style = PaintingStyle.fill);
8281
}
8382

8483
@override

lib/components/permanent/overlay_tool_wrapper.dart

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,26 @@ class OverlayToolWrapperState extends State<OverlayToolWrapper>
126126
offset = Offset(x, y - boxHeight / 2);
127127
entry.markNeedsBuild();
128128
},
129-
child: Container(
130-
width: outWidth,
131-
height: outWidth,
132-
padding: EdgeInsets.all(4),
133-
child: Image.asset('assets/images/icon_head.webp'),
134-
decoration: BoxDecoration(
135-
color: Theme.of(context).primaryColor,
136-
boxShadow: [
137-
BoxShadow(
138-
color:
139-
Theme.of(context).primaryColor.withAlpha(128),
140-
offset: Offset(.5, .5),
141-
spreadRadius: .5,
142-
blurRadius: .5)
143-
],
144-
borderRadius:
145-
BorderRadius.all(Radius.circular(outWidth / 2))),
129+
child: Opacity(
130+
opacity: 0.7,
131+
child: Container(
132+
width: outWidth,
133+
height: outWidth,
134+
padding: EdgeInsets.all(4),
135+
child: Image.asset('assets/images/icon_head.webp'),
136+
decoration: BoxDecoration(
137+
color: Theme.of(context).primaryColor,
138+
boxShadow: [
139+
BoxShadow(
140+
color:
141+
Theme.of(context).primaryColor.withAlpha(128),
142+
offset: Offset(.5, .5),
143+
spreadRadius: .5,
144+
blurRadius: .5)
145+
],
146+
borderRadius:
147+
BorderRadius.all(Radius.circular(outWidth / 2))),
148+
),
146149
)),
147150
PictureFrame(
148151
alignment: Alignment.center,

0 commit comments

Comments
 (0)