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”类型的变量。
可能这段代码已经过时了,或者是因为我在互联网上看到了很多类似的代码示例,但由于某种原因对我不起作用。
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 …