mplatform 0.0.2 copy "mplatform: ^0.0.2" to clipboard
mplatform: ^0.0.2 copied to clipboard

A flutter package that makes it easy to handle platform checking

Mplatform #

How to use #

import 'package:flutter/foundation.dart';
import 'package:mplatform/mplatform.dart';

void main() {
  var platform = Mplatform.current;

  //Handle all conditions
  switch (platform) {
    case Mplatform.android:
    case Mplatform.web:
    case Mplatform.ios:
    case Mplatform.macos:
    case Mplatform.windows:
    case Mplatform.linux:
    case Mplatform.fuchsia:
      debugPrint(platform.name);
      break;
  }

  //check for just one condition
  if (!Mplatform.isFuchsia) {
    debugPrint("Why is fuchsia an option tho 🤔");
  }
}
2
likes
160
points
57
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package that makes it easy to handle platform checking

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on mplatform