Embrace class
Entry point for the SDK. This class is part of the Embrace Public API.
- Implemented types
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.
override
-
addSessionProperty(
String key, String value, {bool permanent = false}) → void -
Annotates the session with a property defined by a
key
andvalue
.override -
addUserPersona(
String persona) → void -
Adds a custom user persona.
override
-
clearAllUserPersonas(
) → void -
Clears all custom user personas from the user.
override
-
clearUserAsPayer(
) → void -
Clears this user as a paying user.
override
-
clearUserEmail(
) → void -
Clear the currently set user email.
override
-
clearUserIdentifier(
) → void -
Clears the currently set user identifier.
override
-
clearUserName(
) → void -
Clear the currently set user name.
override
-
clearUserPersona(
String persona) → void -
Clears the custom user persona, if it is set.
override
-
endAppStartup(
{Map< String, String> ? properties}) → void -
Signals that the app has completed startup.
override
-
endMoment(
String name, {String? identifier, Map< String, String> ? properties}) → void -
Signals the end of a moment with the specified
name
andidentifier
.override -
endSession(
{bool clearUserInfo = true}) → void -
Manually forces the end of the current session and starts a new session.
override
-
endView(
String name) → void -
Log the end of a view.
override
-
getCurrentSessionId(
) → Future< String?> -
Get the ID for the current session.
override
-
getDeviceId(
) → Future< String?> -
Get the Embrace user identifier assigned to the device.
override
-
getLastRunEndState(
) → Future< LastRunEndState> -
Get the exit status (crash or clean exit) of the last time the
application was run.
override
-
getSessionProperties(
) → Future< Map< String, String> > -
Returns all properties for the current session.
override
-
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.
override
-
logError(
String message, {Map< String, String> ? properties}) → void -
Remotely logs a message at ERROR level
override
-
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.
override
-
logInfo(
String message, {Map< String, String> ? properties}) → void -
Remotely logs a message at INFO level
override
-
logMessage(
String message, Severity severity, {Map< String, String> ? properties}) → void -
Remotely logs a message at the given severity level
override
-
logPushNotification(
String? title, String? body, {String? subtitle, int? badge, String? category, String? from, String? messageId, int? priority, bool hasNotification = false, bool hasData = false}) → void -
Manually logs a push notification as a breadcrumb
override
-
logWarning(
String message, {Map< String, String> ? properties}) → void -
Remotely logs a message at WARNING level
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordNetworkRequest(
EmbraceNetworkRequest request) → void -
Records a network request to Embrace.
override
-
removeSessionProperty(
String key) → void -
Remove an existing property from the session
override
-
setUserAsPayer(
) → void -
Sets this user as a paying user.
override
-
setUserEmail(
String email) → void -
Sets the current user's email.
override
-
setUserIdentifier(
String id) → void -
Sets the user identifier
override
-
setUserName(
String name) → void -
Sets the current user's name.
override
-
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.
override
-
startMoment(
String name, {String? identifier, Map< String, String> ? properties}) → void -
Starts a moment.
override
-
startView(
String name) → void -
Log the start of a view.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited