forked from alibaba/flutter-go
-
Notifications
You must be signed in to change notification settings - Fork 0
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
28 changed files
with
684 additions
and
199 deletions.
There are no files selected for viewing
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,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>android</name> | ||
<comment>Project android created by Buildship.</comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature> | ||
</natures> | ||
</projectDescription> |
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,2 @@ | ||
connection.project.dir= | ||
eclipse.preferences.version=1 |
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,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/> | ||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/> | ||
<classpathentry kind="output" path="bin/default"/> | ||
</classpath> |
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,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>app</name> | ||
<comment>Project app created by Buildship.</comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature> | ||
</natures> | ||
</projectDescription> |
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,2 @@ | ||
connection.project.dir=.. | ||
eclipse.preferences.version=1 |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
8 changes: 8 additions & 0 deletions
8
ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>BuildSystemType</key> | ||
<string>Original</string> | ||
</dict> | ||
</plist> |
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,12 @@ | ||
class Api{ | ||
// static const String BASE_URL = 'http://127.0.0.1:6001/'; | ||
static const String BASE_URL = 'http://flutter-go.alibaba.net/'; | ||
|
||
static const String DO_LOGIN = BASE_URL+'doLogin';//登陆 | ||
|
||
static const String CHECK_LOGIN = BASE_URL+'checkLogin';//验证登陆 | ||
|
||
static const String LOGOUT = BASE_URL+'logout';//退出登陆 | ||
|
||
static const String VERSION = BASE_URL+'getAppVersion';//检查版本 | ||
} |
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
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,24 @@ | ||
class UserInfo { | ||
String username; | ||
int id; | ||
String avatarPic; | ||
String themeColor; | ||
String urlName; | ||
|
||
UserInfo({ | ||
this.avatarPic, | ||
this.id, | ||
this.themeColor, | ||
this.urlName, | ||
this.username, | ||
}); | ||
|
||
factory UserInfo.fromJson(Map<String, dynamic> json) { | ||
return UserInfo( | ||
avatarPic: json['avatar_pic'], | ||
id: int.parse(json['id']), | ||
username: json['name'], | ||
themeColor: json['theme_color'], | ||
urlName: json['url_name']); | ||
} | ||
} |
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,64 @@ | ||
/// @Author: 一凨 | ||
/// @Date: 2019-01-07 16:24:42 | ||
/// @Last Modified by: 一凨 | ||
/// @Last Modified time: 2019-01-08 17:37:42 | ||
import 'dart:async'; | ||
|
||
import 'package:flutter_go/utils/sql.dart'; | ||
|
||
abstract class UserInfoInterface { | ||
String get username; | ||
String get password; | ||
} | ||
|
||
class UserInfo implements UserInfoInterface { | ||
String username; | ||
String password; | ||
|
||
UserInfo({this.username, this.password}); | ||
|
||
factory UserInfo.fromJSON(Map json){ | ||
return UserInfo(username: json['username'],password: json['password']); | ||
} | ||
|
||
Object toMap() { | ||
return {'username': username, 'password': password}; | ||
} | ||
} | ||
|
||
class UserInfoControlModel { | ||
final String table = 'userInfo'; | ||
Sql sql; | ||
|
||
UserInfoControlModel() { | ||
sql = Sql.setTable(table); | ||
} | ||
|
||
// 获取所有的收藏 | ||
|
||
// 插入新的缓存 | ||
Future insert(UserInfo userInfo) { | ||
var result = | ||
sql.insert({'username': userInfo.username, 'password': userInfo.password}); | ||
return result; | ||
} | ||
|
||
// 获取用户信息 | ||
Future<List<UserInfo>> getAllInfo() async { | ||
List list = await sql.getByCondition(); | ||
List<UserInfo> resultList = []; | ||
list.forEach((item){ | ||
print(item); | ||
resultList.add(UserInfo.fromJSON(item)); | ||
}); | ||
return resultList; | ||
} | ||
|
||
// 清空表中数据 | ||
Future deleteAll() async{ | ||
return await sql.deleteAll(); | ||
} | ||
|
||
|
||
} |
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,29 @@ | ||
class Data { | ||
String version; | ||
String name; | ||
|
||
Data.fromJson(Map<String, dynamic> json) | ||
: version = json['version'], | ||
name = json['name']; | ||
|
||
@override | ||
String toString() { | ||
return 'name: $name ,version: $version'; | ||
} | ||
} | ||
|
||
class Version { | ||
Data data; | ||
int status; | ||
bool success; | ||
|
||
Version.formJson(Map<String, dynamic> json) | ||
: status = json['status'], | ||
success = json['success'], | ||
data = Data.fromJson(json['data']); | ||
|
||
@override | ||
String toString() { | ||
return 'status: $status ,success: $success,date: ${data.toString()}'; | ||
} | ||
} |
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
Oops, something went wrong.