info_utils_plugin 0.0.4 copy "info_utils_plugin: ^0.0.4" to clipboard
info_utils_plugin: ^0.0.4 copied to clipboard

This is a plugin used to obtain the basic information of the user's device and its current location.

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

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

class _MyAppState extends State<MyApp> {
  final InfoUtilsPlugin plugin = InfoUtilsPlugin();

  Map<String, dynamic> data = {};

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

  test() async{
    final s = await plugin.getDeviceInfo();
    data = s.toJson();
    setState(() {

    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter Info Plugin'),
        ),
        body: Center(
          child: Text('$data'),
        ),
      ),
    );
  }
}