app_config.dart 673 B

123456789101112131415161718192021222324
  1. import 'package:flutter/services.dart';
  2. import 'package:track_common/track_common.dart';
  3. class AppConfig {
  4. ///正式版
  5. static const apiHostProd = "otapi.beswell.com";
  6. // static String apiHost = "t-otapi.beswell.com";
  7. /// 开发版
  8. static const apiHostDev = 'otapi.colormaprun.com';
  9. static int apiPort = 10001;
  10. static int apiPortDev = 443;
  11. static String apiHost = apiHostProd;
  12. static Future<void> init() async {
  13. const platform = MethodChannel('com.beswell.app/api');
  14. final flavor = await platform.invokeMethod('getFlavor');
  15. if (flavor == 'dev') {
  16. info('开发版');
  17. apiHost = apiHostDev;
  18. apiPort = apiPortDev;
  19. }
  20. }
  21. }