app_config.dart 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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>? appStatUrls,
  13. List<String>? assetUrls,
  14. List<String>? logFileUploadUrls,
  15. List<String>? realityApiUrls,
  16. List<String>? realityAppStatUrls,
  17. List<String>? realityLogFileUploadUrls,
  18. bool? autoPing,
  19. int? autoPingInterval,
  20. List<String>? backupApiUrls,
  21. int? cacheDataEffectiveDays,
  22. List<Contacts>? contacts,
  23. List<Contacts>? follows,
  24. List<String>? providers,
  25. List<int>? signalThresholds,
  26. List<int>? packetLossThresholds,
  27. SkipGeo? skipGeo,
  28. List<SpeedTestTargetList>? speedTestTargetList,
  29. String? websiteUrl,
  30. bool? visitorDisabled, // 游客模式
  31. PrivacyTerms? privacyAgreement,
  32. String? email,
  33. List<String>? blackPkgs,
  34. List<String>? whitePkgs,
  35. int? accelerationSampleCount,
  36. int? minAccelerationSampleCount,
  37. int? connectionWarningThreshold,
  38. String? connectiveTestUrl,
  39. List<String>? disabledLogModules,
  40. String? realTimeDbPath,
  41. int? boostTimeInterval,
  42. int? pingDisplayMode,
  43. int? peekTimeInterval,
  44. bool? enableAd,
  45. int? adTimeoutDuration,
  46. int? reportActiveInterval,
  47. int? serverTime,
  48. }) = _AppConfig;
  49. factory AppConfig.fromJson(Map<String, Object?> json) =>
  50. _$AppConfigFromJson(json);
  51. }
  52. @freezed
  53. class Contacts with _$Contacts {
  54. const factory Contacts({
  55. String? title,
  56. String? url,
  57. }) = _Contacts;
  58. factory Contacts.fromJson(Map<String, Object?> json) =>
  59. _$ContactsFromJson(json);
  60. }
  61. @freezed
  62. class SpeedTestTargetList with _$SpeedTestTargetList {
  63. const factory SpeedTestTargetList({
  64. String? title,
  65. String? url,
  66. }) = _SpeedTestTargetList;
  67. factory SpeedTestTargetList.fromJson(Map<String, Object?> json) =>
  68. _$SpeedTestTargetListFromJson(json);
  69. }