proxyApiBaseClass top-level constant

String const proxyApiBaseClass

The base class for all ProxyApis.

All Dart classes generated as a ProxyApi extends this one.

Implementation

const String proxyApiBaseClass = '''
/// An immutable object that serves as the base class for all ProxyApis and
/// can provide functional copies of itself.
///
/// All implementers are expected to be [immutable] as defined by the annotation
/// and override [${classMemberNamePrefix}copy] returning an instance of itself.
@immutable
abstract class $proxyApiBaseClassName {
  /// Construct a [$proxyApiBaseClassName].
  $proxyApiBaseClassName({
    this.$_proxyApiBaseClassMessengerVarName,
    $dartInstanceManagerClassName? $_proxyApiBaseClassInstanceManagerVarName,
  }) : $_proxyApiBaseClassInstanceManagerVarName =
            $_proxyApiBaseClassInstanceManagerVarName ?? $dartInstanceManagerClassName.instance;

  /// Sends and receives binary data across the Flutter platform barrier.
  ///
  /// If it is null, the default BinaryMessenger will be used, which routes to
  /// the host platform.
  @protected
  final BinaryMessenger? $_proxyApiBaseClassMessengerVarName;

  /// Maintains instances stored to communicate with native language objects.
  @protected
  final $dartInstanceManagerClassName $_proxyApiBaseClassInstanceManagerVarName;

  /// Instantiates and returns a functionally identical object to oneself.
  ///
  /// Outside of tests, this method should only ever be called by
  /// [$dartInstanceManagerClassName].
  ///
  /// Subclasses should always override their parent's implementation of this
  /// method.
  @protected
  $proxyApiBaseClassName ${classMemberNamePrefix}copy();
}
''';