$assert static method
void
$assert(
- bool condition,
- String message, [
- List<
String> env = const [], - KareeErrorCode errorCode = KareeErrorCode.assertionError,
Karee assert function that will check a condition and if false will redirect to the Karee error screen with the provided message and environment.
Implementation
static void $assert(bool condition, String message,
[List<String> env = const [],
KareeErrorCode errorCode = KareeErrorCode.assertionError]) {
if (!condition) {
KareeRouter.goto(KareeConstants.kareeErrorPath, parameter: {
#title: message,
#stack: StackTrace.current,
#env: env,
#errorCode: errorCode
});
}
}