Skip to content

Commit 433664c

Browse files
committed
🚀 CustomPaint优化
1 parent 5cd9ab8 commit 433664c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

assets/flutter.db

12 KB
Binary file not shown.

lib/views/widgets/SingleChildRenderObjectWidget/CustomPaint/node1_clock.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ class ClockPage extends StatelessWidget {
1515
return Container(
1616
width: MediaQuery.of(context).size.width,
1717
height: 100,
18-
child:CustomPaint(//使用CustomPaint盛放画布
19-
painter: ClockPainter(),
18+
child:RepaintBoundary(
19+
child: CustomPaint(//使用CustomPaint盛放画布
20+
painter: ClockPainter(),
21+
),
2022
),
2123
)
2224
;

lib/views/widgets/SingleChildRenderObjectWidget/CustomPaint/node2_bezier.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ class _PlayBezier3PageState extends State<PlayBezier3Page> {
4242
return Container(
4343
height: 200,
4444
width: MediaQuery.of(context).size.width,
45-
child: CustomPaint(
46-
painter: BezierPainter(pos: _pos, selectPos: selectPos),
45+
child: RepaintBoundary(
46+
child: CustomPaint(
47+
painter: BezierPainter(pos: _pos, selectPos: selectPos),
48+
),
4749
),
4850

4951
);

0 commit comments

Comments
 (0)