mirror of https://github.com/grpc/grpc.io.git
Update basics.md (#1276)
In this example firstWhere() causes compile time error if null passed to its orElse named parameter in dart 3. I fix it by using firstWhereOrNull() with no orElse named parameter.
This commit is contained in:
parent
a59839a611
commit
0c569cb5ea
|
|
@ -290,8 +290,7 @@ Future<RouteSummary> recordRoute(
|
|||
await for (var location in request) {
|
||||
if (!timer.isRunning) timer.start();
|
||||
pointCount++;
|
||||
final feature = featuresDb.firstWhere((f) => f.location == location,
|
||||
orElse: () => null);
|
||||
final feature = featuresDb.firstWhereOrNull((f) => f.location == location);
|
||||
if (feature != null) {
|
||||
featureCount++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue