selector 3.0.0 copy "selector: ^3.0.0" to clipboard
selector: ^3.0.0 copied to clipboard

Multi type supported platform selector to write functional programming.

Selector #

Multi type support Platform Selector

Basic selector #

  • with selector
String result = selector(
      android: 'hello Android',
      ios: 'hello iOS',
      fuchsia: 'hello Fuchsia',
      linux: 'hello Linux',
      mac: 'hello MacOS',
      windows: 'hello Windows',
);

optional selector #

  • with selector
String? result = optionalSelector(
      android: 'hello Android',
      ios: 'hello iOS',
      fuchsia: 'hello Fuchsia',
);

Device selector #

String result = deviceSelector(
      mobile: 'hello Mobile',
      desktop: 'hello Desktop',
      web: 'hello Web',
);

OrElse selector #

String admobKey = androidOrElse('android-key', 'iOS-key');
String iosPreferredKey = iosOrElse('iOS-key', 'android-key');

Query #

print('isDesktop: $isDesktop')
print('isMobile: $isMobile')
21
likes
160
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

Multi type supported platform selector to write functional programming.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on selector