September 2019
Beginner
512 pages
12h 52m
English
We start by creating a normal custom widget. Here, we expose some properties. Bear in mind that in a real application, we would probably expose more than the properties exposed here, but it's enough for this example:
class VerificationCodeInput extends StatefulWidget { final BorderSide borderSide; final onChanged; final controller; ... // other parts removed for brevity}
The only important property exposed here is controller. We will see the reason in a few moments. First, let's check the associated State class:
class _VerificationCodeInputState extends State<VerificationCodeInput> { @override Widget build(BuildContext context) { return TextField( controller: widget.controller, inputFormatters: [ WhitelistingTextInputFormatter(RegExp("[0-9]")), ...Read now
Unlock full access