platform_data

Last updated:

0 purchases

platform_data Image
platform_data Images
Add to Cart

Description:

platform data

Flutter specified platform data, A cleaner way to know users platform type.
Getting started #
Don't forget to initialize the class at first like that:
void main() {
PlatformData.init();
// You can get the platform type like this:
print('platform type: ' + PlatformData.platformType.toString());
runApp(MyApp());
}
copied to clipboard
Usage #
After initializing the package you can use it anywhere in the code in two ways:
if (PlatformData.platformType == PlatformType.web) {
// build for web
} else if (PlatformData.platformType == PlatformType.android) {
// build for android
}
copied to clipboard
if (isPlatformWeb) {
// build for web
}
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.