createCollation abstract method
Creates a collation that can be used from sql queries sent against this database.
The name
defines the (case insensitive) name of the collating in
sql. The utf8 encoding of name
must not exceed a length of 255
bytes.
The function
can be any Dart closure, it's not restricted to top-level
functions supported by Pointer.fromFunction
. For more details on how
the sql function behaves, see the documentation on CollatingFunction.
As it is a compare function, the function
must return an integer value, and
receives two string parameters (A & B). function
will return 0
if A and B
are considered equals. A negative value is returned if A is less than B,
but a positive if A is greater than B.
For more information, see https://www.sqlite.org/c3ref/create_collation.html.
Implementation
void createCollation({
required String name,
required CollatingFunction function,
});