1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-22 01:47:08 +02:00
immich/mobile/lib/shared/services/server_info.service.dart
Jason Rasmussen 2b839088c7
feat(web,server): server features (#3756)
* feat: server features

* chore: open api

* icon size

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-08-18 04:55:26 +00:00

36 lines
948 B
Dart

import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/shared/providers/api.provider.dart';
import 'package:immich_mobile/shared/services/api.service.dart';
import 'package:openapi/api.dart';
final serverInfoServiceProvider = Provider(
(ref) => ServerInfoService(
ref.watch(apiServiceProvider),
),
);
class ServerInfoService {
final ApiService _apiService;
ServerInfoService(this._apiService);
Future<ServerInfoResponseDto?> getServerInfo() async {
try {
return await _apiService.serverInfoApi.getServerInfo();
} catch (e) {
debugPrint("Error [getServerInfo] ${e.toString()}");
return null;
}
}
Future<ServerVersionResponseDto?> getServerVersion() async {
try {
return await _apiService.serverInfoApi.getServerVersion();
} catch (e) {
debugPrint("Error getting server info");
return null;
}
}
}