Hi there I have an issue in this code. Where I should place the firebase initializing and crashlytics enabled?
From here SplashPage dart I am getting confuse on how I place the firebase. At the same time if this is correct that what I am doing for this
class SplashPage extends StatefulWidget {
final Function onComplete;
SplashPage({Key key, this.onComplete}) : super(key: key);
@override
_SplashPageState createState() => _SplashPageState();
}
class _SplashPageState extends State<SplashPage> {
@override
void initState(){
super.initState();
_initialize();
}
_initialize() async {
WidgetsFlutterBinding.ensureInitialized();
/// Initialize all app dependencies
await Firebase.initializeApp();
debugPrint('Firebase initialized...');
/// initialize Firebase and related services
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterError;
debugPrint('Firebase Crashlytics flutter errors enabled...');
await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
debugPrint('Firebase Crashlytics collection enabled...');
SchedulerBinding.instance.addPostFrameCallback((timeStamp) {
widget.onComplete();
});
}
@override
Widget build(BuildContext context){
return Scaffold(
body: Center(
child: CircularProgressIndicator(),
),
);
}
}```**strong text**