44
55import 'dart:io' ;
66
7+ import 'package:device_info_plus/device_info_plus.dart' ;
78import 'package:flutter/foundation.dart' ;
89import 'package:flutter_test/flutter_test.dart' ;
910import 'package:integration_test/integration_test.dart' ;
1011import 'package:package_info_plus/package_info_plus.dart' ;
1112import 'package:package_info_plus_example/main.dart' ;
1213
14+ const android14SDK = 34 ;
15+
1316void main () {
1417 IntegrationTestWidgetsFlutterBinding .ensureInitialized ();
1518
@@ -25,12 +28,19 @@ void main() {
2528 expect (info.installerStore, null );
2629 } else {
2730 if (Platform .isAndroid) {
31+ final androidVersionInfo = await DeviceInfoPlugin ().androidInfo;
32+
2833 expect (info.appName, 'package_info_example' );
2934 expect (info.buildNumber, '4' );
3035 expect (info.buildSignature, isNotEmpty);
3136 expect (info.packageName, 'io.flutter.plugins.packageinfoexample' );
3237 expect (info.version, '1.2.3' );
33- expect (info.installerStore, null );
38+ // Since Android 14 (API 34) OS returns com.android.shell when app is installed via package installer
39+ if (androidVersionInfo.version.sdkInt >= android14SDK) {
40+ expect (info.installerStore, 'com.android.shell' );
41+ } else {
42+ expect (info.installerStore, null );
43+ }
3444 } else if (Platform .isIOS) {
3545 expect (info.appName, 'Package Info Plus Example' );
3646 expect (info.buildNumber, '4' );
@@ -75,13 +85,22 @@ void main() {
7585 expect (find.text ('not available' ), findsOneWidget);
7686 } else {
7787 if (Platform .isAndroid) {
88+ final androidVersionInfo = await DeviceInfoPlugin ().androidInfo;
89+
7890 expect (find.text ('package_info_example' ), findsOneWidget);
7991 expect (find.text ('4' ), findsOneWidget);
8092 expect (
81- find.text ('io.flutter.plugins.packageinfoexample' ), findsOneWidget);
93+ find.text ('io.flutter.plugins.packageinfoexample' ),
94+ findsOneWidget,
95+ );
8296 expect (find.text ('1.2.3' ), findsOneWidget);
8397 expect (find.text ('Not set' ), findsNothing);
84- expect (find.text ('not available' ), findsOneWidget);
98+ // Since Android 14 (API 34) OS returns com.android.shell when app is installed via package installer
99+ if (androidVersionInfo.version.sdkInt >= android14SDK) {
100+ expect (find.text ('com.android.shell' ), findsOneWidget);
101+ } else {
102+ expect (find.text ('not available' ), findsOneWidget);
103+ }
85104 } else if (Platform .isIOS) {
86105 expect (find.text ('Package Info Plus Example' ), findsOneWidget);
87106 expect (find.text ('4' ), findsOneWidget);
0 commit comments