mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(mobile): tidy-up dependencies, remove unused, replace rarely used ones (#948)
This commit is contained in:
parent
33ded2a174
commit
8d0ff974e1
13 changed files with 76 additions and 303 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import 'package:dio/dio.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:immich_mobile/constants/hive_box.dart';
|
||||
import 'package:immich_mobile/shared/views/version_announcement_overlay.dart';
|
||||
|
||||
|
|
@ -9,21 +11,20 @@ class ReleaseInfoNotifier extends StateNotifier<String> {
|
|||
ReleaseInfoNotifier() : super("");
|
||||
|
||||
void checkGithubReleaseInfo() async {
|
||||
var dio = Dio();
|
||||
final Client client = Client();
|
||||
var box = Hive.box(hiveGithubReleaseInfoBox);
|
||||
|
||||
try {
|
||||
String? localReleaseVersion = box.get(githubReleaseInfoKey);
|
||||
|
||||
var res = await dio.get(
|
||||
"https://api.github.com/repos/alextran1502/immich/releases/latest",
|
||||
options: Options(
|
||||
headers: {"Accept": "application/vnd.github.v3+json"},
|
||||
),
|
||||
);
|
||||
final res = await client.get(
|
||||
Uri.parse(
|
||||
"https://api.github.com/repos/alextran1502/immich/releases/latest",
|
||||
),
|
||||
headers: {"Accept": "application/vnd.github.v3+json"});
|
||||
|
||||
if (res.statusCode == 200) {
|
||||
String latestTagVersion = res.data["tag_name"];
|
||||
final data = jsonDecode(res.body);
|
||||
String latestTagVersion = data["tag_name"];
|
||||
state = latestTagVersion;
|
||||
|
||||
debugPrint("Local release version $localReleaseVersion");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue