Questions tagged [flutter-custompainter]

95 questions
1
vote
0 answers

Flutter CustomPainter paints on animations

I have an extended CustomPainter class inside a MaterialApp widget tree. Unfortunately, the paint method gets invoked multiple times during the intrinsic Material design animations (for instance when hovering over a BottomNavigationBarItem or when…
user2428094
  • 1,643
  • 2
  • 10
  • 6
1
vote
0 answers

Slider between positive and negative values

I'm using syncfusion_flutter_sliders package. Is it possible to display a slider where you choose a value between positive and negative? E.g. the default value is 0 - we can go left on the slider and select a value between 0 and -1, or we can go…
1
vote
3 answers

Custom Shape in Flutter with Custom Painter

I want to make a shape as seen in the photo below with container in Flutter. How can that shape be made?
1
vote
1 answer

How to draw a dashed line in a CustomPainter in Flutter?

There's no native API for drawing a dashed line in Flutter. An existing snippet allows drawing horizontal dashed lines but I can't find a snippet for drawing arbitrary dashed line from one point to another. There also exists a library called…
AlienKevin
  • 2,691
  • 2
  • 17
  • 19
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

How to add border radius to CustomPaint Widget Flutter

I'm trying to add border radius to my custom shaped widget using Custom Paint, but I don't know how to add rounded edges to the custom shape. I achieved the shape, but not the rounded edges. Below is the code for the custom paint. How can I add…
nifesi
  • 80
  • 7
1
vote
1 answer

How to draw an Arc in the middle of CustomPainter shape

I am trying to draw the following shape using CustomPainter, I am looking for a way to make this shape as one shape (union), so for example using Stack with Container and half circle shape is not desired. I have managed to paint the base…
Shady Aziza
  • 50,824
  • 20
  • 115
  • 113
1
vote
2 answers

Clip Container inside CustomPainter

i made this shape using CustumPainter Class , i want the container color to fill only the shape , like a full charged battery this is how i made the shape void paint(Canvas canvas, Size size) { var paint = Paint(); var path = Path(); …
Anas Hafidi
  • 349
  • 1
  • 5
  • 15
1
vote
1 answer

unexpected lines on CustomPaint

I am using CustomPaint to draw some rectangle. But there are visible lines inside my canvas. Current output Expected output Code to reproduce the issue void main() => runApp(const MaterialApp(home: CustomPaintIssue())); class CustomPaintIssue…
1
vote
1 answer

Flutter circular progress indicator - repeatable-Custom painter

I want to create something like that: Want to achieve I have achieved this: Done up until now I am struggling to add just vertical line at state of this circular progress bar just like the line at trailing. import 'dart:math'; import…
1
vote
2 answers

Why is CustomPaint affected by whether it is under a Scaffold?

App〈 MaterialApp〈 MyWidget : all is good Whether I draw the figure on a canvas with a small or a large scale—by replacing v = 100000.0 with v = 1000.0 in the following code, the image doesn't change, as expected. (If you are not familiar with the…
1
vote
1 answer

Timing Animations with Custom Painter in Flutter

I created a custom widget in flutter using custom painter. Its a status bar. I wanted to animate it, but now a problem is occurring that I don't know how to fix. The bar consists of a line and several dots, depending on the status. When animating…
1
vote
1 answer

Canvas.drawPaint in Flutter Custom Painter has no boundaries

In the paint method of a CustomPainter, if we use canvas.paint, the paint unexpectedly goes beyond the boundaries of the containing view. In the example below, I would have expected the pinkAccent of the Container to be visible in the lower half of…
Nerdy Bunz
  • 6,040
  • 10
  • 41
  • 100
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 :…
1
vote
3 answers

Flutter - Hard color stop in linear gradient

I'm using CustomPaint to make a custom shape and I want to apply a color gradient but with hard color stops. Without color transitions. PS:I cannot use different Paints instead of gradient because of the custom shape. I checked the documentation…