How can I access device information without using packages in Flutter? How can I get the information of the device where the app is installed in my Flutter app?
CodePudding user response:
First, you'd be better off using packages. But if you really want/need to do it, you'd have to write platform-specific code code in the native language of the targeted platform (ie. Swift or Objective-C for iOS/Mac, Kotlin or Java for Android, etc), then use so-called platform channels to pass messages between your app and the platform-specific code.
If you'd like to get details about the device, on iOS you'd use UIDevice
, on Android you'd typically want Build
.
CodePudding user response:
This can only be done through Method Channel