diff --git a/compass_app/app/analysis_options.yaml b/compass_app/app/analysis_options.yaml index 59af2e8870d..06985b74eb8 100644 --- a/compass_app/app/analysis_options.yaml +++ b/compass_app/app/analysis_options.yaml @@ -2,4 +2,10 @@ include: package:flutter_lints/flutter.yaml linter: rules: + - combinators_ordering + - directives_ordering + - omit_local_variable_types + - prefer_final_fields + - prefer_final_in_for_each + - prefer_final_locals - prefer_relative_imports diff --git a/compass_app/app/lib/config/dependencies.dart b/compass_app/app/lib/config/dependencies.dart index 42e28347724..3bd1f065e89 100644 --- a/compass_app/app/lib/config/dependencies.dart +++ b/compass_app/app/lib/config/dependencies.dart @@ -2,24 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:provider/single_child_widget.dart'; import 'package:provider/provider.dart'; +import 'package:provider/single_child_widget.dart'; +import '../data/repositories/activity/activity_repository.dart'; +import '../data/repositories/activity/activity_repository_local.dart'; +import '../data/repositories/activity/activity_repository_remote.dart'; import '../data/repositories/auth/auth_repository.dart'; import '../data/repositories/auth/auth_repository_dev.dart'; import '../data/repositories/auth/auth_repository_remote.dart'; import '../data/repositories/booking/booking_repository.dart'; import '../data/repositories/booking/booking_repository_local.dart'; import '../data/repositories/booking/booking_repository_remote.dart'; -import '../data/repositories/user/user_repository.dart'; -import '../data/repositories/user/user_repository_local.dart'; -import '../data/repositories/user/user_repository_remote.dart'; -import '../data/services/api/auth_api_client.dart'; -import '../data/services/local/local_data_service.dart'; -import '../data/services/shared_preferences_service.dart'; -import '../data/repositories/activity/activity_repository.dart'; -import '../data/repositories/activity/activity_repository_local.dart'; -import '../data/repositories/activity/activity_repository_remote.dart'; import '../data/repositories/continent/continent_repository.dart'; import '../data/repositories/continent/continent_repository_local.dart'; import '../data/repositories/continent/continent_repository_remote.dart'; @@ -28,7 +22,13 @@ import '../data/repositories/destination/destination_repository_local.dart'; import '../data/repositories/destination/destination_repository_remote.dart'; import '../data/repositories/itinerary_config/itinerary_config_repository.dart'; import '../data/repositories/itinerary_config/itinerary_config_repository_memory.dart'; +import '../data/repositories/user/user_repository.dart'; +import '../data/repositories/user/user_repository_local.dart'; +import '../data/repositories/user/user_repository_remote.dart'; import '../data/services/api/api_client.dart'; +import '../data/services/api/auth_api_client.dart'; +import '../data/services/local/local_data_service.dart'; +import '../data/services/shared_preferences_service.dart'; import '../domain/use_cases/booking/booking_create_use_case.dart'; import '../domain/use_cases/booking/booking_share_use_case.dart'; diff --git a/compass_app/app/lib/data/repositories/booking/booking_repository_remote.dart b/compass_app/app/lib/data/repositories/booking/booking_repository_remote.dart index cdb66b86df8..94ca8fda588 100644 --- a/compass_app/app/lib/data/repositories/booking/booking_repository_remote.dart +++ b/compass_app/app/lib/data/repositories/booking/booking_repository_remote.dart @@ -23,7 +23,7 @@ class BookingRepositoryRemote implements BookingRepository { @override Future> 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}', diff --git a/compass_app/app/lib/data/services/api/api_client.dart b/compass_app/app/lib/data/services/api/api_client.dart index 5068c443bec..9b75a4d2130 100644 --- a/compass_app/app/lib/data/services/api/api_client.dart +++ b/compass_app/app/lib/data/services/api/api_client.dart @@ -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; diff --git a/compass_app/app/lib/data/services/api/auth_api_client.dart b/compass_app/app/lib/data/services/api/auth_api_client.dart index 89e309674ad..90cfb161997 100644 --- a/compass_app/app/lib/data/services/api/auth_api_client.dart +++ b/compass_app/app/lib/data/services/api/auth_api_client.dart @@ -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; diff --git a/compass_app/app/lib/data/services/local/local_data_service.dart b/compass_app/app/lib/data/services/local/local_data_service.dart index c88828b2db0..bf19cf8348c 100644 --- a/compass_app/app/lib/data/services/local/local_data_service.dart +++ b/compass_app/app/lib/data/services/local/local_data_service.dart @@ -48,12 +48,12 @@ class LocalDataService { Future> getActivities() async { final json = await _loadStringAsset(Assets.activities); - return json.map((json) => Activity.fromJson(json)).toList(); + return json.map(Activity.fromJson).toList(); } Future> getDestinations() async { final json = await _loadStringAsset(Assets.destinations); - return json.map((json) => Destination.fromJson(json)).toList(); + return json.map(Destination.fromJson).toList(); } Future>> _loadStringAsset(String asset) async { diff --git a/compass_app/app/lib/domain/use_cases/booking/booking_share_use_case.dart b/compass_app/app/lib/domain/use_cases/booking/booking_share_use_case.dart index b7d66f0c737..ecfab18c1df 100644 --- a/compass_app/app/lib/domain/use_cases/booking/booking_share_use_case.dart +++ b/compass_app/app/lib/domain/use_cases/booking/booking_share_use_case.dart @@ -6,8 +6,8 @@ import 'package:flutter/material.dart'; import 'package:logging/logging.dart'; import 'package:share_plus/share_plus.dart'; -import '../../../utils/result.dart'; import '../../../ui/core/ui/date_format_start_end.dart'; +import '../../../utils/result.dart'; import '../../models/booking/booking.dart'; typedef ShareFunction = Future Function(String text); diff --git a/compass_app/app/lib/main.dart b/compass_app/app/lib/main.dart index 65b39e0d418..880d91d3101 100644 --- a/compass_app/app/lib/main.dart +++ b/compass_app/app/lib/main.dart @@ -2,16 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:provider/provider.dart'; +import 'main_development.dart' as development; +import 'routing/router.dart'; import 'ui/core/localization/applocalization.dart'; import 'ui/core/themes/theme.dart'; -import 'routing/router.dart'; -import 'package:flutter/material.dart'; - import 'ui/core/ui/scroll_behavior.dart'; -import 'main_development.dart' as development; /// Default main method void main() { diff --git a/compass_app/app/lib/routing/router.dart b/compass_app/app/lib/routing/router.dart index e0e085b43ec..e1112101aa7 100644 --- a/compass_app/app/lib/routing/router.dart +++ b/compass_app/app/lib/routing/router.dart @@ -11,8 +11,8 @@ import '../ui/activities/view_models/activities_viewmodel.dart'; import '../ui/activities/widgets/activities_screen.dart'; import '../ui/auth/login/view_models/login_viewmodel.dart'; import '../ui/auth/login/widgets/login_screen.dart'; -import '../ui/booking/widgets/booking_screen.dart'; import '../ui/booking/view_models/booking_viewmodel.dart'; +import '../ui/booking/widgets/booking_screen.dart'; import '../ui/home/view_models/home_viewmodel.dart'; import '../ui/home/widgets/home_screen.dart'; import '../ui/results/view_models/results_viewmodel.dart'; @@ -137,8 +137,8 @@ GoRouter router( // From https://github.com/flutter/packages/blob/main/packages/go_router/example/lib/redirection.dart Future _redirect(BuildContext context, GoRouterState state) async { // if the user is not logged in, they need to login - final bool loggedIn = await context.read().isAuthenticated; - final bool loggingIn = state.matchedLocation == Routes.login; + final loggedIn = await context.read().isAuthenticated; + final loggingIn = state.matchedLocation == Routes.login; if (!loggedIn) { return Routes.login; } diff --git a/compass_app/app/lib/ui/auth/logout/view_models/logout_viewmodel.dart b/compass_app/app/lib/ui/auth/logout/view_models/logout_viewmodel.dart index 0effd434dc5..7c40dee8c1e 100644 --- a/compass_app/app/lib/ui/auth/logout/view_models/logout_viewmodel.dart +++ b/compass_app/app/lib/ui/auth/logout/view_models/logout_viewmodel.dart @@ -21,7 +21,7 @@ class LogoutViewModel { late Command0 logout; Future _logout() async { - var result = await _authLogoutRepository.logout(); + final result = await _authLogoutRepository.logout(); switch (result) { case Ok(): // clear stored itinerary config diff --git a/compass_app/app/lib/ui/booking/view_models/booking_viewmodel.dart b/compass_app/app/lib/ui/booking/view_models/booking_viewmodel.dart index f32d1a4bbc9..46105a18db1 100644 --- a/compass_app/app/lib/ui/booking/view_models/booking_viewmodel.dart +++ b/compass_app/app/lib/ui/booking/view_models/booking_viewmodel.dart @@ -9,10 +9,10 @@ import '../../../data/repositories/booking/booking_repository.dart'; import '../../../data/repositories/itinerary_config/itinerary_config_repository.dart'; import '../../../domain/models/booking/booking.dart'; import '../../../domain/models/itinerary_config/itinerary_config.dart'; -import '../../../utils/command.dart'; -import '../../../utils/result.dart'; import '../../../domain/use_cases/booking/booking_create_use_case.dart'; import '../../../domain/use_cases/booking/booking_share_use_case.dart'; +import '../../../utils/command.dart'; +import '../../../utils/result.dart'; class BookingViewModel extends ChangeNotifier { BookingViewModel({ diff --git a/compass_app/app/lib/ui/core/themes/dimens.dart b/compass_app/app/lib/ui/core/themes/dimens.dart index d665bcc4c96..8599f0ba674 100644 --- a/compass_app/app/lib/ui/core/themes/dimens.dart +++ b/compass_app/app/lib/ui/core/themes/dimens.dart @@ -29,8 +29,8 @@ abstract final class Dimens { EdgeInsets get edgeInsetsScreenSymmetric => EdgeInsets.symmetric( horizontal: paddingScreenHorizontal, vertical: paddingScreenVertical); - static final Dimens desktop = _DimensDesktop(); - static final Dimens mobile = _DimensMobile(); + static const Dimens desktop = _DimensDesktop(); + static const Dimens mobile = _DimensMobile(); /// Get dimensions definition based on screen size factory Dimens.of(BuildContext context) => @@ -50,6 +50,8 @@ final class _DimensMobile extends Dimens { @override final double profilePictureSize = 64.0; + + const _DimensMobile(); } /// Desktop/Web dimensions @@ -62,4 +64,6 @@ final class _DimensDesktop extends Dimens { @override final double profilePictureSize = 128.0; + + const _DimensDesktop(); } diff --git a/compass_app/app/lib/ui/core/themes/theme.dart b/compass_app/app/lib/ui/core/themes/theme.dart index 98483bcfc69..a61b1fa8d26 100644 --- a/compass_app/app/lib/ui/core/themes/theme.dart +++ b/compass_app/app/lib/ui/core/themes/theme.dart @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'colors.dart'; -import '../ui/tag_chip.dart'; import 'package:flutter/material.dart'; +import '../ui/tag_chip.dart'; +import 'colors.dart'; + abstract final class AppTheme { static const _textTheme = TextTheme( headlineLarge: TextStyle( diff --git a/compass_app/app/lib/ui/core/ui/search_bar.dart b/compass_app/app/lib/ui/core/ui/search_bar.dart index 18859d4d1d0..59d5b10a1eb 100644 --- a/compass_app/app/lib/ui/core/ui/search_bar.dart +++ b/compass_app/app/lib/ui/core/ui/search_bar.dart @@ -80,7 +80,9 @@ class _QueryText extends StatelessWidget { } return Text( - '$continent - ${dateFormatStartEnd(DateTimeRange(start: startDate, end: endDate))} - Guests: $guests', + '$continent - ' + '${dateFormatStartEnd(DateTimeRange(start: startDate, end: endDate))} - ' + 'Guests: $guests', textAlign: TextAlign.center, style: Theme.of(context).textTheme.bodyLarge, ); diff --git a/compass_app/app/lib/ui/core/ui/tag_chip.dart b/compass_app/app/lib/ui/core/ui/tag_chip.dart index a06fea6f30a..02d8c50d161 100644 --- a/compass_app/app/lib/ui/core/ui/tag_chip.dart +++ b/compass_app/app/lib/ui/core/ui/tag_chip.dart @@ -4,10 +4,11 @@ import 'dart:ui'; -import '../themes/colors.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import '../themes/colors.dart'; + class TagChip extends StatelessWidget { const TagChip({ super.key, @@ -96,7 +97,7 @@ class TagChip extends StatelessWidget { // Note: original Figma file uses Google Sans // which is not available on GoogleFonts - _textStyle(BuildContext context) => GoogleFonts.openSans( + TextStyle _textStyle(BuildContext context) => GoogleFonts.openSans( textStyle: TextStyle( fontWeight: FontWeight.w500, fontSize: fontSize, diff --git a/compass_app/app/lib/ui/home/widgets/home_screen.dart b/compass_app/app/lib/ui/home/widgets/home_screen.dart index 46a0c68337b..7ee012ef3bb 100644 --- a/compass_app/app/lib/ui/home/widgets/home_screen.dart +++ b/compass_app/app/lib/ui/home/widgets/home_screen.dart @@ -169,11 +169,11 @@ class _Booking extends StatelessWidget { confirmDismiss: confirmDismiss, background: Container( color: AppColors.grey1, - child: Row( + child: const Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Padding( - padding: const EdgeInsets.only(right: Dimens.paddingHorizontal), + padding: EdgeInsets.only(right: Dimens.paddingHorizontal), child: Icon(Icons.delete), ), ], diff --git a/compass_app/app/lib/ui/results/view_models/results_viewmodel.dart b/compass_app/app/lib/ui/results/view_models/results_viewmodel.dart index 94d1f5d2df7..ad2b71a0a28 100644 --- a/compass_app/app/lib/ui/results/view_models/results_viewmodel.dart +++ b/compass_app/app/lib/ui/results/view_models/results_viewmodel.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:flutter/cupertino.dart'; import 'package:logging/logging.dart'; import '../../../data/repositories/destination/destination_repository.dart'; @@ -10,7 +11,6 @@ import '../../../domain/models/destination/destination.dart'; import '../../../domain/models/itinerary_config/itinerary_config.dart'; import '../../../utils/command.dart'; import '../../../utils/result.dart'; -import 'package:flutter/cupertino.dart'; /// Results screen view model /// Based on https://docs.flutter.dev/get-started/fwe/state-management#using-mvvm-for-your-applications-architecture diff --git a/compass_app/app/lib/ui/search_form/widgets/search_form_date.dart b/compass_app/app/lib/ui/search_form/widgets/search_form_date.dart index 1c9c4b95421..ba1cd59202d 100644 --- a/compass_app/app/lib/ui/search_form/widgets/search_form_date.dart +++ b/compass_app/app/lib/ui/search_form/widgets/search_form_date.dart @@ -5,9 +5,9 @@ import 'package:flutter/material.dart'; import '../../core/localization/applocalization.dart'; +import '../../core/themes/colors.dart'; import '../../core/themes/dimens.dart'; import '../../core/ui/date_format_start_end.dart'; -import '../../core/themes/colors.dart'; import '../view_models/search_form_viewmodel.dart'; /// Date selection form field. diff --git a/compass_app/app/lib/ui/search_form/widgets/search_form_screen.dart b/compass_app/app/lib/ui/search_form/widgets/search_form_screen.dart index fabd2a00fc7..bfa4aa9b11e 100644 --- a/compass_app/app/lib/ui/search_form/widgets/search_form_screen.dart +++ b/compass_app/app/lib/ui/search_form/widgets/search_form_screen.dart @@ -10,9 +10,9 @@ import '../../core/themes/dimens.dart'; import '../../core/ui/search_bar.dart'; import '../../results/widgets/results_screen.dart'; import '../view_models/search_form_viewmodel.dart'; +import 'search_form_continent.dart'; import 'search_form_date.dart'; import 'search_form_guests.dart'; -import 'search_form_continent.dart'; import 'search_form_submit.dart'; /// Search form screen diff --git a/compass_app/app/lib/utils/command.dart b/compass_app/app/lib/utils/command.dart index 2e37434b99b..1df59621612 100644 --- a/compass_app/app/lib/utils/command.dart +++ b/compass_app/app/lib/utils/command.dart @@ -79,7 +79,7 @@ class Command0 extends Command { /// Executes the action. Future execute() async { - await _execute(() => _action()); + await _execute(_action); } } diff --git a/compass_app/app/test/data/repositories/destination/destination_repository_local_test.dart b/compass_app/app/test/data/repositories/destination/destination_repository_local_test.dart index f53cf77b406..8965348f96c 100644 --- a/compass_app/app/test/data/repositories/destination/destination_repository_local_test.dart +++ b/compass_app/app/test/data/repositories/destination/destination_repository_local_test.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:compass_app/data/repositories/destination/destination_repository_local.dart'; import 'package:compass_app/data/services/local/local_data_service.dart'; import 'package:compass_app/utils/result.dart'; -import 'package:compass_app/data/repositories/destination/destination_repository_local.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../../../testing/utils/result.dart'; diff --git a/compass_app/app/test/domain/use_cases/booking/booking_create_use_case_test.dart b/compass_app/app/test/domain/use_cases/booking/booking_create_use_case_test.dart index 6e22287d1b6..28e06a79e80 100644 --- a/compass_app/app/test/domain/use_cases/booking/booking_create_use_case_test.dart +++ b/compass_app/app/test/domain/use_cases/booking/booking_create_use_case_test.dart @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:compass_app/domain/use_cases/booking/booking_create_use_case.dart'; import 'package:compass_app/domain/models/itinerary_config/itinerary_config.dart'; +import 'package:compass_app/domain/use_cases/booking/booking_create_use_case.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../../../testing/fakes/repositories/fake_activities_repository.dart'; diff --git a/compass_app/app/test/domain/use_cases/booking/booking_share_use_case_test.dart b/compass_app/app/test/domain/use_cases/booking/booking_share_use_case_test.dart index 4cb920e8826..946bb6e2ea9 100644 --- a/compass_app/app/test/domain/use_cases/booking/booking_share_use_case_test.dart +++ b/compass_app/app/test/domain/use_cases/booking/booking_share_use_case_test.dart @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:compass_app/domain/use_cases/booking/booking_share_use_case.dart'; import 'package:compass_app/domain/models/booking/booking.dart'; +import 'package:compass_app/domain/use_cases/booking/booking_share_use_case.dart'; import 'package:flutter_test/flutter_test.dart'; import '../../../../testing/models/activity.dart'; diff --git a/compass_app/app/test/ui/booking/booking_screen_test.dart b/compass_app/app/test/ui/booking/booking_screen_test.dart index 6ae3100de9a..808a3b837b3 100644 --- a/compass_app/app/test/ui/booking/booking_screen_test.dart +++ b/compass_app/app/test/ui/booking/booking_screen_test.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:compass_app/domain/models/itinerary_config/itinerary_config.dart'; import 'package:compass_app/domain/use_cases/booking/booking_create_use_case.dart'; import 'package:compass_app/domain/use_cases/booking/booking_share_use_case.dart'; -import 'package:compass_app/domain/models/itinerary_config/itinerary_config.dart'; import 'package:compass_app/ui/booking/view_models/booking_viewmodel.dart'; import 'package:compass_app/ui/booking/widgets/booking_screen.dart'; import 'package:flutter/foundation.dart'; diff --git a/compass_app/app/test/ui/home/widgets/home_screen_test.dart b/compass_app/app/test/ui/home/widgets/home_screen_test.dart index 330fc15a6b0..24890be413f 100644 --- a/compass_app/app/test/ui/home/widgets/home_screen_test.dart +++ b/compass_app/app/test/ui/home/widgets/home_screen_test.dart @@ -37,7 +37,7 @@ void main() { when(() => goRouter.push(any())).thenAnswer((_) => Future.value(null)); }); - loadWidget(WidgetTester tester) async { + Future loadWidget(WidgetTester tester) async { await testApp( tester, ChangeNotifierProvider.value( diff --git a/compass_app/app/test/ui/search_form/view_models/search_form_viewmodel_test.dart b/compass_app/app/test/ui/search_form/view_models/search_form_viewmodel_test.dart index f9e57b70858..87da6dfa858 100644 --- a/compass_app/app/test/ui/search_form/view_models/search_form_viewmodel_test.dart +++ b/compass_app/app/test/ui/search_form/view_models/search_form_viewmodel_test.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'package:compass_app/ui/search_form/view_models/search_form_viewmodel.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:compass_app/ui/search_form/view_models/search_form_viewmodel.dart'; import '../../../../testing/fakes/repositories/fake_continent_repository.dart'; import '../../../../testing/fakes/repositories/fake_itinerary_config_repository.dart'; @@ -28,7 +28,7 @@ void main() { }); test('Setting dateRange updates correctly', () { - final DateTimeRange newDateRange = DateTimeRange( + final newDateRange = DateTimeRange( start: DateTime(2024, 1, 1), end: DateTime(2024, 1, 31), ); @@ -59,7 +59,7 @@ void main() { viewModel.guests = 2; viewModel.selectedContinent = 'CONTINENT'; - final DateTimeRange newDateRange = DateTimeRange( + final newDateRange = DateTimeRange( start: DateTime(2024, 1, 1), end: DateTime(2024, 1, 31), ); diff --git a/compass_app/app/test/ui/search_form/widgets/search_form_date_test.dart b/compass_app/app/test/ui/search_form/widgets/search_form_date_test.dart index d89a3fd960a..eb1de1d1875 100644 --- a/compass_app/app/test/ui/search_form/widgets/search_form_date_test.dart +++ b/compass_app/app/test/ui/search_form/widgets/search_form_date_test.dart @@ -4,8 +4,8 @@ import 'package:compass_app/ui/search_form/view_models/search_form_viewmodel.dart'; import 'package:compass_app/ui/search_form/widgets/search_form_date.dart'; -import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; import '../../../../testing/app.dart'; import '../../../../testing/fakes/repositories/fake_continent_repository.dart'; diff --git a/compass_app/app/test/ui/search_form/widgets/search_form_guests_test.dart b/compass_app/app/test/ui/search_form/widgets/search_form_guests_test.dart index 64aa16cf8a3..858f3e0027e 100644 --- a/compass_app/app/test/ui/search_form/widgets/search_form_guests_test.dart +++ b/compass_app/app/test/ui/search_form/widgets/search_form_guests_test.dart @@ -4,8 +4,8 @@ import 'package:compass_app/ui/search_form/view_models/search_form_viewmodel.dart'; import 'package:compass_app/ui/search_form/widgets/search_form_guests.dart'; -import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; import '../../../../testing/app.dart'; import '../../../../testing/fakes/repositories/fake_continent_repository.dart'; diff --git a/compass_app/app/test/ui/search_form/widgets/search_form_submit_test.dart b/compass_app/app/test/ui/search_form/widgets/search_form_submit_test.dart index 4a7d30aed60..949d4043604 100644 --- a/compass_app/app/test/ui/search_form/widgets/search_form_submit_test.dart +++ b/compass_app/app/test/ui/search_form/widgets/search_form_submit_test.dart @@ -45,7 +45,7 @@ void main() { // Fill in data viewModel.guests = 2; viewModel.selectedContinent = 'CONTINENT'; - final DateTimeRange newDateRange = DateTimeRange( + final newDateRange = DateTimeRange( start: DateTime(2024, 1, 1), end: DateTime(2024, 1, 31), ); diff --git a/compass_app/app/test/utils/command_test.dart b/compass_app/app/test/utils/command_test.dart index 964baf40379..3d925a980bd 100644 --- a/compass_app/app/test/utils/command_test.dart +++ b/compass_app/app/test/utils/command_test.dart @@ -48,7 +48,7 @@ void main() { }); test('should only run once', () async { - int count = 0; + var count = 0; final command = Command0(() => Future.value(Result.ok(count++))); final future = command.execute(); diff --git a/compass_app/app/testing/app.dart b/compass_app/app/testing/app.dart index 2650a757d4a..dad9b8ce9ab 100644 --- a/compass_app/app/testing/app.dart +++ b/compass_app/app/testing/app.dart @@ -12,7 +12,7 @@ import 'package:mocktail_image_network/mocktail_image_network.dart'; import 'mocks.dart'; -testApp( +Future testApp( WidgetTester tester, Widget body, { GoRouter? goRouter,