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

discontinued
outdated

A simple package to get the platform the app is running on, web include.

GetPlatform #

A simple package to get the platform the app is running on, web include.

Getting Started #

To use this package, add get_platform as a dependency in your pubspec.yaml file.

With this package, you can easily get the plaform you're launching the app on as you would do with the dart.io except that with dart.io, you can't have access to web platform. With this package, you can use the function isWeb !

Example #

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(title: 'GetPlatform'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;
  /// We make basic Stateful app.
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    /// This is a simple ap that will show the platform it's running on.
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        /// Here we get the platform we're on.
        child: Text(GetPlatform.getPlatform()),
      ),
    );
  }
}
3
likes
0
pub points
5%
popularity

Publisher

unverified uploader

A simple package to get the platform the app is running on, web include.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on get_platform