kmcgill88 / admob_flutter

Admob Flutter plugin that shows banner ads using native platform views.

Home Page:https://pub.dartlang.org/packages/admob_flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why doesn't the Admob Banner class have a dispose method?

hkndzdr opened this issue · comments

Why doesn't the Admob Banner class have a dispose method?

Adding this to README FAQ.

Technically the banner class is using PlatformView which handles disposing the view for you.

onBannerCreated: (AdmobBannerController controller) {
// Dispose is called automatically for you when Flutter removes the banner from the widget tree.
// Normally you don't need to worry about disposing this yourself, it's handled.
// If you need direct access to dispose, this is your guy!
  controller.dispose();
},
();

@kmcgill88
I check using devtools, when using controller dispose, the banner still showed in memory.
Screen Shot 2021-11-19 at 14 19 27

The controller and banner is already to dispose after widget close
Screen Shot 2021-11-19 at 14 19 41