Questions tagged [flutter-canvas]

78 questions
1
vote
0 answers

Flutter CustomPainter: Keep path although repaint should't be done

I have a CustomPainter like the one in the example. Where I don't always need to repaint, but I need to keep the previously drawn path because it is used in hitTest. It is also not a solution to create the path in the constructor because the Size…
1
vote
1 answer

How can I create fading hexagon in Flutter

Fading hexagon Hello, I want to create and Fading hexagon like in image with a fading purple circle middle on it. What should I do?
nadas00
  • 11
  • 4
1
vote
1 answer

Calculate distance between the area surrounded by a Path and a specific point in Flutter

According to the documentation for Path: Closed sub-paths enclose a (possibly discontiguous) region of the plane based on the current fillType. As far as I understand this implies that when a Path object is closed it surrounds a two dimensional…
Christian
  • 25,249
  • 40
  • 134
  • 225
1
vote
1 answer

Flutter Canvas Not Repainting

After the user taps, I want the canvas to redraw, but it never does. I tried to use setState and return different painters but nothing seems to work. It gets repainted if I flip the screen or replace the page with itself but that's really…
1
vote
1 answer

How to draw an arc from points in Flutter

I'm trying to draw an arc with drawPoints method, how can I calculate the points necessary to make an arc? (of any radius) @override void paint(Canvas canvas, Size size) { final pointMode = ui.PointMode.points; final points = [ …
1
vote
0 answers

Can Flutter's inbuilt Canvas drawing methods be directly used to render variable-width strokes?

Can Flutter's inbuilt Canvas drawing methods be directly used to render variable-width strokes, for example to reflect pressure applied throughout each stroke in a handwriting app? Ideally, in a manner compatible with saving in the XML-esque format…
userManyNumbers
  • 904
  • 2
  • 10
  • 26
1
vote
0 answers

Flutter canvas chart not appearing always

I am new to flutter Canvas, I use CustomPainter to draw a chart on the screen along with some other widgets. Everything works fine except that the chart is not appearing in some cases. The chart is supposed to display when I click on the day number…
Sudheer
  • 33
  • 8
1
vote
2 answers

How can I use two custom painters in Flutter?

I made 2 custom painters 1. class DrawTriangle1 extends CustomPainter { DrawTriangle1() { painter = Paint() ..shader = LinearGradient(colors: [Colors.red, Colors.white]).createShader(rect) ..style = PaintingStyle.fill; …
1
vote
2 answers

How to create a blank image with a specified size in Flutter

I want to create a blank image with a white background and a specified size in Flutter, then I may add other images onto this blank image later to merge them as a new image. I am working on my first Flutter project and still learning new things by…
echo
  • 1,244
  • 1
  • 16
  • 40
0
votes
0 answers

The non-abstract class 'CustomCanvas' is missing implementations for these members

I am using flutter_smartlook for monitoring in my app. It was working fine, But after upgrading to the latest version 4.1.7. It started to cause an error while running. If I downgrade to 4.1.5. It was working fine. Can anyone have any idea what is…
0
votes
0 answers

how to draw SVG on CustomPainter Canvas with layer wise in flutter

i am looking to render svg image on canvas with layers.My aim is to transfer svg image on canvas layer wise. As SVG String contain tag by which we can decompose on flutter. but i did not find any solution after a lot of research what i need to…
Karamat Subhani
  • 104
  • 1
  • 7
0
votes
0 answers

How to add bevel and emboss effect in Flutter Custom Paint?

How to add the bevel and emboss effect to a Rectangle in Flutter Custom Paint? Expected something like this:
0
votes
0 answers

Is there a way to draw on a single canvas in Flutter, like p5js or processing

In Flutter you can animate a CustomPainter by updating value of its repaint field. But it gives you an empty Canvas, every time its paint method is called. This makes it difficult to develop a simple "Paint" application for example, because you have…
Ashkan Sarlak
  • 7,124
  • 6
  • 39
  • 51
0
votes
0 answers

In the custompainter of the fluter, I want to draw two images overlaping

I want to implement a CustomPainter that draws a clock given images of hour, minute, and second hands, as well as an image of an empty clock face. To account for the possibility of the image being too large or small, I used drawImageRect to resize…
0
votes
1 answer

Dart: Get bytes from Flutter-Canvas without opening Flutter App

Background I am developing a pure Dart command line tool, which combines images from files. Think creating NFTs by stacking images. Using the pure Dart image library is slow, it takes about 11-20 seconds for one image sized 3000 x 3000. Tried Adding…
Dabbel
  • 2,468
  • 1
  • 8
  • 25