Questions tagged [flutter-custompainter]

95 questions
6
votes
1 answer

Flutter - drawAtlas circular cutout

I'm trying to implement a circular cutout of an image and I am using drawAtlas for it. Here is my implementation so far: canvas.drawAtlas( image!, [ /* Identity transform */ RSTransform.fromComponents( rotation: 0.0, scale:…
Zero Live
  • 1,653
  • 5
  • 22
  • 44
5
votes
2 answers

How does CustomPainter.shouldRepaint() work in Flutter?

In Flutter, when creating a CustomPainter, there is an override method, shouldRepaint() that you can return either true or false... presumably to tell the system whether or not to repaint the view. And in the docs, the description for the method…
Nerdy Bunz
  • 6,040
  • 10
  • 41
  • 100
4
votes
2 answers

how to make a curved chart with a gradient under highest value in flutter?

I want to make a chart with a gradient under the highest value, exactly like this : how can I do that?
Mahdi Dahouei
  • 1,588
  • 2
  • 12
  • 32
3
votes
0 answers

Is it less resource intensive to use Flutter's CustomPaint class or to use assets?

I am building a simple group chat app for Android and iOS. For the symbols on the buttons, they are mostly going to be simple shapes. I can add JPEGs/PNG as assets to the app, but I noticed that Flutter has this CustomPaint class. Is it less…
whatwhatwhat
  • 1,991
  • 4
  • 31
  • 50
2
votes
1 answer

Drawing line is offset when add an appBar - Flu

I'm making a drawing app by Flutter. I can draw a line normally when i put it in a Scaffold with only home. But the problem is when i add an AppBar, the line is offset down from the top, it's not the position where i touch in screen, it's moved down…
2
votes
0 answers

How Can I Optimally Draw Lines Using Flutter's CustomPainter Widget?

I am attempting to figure out the most efficient way to draw lines with the CustomPainter widget. I have everything set up and it works great as I pass in points to the custompainter and it paints all of the lines perfectly using this class: class…
Slavy
  • 21
  • 2
2
votes
0 answers

How to drag a custompainter widget in flutter

I created the clock in the image using custompainter. My objective is to drag the clock hands(second ,hour and minute hands) to set the time. How can i drag these hands around the clock from a fixed center point in flutter?
Febin Johnson
  • 277
  • 1
  • 6
  • 21
2
votes
1 answer

How to draw a trapezoid shape line in flutter using Rrect or similar?

I want to draw a trapezoidal shape in flutter, like this: Now I am drawing an elliptical shape using Rrect for the same, here is my code for drawing the second picture(getting an elliptical shape) @override void paint(Canvas canvas, Offset…
Abdul azeez VP
  • 156
  • 1
  • 1
  • 9
2
votes
1 answer

Battery level indicator drawing upside down in Flutter CustomPainter Class

I have this code to draw the battery level but it is drawing the inside colored indicator from the top down. It should paint it from the bottom to the top like you see on all Android phones. Any thoughts on what I am doing wrong? class…
bzark
  • 65
  • 8
1
vote
1 answer

Flutter - Text foreground is not showing up on iOS

I'm trying to create a text with a border. I've written this code LayoutBuilder( builder: (_, constraints) => Container( width: constraints.maxHeight, decoration: BoxDecoration( border: Border.all(width: 1), …
Ale TheFe
  • 1,540
  • 15
  • 43
1
vote
2 answers

Flutter programing svg design

I designed a simple svg into this website and i'll to try programing that in flutter I have implemented the code using this approach: class AppbarBackgroundPainter extends CustomPainter { final Color color; …
DolDurma
  • 15,753
  • 51
  • 198
  • 377
1
vote
0 answers

Adding a shadow effect to a folder-shaped container with Flutter

I'm making a folder-shaped container component in Flutter. I am using the code below to create a folder-shaped container and give it a shadow effect. (I got some help from Stack Overflow.) I want to give a natural shadow effect like the image…
1
vote
1 answer

Flutter CustomPainter MultiColor tween animation

how can I create a CustomPainter that animates between multiple colors depending on a value? The code below only works on one Tween value, create a smooth transition from blue to orange if the value is greater than 400, and back from orange to blue…
JBTG
  • 91
  • 1
  • 7
1
vote
1 answer

Centering Text in an Arc - Flutter

I am trying to center the Text within an arc in a flutter app. There are two elements in this. First the arcs with colors are painted on the canvas and the Text is stacked over it. The distance of each arc varies and is also dynamic based on the…
gputhige
  • 109
  • 2
  • 11
1
vote
1 answer

Flutter canvas draw raw points with different colors

I am trying to draw a lot of points to the screen quickly. I have created the following method. void _paintPoints(Canvas canvas, List matrix, Size size) { final width = size.width / matrix.length; final height = size.height /…
MaLa
  • 582
  • 2
  • 16
1
2 3 4 5 6 7