mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
[compass_app] Standardize on Result factories rather than constructors (#2538)
From my review of the recipes PR in https://github.com/flutter/website/pull/11444#pullrequestreview-2480423811.
This commit is contained in:
@@ -98,7 +98,7 @@ class BookingCreateUseCase {
|
||||
case Ok<List<Destination>>():
|
||||
final destination = result.value
|
||||
.firstWhere((destination) => destination.ref == destinationRef);
|
||||
return Ok(destination);
|
||||
return Result.ok(destination);
|
||||
case Error<List<Destination>>():
|
||||
return Result.error(result.error);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class BookingShareUseCase {
|
||||
try {
|
||||
await _share(text);
|
||||
_log.fine('Shared booking');
|
||||
return Result.ok(null);
|
||||
return const Result.ok(null);
|
||||
} on Exception catch (error) {
|
||||
_log.severe('Failed to share booking', error);
|
||||
return Result.error(error);
|
||||
|
||||
Reference in New Issue
Block a user