小编You*_*thm的帖子

无法将“RenderObject”类型的值分配给“RenderBox”类型的变量

 void getPositions() {
  final RenderBox renderBox = scheduleForDayKey.currentContext!.findRenderObject();
  final position = renderBox.localToGlobal(Offset.zero);
  print("POSITION of Red: $position ");
}
Run Code Online (Sandbox Code Playgroud)

这部分用红色下划线:

scheduleForDayKey.currentContext!.findRenderObject()
Run Code Online (Sandbox Code Playgroud)

当我悬停时,它告诉我错误:

“RenderObject”类型的值不能分配给“RenderBox”类型的变量。

可能这段代码已经过时了,或者是因为我在互联网上看到了很多类似的代码示例,但由于某种原因对我不起作用。

dart flutter

4
推荐指数
2
解决办法
1126
查看次数

Flutter AdMob | The app starts to lag after implementing ads

I'm working on an audiobook listening app. There I have my main page, which consists of 3 page widgets linked through a Page View that I can swipe to navigate through these pages. On each page I have laid exactly one banner ad from google_mobile_ads package. The problem is that if I add those 3 banners, my app starts to lag a lot, I did check the release version of my app, it is still laggy. In order to understand …

android ads admob dart flutter

1
推荐指数
1
解决办法
1876
查看次数

标签 统计

dart ×2

flutter ×2

admob ×1

ads ×1

android ×1