flutterfire
flutterfire copied to clipboard
🐛 [cloud_firestore_odm] Allow passing startAt only on the first orderBy query
Consider:
@Collection<Foo>('firestore-example-app/test/private-advanced')
@JsonSerializable()
class Foo {
Foo({
this.firstName,
this.lastName,
});
final String? firstName;
final String? lastName;
}
Currently, it is "allowed" to write:
void main() {
FooCollectionReference().orderByFirstName().orderByLastName(startAt: 'John');
}
But such a query does not make sense, as due to how Firestore works, the startAt will be applied on firstName not lastName.
Currently, this throws an assertion error, but this could be made a compilation error if calling orderByX returned a special type of Query that doesn't have startAt operators.