flutter-universal-platform icon indicating copy to clipboard operation
flutter-universal-platform copied to clipboard

Make currentUniversalPlatform accessible

Open scopendo opened this issue 1 year ago • 1 comments

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 avatar Jan 31 '24 15:01 scopendo

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?

scopendo avatar Jan 31 '24 15:01 scopendo