AndroidViewSurface

PlatformViewsService

Virtual display

In your Dart file,
for example native_view_example.dart,
use the following instructions:

Add the following imports:

    
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

Implement a build() method:

    
Widget build(BuildContext context) {
  // This is used in the platform side to register the view.
  const String viewType = '<platform-view-type>';
  // Pass parameters to the platform side.
  final Map<String, dynamic> creationParams = <String, dynamic>{};

  return AndroidView(
    viewType: viewType,
    layoutDirection: TextDirection.ltr,
    creationParams: creationParams,
    creationParamsCodec: const StandardMessageCodec(),
  );
}

For more information, see the API docs for:

AndroidView