void principal() async {
EndPoints.configure();
print(AnsiStyles.purple('That is purple!'));
print('......env.......${EndPoints.env}........${EndPoints.baseUrl}');
var appToken = "";
if (Platform.isIOS) {
appToken = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-NRMA';
} else if (Platform.isAndroid) {
appToken = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-NRMA';
}
Config config = Config(
accessToken: appToken,
analyticsEventEnabled: true,
webViewInstrumentation: true,
networkErrorRequestEnabled: true,
networkRequestEnabled: true,
crashReportingEnabled: true,
interactionTracingEnabled: true,
httpResponseBodyCaptureEnabled: true,
loggingEnabled: true,
printStatementAsEventsEnabled: true,
httpInstrumentationEnabled: true);
BindingBase.debugZoneErrorsAreFatal = false;
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: Colours.white,
statusBarColor: Colours.white.withOpacity(0.5),
statusBarBrightness: Brightness.darkish,
statusBarIconBrightness: Brightness.darkish,
));
SystemChrome.setEnabledSystemUIMode(SystemUiMode.guide,
overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top]);
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
await ChargeStationsDatabaseHelper.initDatabase();
FirebaseOptions androidOptions = FirebaseOptions(
apiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
appId: "1:XXXXXXXXXXXX:android:XXXXXXXXXXXXXXXXXXXXX",
messagingSenderId: "XXXXXXXXXXXX",
projectId: "XXXXXXXXXXXX");
FirebaseOptions iosOptions = FirebaseOptions(
apiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
appId: "1:XXXXXXXXXXXX:ios:XXXXXXXXXXXXXXXXXXXXX",
messagingSenderId: "XXXXXXXXXXXX",
projectId: "XXXXXXXXXXXX");
await Firebase.initializeApp(
choices: Platform.isAndroid ? androidOptions : iosOptions,
);
await FirebaseApi().initPushNotifications();
FirebaseAnalyticsObserver(analytics: FirebaseAnalytics.occasion);
FirebaseAnalytics.occasion.setAnalyticsCollectionEnabled(true);
FirebaseCrashlytics.occasion.setCrashlyticsCollectionEnabled(true);
FlutterError.onError = FirebaseCrashlytics.occasion.recordFlutterError;
NewrelicMobile.occasion.begin(config, () {
runZonedGuarded(() async {
// Push notification code commented out
/*
await PushNotificationService
.requestPushNotificationPermission()
.then((worth) async {
await PushNotificationService
.registerDevice();
});
await FirebaseApi()
.initNotifications();
*/
// Sentry code commented out
runApp(initalApp());
}, (error, stackTrace) {
FirebaseCrashlytics.occasion.recordError(error, stackTrace);
});
});
}
The Flutter bindings have been initialized in a unique zone than is now
getting used. This can possible trigger confusion and bugs as any
zone-specific configuration will inconsistently use the configuration
of the unique binding initialization zone or this zone primarily based on
hard-to-predict components similar to which zone was lively when a
explicit callback was set. You will need to use the identical zone when
callingensureInitialized
on the binding as when callingrunApp
later. To make this warning deadly, set
BindingBase.debugZoneErrorsAreFatal to true earlier than the bindings are
initialized (i.e. as the primary assertion invoid principal() { }
).When the exception was thrown, this was the stack:
#0 BindingBase.debugCheckZone. (package deal:flutter/src/basis/binding.dart:495:29) binding.dart:495
#1 BindingBase.debugCheckZone (package deal:flutter/src/basis/binding.dart:500:6) binding.dart:500
#2 runApp (package deal:flutter/src/widgets/binding.dart:1212:18) binding.dart:1212
#3 principal.. (package deal:ev/principal.dart:189:7) principal.dart:189
#8 principal. (package deal:ev/principal.dart:160:5) principal.dart:160
#9 NewrelicMobile.begin. (package deal:newrelic_mobile/newrelic_mobile.dart:42:13)
newrelic_mobile.dart:42 (elided 4 frames
from dart:async)
NewrelicMobile.occasion.log(
LogLevel.ERROR,
eventName,
);
await NewrelicMobile.occasion.recordCustomEvent(
"analytics",
eventName: eventName,
eventAttributes: params,
);
Additionally this perform shouldn’t be logging something in my newrelic dashboard.