Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
/pluginsPublic archive

[flutter_plugin_tool] Add support for building UWP plugins#4047

Merged
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
20 commits
Select commitHold shift + click to select a range
507f06d
Add UWP support to build-example
stuartmorgan-gMay 17, 2021
aca220d
Fix create order
stuartmorgan-gMay 17, 2021
5a93a36
Add the ability to check for the new supportedVariants
stuartmorgan-gJun 11, 2021
903c642
Gate the build support on platform variant
stuartmorgan-gJun 11, 2021
27ec174
Clean up createFakePlugin API
stuartmorgan-gJun 11, 2021
c414de1
More API cleanup
stuartmorgan-gJun 11, 2021
e50ac6c
More cleanup from API changes
stuartmorgan-gJun 11, 2021
dfc85ef
CHANGELOG
stuartmorgan-gJun 11, 2021
7422daa
Merge branch 'master' into uwp-build-example
stuartmorgan-gJun 12, 2021
2bc437d
Merge branch 'master' into uwp-build-example
stuartmorgan-gJun 17, 2021
e9966ca
Merge branch 'master' into uwp-build-example
stuartmorgan-gJun 21, 2021
04d5917
Merge branch 'master' into uwp-build-example
stuartmorgan-gJun 22, 2021
139004b
Merge branch 'master' into uwp-build-example
stuartmorgan-gJul 15, 2021
06c5c85
Fix analyze warnings from merge mistake
stuartmorgan-gJul 15, 2021
4ce6158
Merge branch 'master' into uwp-build-example
stuartmorgan-gJul 26, 2021
0fd7eb3
Add no-op UWP support to drive
stuartmorgan-gAug 2, 2021
ca8b344
Merge branch 'master' into uwp-build-example
stuartmorgan-gAug 18, 2021
49caa9b
Post-merge build fixes
stuartmorgan-gAug 18, 2021
258781b
Merge branch 'master' into uwp-build-example
stuartmorgan-gAug 26, 2021
d715988
Review feedback
stuartmorgan-gAug 26, 2021
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
PrevPrevious commit
NextNext commit
Merge branch 'master' into uwp-build-example
  • Loading branch information
@stuartmorgan-g
stuartmorgan-g committedJun 17, 2021
commit2bc437d22a30244f9e109e55bb144510c5280042
27 changes: 17 additions & 10 deletions.ci/Dockerfile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
FROM cirrusci/flutter:stable
# The Flutter version is not important here, since the CI scripts update Flutter
# before running. What matters is that the base image is pinned to minimize
# unintended changes when modifying this file.
FROM cirrusci/flutter:2.2.2

RUNsudoapt-get update -y
RUN apt-get update -y

RUN sudo apt-get install -y --no-install-recommends gnupg
# Required by Roboeletric and the Android SDK.
RUN apt-get install -y openjdk-8-jdk
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

RUN apt-get install -y --no-install-recommends gnupg

# Add repo for gcloud sdk and install it
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
Expand All@@ -11,7 +18,7 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

RUNsudoapt-get update && sudo apt-get install -y google-cloud-sdk && \
RUN apt-get update && apt-get install -y google-cloud-sdk && \
gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true

Expand All@@ -24,20 +31,20 @@ RUN yes | sdkmanager \
RUN yes | sdkmanager --licenses

# Install formatter.
RUNsudoapt-get install -y clang-format
RUN apt-get install -y clang-format

# Install xvfb to allow running headless
RUNsudoapt-get install -y xvfb libegl1-mesa
RUN apt-get install -y xvfb libegl1-mesa
# Install Linux desktop build tool requirements.
RUNsudoapt-get install -y clang cmake ninja-build file pkg-config
RUN apt-get install -y clang cmake ninja-build file pkg-config
# Install necessary libraries.
RUNsudoapt-get install -y libgtk-3-dev libblkid-dev liblzma-dev libgcrypt20-dev
RUN apt-get install -y libgtk-3-dev libblkid-dev liblzma-dev libgcrypt20-dev

