advanced_platform_detection 1.0.0 copy "advanced_platform_detection: ^1.0.0" to clipboard
advanced_platform_detection: ^1.0.0 copied to clipboard

outdated

A plugin that enables you to retrive the current platform (iOS, Android, Windows, ...)+ brower & more

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  num? version;
  dynamic? browser;

  @override
  void initState() {
    super.initState();

    AdvancedPlatform.browser().then((value) {
      setState(() {
        browser = value;
      });
    });

    AdvancedPlatform.version().then((value) {
      setState(() {
        version = value;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Version $version Browser $browser'),
        ),
      ),
    );
  }
}
4
likes
0
pub points
41%
popularity

Publisher

verified publishergaspardmerten.dev

A plugin that enables you to retrive the current platform (iOS, Android, Windows, ...)+ brower & more

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_web_plugins

More

Packages that depend on advanced_platform_detection