gskinnerTeam / flutter-universal-platform

A web-safe implementation of dart.io.Platforms. Helps avoid the "Unsupported operation: Platform._operatingSystem" runtime error.
MIT License
105 stars 27 forks source link

Make currentUniversalPlatform accessible #27

Open scopendo opened 7 months ago

scopendo commented 7 months ago

Currently currentUniversalPlatform is internal to the universal_platform.dart package, requiring the use of the UniversalPlatform.isXXX booleans.

It would be useful if currentUniversalPlatform was exported so that apps could use a switch statement:

final xxx = switch (currentUniversalPlatform` {
  UniversalPlatformType.Web => 'web',
  UniversalPlatformType.IOS => 'ios',
  UniversalPlatformType.Android => 'android',
  _ => 'something else',
};
scopendo commented 7 months ago

I was going to add a PR for this but can see that it's already exported on the master branch. Is it possible to publish an updated version to pub.dev?