Questions tagged [flutter-canvas]
78 questions
0
votes
1 answer
How to Draw multiple Rectangle with different rotation in Flutter Canvas?
I am trying to add multiple Rectangles in the Canvas and rotate them with user pan action. But the Constructor I found till now for Rect is all to draw them without Rotation. and I found a method canvas.rotate() which will rotate the whole…

Zihan
- 668
- 8
- 19
0
votes
1 answer
Painting with Path Flutter
I have custom annotation for map as displayed in image.
How can I make the rounding of the edges from the bottom, identical to how it was done at the top.
My code
Path getClip(Size size) {
double width = size.width;
double height =…

Евгений Чепелев
- 13
- 3
0
votes
1 answer
Does Flutter TextSpan GestureRecognizer work on Custom Painter
I am painting text and other objects on a canvas in flutter.
I would like to detect when the mouse is over some text that is rendered on the canvas.
The TextSpan class has the recognizer property as well as onEnter and onExit.
they don't seem to be…

xerotolerant
- 1,955
- 4
- 21
- 39
0
votes
1 answer
How to render a arc path after previous arc animation complete
When I trying to render a two arc in I same path both are rendered at the same time, but I need to render a second arc after the first arc's animation gets completed.
I just want to render the second arc as it should start from the end of the first…

yuva
- 436
- 4
- 9
0
votes
0 answers
Is there any alternative faster approach of ui.Image.toByteData(format: ui.ImageByteFormat.png)
I am trying to save ui.Image into device gallery, to do so I have to convert ui.Image.toByteData which takes so much time. Is there a way to save image to gallery without using ui.Image.toByteData? Following is my code.
final recorder =…

D. Islam
- 56
- 5
0
votes
0 answers
Text drawn in 3D on Canvas
How can I display text as 3D on a Canvas in Flutter? One way I've thought of is to replicate the text multiple times but display each replicant as an offset from the original text. The problem with that is that you won't be able to distinguish the…

user2233706
- 6,148
- 5
- 44
- 86
0
votes
1 answer
flutter code painting Rect bottom line below screen - why (example attached)
Why does the lower Rect line go below the screen even through I've aimed to calculate this?
Code:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget…

Greg
- 34,042
- 79
- 253
- 454
0
votes
0 answers
Flutter Repaint Boundary repainting rule
I want to repaint my RepaintBoundary widget's child every time the variable _lastIndex changes in setState() method. Basically, I want the same behaviour for RepaintBoundary as would apply to any normal Container - but for unrelated reasons I need a…

Coding Glass
- 137
- 1
- 7
0
votes
1 answer
Trouble drawing rectangle on a canvas using local coordinates- Flutter
I have 2 screens.
One the first screen I load up an image from the web and have my user draw a rectangle on the image. I am using local position from onPanStart and onPanUpdate callbacks in the GestureDetector. I am saving the start and end Offset…

DrkStr
- 1,752
- 5
- 38
- 90
0
votes
1 answer
Flutter container gets disappear
Don't know what I am missing here. Want to make the Container UI like the Material Filled Text Field. Just want to know whether we can use BorderSide and borderRadius together or they work separately. And using Container only How can I achieve…

Azhar Bhatti
- 91
- 1
- 3
- 14
0
votes
1 answer
Offset origin of tiled Image in Flutter
I'm trying to create a parallax background in a Flutter app, and the most efficient way to build it is to use a Stack with the image filling the screen as a background and then my list on top. The image is tiled with an ImageRepeat set on the Y…

Lee Probert
- 10,308
- 8
- 43
- 70
0
votes
1 answer
Flutter: Path scaling results in shapes not being aligned, how do i align?
I'm trying to draw a polygon using a CustomPainter, this is working fine. Then I would like to draw a 2nd polygon identical to the first underneath it but X times the size. Currently I am transforming the path like:
polygon1 = new…

iwishiwasaneagle
- 311
- 1
- 9
0
votes
3 answers
How to constrain an image on the canvas
I would like to draw an image 200x200 pixels on the canvas, and then do some other things to it. The image I have is 900x690, so ideally I would like to "center crop" the image to use an Android term. This video for some reason tells us to use a…

Daniel Wilson
- 18,838
- 12
- 85
- 135
0
votes
0 answers
Flutter: scaling of large canvas drops FPS
I created a CustomPainter which paints large canvas of volume 10000 elements.
A CustomPaint containing this painter is wrapped in a RepaintBoundary.
Problem: When I use Transform.scale of the parent widget, fps slowing down is observed.
For scaling…

tvauri.timur
- 1
- 2
0
votes
0 answers
Drawing Base64Encoded image as canvas background in flutter
I am facing two problems with my code:
1) I am unable to add a Base64Encoded string image as a background in Canvas.
2) Anything I am drawing in my canvas using freehand, is not clipping at the bottom edge of the canvas
Would like to have some…

Damandroid
- 756
- 9
- 31