Loading topic
Size. You don't need animation yet.4 min readCustomPainter subclass and place it in a CustomPaint widget. It also assumes you know how Size and Offset work. Here you learn what Canvas and Paint each are, how they split the work of drawing, and which mistakes cause most painter bugs.5 min readCanvas: lines, rectangles, circles, and arcs. It assumes you know Dart classes and named parameters, can build a basic widget tree, and have seen CustomPaint, CustomPainter, and Paint in earlier chapters. You should also know that the c5 min readPaint decides whether a shape is filled or outlined, and how stroked lines look at their ends and corners. It assumes you can write a CustomPainter subclass, know that paint() receives a Canvas and a Size, and have drawn basic primitives such as lines, rectangles, a5 min readCustomPainter with paint() and shouldRepaint(), and that you know the canvas coordinate system (origin at the top left, y growing downward). You also need Paint basics: fill versus stroke style and stroke width.6 min readpaint() again, and how to write shouldRepaint so it is correct and cheap. It assumes you can write a CustomPainter subclass, you know what Canvas and Paint are, and you understand that a widget's build method can run many times. The5 min readCustomPainter with paint and shouldRepaint, and that you know how to create and dispose an AnimationController. It shows how to animate a painter without rebuilding any widgets, and what can go wrong.4 min readCustomPainter, know that paint() receives a Canvas and a Size, and can build simple shapes with Paint and Path. You should also be comfortable with Dart classes and named parameters.6 min readPaint. This chapter covers the three gradient classes, the rectangle argument that causes most gradient bugs, and the rules 5 min readCanvas has methods for shapes but none for text. To draw a string inside paint(), you use TextPainter. This chapter covers its lifecycle, how to measure and position text, and the edge cases that cause crashes or blurry layouts.4 min readCustomPaint widget draws pixels, but it has no idea what those pixels mean. A circle you draw is not a button. This chapter shows how Flutter decides whether a touch landed on a painted shape, how to override that decision, and how to turn a touch into an action. It assumes you can write a `Cust5 min readCustomPainter with paint and shouldRepaint, and that you have driven a painter from an AnimationController through the repaint parameter. You don't need to know Flutter's rendering internals. The chapter explains the parts that matter for painting.5 min readCustomPaint draws pixels, and a screen reader such as TalkBack on Android or VoiceOver on iOS cannot read pixels. This chapter shows how to describe a painted widget to assistive technology. It covers wrapping the widget in Semantics, giving individual painted regions their own nodes with `sem5 min readCustomPainter, draw shapes with Paint, and use save and restore. You will learn how a blend mode combines the pixels you draw with the pixels already on the canvas. You will also learn why many blend modes only work correctly inside saveLayer, and what 4 min read