BanhmiDev / admob_consent

This is a wrapper for Google's User Messaging Platform (UMP) SDK in Flutter
https://pub.dev/packages/admob_consent
Apache License 2.0
12 stars 11 forks source link

Null safety migration #15

Closed bdlukaa closed 1 year ago

bdlukaa commented 3 years ago

Migrated the package to null-safety. Here are a summary of the changes:

Closes #11

I use this plugin with my package native_admob_flutter

sgissinger commented 3 years ago

@bdlukaa I used your version but had an issue

E/flutter (32281): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: LateInitializationError: Field '_instance@17154335' has not been initialized.
E/flutter (32281): #0      AdmobConsent._instance (package:admob_consent/admob_consent.dart)
package:admob_consent/admob_consent.dart:1
E/flutter (32281): #1      new AdmobConsent
package:admob_consent/admob_consent.dart:32
E/flutter (32281): #2      main.<anonymous closure>
package:myapp_flutter/main.dart:40
E/flutter (32281): #3      _rootRunUnary (dart:async/zone.dart:1362:47)
E/flutter (32281): #4      _CustomZone.runUnary (dart:async/zone.dart:1265:19)

To make it works, I removed late modifier

static AdmobConsent? _instance;
bdlukaa commented 3 years ago

I will fix it