# Add repo for Google Chrome and install it
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
RUN echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list
RUNsudoapt-get update && sudo apt-get install -y --no-install-recommends google-chrome-stable
RUN apt-get update && apt-get install -y --no-install-recommends google-chrome-stable

# Make Chrome the default so http: has a handler for url_launcher tests.
RUNsudoapt-get install -y xdg-utils
RUN apt-get install -y xdg-utils
RUN xdg-settings set default-web-browser google-chrome.desktop
33 changes: 33 additions & 0 deletions.ci/java8.Dockerfile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
FROM cirrusci/flutter:stable

RUN apt-get update -y

# Required by Roboeletric and the Android SDK.
RUN apt-get install -y openjdk-8-jdk
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

RUN apt-get install -y --no-install-recommends gnupg

# Add repo for gcloud sdk and install it
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

RUN apt-get update && apt-get install -y google-cloud-sdk && \
gcloud config set core/disable_usage_reporting true && \
gcloud config set component_manager/disable_update_check true

RUN yes | sdkmanager \
"platforms;android-27" \
"build-tools;27.0.3" \
"extras;google;m2repository" \
"extras;android;m2repository"

RUN yes | sdkmanager --licenses

# Install formatter.
RUN apt-get install -y clang-format
# Required by Roboeletric and the Android SDK.
RUN apt-get install -y openjdk-8-jdk
9 changes: 7 additions & 2 deletions.cirrus.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,11 @@ tool_setup_template: &TOOL_SETUP_TEMPLATE

flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
upgrade_flutter_script:
# Ensure that the repository has all the branches.
- cd $FLUTTER_HOME
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin
# Switch to the requested branch.
- flutter channel $CHANNEL
- flutter upgrade
<< : *TOOL_SETUP_TEMPLATE
Expand All@@ -34,7 +39,7 @@ task:
<< : *FLUTTER_UPGRADE_TEMPLATE
gke_container:
dockerfile: .ci/Dockerfile
builder_image_name: docker-builder # gce vm image
builder_image_name: docker-builder-linux # gce vm image
builder_image_project: flutter-cirrus
cluster_name: test-cluster
zone: us-central1-a
Expand DownExpand Up@@ -114,7 +119,7 @@ task:
<< : *FLUTTER_UPGRADE_TEMPLATE
gke_container:
dockerfile: .ci/Dockerfile
builder_image_name: docker-builder # gce vm image
builder_image_name: docker-builder-linux # gce vm image
builder_image_project: flutter-cirrus
cluster_name: test-cluster
zone: us-central1-a
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -587,4 +587,34 @@ void main() {

expect(platformGoogleMap.buildingsEnabled, true);
});

testWidgets(
'Default Android widget is AndroidView',
(WidgetTester tester) async {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
child: GoogleMap(
initialCameraPosition: CameraPosition(target: LatLng(10.0, 15.0)),
),
),
);

expect(find.byType(AndroidView), findsOneWidget);
},
);

// TODO(bparrishMines): Uncomment once https://github.com/flutter/plugins/pull/4017 has landed.
// testWidgets('Use AndroidViewSurface on Android', (WidgetTester tester) async {
// await tester.pumpWidget(
// const Directionality(
// textDirection: TextDirection.ltr,
// child: GoogleMap(
// initialCameraPosition: CameraPosition(target: LatLng(10.0, 15.0)),
// ),
// ),
// );
//
// expect(find.byType(AndroidViewSurface), findsOneWidget);
// });
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
## 2.1.0

* Add support for Hybrid Composition when building the Google Maps widget on Android. Set
`MethodChannelGoogleMapsFlutter.useAndroidViewSurface` to `true` to build with Hybrid Composition.

## 2.0.4

* Preserve the `TileProvider` when copying `TileOverlay`, fixing a
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

