init method
Future<void>
init(
- String appKey, {
- Uri? apiUri,
- Uri? baseUri,
- int? maximumLocalStorageSize,
- bool printToConsole = true,
- bool enableUIEventLogging = true,
- bool enableCrashReporting = true,
- bool enableAndroidLogcatLogging = true,
- String? overrideDeviceName,
- String? version,
- String? build,
override
Implementation
@override
Future<void> init(
String appKey, {
Uri? apiUri,
Uri? baseUri,
int? maximumLocalStorageSize, // note this is ignored in web
bool printToConsole = true,
bool enableUIEventLogging = true,
bool enableCrashReporting = true,
bool enableAndroidLogcatLogging = true,
String? overrideDeviceName,
String? version,
String? build,
}) async {
WidgetsFlutterBinding.ensureInitialized();
// options keys are variable. For example, the "apiURL" key may or may not be present.
// We can't use Dart classes with automatic conversion because Dart properties of a class are null when unset, but Bugfender.init() expects undefined.
var options = {
'appKey': appKey,
'overrideConsoleMethods': false,
'printToConsole': printToConsole,
'registerErrorHandler': enableCrashReporting,
'logBrowserEvents': enableUIEventLogging,
'logUIEvents': enableUIEventLogging,
};
if (apiUri != null) {
options['apiURL'] = apiUri.toString();
}
if (baseUri != null) {
options['baseURL'] = baseUri.toString();
}
if (overrideDeviceName != null) {
options['deviceName'] = overrideDeviceName;
}
if (version != null) {
options['version'] = version;
}
if (build != null) {
options['build'] = build;
}
return _initWithMap(options);
}