Flutter Engine
 
Loading...
Searching...
No Matches
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
25
27
28@implementation FlutterHeadlessDartRunner
29
30- (instancetype)initWithName:(NSString*)labelPrefix project:(FlutterDartProject*)projectOrNil {
31 return [self initWithName:labelPrefix project:projectOrNil allowHeadlessExecution:YES];
32}
33
34- (instancetype)initWithName:(NSString*)labelPrefix
35 project:(FlutterDartProject*)projectOrNil
36 allowHeadlessExecution:(BOOL)allowHeadlessExecution {
37 NSAssert(allowHeadlessExecution == YES,
38 @"Cannot initialize a FlutterHeadlessDartRunner without headless execution.");
39 return [self initWithName:labelPrefix
40 project:projectOrNil
41 allowHeadlessExecution:allowHeadlessExecution
42 restorationEnabled:NO];
43}
44
45- (instancetype)initWithName:(NSString*)labelPrefix
46 project:(FlutterDartProject*)projectOrNil
47 allowHeadlessExecution:(BOOL)allowHeadlessExecution
48 restorationEnabled:(BOOL)restorationEnabled {
49 NSAssert(allowHeadlessExecution == YES,
50 @"Cannot initialize a FlutterHeadlessDartRunner without headless execution.");
51 return [super initWithName:labelPrefix
52 project:projectOrNil
53 allowHeadlessExecution:allowHeadlessExecution
54 restorationEnabled:restorationEnabled];
55}
56
57- (instancetype)init {
58 return [self initWithName:@"io.flutter.headless" project:nil];
59}
60
61@end
instancetype initWithName:project:allowHeadlessExecution:(NSString *labelPrefix,[project] FlutterDartProject *projectOrNil,[allowHeadlessExecution] BOOL allowHeadlessExecution)
int BOOL