export 'src/method_channel/method_channel_google_maps_flutter.dart'
show MethodChannelGoogleMapsFlutter;
export 'src/platform_interface/google_maps_flutter_platform.dart';
export 'src/types/types.dart';
export 'src/events/map_event.dart';
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@ import 'dart:typed_data';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart';
import 'package:stream_transform/stream_transform.dart';
Expand DownExpand Up@@ -441,6 +442,98 @@ class MethodChannelGoogleMapsFlutter extends GoogleMapsFlutterPlatform {
return channel(mapId).invokeMethod<Uint8List>('map#takeSnapshot');
}

/// Set [GoogleMapsFlutterPlatform] to use [AndroidViewSurface] to build the Google Maps widget.
///
/// This implementation uses hybrid composition to render the Google Maps
/// Widget on Android. This comes at the cost of some performance on Android
/// versions below 10. See
/// https://flutter.dev/docs/development/platform-integration/platform-views#performance for more
/// information.
///
/// If set to true, the google map widget should be built with
/// [buildViewWithTextDirection] instead of [buildView].
///
/// Defaults to false.
bool useAndroidViewSurface = false;

/// Returns a widget displaying the map view.
///
/// This method includes a parameter for platforms that require a text
/// direction. For example, this should be used when using hybrid composition
/// on Android.
Widget buildViewWithTextDirection(
int creationId,
PlatformViewCreatedCallback onPlatformViewCreated, {
required CameraPosition initialCameraPosition,
required TextDirection textDirection,
Set<Marker> markers = const <Marker>{},
Set<Polygon> polygons = const <Polygon>{},
Set<Polyline> polylines = const <Polyline>{},
Set<Circle> circles = const <Circle>{},
Set<TileOverlay> tileOverlays = const <TileOverlay>{},
Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
Map<String, dynamic> mapOptions = const <String, dynamic>{},
}) {
if (defaultTargetPlatform == TargetPlatform.android &&
useAndroidViewSurface) {
final Map<String, dynamic> creationParams = <String, dynamic>{
'initialCameraPosition': initialCameraPosition.toMap(),
'options': mapOptions,
'markersToAdd': serializeMarkerSet(markers),
'polygonsToAdd': serializePolygonSet(polygons),
'polylinesToAdd': serializePolylineSet(polylines),
'circlesToAdd': serializeCircleSet(circles),
'tileOverlaysToAdd': serializeTileOverlaySet(tileOverlays),
};
return PlatformViewLink(
viewType: 'plugins.flutter.io/google_maps',
surfaceFactory: (
BuildContext context,
PlatformViewController controller,
) {
return AndroidViewSurface(
controller: controller as AndroidViewController,
gestureRecognizers: gestureRecognizers ??
const <Factory<OneSequenceGestureRecognizer>>{},
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
);
},
onCreatePlatformView: (PlatformViewCreationParams params) {
final SurfaceAndroidViewController controller =
PlatformViewsService.initSurfaceAndroidView(
id: params.id,
viewType: 'plugins.flutter.io/google_maps',
layoutDirection: textDirection,
creationParams: creationParams,
creationParamsCodec: const StandardMessageCodec(),
onFocus: () => params.onFocusChanged(true),
);
controller.addOnPlatformViewCreatedListener(
params.onPlatformViewCreated,
);
controller.addOnPlatformViewCreatedListener(
onPlatformViewCreated,
);

controller.create();
return controller;
},
);
}
return buildView(
creationId,
onPlatformViewCreated,
initialCameraPosition: initialCameraPosition,
markers: markers,
polygons: polygons,
polylines: polylines,
circles: circles,
tileOverlays: tileOverlays,
gestureRecognizers: gestureRecognizers,
mapOptions: mapOptions,
);
}

