Comments (13)
这是一个 Flutter Plugin,不需要配合 flutter module一起使用,但是如果你是要嵌入原生应用的话,应该是需要flutter module的。另外如果要把flutter作为第一启动页面的话,比较好的选择是新建一个 flutter app,然后对其进行改造,将其放在storyboard上的FlutterViewController替换掉你自己继承于NavigatorFlutterViewController的类,继承的目的是为了处理好引擎的复用。
from flutter_thrio.
这是一个Flutter插件,不需要配合flutter module一起使用,但是如果你是要嵌入原生应用的话,应该是需要Flutter module的。另外如果要把Flutter作为第一启动页面的话,比较好的选择是新建一个flutter应用程序,然后进行进行改造,将其放在storyboard上的FlutterViewController替换掉你自己继承于NavigatorFlutterViewController的类,继承的目的是为了处理好引擎的替代。
好的,谢谢大佬,我去尝试一下。
from flutter_thrio.
这是一个Flutter插件,不需要配合flutter module一起使用,但是如果你是要嵌入原生应用的话,应该是需要Flutter module的。另外如果要把Flutter作为第一启动页面的话,比较好的选择是新建一个flutter应用程序,然后进行进行改造,将其放在storyboard上的FlutterViewController替换掉你自己继承于NavigatorFlutterViewController的类,继承的目的是为了处理好引擎的替代。
大佬给一个解决思路吧,这个错困扰我了两天了。
MissingPluginException(No implementation found for method registerUrls on channel method___thrio_app_)
#0 MethodChannel.invokeMethod
from flutter_thrio.
你有demo的话好解决点
from flutter_thrio.
你有demo的话好解决点
就是在flutter侧一打开调试模式,就会报这个错(emmm,我不知道你能不能看到我上传的截图,这如果第一启动是OC的页面,再push到flutter页面,就不会报这个错,如果是直接在flutter启动的话,就会报这个错。如果可以的话,我希望能够添加多一个flutter作为第一启动的demo,给我们这些小白参考。)
from flutter_thrio.
你有demo的话好解决点
这个是vscode的抛出的异常。
出现异常。
MissingPluginException (MissingPluginException(No implementation found for method registerUrls on channel method___thrio_app_))
from flutter_thrio.
你是少了一些步骤嘛?没到插件注册这一步呢,原生端的代码要加,参考下thrio的demo
from flutter_thrio.
你是少了一些步骤嘛?没到插件注册这一步呢,原生端的代码要加,参考下thrio的demo
OC那边的代码不知道算不算添加成功,但是我能够在OC->push->flutter, 然后在flutter->push->OC,都是没有问题的。
` // 这样子是没有问题的,这边是把UIVIewController作为第一启动
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[ThrioModule init:[RegisterThrio new]];
FristViewController *vc = [FristViewController viewController];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
self.window.rootViewController = nav;
[self.window makeKeyAndVisible];
return YES;
// 这样子是有问题的,我只是flutterViewController作为第一启动,就不行了
// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// [ThrioModule init:[RegisterThrio new]];
// FlutterViewController *flutterView = [DartdViewController viewController];
// UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:flutterView];
// self.window.rootViewController = nav;
// [self.window makeKeyAndVisible];
// return YES;`
from flutter_thrio.
因为你的DartdViewController自己起了一个引擎,这个引擎没有注册插件,你重写其构造函数,用如下的方式获取引擎 [NavigatorFlutterEngineFactory.shared getEngineByEntrypoint:@""]
,传给父类,这样应该就可以了
from flutter_thrio.
FlutterEngine *flutterEngine = [NavigatorFlutterEngineFactory.shared getEngineByEntrypoint:@""];
[flutterEngine run];
FlutterViewController *vc = [[FlutterViewController alloc] initWithEngine:flutterEngine nibName:nil bundle:nil];
return vc;
因为你的DartdViewController自己起了一个引擎,这个引擎没有注册插件,你重新构造函数,用如下的方式获取引擎
[NavigatorFlutterEngineFactory.shared getEngineByEntrypoint:@""]
,传给父类,这样应该就可以了
FlutterEngine *flutterEngine = [NavigatorFlutterEngineFactory.shared getEngineByEntrypoint:@""]; [flutterEngine run]; FlutterViewController *vc = [[FlutterViewController alloc] initWithEngine:flutterEngine nibName:nil bundle:nil]; return vc;
大佬是这样吗?我该在哪里导入这个NavigatorFlutterEngineFactory类?感谢大佬嘻嘻嘻嘻
from flutter_thrio.
因为你的DartdViewController自己起了一个引擎,这个引擎没有注册插件,你重新构造函数,用如下的方式获取引擎
[NavigatorFlutterEngineFactory.shared getEngineByEntrypoint:@""]
,传给父类,这样应该就可以了
from flutter_thrio.
你加下我微信吧 foxsofter
from flutter_thrio.
foxsofter
哇,谢谢大佬。
from flutter_thrio.
Related Issues (20)
- [feat] 添加 canPop HOT 1
- [bug] iOS下横屏的问题 HOT 1
- 有考虑支持navigator2.0的page么? HOT 9
- [feat] 支持复杂类型参数传递时不需要序列化和反序列化 HOT 1
- [fix] 适配 flutter_webview_plugin 插件 HOT 2
- flutter页面启动一个native页面,关闭native页面后,无法再次打开,走了这个routeAction != RouteAction.NONE HOT 1
- an incorrect `androidPackage: com.hellobike.flutter.thrio` or `mainClass` entry in the plugin's pubspec.yaml HOT 1
- Android移除两个Flutter之间的原生页面,然后push 某个flutter页面,push失败,且页面无法操作 HOT 3
- iOS 14真机debug模式崩溃 HOT 1
- [feat] Flutter端生成代码框架
- [feat] 增加原生 ModuleContext 共享状态给 Flutter 的 ModuleContext 的接口 HOT 1
- Android上Flutter页面回收重启问题 HOT 2
- [feat] 适配 1.22.6
- [feat] canPop要能兼容原生方式打开的页面作为首页 HOT 1
- [feat] TransitionBuilder 要能兼容所有场景 HOT 1
- [feat] 丰富 ModuleContext 的能力,提供 Stream 接口 HOT 1
- 继承ThrioActivity之后,flutter与android原生之间如何通信? HOT 2
- 1.7.2 版本 从flutter页面跳native页面再跳flutter页面,前一个flutter页面会didChangeDependencies两次,第二次的时候pageview的controller中的offset被清空 HOT 1
- 在ActivityGroup中使用ThrioActivity会崩溃 HOT 1
- 如何在flutter端发送通知,让flutteractivity能打开友盟分享的dialog,想重写onNotify方法是私有的,或者在外部能不能通过ThrioNavigator获得当前的activity实例? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_thrio.