extended_platform_view 0.0.2 copy "extended_platform_view: ^0.0.2" to clipboard
extended_platform_view: ^0.0.2 copied to clipboard

Adds the ExtendedPlatformView widget to simplify PlatformView initialization & communication

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: _buildSamplePlatformView(),
      ),
    );
  }

  Widget _buildSamplePlatformView() {
    return ExtendedPlatformView(
      config: const ExtendedPlatformViewConfig(
        viewType: 'sample_platform_view',
        androidCompositionMode: AndroidCompositionMode.hybridComposition,
        creationParams: "initial text",
      ),
      methodChannelDelegate: MethodChannelDelegate(
        onCreate: (channel) async {
          await Future.delayed(const Duration(seconds: 3));
          channel.invokeMethod(
            'set_text',
            '3 seconds elapsed',
          );
        },
      ),
    );
  }
}
0
likes
160
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

Adds the ExtendedPlatformView widget to simplify PlatformView initialization & communication

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on extended_platform_view

Packages that implement extended_platform_view