uni_platform

Creator: coderz1093

Last updated:

0 purchases

uni_platform Image
uni_platform Images
Add to Cart

Description:

uni platform

uni_platform #

Substitutes the Platform class, ensuring works across all platforms.




Quick Start

Installation
Usage


License


Quick Start #
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
uni_platform: ^0.1.1
copied to clipboard
Usage #
select method:
import 'package:uni_platform/uni_platform.dart';

String platformType = UniPlatform.select<String>(
android: 'Android',
fuchsia: 'Fuchsia',
ios: 'iOS',
linux: 'Linux',
macos: 'macOS',
windows: 'Windows',
web: 'Web',
otherwise: 'Unknown',
);
copied to clipboard
call method:
String platformType = UniPlatform.call<String>(
android: () => 'Android',
fuchsia: () => 'Fuchsia',
ios: () => 'iOS',
linux: () => 'Linux',
macos: () => 'macOS',
windows: () => 'Windows',
web: () => 'Web',
otherwise: () => 'Unknown',
);
copied to clipboard

Please see the example app of this plugin for a full example.

License #
MIT

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.