flavor_plugin.dart 520 B

12345678910111213141516171819202122
  1. import 'dart:async';
  2. import 'package:flutter/services.dart';
  3. class FlavorPlugin {
  4. FlavorPlugin._();
  5. static FlavorPlugin? _instance;
  6. static FlavorPlugin get instance => _instance ??= FlavorPlugin._();
  7. final MethodChannel _channel = const MethodChannel('plugin_flavor');
  8. Future<String?> get platformVersion async {
  9. final String? version = await _channel.invokeMethod('getPlatformVersion');
  10. return version;
  11. }
  12. /// 获取Flavor
  13. Future<String?> getFlavor() => _channel.invokeMethod('flavor');
  14. }