universal_platform 0.1.2 copy "universal_platform: ^0.1.2" to clipboard
universal_platform: ^0.1.2 copied to clipboard

outdated

Replacement for dart.io.Platform class which works on Web as well as Desktop and Mobile.

example/lib/main.dart

import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:universal_platform/universal_platform.dart';

void main() => runApp(MaterialApp(home: Demo()));

class Demo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    print(window.physicalSize);

    return Material(
      child: Center(
          child: Text(
        "Web: ${UniversalPlatform.isWeb} \n "
        "MacOS: ${UniversalPlatform.isMacOS} \n"
        "Windows: ${UniversalPlatform.isWindows} \n"
        "Linux: ${UniversalPlatform.isLinux} \n"
        "Android: ${UniversalPlatform.isAndroid} \n"
        "IOS: ${UniversalPlatform.isIOS} \n"
        "Fuschia: ${UniversalPlatform.isFuchsia} \n",
      )),
    );
  }
}
295
likes
0
points
751k
downloads

Publisher

verified publishergskinner.com

Weekly Downloads

Replacement for dart.io.Platform class which works on Web as well as Desktop and Mobile.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on universal_platform