app_config.dart 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import 'package:freezed_annotation/freezed_annotation.dart';
  2. import 'package:flutter/foundation.dart';
  3. import 'privacy_terms.dart';
  4. import 'skip_geo.dart';
  5. part 'app_config.freezed.dart';
  6. part 'app_config.g.dart';
  7. @freezed
  8. class AppConfig with _$AppConfig {
  9. const factory AppConfig({
  10. List<String>? apiIps,
  11. List<String>? apiUrls,
  12. List<String>? routerApiUrls,
  13. List<String>? appStatUrls,
  14. List<String>? assetUrls,
  15. List<String>? logFileUploadUrls,
  16. List<String>? realityApiUrls,
  17. List<String>? realityAppStatUrls,
  18. List<String>? realityLogFileUploadUrls,
  19. bool? autoPing,
  20. int? autoPingInterval,
  21. List<String>? backupApiUrls,
  22. int? cacheDataEffectiveDays,
  23. List<Contacts>? contacts,
  24. List<Contacts>? follows,
  25. List<String>? providers,
  26. List<int>? signalThresholds,
  27. List<int>? packetLossThresholds,
  28. SkipGeo? skipGeo,
  29. List<SpeedTestTargetList>? speedTestTargetList,
  30. String? websiteUrl,
  31. bool? visitorDisabled, // 游客模式
  32. PrivacyTerms? privacyAgreement,
  33. String? email,
  34. List<String>? blackPkgs,
  35. List<String>? whitePkgs,
  36. int? accelerationSampleCount,
  37. int? minAccelerationSampleCount,
  38. int? connectionWarningThreshold,
  39. String? connectiveTestUrl,
  40. List<String>? disabledLogModules,
  41. String? realTimeDbPath,
  42. int? boostTimeInterval,
  43. int? pingDisplayMode,
  44. int? peekTimeInterval,
  45. bool? enableAd,
  46. int? adTimeoutDuration,
  47. int? reportActiveInterval,
  48. int? serverTime,
  49. }) = _AppConfig;
  50. factory AppConfig.fromJson(Map<String, Object?> json) =>
  51. _$AppConfigFromJson(json);
  52. }
  53. @freezed
  54. class Contacts with _$Contacts {
  55. const factory Contacts({String? title, String? url}) = _Contacts;
  56. factory Contacts.fromJson(Map<String, Object?> json) =>
  57. _$ContactsFromJson(json);
  58. }
  59. @freezed
  60. class SpeedTestTargetList with _$SpeedTestTargetList {
  61. const factory SpeedTestTargetList({String? title, String? url}) =
  62. _SpeedTestTargetList;
  63. factory SpeedTestTargetList.fromJson(Map<String, Object?> json) =>
  64. _$SpeedTestTargetListFromJson(json);
  65. }