get_platform 0.0.3

Flutter Android iOS web

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

example/main.dart

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
90
pub points
44%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

simon.braillard@gmail.com

License

BSD (LICENSE)

Dependencies

flutter

More

Packages that depend on get_platform