mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat: use OkHttp and fix mTLS (#15230)
This commit is contained in:
parent
4cd2cc223a
commit
6de4921b99
22 changed files with 560 additions and 236 deletions
39
mobile/lib/common/package_info.dart
Normal file
39
mobile/lib/common/package_info.dart
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
class PackageInfoSingleton {
|
||||
static PackageInfoSingleton? _instance;
|
||||
static PackageInfoSingleton get instance {
|
||||
_instance ??= PackageInfoSingleton._();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
PackageInfoSingleton._();
|
||||
|
||||
PackageInfo? _packageInfo;
|
||||
|
||||
/// Initializes the package info by calling PackageInfo.fromPlatform()
|
||||
/// This should be called once during app initialization
|
||||
Future<void> init() async {
|
||||
_packageInfo ??= await PackageInfo.fromPlatform();
|
||||
}
|
||||
|
||||
/// Returns the PackageInfo instance
|
||||
/// Returns null if init() hasn't been called yet
|
||||
PackageInfo? get packageInfo => _packageInfo;
|
||||
|
||||
/// Returns the app name
|
||||
/// Returns null if init() hasn't been called yet
|
||||
String? get appName => _packageInfo?.appName;
|
||||
|
||||
/// Returns the app version
|
||||
/// Returns null if init() hasn't been called yet
|
||||
String? get version => _packageInfo?.version;
|
||||
|
||||
/// Returns the build number
|
||||
/// Returns null if init() hasn't been called yet
|
||||
String? get buildNumber => _packageInfo?.buildNumber;
|
||||
|
||||
/// Returns the package name
|
||||
/// Returns null if init() hasn't been called yet
|
||||
String? get packageName => _packageInfo?.packageName;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue