platform_utils 0.0.3 platform_utils: ^0.0.3 copied to clipboard
Returns value or run function based on Platform. If the context is passed, it will get the platform by Theme.of(context).platform. Otherwise, it will use defaultTargetPlatform.
Use this package as a library
Depend on it
Run this command:
With Flutter:
$ flutter pub add platform_utils
This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get
):
dependencies:
platform_utils: ^0.0.3
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:platform_utils/platform_utils.dart';