-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
android/src/main/java/com/lunagao/leancloudflutterplugin/LeancloudUser.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.lunagao.leancloudflutterplugin; | ||
|
||
import cn.leancloud.AVUser; | ||
import io.flutter.plugin.common.MethodCall; | ||
import io.flutter.plugin.common.MethodChannel; | ||
|
||
public class LeancloudUser { | ||
|
||
void getCurrentUser(MethodCall call, final MethodChannel.Result result) { | ||
AVUser currentUser = AVUser.getCurrentUser(); | ||
result.success(currentUser.toJSONString()); | ||
} | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class UserScreen extends StatefulWidget { | ||
@override | ||
_UserScreenState createState() => _UserScreenState(); | ||
} | ||
|
||
class _UserScreenState extends State<UserScreen> { | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text('User Page'), | ||
), | ||
body: ListView( | ||
shrinkWrap: true, | ||
padding: const EdgeInsets.all(20.0), | ||
children: <Widget>[ | ||
Text("Please click 'create an Object' button"), | ||
FlatButton( | ||
onPressed: () {}, | ||
child: Text('Sign in'), | ||
), | ||
FlatButton( | ||
onPressed: () {}, | ||
child: Text('Login in'), | ||
) | ||
], | ||
) | ||
); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:leancloud_flutter_plugin/leancloud_flutter_plugin.dart'; | ||
import 'package:leancloud_flutter_plugin/leancloud_object.dart'; | ||
|
||
class AVUser extends AVObject{ | ||
|
||
var _userName; | ||
|
||
AVUser() : super("_User"); | ||
|
||
// AVUser currentUser() { | ||
// var leancloudFlutterPlugin = LeancloudFlutterPlugin.getInstance(); | ||
// String jsonString = leancloudFlutterPlugin.currentUser(); | ||
// return leancloudFlutterPlugin.currentUser(); | ||
// } | ||
} |