@@ -39,13 +39,13 @@ This plugin requires Flutter >= 3.3.0
39
39
First depend on the library by adding this to your packages ` pubspec.yaml ` :
40
40
``` yaml
41
41
dependencies :
42
- flutter_unity_widget : ^2022.2.1 # use the latest compatible version
42
+ flutter_unity_widget_2 : ^2022.2.2 # use the latest compatible version
43
43
` ` `
44
44
45
45
Now inside your Dart code you can import it.
46
46
47
47
` ` ` dart
48
- import 'package:flutter_unity_widget /flutter_unity_widget.dart';
48
+ import 'package:flutter_unity_widget_2 /flutter_unity_widget.dart';
49
49
```
50
50
51
51
You will need to open and export a Unity project, even for running the example. Your build will fail if you only include the widget in Flutter!
@@ -180,17 +180,16 @@ Check the **Minimum API Level** setting in the Unity player settings, and match
180
180
The Unity widget will function without this step, but some Unity plugins like ArFoundation will throw ` mUnityPlayer ` errors on newer Unity versions.
181
181
182
182
This is needed for Unity 2020.3.46+, 2021.3.19 - 2021.3.20 and 2022.2.4 - 2022.3.18.
183
- This requires a flutter_unity_widget version that is newer than 2022.2.1.
184
183
185
184
186
185
- 3.1. Open the ` android/app/build.gradle ` file and add the following:
187
186
188
187
``` diff
189
188
dependencies {
190
189
// build.gradle
191
- + implementation project(':flutter_unity_widget ')
190
+ + implementation project(':flutter_unity_widget_2 ')
192
191
// build.gradle.kts (Flutter 3.29+)
193
- + implementation(project(":flutter_unity_widget "))
192
+ + implementation(project(":flutter_unity_widget_2 "))
194
193
}
195
194
```
196
195
- 3.2. Edit your android MainActivity file.
@@ -342,7 +341,7 @@ allprojects {
342
341
``` diff
343
342
import UIKit
344
343
import Flutter
345
- + import flutter_unity_widget
344
+ + import flutter_unity_widget_2
346
345
347
346
@UIApplicationMain
348
347
@objc class AppDelegate: FlutterAppDelegate {
@@ -360,7 +359,7 @@ allprojects {
360
359
361
360
3.2. If you're using Objective-C, open the * ios/Runner/main.m* file and change the following:
362
361
``` diff
363
- + #import "flutter_unity_widget .swift.h"
362
+ + #import "flutter_unity_widget_2 .swift.h"
364
363
365
364
int main(int argc, char * argv[]) {
366
365
@autoreleasepool {
@@ -590,7 +589,7 @@ If you computer does not have an ARM processor, like most computers running on I
590
589
591
590
``` dart
592
591
import 'package:flutter/material.dart';
593
- import 'package:flutter_unity_widget /flutter_unity_widget.dart';
592
+ import 'package:flutter_unity_widget_2 /flutter_unity_widget.dart';
594
593
595
594
void main() {
596
595
runApp(
@@ -647,7 +646,7 @@ class _UnityDemoScreenState extends State<UnityDemoScreen> {
647
646
648
647
``` dart
649
648
import 'package:flutter/material.dart';
650
- import 'package:flutter_unity_widget /flutter_unity_widget.dart';
649
+ import 'package:flutter_unity_widget_2 /flutter_unity_widget.dart';
651
650
652
651
void main() => runApp(const MyApp());
653
652
0 commit comments