um_share_plugin 0.0.3 copy "um_share_plugin: ^0.0.3" to clipboard
um_share_plugin: ^0.0.3 copied to clipboard

集成友盟第三方登录插件.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:um_share_plugin/um_share_plugin.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> {
  @override
  void initState() {
    super.initState();
    UMSharePlugin.init('UM appKey');
    UMSharePlugin.setPlatform(platform:UMSocialPlatformType_QQ, appKey: 'QQ AppKey');
  }
  String textStr = 'Tap to login';
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: GestureDetector(onTap:()async{
            UMShareUserInfo info = await UMSharePlugin.getUserInfoForPlatform(UMSocialPlatformType_QQ);
            setState(() {
              if(info.error == null){
                textStr = 'hello ${info.name}';
              }else{
                textStr = info.error??'';
              }
            });
          },child: Text(textStr)),
        ),
      ),
    );
  }
}
0
likes
135
points
22
downloads

Publisher

verified publisherlibin.zone

Weekly Downloads

集成友盟第三方登录插件.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on um_share_plugin