fbmobile/lib/core/viewmodels/about_model.dart
Varakh b55e932204
All checks were successful
continuous-integration/drone/push Build is passing
Added proper linting #noissue
2023-01-04 21:17:54 +01:00

32 lines
771 B
Dart

import 'package:package_info_plus/package_info_plus.dart';
import '../../core/services/link_service.dart';
import '../../locator.dart';
import '../enums/viewstate.dart';
import 'base_model.dart';
class AboutModel extends BaseModel {
final LinkService _linkService = locator<LinkService>();
PackageInfo packageInfo = PackageInfo(
appName: 'Unknown',
packageName: 'Unknown',
version: 'Unknown',
buildNumber: 'Unknown',
);
void init() async {
await _initPackageInfo();
}
Future<void> _initPackageInfo() async {
setStateView(ViewState.busy);
final PackageInfo info = await PackageInfo.fromPlatform();
packageInfo = info;
setStateView(ViewState.idle);
}
void openLink(String link) {
_linkService.open(link);
}
}