pluginClassSnakeCase.h.tmpl 933 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#ifndef FLUTTER_PLUGIN_{{pluginClassCapitalSnakeCase}}_H_
#define FLUTTER_PLUGIN_{{pluginClassCapitalSnakeCase}}_H_

#include <flutter/method_channel.h>
#include <flutter/plugin_registrar_windows.h>

#include <memory>

namespace {{projectName}} {

class {{pluginClass}} : public flutter::Plugin {
 public:
  static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar);

  {{pluginClass}}();

  virtual ~{{pluginClass}}();

  // Disallow copy and assign.
  {{pluginClass}}(const {{pluginClass}}&) = delete;
  {{pluginClass}}& operator=(const {{pluginClass}}&) = delete;

  // Called when a method is called on this plugin's channel from Dart.
  void HandleMethodCall(
      const flutter::MethodCall<flutter::EncodableValue> &method_call,
      std::unique_ptr<flutter::MethodResult<flutter::EncodableValue>> result);
};

}  // namespace {{projectName}}

#endif  // FLUTTER_PLUGIN_{{pluginClassCapitalSnakeCase}}_H_