EmbraceFlutterApi class abstract
Declares the functions that consist of Embrace's public API - specifically those that are only declared on Flutter. You should not use EmbraceFlutterApi directly or implement it in your own custom classes, as new functions may be added in future. Use the Embrace class instead.
- Implemented types
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addBreadcrumb(
String message) → void -
Adds a breadcrumb.
inherited
-
addSessionProperty(
String key, String value, {bool permanent = false}) → void -
Annotates the session with a property defined by a
key
andvalue
.inherited -
addUserPersona(
String persona) → void -
Adds a custom user persona.
inherited
-
clearAllUserPersonas(
) → void -
Clears all custom user personas from the user.
inherited
-
clearUserAsPayer(
) → void -
Clears this user as a paying user.
inherited
-
clearUserEmail(
) → void -
Clear the currently set user email.
inherited
-
clearUserIdentifier(
) → void -
Clears the currently set user identifier.
inherited
-
clearUserName(
) → void -
Clear the currently set user name.
inherited
-
clearUserPersona(
String persona) → void -
Clears the custom user persona, if it is set.
inherited
-
endSession(
{bool clearUserInfo = true}) → void -
Manually forces the end of the current session and starts a new session.
inherited
-
endView(
String name) → void -
Log the end of a view.
inherited
-
generateW3cTraceparent(
String? traceId, String? spanId) → Future< String?> -
Generates a W3C traceparent header for network span forwarding, or null
if this has not been enabled.
For iOS, it's required to pass in the spanId and traceId of the network
span that is being forwarded. For Android, these parameters are ignored.
inherited
-
getCurrentSessionId(
) → Future< String?> -
Get the ID for the current session.
inherited
-
getDeviceId(
) → Future< String?> -
Get the Embrace user identifier assigned to the device.
inherited
-
getLastRunEndState(
) → Future< LastRunEndState> - Get the exit status (crash or clean exit) of the last time the application was run.
-
logDartError(
Object error, StackTrace stack) → void - Manually logs a Dart error or exception to Embrace. You should use this if you want to capture errors/exceptions and report them to Embrace. A good example would be to call this function from within a try-catch block.
-
logError(
String message, {Map< String, String> ? properties}) → void -
Remotely logs a message at ERROR level
inherited
-
logHandledDartError(
Object error, StackTrace stack) → void - Manually logs a handled Dart error or exception to Embrace. This is equivalent to logDartError but records the error as handled. Handled errors do not count towards calculation of error-free sessions.
-
logInfo(
String message, {Map< String, String> ? properties}) → void -
Remotely logs a message at INFO level
inherited
-
logMessage(
String message, Severity severity, {Map< String, String> ? properties}) → void -
Remotely logs a message at the given severity level
inherited
-
logPushNotification(
String? title, String? body, {String? subtitle, int? badge, String? category, String? from, String? messageId, int priority = 0, bool hasNotification = false, bool hasData = false}) → void -
Manually logs a push notification as a breadcrumb
inherited
-
logWarning(
String message, {Map< String, String> ? properties}) → void -
Remotely logs a message at WARNING level
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordCompletedSpan<
T> (String name, int startTimeMs, int endTimeMs, {ErrorCode? errorCode, EmbraceSpan? parent, Map< String, String> ? attributes, List<EmbraceSpanEvent> ? events}) → Future<bool> -
Record a span with the given name, error code, parent, start time, and
end time (epoch time in milliseconds). Passing in a parent
that is null will result in a new trace with the new span as its root.
A non-null
ErrorCode
can be passed in to denote the operation the span represents was ended unsuccessfully under the stated circumstances. You can also pass in a Map with String keys and values to be used as the attributes of the recorded span, or a List of EmbraceSpanEvent to be used as the events of the recorded span.inherited -
recordNetworkRequest(
EmbraceNetworkRequest request) → void -
Records a network request to Embrace.
inherited
-
removeSessionProperty(
String key) → void -
Remove an existing property from the session
inherited
-
setUserAsPayer(
) → void -
Sets this user as a paying user.
inherited
-
setUserEmail(
String email) → void -
Sets the current user's email.
inherited
-
setUserIdentifier(
String id) → void -
Sets the user identifier
inherited
-
setUserName(
String name) → void -
Sets the current user's name.
inherited
-
start(
FutureOr< void> action(), {bool enableIntegrationTesting = false}) → Future<void> - Starts instrumentation of Dart code by the Embrace SDK. This should be wrap the entire contents of your Dart main() function if you wish to capture Dart errors.
-
startSpan(
String name, {EmbraceSpan? parent, int? startTimeMs}) → Future< EmbraceSpan?> -
Create and start a new span. Returns a reference to the new span on
success and null on failure.
inherited
-
startView(
String name) → void -
Log the start of a view.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited