mirror of
https://github.com/flutter/samples.git
synced 2025-11-12 07:48:55 +00:00
Clean up dependencies across packages (#2585)
Drop dep on pkg:collection, use new bits in Dart 3.0 Fixed very old dep in navigation_and_routing – bug was fixed long ago
This commit is contained in:
@@ -4,12 +4,9 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
|
||||
import '../../../domain/models/booking/booking.dart';
|
||||
import '../../../domain/models/booking/booking_summary.dart';
|
||||
import '../../../utils/result.dart';
|
||||
|
||||
import '../../services/local/local_data_service.dart';
|
||||
import 'booking_repository.dart';
|
||||
|
||||
@@ -35,7 +32,7 @@ class BookingRepositoryLocal implements BookingRepository {
|
||||
|
||||
@override
|
||||
Future<Result<Booking>> getBooking(int id) async {
|
||||
final booking = _bookings.firstWhereOrNull((booking) => booking.id == id);
|
||||
final booking = _bookings.where((booking) => booking.id == id).firstOrNull;
|
||||
if (booking == null) {
|
||||
return Result.error(Exception('Booking not found'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user