Created
February 2, 2022 15:47
-
-
Save Sumit-Ghosh/251f604094213f9ba2690b9896219e7c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> _getDeviceModel() async { | |
String _model; | |
try { | |
// 1 | |
_model = await platformChannel.invokeMethod('getDeviceModel'); | |
} catch (e) { | |
// 2 | |
_model = "Can't fetch the method: '$e'."; | |
} | |
// 3 | |
setState(() { | |
_deviceModel = _model; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment