June 2017
Intermediate to advanced
873 pages
18h 9m
English
In this recipe, you will see how to interact with the underlying operating system on which your app runs by making system calls and getting information from the system.
The Platform class provides you with information about the OS and the computer the app is executing on. It lives in dart:io, so we need to import this library.
The following script shows the use of some interesting options (refer to the code files tools\code\platform\bin\platform.dart of this chapter):
import 'dart:io'; Map env = Platform.environment; void main() { print('We run from this VM: ${Platform.executable}'); // getting the OS and Dart version: print('Our OS is: ${Platform.operatingSystem}'); print('We ...
Read now
Unlock full access