Questions tagged [flutter-custompainter]

95 questions
0
votes
2 answers

CustomPainter: How to draw translucent areas?

This sketch shows what the final result should look like: A CustomPainter fills its Canvas (yellow area) with a slightly translucent background color. (Amber with an opacity of 0.8 in the sketch). The CustomPainter draws a rectangle onto the…
SePröbläm
  • 5,142
  • 6
  • 31
  • 45
0
votes
1 answer

The argument type 'ShapePainter' can't be assigned to the parameter type 'CustomPainter?'. error in painter of flutter

i got this error with using painet in flutter: The argument type 'ShapePainter' can't be assigned to the parameter type 'CustomPainter?'. and my code is: class ClipWidget extends StatelessWidget { final Widget? childWidget; const…
0
votes
2 answers

Flutter half circle with multiple fill colors

I would like to create this in Flutter: I know you can create a half circle like this. But how I can get these multiple fill colors? I know there is way to get this done with LinearGradient. (something like this) But this might work, but I need to…
Chris
  • 1,828
  • 6
  • 40
  • 108
0
votes
1 answer

How to draw 2 overlapped icons on one paint canvas flutter

I want to make 2 overlapped circle icons on a Custom paint as in the diagram at the end. I don't know how I can implement the children widget on the Paint widget or maybe put the icons on the CustomPaint() widget and then overlap it on the canvas.…
Clinton Njiru
  • 41
  • 1
  • 7
0
votes
1 answer

Cutting transparent rectangle using canvas from filled rectangle Dart

I pin the picture of how it should looks like. I was trying ti use Cnavas, because as I inderstood such things can't be done by simple widget. So I have a question, how can I extract rectangle from this filled rectangle? I saw solution like…
inkwelll075
  • 494
  • 4
  • 19
0
votes
2 answers

How to make Custom shape Container in Flutter?

I have to make container which bottom is triangular shape as below image. How to create this shape in flutter?
0
votes
0 answers

Flutter: Is there any way to clean the contents in CustomPaint?

Recently I'm using CustomPaint and CustomPainter to draw line chart. I want to implement the function that, once I click a button, the lines in CustomPaint will disappear, just like no lines have been painted. So what function should I put in the…
0
votes
0 answers

What is the right gradient to use to achieve the inner shadow effect of the native macOS graphical time picker with Flutter CustomPainter?

I'm recreating the graphical macOS time picker for macos_ui and I'm having some difficulty painting the inner shadow gradient correctly. This shadow, along with the gradient of the clock's border, help give the clock a sort of 3D look. Here is a…
0
votes
0 answers

Why are Flutter CustomPainter Class Variables not Persisting

In Flutter, is a Custom Painter and all its class variables re-constructed from scratch every time the paint method is called? -- when setState is called in the parent?? I didn't expect that, but it seems to be the case: I ask because I have a…
Nerdy Bunz
  • 6,040
  • 10
  • 41
  • 100
0
votes
1 answer

How to implement shouldRepaint when the object being compared is a List?

Lets say in Flutter we have a Custom Painter like this that takes a List as an argument: class StackPainter02 extends CustomPainter { final List brightnessValues; late final int numberOfBulbs; StackPainter02( {required…
Nerdy Bunz
  • 6,040
  • 10
  • 41
  • 100
0
votes
1 answer

Flutter Animation Controller Velocity Does Not Reflect Curve Applied

Preface: This is not a debugging question -- there is no code problem -- code is for illustration purposes only. I am working with an animation controller in Flutter. Using controller.forward with the controller alone (no curve applied), the…
Nerdy Bunz
  • 6,040
  • 10
  • 41
  • 100
0
votes
1 answer

Is it ok to stack multiple CustomPainter in Flutter?

Is it ok to stack multiple CustomPainter in a Stack widget? For example: Stack( children: [ RepaintBoundary( child: CustomPaint( size: Size(imgSource.width.toDouble(), imgSource.height.toDouble()), painter:…
ynnob
  • 75
  • 1
  • 6
0
votes
0 answers

How to expand all children of a Stack that includes a CustomPainter in Flutter

Let's say in Flutter we have a Stack that contains: A CustomPainter with size of Size.infinite Any other widget that is not a Custom Painter (that we also want to fill all available space exactly the same way that the custom painter does) In this…
0
votes
1 answer

How to skip spaces with CustomPaint with Flutter?

I'm trying to achive an ARC in flutter, but with "holes" in it. What I have: screen image What I want: achive image My code: class ProgressArc extends CustomPainter { bool isBackground; Color progressColor; double arcLength; ProgressArc({ …
0
votes
2 answers

Custom painter painting outside of the screen for new incoming data?

I am implementing waveform visualization for mic in my app. class BarVisualizer extends CustomPainter { final List waveData; BarVisualizer({ required this.waveData, }); @override void paint(Canvas canvas, Size size) { for (var i…
Pokaboom
  • 1,110
  • 9
  • 28