Skip to content

Commit

Permalink
Merge pull request #685 from juicycleff/feat/upgrade_flutter_3_3
Browse files Browse the repository at this point in the history
feat: bumped to flutter 3.3.0
  • Loading branch information
juicycleff committed Sep 1, 2022
2 parents a1ab360 + 79fba14 commit c884be0
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projectName": "flutter-unity-view-widget",
"projectOwner": "snowballdigital",
"projectOwner": "juicycleff",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.0.0'
flutter-version: '3.3.0'
channel: 'stable'

- name: Clean Dependencies
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2022.2.0

* Enable AndroidView due to native view improvement in flutter 3.3.0

## 2022.1.7+1

* **BREAKING-CHANGE**:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ First depend on the library by adding this to your packages `pubspec.yaml`:
- Flutter 3.0.0
```yaml
dependencies:
flutter_unity_widget: ^2022.1.1+3
flutter_unity_widget: ^2022.2.0
```


Expand Down
2 changes: 1 addition & 1 deletion example/lib/screens/simple_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class _SimpleScreenState extends State<SimpleScreen> {
onUnityCreated: _onUnityCreated,
onUnityMessage: onUnityMessage,
onUnitySceneLoaded: onUnitySceneLoaded,
useAndroidViewSurface: true,
useAndroidViewSurface: false,
borderRadius: BorderRadius.all(Radius.circular(70)),
),
PointerInterceptor(
Expand Down
8 changes: 0 additions & 8 deletions example/unity/DemoApp/Assets/StreamingAssets.meta

This file was deleted.

6 changes: 3 additions & 3 deletions example/unity/DemoApp/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"dependencies": {
"com.unity.collab-proxy": "1.15.18",
"com.unity.collab-proxy": "1.17.1",
"com.unity.ext.nunit": "1.0.6",
"com.unity.ide.rider": "3.0.14",
"com.unity.ide.visualstudio": "2.0.15",
"com.unity.ide.rider": "3.0.15",
"com.unity.ide.visualstudio": "2.0.16",
"com.unity.ide.vscode": "1.2.5",
"com.unity.test-framework": "1.1.31",
"com.unity.textmeshpro": "3.0.6",
Expand Down
8 changes: 4 additions & 4 deletions example/unity/DemoApp/Packages/packages-lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"com.unity.collab-proxy": {
"version": "1.15.18",
"version": "1.17.1",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -24,7 +24,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.14",
"version": "3.0.15",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -33,7 +33,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.15",
"version": "2.0.16",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -56,7 +56,7 @@
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.4.0",
"version": "1.4.2",
"depth": 1,
"source": "registry",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions example/unity/DemoApp/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ PlayerSettings:
Others: 1
bundleVersion: 0.1
preloadedAssets:
- {fileID: 4800000, guid: e7c77f6eaab324a819efdc13b8125a39, type: 3}
- {fileID: -5691617579673776505, guid: 1356279c9d721447b97eebba41ddf775, type: 2}
- {fileID: 4800000, guid: c9f956787b1d945e7b36e0516201fc76, type: 3}
- {fileID: 673190512444688615, guid: 1356279c9d721447b97eebba41ddf775, type: 2}
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
Expand Down
4 changes: 2 additions & 2 deletions example/unity/DemoApp/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 2022.1.7f1
m_EditorVersionWithRevision: 2022.1.7f1 (240f4c1f462c)
m_EditorVersion: 2022.1.13f1
m_EditorVersionWithRevision: 2022.1.13f1 (22856944e6d2)
2 changes: 0 additions & 2 deletions ios/Classes/UnityPlayerUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,13 @@ var sharedApplication: UIApplication?
/// the controller handler methods
@objc
func unityMessageHandlers(_ message: UnsafePointer<Int8>?) {

for c in globalControllers {
if let strMsg = message {
c.handleMessage(message: String(utf8String: strMsg) ?? "")
} else {
c.handleMessage(message: "")
}
}

}

func unitySceneLoadedHandlers(name: UnsafePointer<Int8>?, buildIndex: UnsafePointer<Int32>?, isLoaded: UnsafePointer<Bool>?, isValid: UnsafePointer<Bool>?) {
Expand Down
23 changes: 11 additions & 12 deletions lib/src/io/device_method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,17 @@ class MethodChannelUnityWidget extends UnityWidgetPlatform {
}

if (defaultTargetPlatform == TargetPlatform.android) {
// commented for 3.0.0 changes in platform view rendition
// if (!useAndroidViewSurface) {
// return AndroidView(
// viewType: _viewType,
// onPlatformViewCreated: onPlatformViewCreated,
// gestureRecognizers: gestureRecognizers,
// creationParams: creationParams,
// creationParamsCodec: const StandardMessageCodec(),
// hitTestBehavior: PlatformViewHitTestBehavior.opaque,
// layoutDirection: TextDirection.ltr,
// );
// }
if (!useAndroidViewSurface) {
return AndroidView(
viewType: _viewType,
onPlatformViewCreated: onPlatformViewCreated,
gestureRecognizers: gestureRecognizers,
creationParams: creationParams,
creationParamsCodec: const StandardMessageCodec(),
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
layoutDirection: TextDirection.ltr,
);
}

return PlatformViewLink(
viewType: _viewType,
Expand Down
7 changes: 3 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_unity_widget
description: Flutter Unity 3D widget for embedding Unity game scenes in flutter. This library now supports Unity as a Library.
version: 2022.1.7+1
version: 2022.2.0
#authors:
# - Rex Raphael <rex.raphael@outlook.com>
# - Thomas Stockx <thomas@stockxit.com>
Expand All @@ -9,7 +9,7 @@ homepage: https://github.com/juicycleff/flutter-unity-view-widget/tree/master

environment:
sdk: ">=2.16.0 <3.0.0"
flutter: ">=3.0.0"
flutter: ">=3.3.0"

dependencies:
flutter:
Expand All @@ -19,9 +19,8 @@ dependencies:
flutter_plugin_android_lifecycle: ^2.0.7
stream_transform: ^2.0.0
plugin_platform_interface: ^2.1.2
webview_flutter: ^2.8.0
webviewx: ^0.2.1
ffi: ^1.2.1
# ffi: ^1.2.1 // required for windows support

dev_dependencies:
flutter_test:
Expand Down
3 changes: 1 addition & 2 deletions test/flutter_unity_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ Future<void> main() async {
),
);

expect(find.byType(PlatformViewLink), findsOneWidget);
// expect(find.byType(AndroidView), findsOneWidget);
expect(find.byType(AndroidView), findsOneWidget);
expect(find.byType(UnityWidget), findsOneWidget);
},
);
Expand Down

0 comments on commit c884be0

Please sign in to comment.