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

[google_maps_flutter] Add examples for different iOS versions #3757

Merged
merged 17 commits into from
Apr 20, 2023
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.2.2

* Sets an upper bound on the `GoogleMaps` SDK version that can be used, to
avoid future breakage.

## 2.2.1

* Clarifies explanation of endorsement in README.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,46 @@
# Platform Implementation Test App
# Platform Implementation Test Apps

This is a test app for manual testing and automated integration testing
of this platform implementation. It is not intended to demonstrate actual use of
this package, since the intent is that plugin clients use the app-facing
package.
These are test apps for manual testing and automated integration testing
of this platform implementation. They are not intended to demonstrate actual
use of this package, since the intent is that plugin clients use the
app-facing package.

Unless you are making changes to this implementation package, this example is
very unlikely to be relevant.
Unless you are making changes to this implementation package, these examples
are very unlikely to be relevant.

## Structure

This package contains multiple exmaples, which are used to test different
versions of the Google Maps iOS SDK. Because the plugin's dependency
is loosely pinned, CocoaPods will pick the newest version that supports the
minimum targetted OS version of the application using the plugin. In
order to ensure that the plugin continues to compile against all
SDK versions that could resolve, there are multiple largely identical
examples, each with a different minimum target iOS version.

In order to avoid wasting CI resources, tests are mostly not duplicated.
The test structure is:
* The oldest version has all of the usual tests (Dart integration,
XCTest, XCUITest).
* The newest version has only XCTests (the cheapest tests), which
can be used to unit tests any code paths that are specific to
new SDKs (e.g., behind target OS `#if` checks).

This setup is based on the assumption (based on experience so far) that
the changes in the SDK are unlikely to break functionality at runtime,
but that we will want to have unit test coverage of new-SDK-only code.
New test types can be added to any example if needs change.

## Updating Examples

* When a new major of the SDK comes out that raises the minimum
iOS deployment version, a new example with that minimum target
should be added to ensure that the plugin compiles with that
version of the SDK, and the range in the plugin's `podspec` file
should be bumped to the next major version.
* When the minimum supported version of Flutter (on `stable`)
reaches the point where the oldest example is for an SDK
that can no longer be resolved to, that example should be
removed, and all of its testing (Dart integration tests,
native unit tests, native UI tests) should be folded into
the next-oldest version.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Platform Implementation Test App

This is a test app for manual testing and automated integration testing
of this platform implementation. It is not intended to demonstrate actual use of
this package, since the intent is that plugin clients use the app-facing
package.

Unless you are making changes to this implementation package, this example is
very unlikely to be relevant.

## Versions

This example requires iOS 11, so will select a 5.x GoogleMaps SDK version.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import 'dart:ui' as ui;

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:google_maps_flutter_example/example_google_map.dart';
import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart';
import 'package:integration_test/integration_test.dart';
import 'package:maps_example_dart/example_google_map.dart';

const LatLng _kInitialMapCenter = LatLng(0, 0);
const double _kInitialZoomLevel = 5;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// 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:maps_example_dart/animate_camera.dart';
import 'package:maps_example_dart/lite_mode.dart';
import 'package:maps_example_dart/map_click.dart';
import 'package:maps_example_dart/map_coordinates.dart';
import 'package:maps_example_dart/map_ui.dart';
import 'package:maps_example_dart/maps_demo.dart';
import 'package:maps_example_dart/marker_icons.dart';
import 'package:maps_example_dart/move_camera.dart';
import 'package:maps_example_dart/padding.dart';
import 'package:maps_example_dart/page.dart';
import 'package:maps_example_dart/place_circle.dart';
import 'package:maps_example_dart/place_marker.dart';
import 'package:maps_example_dart/place_polygon.dart';
import 'package:maps_example_dart/place_polyline.dart';
import 'package:maps_example_dart/scrolling_map.dart';
import 'package:maps_example_dart/snapshot.dart';
import 'package:maps_example_dart/tile_overlay.dart';

void main() {
runApp(const MaterialApp(
home: MapsDemo(<GoogleMapExampleAppPage>[
MapUiPage(),
MapCoordinatesPage(),
MapClickPage(),
AnimateCameraPage(),
MoveCameraPage(),
PlaceMarkerPage(),
MarkerIconsPage(),
ScrollingMapPage(),
PlacePolylinePage(),
PlacePolygonPage(),
PlaceCirclePage(),
PaddingPage(),
SnapshotPage(),
LiteModePage(),
TileOverlayPage(),
])));
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ dependencies:
# See https://dart.dev/tools/pub/dependencies#version-constraints
# The example app is bundled with the plugin so we use a path dependency on
# the parent directory to use the current plugin's version.
path: ../
path: ../../
google_maps_flutter_platform_interface: ^2.2.1
maps_example_dart:
path: ../shared/maps_example_dart/

dev_dependencies:
flutter_driver:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Platform Implementation Test App

This is a test app for manual testing and automated integration testing
of this platform implementation. It is not intended to demonstrate actual use of
this package, since the intent is that plugin clients use the app-facing
package.

Unless you are making changes to this implementation package, this example is
very unlikely to be relevant.

## Versions

This example requires iOS 12, so will select a 6.x GoogleMaps SDK version.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
[
{
"elementType": "geometry",
"stylers": [
{
"color": "#242f3e"
}
]
},
{
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#746855"
}
]
},
{
"elementType": "labels.text.stroke",
"stylers": [
{
"color": "#242f3e"
}
]
},
{
"featureType": "administrative.locality",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#d59563"
}
]
},
{
"featureType": "poi",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#d59563"
}
]
},
{
"featureType": "poi.park",
"elementType": "geometry",
"stylers": [
{
"color": "#263c3f"
}
]
},
{
"featureType": "poi.park",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#6b9a76"
}
]
},
{
"featureType": "road",
"elementType": "geometry",
"stylers": [
{
"color": "#38414e"
}
]
},
{
"featureType": "road",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#212a37"
}
]
},
{
"featureType": "road",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#9ca5b3"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry",
"stylers": [
{
"color": "#746855"
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#1f2835"
}
]
},
{
"featureType": "road.highway",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#f3d19c"
}
]
},
{
"featureType": "transit",
"elementType": "geometry",
"stylers": [
{
"color": "#2f3948"
}
]
},
{
"featureType": "transit.station",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#d59563"
}
]
},
{
"featureType": "water",
"elementType": "geometry",
"stylers": [
{
"color": "#17263c"
}
]
},
{
"featureType": "water",
"elementType": "labels.text.fill",
"stylers": [
{
"color": "#515c6d"
}
]
},
{
"featureType": "water",
"elementType": "labels.text.stroke",
"stylers": [
{
"color": "#17263c"
}
]
}
]

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>MinimumOSVersion</key>
<string>12.0</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |build_configuration|
build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
end
end
end
Loading