import 'dart:async'; import 'package:flutter/services.dart'; class FlavorPlugin { FlavorPlugin._(); static FlavorPlugin? _instance; static FlavorPlugin get instance => _instance ??= FlavorPlugin._(); final MethodChannel _channel = const MethodChannel('plugin_flavor'); Future get platformVersion async { final String? version = await _channel.invokeMethod('getPlatformVersion'); return version; } /// 获取Flavor Future getFlavor() => _channel.invokeMethod('flavor'); }