update_info.dart 960 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import 'package:flutter/foundation.dart';
  2. /// The latest published Gogs release relevant to the update check.
  3. @immutable
  4. class UpdateInstallResult {
  5. const UpdateInstallResult({
  6. required this.started,
  7. required this.permissionRequired,
  8. this.message,
  9. });
  10. final bool started;
  11. final bool permissionRequired;
  12. final String? message;
  13. factory UpdateInstallResult.fromMap(Map<dynamic, dynamic> map) {
  14. return UpdateInstallResult(
  15. started: map['started'] == true,
  16. permissionRequired: map['permissionRequired'] == true,
  17. message: map['message'] as String?,
  18. );
  19. }
  20. }
  21. class UpdateInfo {
  22. const UpdateInfo({
  23. required this.currentVersion,
  24. required this.latestVersion,
  25. required this.available,
  26. required this.releasePageUrl,
  27. required this.downloadUrl,
  28. });
  29. final String currentVersion;
  30. final String latestVersion;
  31. final bool available;
  32. final String releasePageUrl;
  33. final String downloadUrl;
  34. }