File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/package_info_plus_windows/lib Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,19 @@ class PackageInfoWindows extends PackageInfoPlatform {
1818 @override
1919 Future <PackageInfoData > getAll () {
2020 final info = _FileVersionInfo (Platform .resolvedExecutable);
21+ final versions = info.productVersion.split ('+' );
2122 final data = PackageInfoData (
2223 appName: info.productName,
2324 packageName: info.internalName,
24- version: info.productVersion ,
25- buildNumber: info.fileVersion ,
25+ version: versions. getOrNull ( 0 ) ,
26+ buildNumber: versions. getOrNull ( 1 ) ,
2627 );
2728 info.dispose ();
2829 return Future .value (data);
2930 }
3031}
32+
33+ extension _GetOrNull <T > on List <T > {
34+ T getOrNull (int index) => _checkIndex (index) ? this [index] : null ;
35+ bool _checkIndex (int index) => index >= 0 && index < length;
36+ }
You can’t perform that action at this time.
0 commit comments