Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/device_info_plus/device_info_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Get current device information from within the Flutter application.
- Dart >=3.7.0 <4.0.0
- iOS >=12.0
- macOS >=10.14
- Android `compileSDK` 34
- Java 17
- Android Gradle Plugin >=8.3.0
- Gradle wrapper >=8.4
- Kotlin 2.2.0
- Android Gradle Plugin >=8.12.1
- Gradle wrapper >=8.13

# Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ group 'dev.fluttercommunity.plus.device_info'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.7.22'
ext.kotlin_version = '2.2.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.3.1'
classpath 'com.android.tools.build:gradle:8.12.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -25,9 +25,8 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdk 34

namespace 'dev.fluttercommunity.plus.device_info'
compileSdk = flutter.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ if (flutterVersionName == null) {
}

android {
compileSdk 34

namespace 'io.flutter.plugins.deviceinfoexample.example'
compileSdk = flutter.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
Expand All @@ -46,8 +45,8 @@ android {

defaultConfig {
applicationId "io.flutter.plugins.deviceinfoexample.example"
minSdk 21
targetSdk 34
minSdk flutter.minSdkVersion
targetSdk flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Oct 05 15:15:38 CEST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.3.1" apply false
id "org.jetbrains.kotlin.android" version "1.9.23" apply false
id "com.android.application" version "8.12.1" apply false
id "org.jetbrains.kotlin.android" version "2.2.0" apply false
}

include ":app"
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,19 @@ void main() {
}
});

testWidgets('Can get non-null iOS utsname fields',
(WidgetTester tester) async {
testWidgets('Can get non-null iOS utsname fields', (
WidgetTester tester,
) async {
expect(iosInfo.utsname.machine, isNotNull);
expect(iosInfo.utsname.nodename, isNotNull);
expect(iosInfo.utsname.release, isNotNull);
expect(iosInfo.utsname.sysname, isNotNull);
expect(iosInfo.utsname.version, isNotNull);
}, skip: !Platform.isIOS);

testWidgets('Check all android info values are available',
(WidgetTester tester) async {
testWidgets('Check all android info values are available', (
WidgetTester tester,
) async {
if (androidInfo.version.sdkInt >= 23) {
expect(androidInfo.version.baseOS, isNotNull);
expect(androidInfo.version.previewSdkInt, isNotNull);
Expand Down Expand Up @@ -112,8 +114,9 @@ void main() {
expect(androidInfo.serialNumber, isNotNull);
}, skip: !Platform.isAndroid);

testWidgets('Check all macos info values are available',
((WidgetTester tester) async {
testWidgets('Check all macos info values are available', ((
WidgetTester tester,
) async {
expect(macosInfo.computerName, isNotNull);
expect(macosInfo.hostName, isNotNull);
expect(macosInfo.arch, isNotNull);
Expand All @@ -127,8 +130,9 @@ void main() {
expect(macosInfo.systemGUID, isNotNull);
}), skip: !Platform.isMacOS);

testWidgets('Check all Linux info values are available',
((WidgetTester tester) async {
testWidgets('Check all Linux info values are available', ((
WidgetTester tester,
) async {
expect(linuxInfo.name, isNotNull);
expect(linuxInfo.version, isNotNull);
expect(linuxInfo.id, isNotNull);
Expand All @@ -141,96 +145,43 @@ void main() {
expect(linuxInfo.variantId, isNull);
}), skip: !Platform.isLinux);

testWidgets('Check all Windows info values are available',
((WidgetTester tester) async {
expect(
windowsInfo.numberOfCores,
isPositive,
);
expect(
windowsInfo.computerName,
isNotEmpty,
);
expect(
windowsInfo.systemMemoryInMegabytes,
isPositive,
);
expect(
windowsInfo.userName,
isNotEmpty,
);
expect(
windowsInfo.majorVersion,
equals(10),
);
expect(
windowsInfo.minorVersion,
equals(0),
);
expect(
windowsInfo.buildNumber,
greaterThan(10240),
);
expect(
windowsInfo.platformId,
equals(2),
);
expect(
windowsInfo.reserved,
isZero,
);
expect(
windowsInfo.buildLab,
isNotEmpty,
);
testWidgets('Check all Windows info values are available', ((
WidgetTester tester,
) async {
expect(windowsInfo.numberOfCores, isPositive);
expect(windowsInfo.computerName, isNotEmpty);
expect(windowsInfo.systemMemoryInMegabytes, isPositive);
expect(windowsInfo.userName, isNotEmpty);
expect(windowsInfo.majorVersion, equals(10));
expect(windowsInfo.minorVersion, equals(0));
expect(windowsInfo.buildNumber, greaterThan(10240));
expect(windowsInfo.platformId, equals(2));
expect(windowsInfo.reserved, isZero);
expect(windowsInfo.buildLab, isNotEmpty);
expect(
windowsInfo.buildLab,
startsWith(
windowsInfo.buildNumber.toString(),
),
);
expect(
windowsInfo.buildLabEx,
isNotEmpty,
startsWith(windowsInfo.buildNumber.toString()),
);
expect(windowsInfo.buildLabEx, isNotEmpty);
expect(
windowsInfo.buildLab,
startsWith(windowsInfo.buildNumber.toString()),
);
expect(windowsInfo.digitalProductId, isNotEmpty);
expect(windowsInfo.editionId, isNotEmpty);
expect(windowsInfo.productId, isNotEmpty);
expect(
windowsInfo.digitalProductId,
isNotEmpty,
);
expect(
windowsInfo.editionId,
isNotEmpty,
);
expect(
windowsInfo.productId,
isNotEmpty,
);
expect(
RegExp(r'^([A-Z0-9]{5}-){4}[A-Z0-9]{5}$')
.hasMatch(windowsInfo.productId) ||
RegExp(r'^([A-Z0-9]{5}-){3}[A-Z0-9]{5}$')
.hasMatch(windowsInfo.productId),
RegExp(
r'^([A-Z0-9]{5}-){4}[A-Z0-9]{5}$',
).hasMatch(windowsInfo.productId) ||
RegExp(
r'^([A-Z0-9]{5}-){3}[A-Z0-9]{5}$',
).hasMatch(windowsInfo.productId),
isTrue,
);
expect(
windowsInfo.productName,
isNotEmpty,
);
expect(
windowsInfo.productName,
startsWith('Windows'),
);
expect(
windowsInfo.releaseId,
isNotEmpty,
);
expect(
windowsInfo.deviceId,
isNotEmpty,
);
expect(windowsInfo.productName, isNotEmpty);
expect(windowsInfo.productName, startsWith('Windows'));
expect(windowsInfo.releaseId, isNotEmpty);
expect(windowsInfo.deviceId, isNotEmpty);
}), skip: !Platform.isWindows);
}
Loading
Loading