flutter_boost icon indicating copy to clipboard operation
flutter_boost copied to clipboard

flutter methodChannel问题

Open WaXiDe opened this issue 6 years ago • 3 comments

flutter端

  1. 根据flutterboostDemo,flutterboost注册widget(A)
  2. classA中声明methodChannel
  3. init方法初始化methodChannel
  4. disposal释放methodChannel

iOS端 APPDelegate初始化flutterboost。

  1. 根控制器是tabBarController,子控制器是A,B,C,D
  2. 存在一个FLBFlutterViewContainer作为tabbar的childController(D)
  3. 使用B,push一个新的FLBFlutterViewContainer(F)。初始化流程:1、init(setname)2、注册methodChannel 3、push(F)
  4. pop (F)
  5. 再次push一个新的(F)

问题: 再次进入页面F flutter报错,methodChannel为空

**Flutter Boost Version 1.12.13 **Target Platform:iOS **Target OS version/browser:13 **Devices: 模拟器

WaXiDe avatar May 07 '20 09:05 WaXiDe

  1. 使用B,push一个新的FLBFlutterViewContainer(F)。初始化流程:1、init(setname)2、注册methodChannel 3、push(F)

这里如何注册的methodChannel? 全局使用一个methodChannel试试 是不是 首次生成的methodChannel被你在第二步注册的methodChannel覆盖掉了,代码贴出来看看

colorface avatar May 07 '20 12:05 colorface

flutter端

  1. 根据flutterboostDemo,flutterboost注册widget(A)
  2. classA中声明methodChannel
  3. init方法初始化methodChannel
  4. disposal释放methodChannel

iOS端 APPDelegate初始化flutterboost。

  1. 根控制器是tabBarController,子控制器是A,B,C,D
  2. 存在一个FLBFlutterViewContainer作为tabbar的childController(D)
  3. 使用B,push一个新的FLBFlutterViewContainer(F)。初始化流程:1、init(setname)2、注册methodChannel 3、push(F)
  4. pop (F)
  5. 再次push一个新的(F)

问题: 再次进入页面F flutter报错,methodChannel为空

**Flutter Boost Version 1.12.13 **Target Platform:iOS **Target OS version/browser:13 **Devices: 模拟器

每次进入flbvc init后注册channel 并监听然后push,pop后销毁看起来没问题

nightfallsad avatar May 08 '20 05:05 nightfallsad

methodChannel的binaryMessenger挂载到哪里了

MrLittleStrong avatar May 09 '20 02:05 MrLittleStrong