mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
15 lines
399 B
Dart
15 lines
399 B
Dart
import 'package:dio/dio.dart';
|
|
import 'package:toolbox/data/res/store.dart';
|
|
|
|
import '../model/app/update.dart';
|
|
import '../res/url.dart';
|
|
|
|
class AppService {
|
|
Future<AppUpdate> getUpdate() async {
|
|
final useCDN = Stores.setting.useCdn.fetch() == 1;
|
|
final resp =
|
|
await Dio().get('${useCDN ? Urls.cdnBase : Urls.resBase}/update.json');
|
|
return AppUpdate.fromJson(resp.data);
|
|
}
|
|
}
|