signature null values fix.

design_3.0_demo_module
Sikander Saleem 10 months ago
parent 69d10c50de
commit 10dd969d71

@ -19,7 +19,8 @@ class ESignature extends StatefulWidget {
final bool showShadow; final bool showShadow;
final String title; final String title;
const ESignature({Key? key, required this.title, required this.oldSignature, this.backgroundColor, this.onSaved, this.onChange, this.showShadow=true, required this.newSignature}) : super(key: key); const ESignature({Key? key, required this.title, required this.oldSignature, this.backgroundColor, this.onSaved, this.onChange, this.showShadow = true, required this.newSignature})
: super(key: key);
@override @override
State<ESignature> createState() => _ESignatureState(); State<ESignature> createState() => _ESignatureState();
@ -89,7 +90,7 @@ class _ESignatureState extends State<ESignature> {
.onPress(() async { .onPress(() async {
if (_editable) { if (_editable) {
signature = await _controller!.toPngBytes(); signature = await _controller!.toPngBytes();
if (widget.onChange != null) { if (widget.onChange != null && signature != null) {
widget.onChange!(signature!); widget.onChange!(signature!);
} }
} }

Loading…
Cancel
Save