endsWith method Null safety

QueryExpressionJunction<T, InstanceType> endsWith(
  1. String value,
  2. {bool caseSensitive = true}
)

Adds a 'ends with string' expression to a query.

A query will only return objects where the selected property is ends with the string value.

This method can be used on String types. The flag caseSensitive controls whether strings are compared case-sensitively.

Example:

  var query = new Query<Employee>()
    ..where((e) => e.name).endsWith("son");

Implementation

QueryExpressionJunction<T, InstanceType> endsWith(
  String value, {
  bool caseSensitive = true,
}) {
  expression = StringExpression(
    value,
    PredicateStringOperator.endsWith,
    caseSensitive: caseSensitive,
    allowSpecialCharacters: false,
  );

  return _createJunction();
}