Conversation
|
@naoki0719 please check this commit |
|
Thanks for the new feature! |
|
this is a breaking API change and according to semantic versioning it shouldnt be a patch or a minor but a major. |
| Widget? customizedButtonChild, | ||
| VoidCallback? customizedButtonTap, | ||
| Widget Function(bool confirmed)? customizedButtonChild, | ||
| Function(bool confirmed, InputController controller)? customizedButtonTap, |
There was a problem hiding this comment.
This is missing a return type for the Function.
| Function(bool confirmed, InputController controller)? customizedButtonTap, | |
| void Function(bool confirmed, InputController controller)? customizedButtonTap, |
|
|
||
| /// Tapped for left side lower button. | ||
| final VoidCallback? customizedButtonTap; | ||
| final Function(bool confirmed, InputController controller)? |
There was a problem hiding this comment.
| final Function(bool confirmed, InputController controller)? | |
| final void Function(bool confirmed, InputController controller)? |
|
Additionally to the above, it should already be possible to to what you wish for without this PR. onPressed: () async {
bool confirmed = false;
final controller = InputController();
final subscription = controller.confirmed
.listen((event) => confirmed = event);
await screenLock(
context: context,
correctString: '1234',
customizedButtonChild: StreamBuilder<bool>(
stream: controller.confirmed,
builder: (context, snapshot) => Icon(
confirmed
? Icons.restart_alt_rounded
: Icons.arrow_back,
),
),
customizedButtonTap: () async {
if (confirmed) {
controller.unsetConfirmed();
} else {
Navigator.of(context).pop();
}
},
onOpened: () async => await localAuth(context),
);
subscription.cancel();
},So I dont think it is necessary to add it to the package itself. |
customizedButton in confirmed mode