WARNING! This stuff requires Dart SDK version 2.6+
so if your code is supposed to be running on
older versions do not use these methods!
or change the sdk restrictions in your pubspec.yaml like this:
environment:
sdk: ">=2.6.0 <3.0.0"
Detailed wallet check. The returned object contains all
the necessary info like address type, network, wallet type
and address. Before using the returned object, use isValid
getter to check if the result is valid
returns a list of country datas with a country code of
the supplied phone number. The return type is List because
many countries and territories may share the same phone code
the list will contain one PhoneCountryData at max
returns A list of PhoneCountryData datas or an empty list
Call it somewhere in the beginning of your app code
config allows you to configure the look and feel
for all of your form fields by default.
Doing this you won't have to set decorations, paddings
and other common stuff for your forms everywhere
Initializes JSON decoders
for custom types
(if you ever need to store anything custom in shared preferences),
so they can be easily
restored from SharedPreferences.
Call this method someplace at the beginning of
your app, just before you initialize LiteState controllers
so that controllers can have access to this data before
they are initialized themselves.
Decoder MUST be a STATIC function
that creates instances of custom classes
from a map
e.g.
static AuthData decode(Map map) {
return AuthData(
type: map'type',
token: map'token',
userName: map'userName',
);
}
this function converts a Map, stored in SharedPreferences
into a user defined object. In this case a custom class
called AuthData
checks not only for a length and characters but also
for card system code. If it's not found the succession of numbers
will not be marked as a valid card number
Basically it doesn't really check if the currencyId is
a crypto currency. It just checks if it's not fiat.
I decided not to collect all possible crypto currecies as
there's an endless amount of them
character a character to check if it's a digit against
positiveOnly if true it will not allow a minus (dash) character
to be accepted as a part of a digit
The default for all fields. This means that the values is
supposed to be accepted as is. If you need to convert the
value somehow, write your custom serializer for a particular field
just calls a reset() method on all initialized controllers
what this method should / should not do is up to you. Just write
your own implementation if you need it
all of the forms' errors, hints and labels call this
function before displaying. The value passed as a parameter.
If you need to translate the value of even change it completely
return your value.