1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-16 12:20:08 +02:00
immich/mobile/lib/shared/services/server_info.service.dart
xpwmaosldk caaa474c23
Optimize android's Gradle settings and clean up mobile source code (#240)
* optimize android side gradle settings

* android minsdk back to 21

* remove unused package, update linter and fix lint error
2022-06-22 00:23:35 -05:00

29 lines
864 B
Dart

import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:immich_mobile/shared/models/server_info.model.dart';
import 'package:immich_mobile/shared/models/server_version.model.dart';
import 'package:immich_mobile/shared/services/network.service.dart';
class ServerInfoService {
final NetworkService _networkService = NetworkService();
Future<ServerInfo> getServerInfo() async {
Response response = await _networkService.getRequest(url: 'server-info');
return ServerInfo.fromJson(response.toString());
}
Future<ServerVersion?> getServerVersion() async {
try {
Response response =
await _networkService.getRequest(url: 'server-info/version');
return ServerVersion.fromJson(response.toString());
} catch (e) {
debugPrint("Error getting server info");
}
return null;
}
}