#import <FlutterCallbackCache.h>
The cache containing callback information for spawning a FlutterHeadlessDartRunner
.
Definition at line 37 of file FlutterCallbackCache.h.
◆ lookupCallbackInformation:
Returns the callback information for the given callback handle. This callback information can be used when spawning a FlutterHeadlessDartRunner
.
- Parameters
-
handle | The handle for a callback, provided by the Dart method PluginUtilities.getCallbackHandle . |
- Returns
- A
FlutterCallbackInformation
object which contains the name of the callback, the name of the class in which the callback is defined, and the path of the library which contains the callback. If the provided handle is invalid, nil is returned.
Definition at line 10 of file FlutterCallbackCache.mm.
17 :(int64_t)handle {
19 if (
info ==
nullptr) {
20 return nil;
21 }
23 new_info.
callbackName = [NSString stringWithUTF8String:info->name.c_str()];
24 new_info.
callbackClassName = [NSString stringWithUTF8String:info->class_name.c_str()];
26 return new_info;
27}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static std::unique_ptr< DartCallbackRepresentation > GetCallbackInformation(int64_t handle)
◆ setCachePath:
+ (void) setCachePath: |
|
(NSString*) |
path |
|
|
implementation |
Definition at line 10 of file FlutterCallbackCache.mm.
32 NSString* cache_path =
33 [NSString stringWithUTF8String:flutter::DartCallbackCache::GetCachePath().c_str()];
34
35
36 if (![[NSFileManager defaultManager] fileExistsAtPath:cache_path]) {
37 [[NSFileManager defaultManager] createFileAtPath:cache_path contents:nil attributes:nil];
39 NSURL*
URL = [NSURL fileURLWithPath:cache_path];
40 BOOL success = [
URL setResourceValue:[NSNumber numberWithBool:YES]
41 forKey:NSURLIsExcludedFromBackupKey
42 error:&error];
43 if (!success) {
44 NSLog(
@"Error excluding %@ from backup %@", [
URL lastPathComponent],
error);
45 }
46 }
47}
static void SetCachePath(const std::string &path)
const uint8_t uint32_t uint32_t GError ** error
#define FML_DCHECK(condition)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
The documentation for this class was generated from the following files: