Masterarbeit Richard Stern. Flutter App, sich mit einem Bluetooth-Gerät verbindet und Berührungen auf einem Sensor visualisiert.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FlutterHeadlessDartRunner.h 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #ifndef FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_
  5. #define FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_
  6. #import <Foundation/Foundation.h>
  7. #include "FlutterBinaryMessenger.h"
  8. #include "FlutterDartProject.h"
  9. #include "FlutterEngine.h"
  10. #include "FlutterMacros.h"
  11. /**
  12. * A callback for when FlutterHeadlessDartRunner has attempted to start a Dart
  13. * Isolate in the background.
  14. *
  15. * @param success YES if the Isolate was started and run successfully, NO
  16. * otherwise.
  17. */
  18. typedef void (^FlutterHeadlessDartRunnerCallback)(BOOL success);
  19. /**
  20. * The FlutterHeadlessDartRunner runs Flutter Dart code with a null rasterizer,
  21. * and no native drawing surface. It is appropriate for use in running Dart
  22. * code e.g. in the background from a plugin.
  23. *
  24. * Most callers should prefer using `FlutterEngine` directly; this interface exists
  25. * for legacy support.
  26. */
  27. FLUTTER_EXPORT
  28. FLUTTER_DEPRECATED("FlutterEngine should be used rather than FlutterHeadlessDartRunner")
  29. @interface FlutterHeadlessDartRunner : FlutterEngine
  30. /**
  31. * Iniitalize this FlutterHeadlessDartRunner with a `FlutterDartProject`.
  32. *
  33. * If the FlutterDartProject is not specified, the FlutterHeadlessDartRunner will attempt to locate
  34. * the project in a default location.
  35. *
  36. * A newly initialized engine will not run the `FlutterDartProject` until either
  37. * `-runWithEntrypoint:` or `-runWithEntrypoint:libraryURI` is called.
  38. *
  39. * @param labelPrefix The label prefix used to identify threads for this instance. Should
  40. * be unique across FlutterEngine instances
  41. * @param projectOrNil The `FlutterDartProject` to run.
  42. */
  43. - (instancetype)initWithName:(NSString*)labelPrefix project:(FlutterDartProject*)projectOrNil;
  44. /**
  45. * Iniitalize this FlutterHeadlessDartRunner with a `FlutterDartProject`.
  46. *
  47. * If the FlutterDartProject is not specified, the FlutterHeadlessDartRunner will attempt to locate
  48. * the project in a default location.
  49. *
  50. * A newly initialized engine will not run the `FlutterDartProject` until either
  51. * `-runWithEntrypoint:` or `-runWithEntrypoint:libraryURI` is called.
  52. *
  53. * @param labelPrefix The label prefix used to identify threads for this instance. Should
  54. * be unique across FlutterEngine instances
  55. * @param projectOrNil The `FlutterDartProject` to run.
  56. * @param allowHeadlessExecution Must be set to `YES`.
  57. */
  58. - (instancetype)initWithName:(NSString*)labelPrefix
  59. project:(FlutterDartProject*)projectOrNil
  60. allowHeadlessExecution:(BOOL)allowHeadlessExecution NS_DESIGNATED_INITIALIZER;
  61. /**
  62. * Not recommended for use - will initialize with a default label ("io.flutter.headless")
  63. * and the default FlutterDartProject.
  64. */
  65. - (instancetype)init;
  66. @end
  67. #endif // FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_