msa_flutter_plugin 1.0.25+1 copy "msa_flutter_plugin: ^1.0.25+1" to clipboard
msa_flutter_plugin: ^1.0.25+1 copied to clipboard

A new Flutter plugin for MSA OAID.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:msa_flutter_plugin/msa_flutter_plugin.dart';

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  MSAData _data;

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

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initMSAtate() async {
    MSAData data = await MsaFlutterPlugin.getMsaIdConfigs();
    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _data = data;
      print("是否支持oaid:${data.isSupport}");
      print("获取oaid:${data.oaid}");
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('msa oaid: ${_data?.oaid}\n'),
        ),
      ),
    );
  }
}
2
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter plugin for MSA OAID.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on msa_flutter_plugin