assertPermission method
Check if a permission is granted, otherwise throw an exception.
Implementation
void assertPermission(String domain, [Object? data]) {
if (!checkPermission(domain, data)) {
throw Exception(
"Permission '$domain' denied${data == null ? '' : " for '$data'"}.\n"
"To grant permissions, use Runtime.grant() or add the permission "
"to the permissions array of your HotSwapLoader, EvalWidget, "
"or eval() function.");
}
}