@override
Widget buildView(
int creationId,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@ repository: https://github.com/flutter/plugins/tree/master/packages/google_maps_
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.0.4
version: 2.1.0

environment:
sdk: '>=2.12.0 <3.0.0'
Expand Down
5 changes: 5 additions & 0 deletionspackages/in_app_purchase/in_app_purchase_ios/CHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
## 0.1.0+2

* Changed the iOS payment queue handler in such a way that it only adds a listener to the SKPaymentQueue when there
is a listener to the Dart purchaseStream.

## 0.1.0+1

* Added a "Restore purchases" button to conform to Apple's StoreKit guidelines on [restoring products](https://developer.apple.com/documentation/storekit/in-app_purchase/restoring_purchased_products?language=objc);
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -301,4 +301,46 @@ - (void)testGetPendingTransactions {
XCTAssertEqualObjects(resultArray, @[ transactionMap ]);
}

- (void)testStartAndStopObservingPaymentQueue {
FlutterMethodCall* startCall = [FlutterMethodCall
methodCallWithMethodName:@"-[SKPaymentQueue startObservingTransactionQueue]"
arguments:nil];
FlutterMethodCall* stopCall =
[FlutterMethodCall methodCallWithMethodName:@"-[SKPaymentQueue stopObservingTransactionQueue]"
arguments:nil];

SKPaymentQueueStub* queue = [SKPaymentQueueStub new];

self.plugin.paymentQueueHandler =
[[FIAPaymentQueueHandler alloc] initWithQueue:queue
transactionsUpdated:nil
transactionRemoved:nil
restoreTransactionFailed:nil
restoreCompletedTransactionsFinished:nil
shouldAddStorePayment:^BOOL(SKPayment* _Nonnull payment,
SKProduct* _Nonnull product) {
return YES;
}
updatedDownloads:nil];

// Check that there is no observer to start with.
XCTAssertNil(queue.observer);

// Start observing
[self.plugin handleMethodCall:startCall
result:^(id r){
}];

// Observer should be set
XCTAssertNotNil(queue.observer);

// Stop observing
[self.plugin handleMethodCall:stopCall
result:^(id r){
}];

// No observer should be set
XCTAssertNil(queue.observer);
}

@end
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,6 +36,7 @@ API_AVAILABLE(ios(11.2), macos(10.13.2))

@interface SKPaymentQueueStub : SKPaymentQueue
@property(assign, nonatomic) SKPaymentTransactionState testState;
@property(strong, nonatomic, nullable) id<SKPaymentTransactionObserver> observer;
@end

@interface SKPaymentTransactionStub : SKPaymentTransaction
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -151,8 +151,6 @@ - (SKReceiptRefreshRequestStub *)getRefreshReceiptRequest:(NSDictionary *)proper

@interface SKPaymentQueueStub ()

@property(strong, nonatomic) id<SKPaymentTransactionObserver> observer;

@end

@implementation SKPaymentQueueStub
Expand All@@ -161,6 +159,10 @@ - (void)addTransactionObserver:(id<SKPaymentTransactionObserver>)observer {
self.observer = observer;
}

- (void)removeTransactionObserver:(id<SKPaymentTransactionObserver>)observer {
self.observer = nil;
}

- (void)addPayment:(SKPayment *)payment {
SKPaymentTransactionStub *transaction =
[[SKPaymentTransactionStub alloc] initWithState:self.testState payment:payment];
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,6 +34,8 @@ typedef void (^UpdatedDownloads)(NSArray<SKDownload *> *downloads);

// This method needs to be called before any other methods.
- (void)startObservingPaymentQueue;
// Call this method when the Flutter app is no longer listening
- (void)stopObservingPaymentQueue;

// Appends a payment to the SKPaymentQueue.
//
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,6 +44,10 @@ - (void)startObservingPaymentQueue {
[_queue addTransactionObserver:self];
}

- (void)stopObservingPaymentQueue {
[_queue removeTransactionObserver:self];
}

- (BOOL)addPayment:(SKPayment *)payment {
for (SKPaymentTransaction *transaction in self.queue.transactions) {
if ([transaction.payment.productIdentifier isEqualToString:payment.productIdentifier]) {
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view thefull changes here.

[8]ページ先頭

©2009-2026 Movatter.jp