device_info is a package which allows developers to get Android and iOS system information.
Install the package:
device_info: ^1.0.0
Then its classes can be imported with package:device_info/device_info.dart in a Dart file.
DeviceInfoPlugin class in this package can provide device and operating system information. Each OS, Android and iOS, have its own getters to get platform-specific device information.
if (Platform.isAndroid) { var androidInfo = await DeviceInfoPlugin().androidInfo; print("Android ${androidInfo.version.release} on ${androidInfo.model}") } else if (Platform.isIOS) { var iosInfo = await DeviceInfoPlugin().iosInfo; print("iOS ${iosInfo.systemVersion} on ${iosInfo.name}") }