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

A new flutter plugin project.

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
110
pub points
21%
popularity

Publisher

verified publisherlibin.zone

A new flutter plugin project.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on um_share_plugin