Questions tagged [custom-painting]
147 questions
2
votes
1 answer
Flutter blend/mask multiple widgets under another widget in a stack
I'm trying to blend multiple widgets under a specific widget in a Stack. For example, in this Stack...
Stack(
children: [
Container(
decoration: BoxDecoration(
image:…

Wilson Wilson
- 3,296
- 18
- 50
2
votes
1 answer
Flutter Custom Painter drawing is laggy
I am trying to code a drawing app, in which users can choose different pen color and draw colorful drawings. I have created a class PointsGroup which stores list of offsets and associated color. In GestureDetector's onPanUpdate, the PointsGroup is…

om_prakash
- 70
- 9
2
votes
1 answer
How to crop the png image and remove its unused space using Canvas in flutter?
This attachment is from the rendered canvas image which is saved locally via canvas. In image I have drawn the square box which I want to render in canvas and save locally without left and right extra spaces. I just want to save the square box and…

jazzbpn
- 6,441
- 16
- 63
- 99
2
votes
1 answer
TabControl Custom Tab Bar Background Color
I have a TabControl where I needed to have custom tab colors. To do this, I set the DrawMode to OwnerDrawFixed, and overwrote the DrawItem event. However, when I change the DrawMode, it appears that the transparency for the Tab Bar is replaced with…

Tim
- 2,731
- 9
- 35
- 72
2
votes
2 answers
(Flutter) Curved edge to a CustomPaint Widget
This is what I want to build:
(Just see the shape of the appBar and not the contents)
This is what I have:
I want the edge to be curved, and not so sharp.
Here is my code for the CustomPaint:
class LogoPainter extends CustomPainter {
@override
…

Aman Kataria
- 586
- 2
- 12
- 24
2
votes
1 answer
Flutter recognize touch events inside Donut chart
I have Custom Painter that draws a donut chart like the above picture.
I am using
canvas.drawArc(Rect.fromCircle(center: center, radius: radius),
startRadian, radians[i], true, paint);
for drawing this.
Is there any possible way to…

Favas Kv
- 2,961
- 2
- 28
- 38
1
vote
0 answers
how does GestureDetector work with canvas.draw circle custom paint
GestureDetector(
child: SizedBox(
width: double.infinity,
height: MediaQuery.of(context).size.height,
child: InteractiveViewer(
transformationController:…

Arbaz Khan
- 11
- 2
1
vote
1 answer
Flutter : Good way of adding borders to CustomPaint
I am trying to create a more complex customPaint and want to add a border to it.
From the picture you can see the shape (In blue) and the partial border (in white)
The way I am creating the white border is with a secondary customPaint right now.
My…

s3v3ns
- 198
- 1
- 17
1
vote
1 answer
Flutter : Zooming canvas in certain places
I am trying to make something like a magnifying glass on a Custom Painter. So far I am able to use Backdropfilter with imagefilter matrix scaling like below:
BackdropFilter(
filter: ImageFilter.matrix(matrix),
child :…

Zero Live
- 1,653
- 5
- 22
- 44
1
vote
0 answers
Custom brush patttern in flutter custom paint
I have created a drawing application in flutter. Its working very well for simple drawing but the issue is I want to implement brush patterns in drawing and there is no option for custom brush style/ stroke patterns in CustomPainter class. Please…
1
vote
1 answer
How to support and paint multiple algorithms
I have been working on a maze generator/solver program. It works nicely, but I came across a problem while refactoring my code.
Basically, I used to call methods that draw the process of solving a maze directly from another class, as opposed to…

Szász Erik
- 25
- 4
1
vote
2 answers
How to have a dynamically sized CustomPainter in Flutter?
Consider the following code from the Flutter docs:
CustomPaint(
painter: Sky(),
child: const Center(
child: Text(
'Once upon a time...',
style: TextStyle(
fontSize: 40.0,
fontWeight: FontWeight.w900,
…

Nerdy Bunz
- 6,040
- 10
- 41
- 100
1
vote
3 answers
Swing custom painting: should `Graphic` object be disposed?
When overriding public void paintComponent(Graphics g) in any JComponent to perform custom painting of that JComponent, should the Graphic object g be disposed at the end of the painting (and why)?
public void paintComponent(Graphics g) {
…

c0der
- 18,467
- 6
- 33
- 65
1
vote
0 answers
Create flutter custom paint brush types
I have created a custom paint drawer, which works well, but I liked to create custom brush types like a calligraphy brush, crayon brush, etc...
class DrawingPainter extends CustomPainter {
DrawingPainter({this.pointsList}) : super();
…

ÄR Âmmãř Żąîñh
- 484
- 1
- 4
- 17
1
vote
2 answers
How to draw tail end for container in Flutter using Custom painter
I have a chat screen which have the chatItem box with tail end like this
Need to have that tail end in receiver side and sender side as well as
I am currently using custom painter to this. And couldn't able to figure this out.
`class…

Ahalya Raj
- 81
- 2
- 9