books
This commit is contained in:
36
assets/draw/p02/s08.dart
Normal file
36
assets/draw/p02/s08.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
/// create by 张风捷特烈 on 2020-03-19
|
||||
/// contact me by email 1981462002@qq.com
|
||||
/// 说明: 纸
|
||||
|
||||
class Paper extends StatelessWidget{
|
||||
const Paper({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CustomPaint(
|
||||
painter: PaperPainter(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class PaperPainter extends CustomPainter {
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
drawInvertColors(canvas);
|
||||
}
|
||||
void drawInvertColors(Canvas canvas) {
|
||||
var paint = Paint();
|
||||
paint..color = Color(0xff009A44);
|
||||
canvas.drawCircle(Offset(100, 100), 50, paint..invertColors = false);
|
||||
canvas.drawCircle(Offset(100+120.0, 100), 50, paint..invertColors = true);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
bool shouldRepaint(CustomPainter oldDelegate) => true;
|
||||
}
|
||||
Reference in New Issue
Block a user