Skip to content

Commit

Permalink
fix: handle setAuth callback
Browse files Browse the repository at this point in the history
  • Loading branch information
parodyBit committed Nov 26, 2024
1 parent 8ef3c17 commit de033d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/widgets/inputs/input_authorization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ class InputAuthorization extends InputText {
super.onTap,
super.onSuffixTap,
super.maxLines = 3,
this.setAuthorizationCallback,
});

final void Function(String, {bool? validate})? setAuthorizationCallback;

@override
_InputAuthorizationState createState() => _InputAuthorizationState();
final String route;
Expand All @@ -43,7 +46,7 @@ class _InputAuthorizationState extends State<InputAuthorization> {
void initState() {
super.initState();
if (scannedContent.scannedAuthorization != null) {
_handleQrAddressResults(scannedContent.scannedAuthorization!);
_handleQrAuthorizationResults(scannedContent.scannedAuthorization!);
}
widget.focusNode.addListener(widget.onFocusChange);
_scanQrFocusNode.addListener(_handleQrFocus);
Expand All @@ -56,7 +59,8 @@ class _InputAuthorizationState extends State<InputAuthorization> {
_scanQrFocusNode.removeListener(_handleQrFocus);
}

_handleQrAddressResults(String value) {
_handleQrAuthorizationResults(String value) {
widget.setAuthorizationCallback!(value);
widget.styledTextController.text = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ class RecipientStepState extends State<RecipientStep>
focusNode: _authorizationFocusNode,
styledTextController: _authorizationController,
errorText: _authorization.error,
setAuthorizationCallback: setAuthorization,
onFieldSubmitted: (value) async {
_amountFocusNode.requestFocus();
},
Expand Down

0 comments on commit de033d4

Please sign in to comment.