Skip to content

Commit

Permalink
Merge branch 'main' into i120119-plugin-command-to-fetch-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
reidbaker authored Jul 14, 2023
2 parents 6689161 + 4c11497 commit d6a9168
Show file tree
Hide file tree
Showing 62 changed files with 418 additions and 193 deletions.
4 changes: 4 additions & 0 deletions packages/file_selector/file_selector_macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.3+1

* Updates to the latest version of `pigeon`.

## 0.9.3

* Adds `getSaveLocation` and deprecates `getSavePath`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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.
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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.
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon

import Foundation
Expand Down Expand Up @@ -35,7 +35,7 @@ private func wrapError(_ error: Any) -> [Any?] {

private func nilOrValue<T>(_ value: Any?) -> T? {
if value is NSNull { return nil }
return (value as Any) as! T?
return value as! T?
}

/// A Pigeon representation of the macOS portion of an `XTypeGroup`.
Expand All @@ -46,7 +46,7 @@ struct AllowedTypes {
var mimeTypes: [String?]
var utis: [String?]

static func fromList(_ list: [Any]) -> AllowedTypes? {
static func fromList(_ list: [Any?]) -> AllowedTypes? {
let extensions = list[0] as! [String?]
let mimeTypes = list[1] as! [String?]
let utis = list[2] as! [String?]
Expand Down Expand Up @@ -78,9 +78,9 @@ struct SavePanelOptions {
var nameFieldStringValue: String? = nil
var prompt: String? = nil

static func fromList(_ list: [Any]) -> SavePanelOptions? {
static func fromList(_ list: [Any?]) -> SavePanelOptions? {
var allowedFileTypes: AllowedTypes? = nil
if let allowedFileTypesList = list[0] as! [Any]? {
if let allowedFileTypesList: [Any?] = nilOrValue(list[0]) {
allowedFileTypes = AllowedTypes.fromList(allowedFileTypesList)
}
let directoryPath: String? = nilOrValue(list[1])
Expand Down Expand Up @@ -115,11 +115,11 @@ struct OpenPanelOptions {
var canChooseFiles: Bool
var baseOptions: SavePanelOptions

static func fromList(_ list: [Any]) -> OpenPanelOptions? {
static func fromList(_ list: [Any?]) -> OpenPanelOptions? {
let allowsMultipleSelection = list[0] as! Bool
let canChooseDirectories = list[1] as! Bool
let canChooseFiles = list[2] as! Bool
let baseOptions = SavePanelOptions.fromList(list[3] as! [Any])!
let baseOptions = SavePanelOptions.fromList(list[3] as! [Any?])!

return OpenPanelOptions(
allowsMultipleSelection: allowsMultipleSelection,
Expand All @@ -142,11 +142,11 @@ private class FileSelectorApiCodecReader: FlutterStandardReader {
override func readValue(ofType type: UInt8) -> Any? {
switch type {
case 128:
return AllowedTypes.fromList(self.readValue() as! [Any])
return AllowedTypes.fromList(self.readValue() as! [Any?])
case 129:
return OpenPanelOptions.fromList(self.readValue() as! [Any])
return OpenPanelOptions.fromList(self.readValue() as! [Any?])
case 130:
return SavePanelOptions.fromList(self.readValue() as! [Any])
return SavePanelOptions.fromList(self.readValue() as! [Any?])
default:
return super.readValue(ofType: type)
}
Expand Down Expand Up @@ -214,7 +214,7 @@ class FileSelectorApiSetup {
codec: codec)
if let api = api {
displayOpenPanelChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let optionsArg = args[0] as! OpenPanelOptions
api.displayOpenPanel(options: optionsArg) { result in
switch result {
Expand All @@ -236,7 +236,7 @@ class FileSelectorApiSetup {
codec: codec)
if let api = api {
displaySavePanelChannel.setMessageHandler { message, reply in
let args = message as! [Any]
let args = message as! [Any?]
let optionsArg = args[0] as! SavePanelOptions
api.displaySavePanel(options: optionsArg) { result in
switch result {
Expand Down
4 changes: 2 additions & 2 deletions packages/file_selector/file_selector_macos/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: file_selector_macos
description: macOS implementation of the file_selector plugin.
repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_macos
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22
version: 0.9.3
version: 0.9.3+1

environment:
sdk: ">=2.18.0 <4.0.0"
Expand All @@ -27,4 +27,4 @@ dev_dependencies:
flutter_test:
sdk: flutter
mockito: 5.4.1
pigeon: ^9.2.4
pigeon: ^10.1.3
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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.
// Autogenerated from Pigeon (v9.2.4), do not edit directly.
// Autogenerated from Pigeon (v10.1.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import
// ignore_for_file: avoid_relative_lib_imports
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.3.0

* Adds a `cloudMapId` parameter to support cloud-based map styling.

## 2.2.7

* Removes obsolete null checks on non-nullable values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class MapConfiguration {
this.indoorViewEnabled,
this.trafficEnabled,
this.buildingsEnabled,
this.cloudMapId,
});

/// True if the compass UI should be shown.
Expand Down Expand Up @@ -90,6 +91,12 @@ class MapConfiguration {
/// True if 3D building display should be enabled.
final bool? buildingsEnabled;

/// Identifier that's associated with a specific cloud-based map style.
///
/// See https://developers.google.com/maps/documentation/get-map-id
/// for more details.
final String? cloudMapId;

/// Returns a new options object containing only the values of this instance
/// that are different from [other].
MapConfiguration diffFrom(MapConfiguration other) {
Expand Down Expand Up @@ -143,6 +150,7 @@ class MapConfiguration {
trafficEnabled != other.trafficEnabled ? trafficEnabled : null,
buildingsEnabled:
buildingsEnabled != other.buildingsEnabled ? buildingsEnabled : null,
cloudMapId: cloudMapId != other.cloudMapId ? cloudMapId : null,
);
}

Expand Down Expand Up @@ -171,6 +179,7 @@ class MapConfiguration {
indoorViewEnabled: diff.indoorViewEnabled ?? indoorViewEnabled,
trafficEnabled: diff.trafficEnabled ?? trafficEnabled,
buildingsEnabled: diff.buildingsEnabled ?? buildingsEnabled,
cloudMapId: diff.cloudMapId ?? cloudMapId,
);
}

Expand All @@ -193,7 +202,8 @@ class MapConfiguration {
padding == null &&
indoorViewEnabled == null &&
trafficEnabled == null &&
buildingsEnabled == null;
buildingsEnabled == null &&
cloudMapId == null;

@override
bool operator ==(Object other) {
Expand Down Expand Up @@ -221,7 +231,8 @@ class MapConfiguration {
padding == other.padding &&
indoorViewEnabled == other.indoorViewEnabled &&
trafficEnabled == other.trafficEnabled &&
buildingsEnabled == other.buildingsEnabled;
buildingsEnabled == other.buildingsEnabled &&
cloudMapId == other.cloudMapId;
}

@override
Expand All @@ -244,5 +255,6 @@ class MapConfiguration {
indoorViewEnabled,
trafficEnabled,
buildingsEnabled,
cloudMapId,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ Map<String, Object> jsonForMapConfiguration(MapConfiguration config) {
if (config.trafficEnabled != null) 'trafficEnabled': config.trafficEnabled!,
if (config.buildingsEnabled != null)
'buildingsEnabled': config.buildingsEnabled!,
if (config.cloudMapId != null) 'cloudMapId': config.cloudMapId!,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_maps_f
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.2.7
version: 2.3.0

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart';

const String _kCloudMapId = '000000000000000'; // Dummy map ID.

void main() {
group('diffs', () {
// A options instance with every field set, to test diffs against.
Expand Down Expand Up @@ -53,6 +55,7 @@ void main() {
expect(updated.liteModeEnabled, isNot(null));
expect(updated.padding, isNot(null));
expect(updated.trafficEnabled, isNot(null));
expect(updated.cloudMapId, null);
});

test('handle compassEnabled', () async {
Expand Down Expand Up @@ -281,6 +284,18 @@ void main() {
// A diff applied to non-empty options should update that field.
expect(updated.buildingsEnabled, true);
});

test('handle cloudMapId', () async {
const MapConfiguration diff = MapConfiguration(cloudMapId: _kCloudMapId);

const MapConfiguration empty = MapConfiguration();
final MapConfiguration updated = diffBase.applyDiff(diff);

// A diff applied to empty options should be the diff itself.
expect(empty.applyDiff(diff), diff);
// A diff applied to non-empty options should update that field.
expect(updated.cloudMapId, _kCloudMapId);
});
});

group('isEmpty', () {
Expand Down Expand Up @@ -408,5 +423,11 @@ void main() {

expect(diff.isEmpty, false);
});

test('is false with cloudMapId', () async {
const MapConfiguration diff = MapConfiguration(cloudMapId: _kCloudMapId);

expect(diff.isEmpty, false);
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart';
import 'package:google_maps_flutter_platform_interface/src/types/utils/map_configuration_serialization.dart';

const String _kCloudMapId = '000000000000000'; // Dummy map ID.

void main() {
test('empty serialization', () async {
const MapConfiguration config = MapConfiguration();
Expand All @@ -18,26 +20,26 @@ void main() {

test('complete serialization', () async {
final MapConfiguration config = MapConfiguration(
compassEnabled: false,
mapToolbarEnabled: false,
cameraTargetBounds: CameraTargetBounds(LatLngBounds(
northeast: const LatLng(30, 20), southwest: const LatLng(10, 40))),
mapType: MapType.normal,
minMaxZoomPreference: const MinMaxZoomPreference(1.0, 10.0),
rotateGesturesEnabled: false,
scrollGesturesEnabled: false,
tiltGesturesEnabled: false,
trackCameraPosition: false,
zoomControlsEnabled: false,
zoomGesturesEnabled: false,
liteModeEnabled: false,
myLocationEnabled: false,
myLocationButtonEnabled: false,
padding: const EdgeInsets.all(5.0),
indoorViewEnabled: false,
trafficEnabled: false,
buildingsEnabled: false,
);
compassEnabled: false,
mapToolbarEnabled: false,
cameraTargetBounds: CameraTargetBounds(LatLngBounds(
northeast: const LatLng(30, 20), southwest: const LatLng(10, 40))),
mapType: MapType.normal,
minMaxZoomPreference: const MinMaxZoomPreference(1.0, 10.0),
rotateGesturesEnabled: false,
scrollGesturesEnabled: false,
tiltGesturesEnabled: false,
trackCameraPosition: false,
zoomControlsEnabled: false,
zoomGesturesEnabled: false,
liteModeEnabled: false,
myLocationEnabled: false,
myLocationButtonEnabled: false,
padding: const EdgeInsets.all(5.0),
indoorViewEnabled: false,
trafficEnabled: false,
buildingsEnabled: false,
cloudMapId: _kCloudMapId);

final Map<String, Object> json = jsonForMapConfiguration(config);

Expand Down Expand Up @@ -69,7 +71,8 @@ void main() {
'padding': <double>[5.0, 5.0, 5.0, 5.0],
'indoorEnabled': false,
'trafficEnabled': false,
'buildingsEnabled': false
'buildingsEnabled': false,
'cloudMapId': _kCloudMapId
});
});
}
3 changes: 2 additions & 1 deletion packages/path_provider/path_provider_foundation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 2.2.4

* Updates to the latest version of `pigeon`.
* Updates minimum supported macOS version to 10.14.

## 2.2.3
Expand Down
Loading

0 comments on commit d6a9168

Please sign in to comment.