Open tushar0518 opened 10 months ago
Since penColor, penStrokeWidth and other properties are final we can't change them dynamically. Like sometimes we need different colors in the same canvas with different strockWidth. Due to the above the current controller is overridden.
Currently is there a way to do it?
Here is my sample code,
final SignatureController _controller = SignatureController( penStrokeWidth: 4, penColor: Colors.red, exportBackgroundColor: Colors.transparent, exportPenColor: Colors.red, onDrawStart: () => log('onDrawStart called!'), onDrawEnd: () => log('onDrawEnd called!'), );
MaterialPicker( pickerColor: Colors.red, portraitOnly: true, onColorChanged: (Color color) { //on color picked print(color); _controller ..penColor = color ..penStrokeWidth = 4; setState(() {}); Navigator.pop(context); }, );
Added a change in below PR https://github.com/4Q-s-r-o/signature/pull/105
Since penColor, penStrokeWidth and other properties are final we can't change them dynamically. Like sometimes we need different colors in the same canvas with different strockWidth. Due to the above the current controller is overridden.
Currently is there a way to do it?
Here is my sample code,