mirror of
https://github.com/immich-app/immich.git
synced 2024-12-16 12:20:08 +02:00
caaa474c23
* optimize android side gradle settings * android minsdk back to 21 * remove unused package, update linter and fix lint error
29 lines
864 B
Dart
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;
|
|
}
|
|
}
|