Skip to content

Commit 117c99f

Browse files
committed
Allow user to specify text for clear button in signature pad
1 parent 78b9d0d commit 117c99f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ class MyHomePageState extends State<MyHomePage> {
290290
FormBuilderSignaturePad(
291291
decoration: InputDecoration(labelText: "Signature"),
292292
attribute: "signature",
293-
height: 200,
293+
height: 250,
294294
// onChanged: _onChanged,
295295
),
296296
],

lib/src/inputs/form_builder_signature_pad.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class FormBuilderSignaturePad extends StatefulWidget {
1818
final Color backgroundColor;
1919
final Color penColor;
2020
final double penStrokeWidth;
21+
final String clearButtonText;
2122

2223
FormBuilderSignaturePad({
2324
@required this.attribute,
@@ -27,6 +28,7 @@ class FormBuilderSignaturePad extends StatefulWidget {
2728
this.backgroundColor = Colors.grey,
2829
this.penColor = Colors.black,
2930
this.penStrokeWidth = 3.0,
31+
this.clearButtonText = "Clear",
3032
this.initialValue,
3133
this.points,
3234
this.width,
@@ -100,7 +102,7 @@ class _FormBuilderSignaturePadState extends State<FormBuilderSignaturePad> {
100102
field.didChange(null);
101103
},
102104
label: Text(
103-
"Clear",
105+
widget.clearButtonText,
104106
style: TextStyle(color: Theme.of(context).errorColor),
105107
),
106108
icon: Icon(

0 commit comments

Comments
 (0)