restore
Rebuilds a numeric state from values saved earlier from length, code and isError, for example across Android configuration changes or process death, or iOS scene restoration.
Returns null unless code holds only the ASCII digits 0-9 and is no longer than length: the values a state can hold. Nothing is normalized, because saved values come from a state, not from user input. Restoring is not input: no callback fires and completion is not reported again, so a restored complete code is not submitted twice.
Turn saved names back into values with OtpLength.fromName and OtpCharset.fromName.
Saved state can be written to disk by the platform. If the code must not outlive the screen, do not save it, or clear it when the screen is left.
Rebuilds a state from values saved earlier from length, charset, code and isError, like the numeric overload. Returns null unless code holds only characters of charset (uppercase letters for OtpCharset.ALPHANUMERIC) and is no longer than length.