Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Platform Interface test workflow #96

Merged
merged 9 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/tests_platform_interface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
- name: Install dependencies
run: flutter pub get
working-directory: ${{ env.dir }}
- name: Build Runner
run: flutter pub run build_runner build
working-directory: ${{ env.dir }}
- name: Flutter Analyze
run: flutter analyze
working-directory: ${{ env.dir }}
Expand Down
12 changes: 0 additions & 12 deletions flutter_google_places_sdk_platform_interface/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ analyzer:
missing_return: warning
# allow having TODOs in the code
todo: ignore
# Ignore analyzer hints for updating pubspecs when using Future or
# Stream and not importing dart:async
# Please see https://github.com/flutter/flutter/pull/24528 for details.
sdk_version_async_exported_from_core: ignore
exclude:
- "bin/cache/**"
- "lib/l10n/messages_*.dart"
Expand All @@ -47,8 +43,6 @@ linter:
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
- always_declare_return_types
- always_put_control_body_on_new_line
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
- always_require_non_null_named_parameters
# - always_specify_types
- annotate_overrides
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
Expand Down Expand Up @@ -106,13 +100,9 @@ linter:
- flutter_style_todos
- hash_and_equals
- implementation_imports
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
- iterable_contains_unrelated_type
# - join_return_with_assignment # not yet tested
- library_names
- library_prefixes
# - lines_longer_than_80_chars # not yet tested
- list_remove_unrelated_type
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
# - missing_whitespace_between_adjacent_strings # not yet tested
- no_adjacent_strings_in_list
Expand Down Expand Up @@ -140,8 +130,6 @@ linter:
- prefer_const_literals_to_create_immutables
# - prefer_constructors_over_static_methods # not yet tested
- prefer_contains
# - prefer_double_quotes # opposite of prefer_single_quotes
- prefer_equal_for_default_values
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
- prefer_final_fields
- prefer_final_in_for_each
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/foundation.dart';


/// Available types for a [Place]
///
Expand Down Expand Up @@ -159,7 +159,7 @@ enum PlaceType {

final placeTypeValuesMap = {
for (final placeType in PlaceType.values)
describeEnum(placeType): placeType
placeType.name: placeType
};

extension PlaceTypeDescriptor on PlaceType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flutter/foundation.dart';


/// Filter to restrict the result set of autocomplete predictions to certain types.
///
Expand Down Expand Up @@ -58,5 +58,5 @@ enum PlaceTypeFilter {
}

extension PlaceTypeFilterDescriptor on PlaceTypeFilter {
String get value => describeEnum(this);
String get value => name;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ void main() {

const channel = MethodChannel('plugins.msh.com/flutter_google_places_sdk');
final List<MethodCall> log = <MethodCall>[];
channel.setMockMethodCallHandler((MethodCall methodCall) async {
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, (MethodCall methodCall) async {
log.add(methodCall);
for (final callback in handlers) {
final result = callback(methodCall);
if (result != null) {
return result;
}
}
return null;
});

final places = FlutterGooglePlacesSdkMethodChannel();
Expand Down Expand Up @@ -89,7 +91,7 @@ void main() {
arguments: <String, Object>{
'query': testQuery,
'countries': testCountries,
'typesFilter': '(cities)',
'typesFilter': ['(cities)'],
'newSessionToken': newSessionToken,
'origin': origin.toJson(),
'locationBias': locationBias.toJson(),
Expand Down
Loading