{{#no_platforms}} // You have generated a new plugin project without // specifying the `--platforms` flag. A plugin project supports no platforms is generated. // To add platforms, run `flutter create -t plugin --platforms .` under the same // directory. You can also find a detailed instruction on how to add platforms in the `pubspec.yaml` at https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms. {{/no_platforms}} import 'dart:async'; import 'package:flutter/services.dart'; class {{pluginDartClass}} { static const MethodChannel _channel = MethodChannel('{{projectName}}'); static Future get platformVersion async { final String? version = await _channel.invokeMethod('getPlatformVersion'); return version; } }