mirror of
https://github.com/flutter/samples.git
synced 2025-11-11 23:39:14 +00:00
Enable some extra lints for compass app client (#2560)
Enable a few more lints that were mostly followed already for consistency.
This commit is contained in:
@@ -23,7 +23,7 @@ class BookingRepositoryRemote implements BookingRepository {
|
||||
@override
|
||||
Future<Result<void>> createBooking(Booking booking) async {
|
||||
try {
|
||||
final BookingApiModel bookingApiModel = BookingApiModel(
|
||||
final bookingApiModel = BookingApiModel(
|
||||
startDate: booking.startDate,
|
||||
endDate: booking.endDate,
|
||||
name: '${booking.destination.name}, ${booking.destination.continent}',
|
||||
|
||||
@@ -22,7 +22,7 @@ class ApiClient {
|
||||
HttpClient Function()? clientFactory,
|
||||
}) : _host = host ?? 'localhost',
|
||||
_port = port ?? 8080,
|
||||
_clientFactory = clientFactory ?? (() => HttpClient());
|
||||
_clientFactory = clientFactory ?? HttpClient.new;
|
||||
|
||||
final String _host;
|
||||
final int _port;
|
||||
|
||||
@@ -16,7 +16,7 @@ class AuthApiClient {
|
||||
HttpClient Function()? clientFactory,
|
||||
}) : _host = host ?? 'localhost',
|
||||
_port = port ?? 8080,
|
||||
_clientFactory = clientFactory ?? (() => HttpClient());
|
||||
_clientFactory = clientFactory ?? HttpClient.new;
|
||||
|
||||
final String _host;
|
||||
final int _port;
|
||||
|
||||
@@ -48,12 +48,12 @@ class LocalDataService {
|
||||
|
||||
Future<List<Activity>> getActivities() async {
|
||||
final json = await _loadStringAsset(Assets.activities);
|
||||
return json.map<Activity>((json) => Activity.fromJson(json)).toList();
|
||||
return json.map<Activity>(Activity.fromJson).toList();
|
||||
}
|
||||
|
||||
Future<List<Destination>> getDestinations() async {
|
||||
final json = await _loadStringAsset(Assets.destinations);
|
||||
return json.map<Destination>((json) => Destination.fromJson(json)).toList();
|
||||
return json.map<Destination>(Destination.fromJson).toList();
|
||||
}
|
||||
|
||||
Future<List<Map<String, dynamic>>> _loadStringAsset(String asset) async {
|
||||
|
||||
Reference in New Issue
Block a user