app_config.dart 2.2 KB

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