init method
void
init()
init Method Documentation :
Initializes the platform-related information based on the current platform.
detectPlatformsInsideWeb : The detectPlatformsInsideWeb
function is a utility for detecting the current web platform and populating platform-related information.
detectPlatforms : The detectPlatforms
function , is called when the code is not running on the web and is a utility for detecting the current platform and populating platform-related information.
Implementation
void init() {
if (kIsWeb) {
final userAgent = window.navigator.userAgent.toString().toLowerCase();
detectPlatformsInsideWeb(userAgent);
} else {
detectPlatforms(defaultTargetPlatform);
}
}