method_call_dispatcher 0.3.0 copy "method_call_dispatcher: ^0.3.0" to clipboard
method_call_dispatcher: ^0.3.0 copied to clipboard

discontinued

A scaffold for writing flutter plugins

example/lib/main.dart

import 'dart:async';

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

final _platform = MethodChannel("myFancyChannel");

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String result;

  Future<void> doLoad() async {
    final value = await _platform.invokeMethod("myFancyMethod");
    if (!mounted) return;
    setState(() {
      result = value;
    });

    _platform.invokeMethod("myBrokenMethod");

    _platform.invokeMethod("myBrokenCallbackMethod");
  }

  @override
  void initState() {
    super.initState();
    doLoad();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter MethodCallDispatcher'),
        ),
        body: Center(
          child: Text(result ?? "Waiting for reply..."),
        ),
      ),
    );
  }
}
0
likes
25
pub points
0%
popularity

Publisher

unverified uploader

A scaffold for writing flutter plugins

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on method_call_dispatcher