12345678910111213141516171819202122 |
- 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<String?> get platformVersion async {
- final String? version = await _channel.invokeMethod('getPlatformVersion');
- return version;
- }
- /// 获取Flavor
- Future<String?> getFlavor() => _channel.invokeMethod('flavor');
- }
|