plugin_social 0.0.2 plugin_social: ^0.0.2 copied to clipboard
A new Flutter plugin for Sign in with SMS/Email via AccountKit.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:plugin_social/plugin_social.dart';
void main() => runApp(new MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
PluginSocial authencationExample = new PluginSocial();
@override
initState() {
super.initState();
}
signInWithSMS() async {
await authencationExample.signInWithSMS();
}
signInWithEmail() async {
await authencationExample.signInWithEmail();
}
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('Plugin example app'),
),
body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new RaisedButton(
child: new Text("Press to sign in with SMS"),
onPressed: () async {
this.signInWithSMS();
},
),
new RaisedButton(
child: new Text("Press to sign in with Email"),
onPressed: () async {
this.signInWithEmail();
},
)
],
),
),
),
);
}
}