import 'package:electronic_assistant/data/consts/constants.dart';
import 'package:package_info_plus/package_info_plus.dart';

class AppInfoUtil {
  PackageInfo? _packageInfo;

  AppInfoUtil._();

  init() async {
    _packageInfo = await PackageInfo.fromPlatform();
  }

  String? get appName => _packageInfo?.appName;

  String? get packageName => _packageInfo?.packageName;

  String? get appVersionName => _packageInfo?.version;

  int? get appVersionCode => int.tryParse(_packageInfo?.buildNumber ?? '');
}

final appInfoUtil = AppInfoUtil._();
