I wrote this code, but I got the error.
void main() async {
WidgetsFlutterBinding.ensureInitialized;
if (kIsWeb) {
await Firebase.initializeApp(
options: const FirebaseOptions(
apiKey: 'xxx',
appId: 'xxx',
messagingSenderId: 'xxxx',
projectId: 'xxxx',
storageBucket: 'xxx',
),
);
} else {
await Firebase.initializeApp();
}
Exception has occurred. _CastError (Null check operator used on a null value)
where has a problem? I think this code is correct.