# uni_platform **Repository Path**: leanflutter/uni_platform ## Basic Information - **Project Name**: uni_platform - **Description**: Replaces the Platform class and works on any platform. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-01-19 - **Last Updated**: 2024-03-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # uni_platform [![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] [pub-image]: https://img.shields.io/pub/v/uni_platform.svg [pub-url]: https://pub.dev/packages/uni_platform [discord-image]: https://img.shields.io/discord/884679008049037342.svg [discord-url]: https://discord.gg/zPa6EZ2jqb Substitutes the Platform class, ensuring works across all platforms. --- - [Quick Start](#quick-start) - [Installation](#installation) - [Usage](#usage) - [License](#license) ## Quick Start ### Installation Add this to your package's pubspec.yaml file: ```yaml dependencies: uni_platform: ^0.1.1 ``` ### Usage select method: ```dart import 'package:uni_platform/uni_platform.dart'; String platformType = UniPlatform.select( android: 'Android', fuchsia: 'Fuchsia', ios: 'iOS', linux: 'Linux', macos: 'macOS', windows: 'Windows', web: 'Web', otherwise: 'Unknown', ); ``` call method: ```dart String platformType = UniPlatform.call( android: () => 'Android', fuchsia: () => 'Fuchsia', ios: () => 'iOS', linux: () => 'Linux', macos: () => 'macOS', windows: () => 'Windows', web: () => 'Web', otherwise: () => 'Unknown', ); ``` > Please see the example app of this plugin for a full example. ## License [MIT](./LICENSE)