Flutter iOS Embedder
FlutterHeadlessDartRunner.mm
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #define FML_USED_ON_EMBEDDER
6 
8 
9 #include <memory>
10 
11 #include "flutter/fml/make_copyable.h"
12 #include "flutter/fml/message_loop.h"
13 #include "flutter/shell/common/engine.h"
14 #include "flutter/shell/common/rasterizer.h"
15 #include "flutter/shell/common/run_configuration.h"
16 #include "flutter/shell/common/shell.h"
17 #include "flutter/shell/common/switches.h"
18 #include "flutter/shell/common/thread_host.h"
25 
26 @implementation FlutterHeadlessDartRunner {
27 }
28 
29 - (instancetype)initWithName:(NSString*)labelPrefix project:(FlutterDartProject*)projectOrNil {
30  return [self initWithName:labelPrefix project:projectOrNil allowHeadlessExecution:YES];
31 }
32 
33 - (instancetype)initWithName:(NSString*)labelPrefix
34  project:(FlutterDartProject*)projectOrNil
35  allowHeadlessExecution:(BOOL)allowHeadlessExecution {
36  NSAssert(allowHeadlessExecution == YES,
37  @"Cannot initialize a FlutterHeadlessDartRunner without headless execution.");
38  return [self initWithName:labelPrefix
39  project:projectOrNil
40  allowHeadlessExecution:allowHeadlessExecution
41  restorationEnabled:NO];
42 }
43 
44 - (instancetype)initWithName:(NSString*)labelPrefix
45  project:(FlutterDartProject*)projectOrNil
46  allowHeadlessExecution:(BOOL)allowHeadlessExecution
47  restorationEnabled:(BOOL)restorationEnabled {
48  NSAssert(allowHeadlessExecution == YES,
49  @"Cannot initialize a FlutterHeadlessDartRunner without headless execution.");
50  return [super initWithName:labelPrefix
51  project:projectOrNil
52  allowHeadlessExecution:allowHeadlessExecution
53  restorationEnabled:restorationEnabled];
54 }
55 
56 - (instancetype)init {
57  return [self initWithName:@"io.flutter.headless" project:nil];
58 }
59 @end
FlutterEngine_Internal.h
command_line.h
FlutterPlugin.h
FlutterHeadlessDartRunner.h
FlutterHeadlessDartRunner
Definition: FlutterHeadlessDartRunner.h:34
FlutterDartProject_Internal.h
platform_view_ios.h
FlutterDartProject
Definition: FlutterDartProject.mm:262
platform_message_response_darwin.h