This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final GoogleSignIn googleSignIn = GoogleSignIn(); | |
final FirebaseAuth _auth = FirebaseAuth.instance; | |
Future<FirebaseUser> signInWithGoogle() async { | |
final GoogleSignInAccount googleUser = await googleSignIn.signIn(); | |
final GoogleSignInAuthentication googleAuth = await googleUser.authentication; | |
final AuthCredential credential = GoogleAuthProvider.getCredential( | |
idToken: googleAuth.idToken, accessToken: googleAuth.accessToken); | |
AuthResult authResult = await _auth.signInWithCredential(credential); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "flex", | |
"altText": "Hello", | |
"contents": { | |
"type": "bubble", | |
"hero": { | |
"type": "image", | |
"url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/01_1_cafe.png", | |
"size": "full", | |
"aspectRatio": "20:13", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<bool> signInWithEmail(BuildContext context, | |
{@required String email, @required String password}) { | |
return _auth | |
.signInWithEmailAndPassword(email: email, password: password) | |
.then((result) { | |
print("Welcome " + result.user.uid); | |
Navigator.pop(context); | |
Navigator.pushReplacement( | |
context, | |
MaterialPageRoute( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<bool> registerWithEmail( | |
{@required email, @required password, @required repassword}) { | |
final FirebaseAuth _auth = FirebaseAuth.instance; | |
return _auth | |
.createUserWithEmailAndPassword(email: email, password: password) | |
.then((data) { | |
print("Registation Success"); | |
print(data.user.uid); | |
return true; | |
}).catchError((e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => { | |
const agent = new WebhookClient({ request, response }); | |
console.log('Dialogflow Request headers: ' + JSON.stringify(request.headers)); | |
console.log('Dialogflow Request body: ' + JSON.stringify(request.body)); | |
function welcome(agent) { | |
agent.add(`Welcome to my agent!`); | |
} | |
function fallback(agent) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String pddescription = "Please wait..."; | |
@override | |
void initState() { | |
super.initState(); | |
Firestore.instance.collection("catalog").document(widget.pdname).get().then((value) { | |
setState(() { | |
pddescription = value.data["description"]; | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"line": { | |
"type": "flex", | |
"altText": "LIFF", | |
"contents": { | |
"type": "carousel", | |
"contents": [ | |
{ | |
"type": "bubble", | |
"hero": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StreamBuilder( | |
stream: Firestore.instance.collection("catalog").snapshots(), | |
builder: (context, snapshot) { | |
if (!snapshot.hasData) { | |
return Center( | |
child: Column( | |
children: <Widget>[ | |
CircularProgressIndicator(), | |
Text("Loading . . . "), | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "bubble", | |
"size": "giga", | |
"header": { | |
"type": "box", | |
"layout": "horizontal", | |
"contents": [ | |
{ | |
"type": "box", | |
"layout": "vertical", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "bubble", | |
"size": "giga", | |
"header": { | |
"type": "box", | |
"layout": "horizontal", | |
"contents": [ | |
{ | |
"type": "image", | |
"url": "https://www.shareicon.net/data/128x128/2016/09/02/824400_airport_512x512.png", |