Commit f9e8e9f5 authored by 何碧荣's avatar 何碧荣

update

parent 325f43f0
......@@ -35,9 +35,9 @@ buildDir = new File(rootProject.projectDir, "../build/host")
dependencies {
implementation project(':flutter')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
testImplementation 'junit:junit:4.12'
......
......@@ -36,14 +36,5 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.example.gengmei_flutter_plugin"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>
sdk.dir=/Users/apple/Library/Android/sdk
flutter.sdk=/Users/apple/Applications/flutter
\ No newline at end of file
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
\ No newline at end of file
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/apple/Downloads/flutter
FLUTTER_APPLICATION_PATH=/Users/apple/lsy/gmalpha_flutter
FLUTTER_TARGET=/Users/apple/lsy/gmalpha_flutter/lib/main.dart
FLUTTER_ROOT=/Users/apple/Applications/flutter
FLUTTER_APPLICATION_PATH=/Users/user/work/gmalpha_flutter
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
TRACK_WIDGET_CREATION=true
......@@ -7,7 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
0523E7645C49429140A87BC8 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F32CCBF52B4BC64C019A584D /* libPods-Runner.a */; };
741F496221355F47001E2961 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 741F495E21355F27001E2961 /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
741F496821356857001E2961 /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 741F496521356807001E2961 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
74974048213559DB008C567A /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 74974046213559DB008C567A /* Release.xcconfig */; };
......@@ -36,8 +35,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
2C9B1AB557CD5CBC16164957 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
441FD4625C7D0900F05C9A58 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
741F495E21355F27001E2961 /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = ../.ios/Flutter/engine/Flutter.framework; sourceTree = "<group>"; };
741F496521356807001E2961 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = ../.ios/Flutter/App.framework; sourceTree = "<group>"; };
74974046213559DB008C567A /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
......@@ -52,8 +49,6 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F32CCBF52B4BC64C019A584D /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F99355DD7889C1520E1503E4 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -61,21 +56,12 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0523E7645C49429140A87BC8 /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
37CBF6198D3E34CE197F7E29 /* Frameworks */ = {
isa = PBXGroup;
children = (
F32CCBF52B4BC64C019A584D /* libPods-Runner.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
741F49642135620F001E2961 /* Config */ = {
isa = PBXGroup;
children = (
......@@ -103,8 +89,6 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
F558CDC6611173C14623ADA6 /* Pods */,
37CBF6198D3E34CE197F7E29 /* Frameworks */,
);
sourceTree = "<group>";
};
......@@ -138,16 +122,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
F558CDC6611173C14623ADA6 /* Pods */ = {
isa = PBXGroup;
children = (
F99355DD7889C1520E1503E4 /* Pods-Runner.debug.xcconfig */,
441FD4625C7D0900F05C9A58 /* Pods-Runner.release.xcconfig */,
2C9B1AB557CD5CBC16164957 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
......@@ -155,14 +129,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
E10CBE561B0B3954E5D8AB2F /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
741F496321355F47001E2961 /* Embed Frameworks */,
5BAC25529DA8134F9EC5F747 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
......@@ -184,7 +156,6 @@
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = 86R4V3XFLU;
};
};
};
......@@ -237,24 +208,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
};
5BAC25529DA8134F9EC5F747 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/engine/Flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
......@@ -269,28 +222,6 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
E10CBE561B0B3954E5D8AB2F /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
......@@ -381,7 +312,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 86R4V3XFLU;
DEVELOPMENT_TEAM = S8QB4VV633;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -509,7 +440,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 86R4V3XFLU;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -534,7 +464,6 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 86R4V3XFLU;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -577,6 +506,7 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
......@@ -4,7 +4,4 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
......@@ -8,10 +8,10 @@ import "package:gmalpha_flutter/AlbumModel/AlbumRouterImpl.dart";
import "package:gmalpha_flutter/AlbumModel/AlbumRouter.dart";
import "package:gmalpha_flutter/messageModel/MessageRouterImpl.dart";
import "package:gmalpha_flutter/messageModel/MessageRouter.dart";
import "package:gmalpha_flutter/userModel/UserRouterImpl.dart";
import "package:gmalpha_flutter/userModel/UserRouter.dart";
import "package:gmalpha_flutter/questionModel/QuestionRouterImpl.dart";
import "package:gmalpha_flutter/questionModel/QuestionRouter.dart";
import "package:gmalpha_flutter/userModel/UserRouterImpl.dart";
import "package:gmalpha_flutter/userModel/UserRouter.dart";
import "package:gmalpha_flutter/Annotations/RouterCenterRestore.dart";
import "package:gmalpha_flutter/Annotations/RouterBaser.dart";
......@@ -42,8 +42,8 @@ class RouterCenterImpl {
void init() {
map.putIfAbsent("albumModel", () => AlbumRouterImpl());
map.putIfAbsent("messageModel", () => MessageRouterImpl());
map.putIfAbsent("userModel", () => UserRouterImpl());
map.putIfAbsent("questionModel", () => QuestionRouterImpl());
map.putIfAbsent("userModel", () => UserRouterImpl());
}
RouterBaser getModel(String modelName) {
......@@ -64,17 +64,17 @@ class RouterCenterImpl {
return map["messageModel"] as MessageRouter;
}
UserRouter findUserRouter() {
if (map["userModel"] == null) {
QuestionRouter findQuestionRouter() {
if (map["questionModel"] == null) {
return null;
}
return map["userModel"] as UserRouter;
return map["questionModel"] as QuestionRouter;
}
QuestionRouter findQuestionRouter() {
if (map["questionModel"] == null) {
UserRouter findUserRouter() {
if (map["userModel"] == null) {
return null;
}
return map["questionModel"] as QuestionRouter;
return map["userModel"] as UserRouter;
}
}
/*
* @author lsy
* @date 2019-09-04
**/
\ No newline at end of file
......@@ -5,22 +5,17 @@
**/
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart';
import 'package:gmalpha_flutter/questionModel/page/question/QuestionPageModel.dart';
import 'package:gmalpha_flutter/questionModel/service/remote/entity/TestQuestionEntity.dart';
import 'package:gmalpha_flutter/questionModel/page/QuestionPageModel.dart';
import 'package:gmalpha_flutter/questionModel/service/remote/entity/QuestionEntity.dart';
class QuestionWidget extends StatefulWidget {
class QuestionPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => UserState();
State<StatefulWidget> createState() => QuestionState();
}
class UserState extends State<QuestionWidget> {
class QuestionState extends State<QuestionPage> {
QuestionPageModel _model;
TextEditingController _nameController = new TextEditingController();
TextEditingController _wordController = new TextEditingController();
@override
void initState() {
super.initState();
......@@ -31,8 +26,6 @@ class UserState extends State<QuestionWidget> {
void dispose() {
super.dispose();
_model.dispose();
_wordController.dispose();
_nameController.dispose();
}
@override
......@@ -47,25 +40,11 @@ class UserState extends State<QuestionWidget> {
),
body: Column(
children: <Widget>[
Expanded(
child: StreamBuilder<SimpleResponce>(
stream: _model.logoutLive.stream,
initialData: _model.logoutLive.data,
builder: (BuildContext context,
AsyncSnapshot<SimpleResponce> snapshot) {
if (snapshot.data == null) {
return Center(child: Text("没有退出"));
} else {
return Center(child: Text("退出接口回掉成功!!"));
}
},
),
),
Container(
margin: EdgeInsets.fromLTRB(16, 10, 16, 20),
child: TextField(
cursorColor: Colors.black,
controller: _nameController,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(10.0),
icon: Icon(Icons.text_fields, color: Colors.black),
......@@ -78,7 +57,6 @@ class UserState extends State<QuestionWidget> {
margin: EdgeInsets.fromLTRB(16, 0, 16, 20),
child: TextField(
cursorColor: Colors.black,
controller: _wordController,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(10.0),
icon: Icon(
......@@ -90,17 +68,7 @@ class UserState extends State<QuestionWidget> {
autofocus: false,
),
),
Container(
width: double.maxFinite,
margin: EdgeInsets.fromLTRB(16, 0, 16, 0),
child: OutlineButton(
onPressed: () => _model.resignUser(
context, _nameController.text, _wordController.text),
child: Text("注册"),
shape: BeveledRectangleBorder(
borderRadius: BorderRadius.circular(3),
),
)),
Container(
width: double.maxFinite,
margin: EdgeInsets.fromLTRB(16, 0, 16, 0),
......@@ -111,26 +79,7 @@ class UserState extends State<QuestionWidget> {
borderRadius: BorderRadius.circular(3),
),
)),
Expanded(
child: StreamBuilder<TestQuestionEntity>(
stream: _model.resignLive.stream,
initialData: _model.resignLive.data,
builder: (BuildContext context,
AsyncSnapshot<TestQuestionEntity> snapshot) {
if (snapshot.data != null) {
return Center(
child: snapshot.data.data == null
? Text("错误 ${snapshot.data.errorMsg}")
: Text("登入回掉 用户id: ${snapshot.data.data.id}"),
);
} else {
return Center(
child: Text("初始化~"),
);
}
},
),
)
],
),
);
......
......@@ -3,19 +3,17 @@
* @date 2019-09-04
**/
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/commonModel/live/BaseModel.dart';
import 'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart';
import 'package:gmalpha_flutter/commonModel/live/LiveData.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
import 'package:gmalpha_flutter/questionModel/service/QuestionRepository.dart';
import 'package:gmalpha_flutter/QuestionModel/service/remote/entity/TestQuestionEntity.dart';
import 'package:gmalpha_flutter/questionModel/service/remote/entity/QuestionEntity.dart';
import 'package:gmalpha_flutter/QuestionModel/service/remote/entity/QuestionEntity.dart';
import '../../../commonModel/live/LiveData.dart';
class QuestionPageModel extends BaseModel {
LiveData<SimpleResponce> logoutLive = new LiveData();
LiveData<TestQuestionEntity> resignLive = new LiveData();
LiveData<QuestionEntity> resignLive = new LiveData();
// LiveData<String> userTokenLive = new LiveData();
......
......@@ -3,22 +3,14 @@
* @date 2019-09-04
**/
import 'package:gmalpha_flutter/Annotations/anno/Get.dart';
import 'package:gmalpha_flutter/Annotations/anno/Post.dart';
import 'package:gmalpha_flutter/Annotations/anno/Query.dart';
import 'package:gmalpha_flutter/Annotations/anno/ServiceCenter.dart';
import 'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart';
import 'package:gmalpha_flutter/questionModel/service/remote/entity/TestQuestionEntity.dart';
import 'package:gmalpha_flutter/questionModel/service/remote/entity/QuestionEntity.dart';
@ServiceCenter()
abstract class UserLoginApi {
@Post("user/register")
TestQuestionEntity resign(@Query("username") String name,
@Query("password") String word, @Query("repassword") String repassword);
abstract class QuestionApi {
@Get("user/info")
QuestionEntity getUserInfo(@Query("token") String token);
@Get("api/v1/survey_question/get")
QuestionEntity getUserInfo(@Query("templateId") String templateId);
@Get("user/logout/json")
SimpleResponce logout();
}
......@@ -10,45 +10,27 @@ import 'dart:io';
import 'package:rxdart/rxdart.dart';
import 'package:gmalpha_flutter/questionModel/service/remote/entity/TestQuestionEntity.dart';
import 'package:gmalpha_flutter/questionModel/service/remote/entity/QuestionEntity.dart';
import 'package:gmalpha_flutter/commonModel/net/Responce/SimpleResponce.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
class UserLoginApiImpl {
factory UserLoginApiImpl() => _sharedInstance();
class QuestionApiImpl {
factory QuestionApiImpl() => _sharedInstance();
static UserLoginApiImpl _instance;
static QuestionApiImpl _instance;
UserLoginApiImpl._() {}
QuestionApiImpl._() {}
static UserLoginApiImpl _sharedInstance() {
static QuestionApiImpl _sharedInstance() {
if (_instance == null) {
_instance = UserLoginApiImpl._();
_instance = QuestionApiImpl._();
}
return _instance;
}
Observable<TestQuestionEntity> resign(
String name, String word, String repassword) {
return Observable.fromFuture(DioUtil().post('user/register', data: {
'username': name,
'password': word,
'repassword': repassword
})).map((value) {
if (value.statusCode == 200) {
Map map = json.decode(value.toString());
return TestQuestionEntity.fromJson(map);
} else {
throw HttpException("statusCode error :${value.statusCode}");
}
});
}
Observable<QuestionEntity> getUserInfo(String token) {
return Observable.fromFuture(
DioUtil().get('user/info', data: {'token': token})).map((value) {
Observable<QuestionEntity> getUserInfo(String templateId) {
return Observable.fromFuture(DioUtil().get('api/v1/survey_question/get',
data: {'templateId': templateId})).map((value) {
if (value.statusCode == 200) {
Map map = json.decode(value.toString());
return QuestionEntity.fromJson(map);
......@@ -57,16 +39,4 @@ class UserLoginApiImpl {
}
});
}
Observable<SimpleResponce> logout() {
return Observable.fromFuture(DioUtil().get('user/logout/json'))
.map((value) {
if (value.statusCode == 200) {
Map map = json.decode(value.toString());
return SimpleResponce.fromJson(map);
} else {
throw HttpException("statusCode error :${value.statusCode}");
}
});
}
}
// GENERATED CODE - DO NOT MODIFY BY HAND
// **************************************************************************
// UserGenerator
// **************************************************************************
import 'package:rxdart/rxdart.dart';
import 'package:gmalpha_flutter/commonModel/app_module.dart';
class QuestionEntityImpl {
factory QuestionEntityImpl() => _sharedInstance();
static QuestionEntityImpl _instance;
QuestionEntityImpl._() {}
static QuestionEntityImpl _sharedInstance() {
if (_instance == null) {
_instance = QuestionEntityImpl._();
}
return _instance;
}
String _userId;
Observable<bool> saveuserId(String userId) {
return Observable.fromFuture(mmKvUtil.saveStringKv("user_uid", userId))
.map((value) {
if (value) {
this._userId = userId;
}
return value;
});
}
Observable<String> getuserId() {
if (_userId != null) {
return Observable.fromFuture(Future.value(_userId));
}
return Observable.fromFuture(mmKvUtil.getStringKv("user_uid"));
}
String _nickName;
Observable<bool> savenickName(String nickName) {
return Observable.fromFuture(mmKvUtil.saveStringKv("username", nickName))
.map((value) {
if (value) {
this._nickName = nickName;
}
return value;
});
}
Observable<String> getnickName() {
if (_nickName != null) {
return Observable.fromFuture(Future.value(_nickName));
}
return Observable.fromFuture(mmKvUtil.getStringKv("username"));
}
String _profilePic;
Observable<bool> saveprofilePic(String profilePic) {
return Observable.fromFuture(mmKvUtil.saveStringKv("potrait", profilePic))
.map((value) {
if (value) {
this._profilePic = profilePic;
}
return value;
});
}
Observable<String> getprofilePic() {
if (_profilePic != null) {
return Observable.fromFuture(Future.value(_profilePic));
}
return Observable.fromFuture(mmKvUtil.getStringKv("potrait"));
}
bool _hasAnswered;
Observable<bool> savehasAnswered(bool hasAnswered) {
return Observable.fromFuture(
mmKvUtil.saveBoolKv("personal_qa", hasAnswered))
.map((value) {
if (value) {
this._hasAnswered = hasAnswered;
}
return value;
});
}
Observable<bool> gethasAnswered() {
if (_hasAnswered != null) {
return Observable.fromFuture(Future.value(_hasAnswered));
}
return Observable.fromFuture(mmKvUtil.getBoolKv("personal_qa"));
}
bool _hasScanFace;
Observable<bool> savehasScanFace(bool hasScanFace) {
return Observable.fromFuture(
mmKvUtil.saveBoolKv("has_scan_face", hasScanFace))
.map((value) {
if (value) {
this._hasScanFace = hasScanFace;
}
return value;
});
}
Observable<bool> gethasScanFace() {
if (_hasScanFace != null) {
return Observable.fromFuture(Future.value(_hasScanFace));
}
return Observable.fromFuture(mmKvUtil.getBoolKv("has_scan_face"));
}
String _gender;
Observable<bool> savegender(String gender) {
return Observable.fromFuture(mmKvUtil.saveStringKv("gender", gender))
.map((value) {
if (value) {
this._gender = gender;
}
return value;
});
}
Observable<String> getgender() {
if (_gender != null) {
return Observable.fromFuture(Future.value(_gender));
}
return Observable.fromFuture(mmKvUtil.getStringKv("gender"));
}
String _cityId;
Observable<bool> savecityId(String cityId) {
return Observable.fromFuture(
mmKvUtil.saveStringKv("current_city_id", cityId))
.map((value) {
if (value) {
this._cityId = cityId;
}
return value;
});
}
Observable<String> getcityId() {
if (_cityId != null) {
return Observable.fromFuture(Future.value(_cityId));
}
return Observable.fromFuture(mmKvUtil.getStringKv("current_city_id"));
}
int _birth;
Observable<bool> savebirth(int birth) {
return Observable.fromFuture(mmKvUtil.saveIntKv("birthday", birth))
.map((value) {
if (value) {
this._birth = birth;
}
return value;
});
}
Observable<int> getbirth() {
if (_birth != null) {
return Observable.fromFuture(Future.value(_birth));
}
return Observable.fromFuture(mmKvUtil.getIntKv("birthday"));
}
String _countryId;
Observable<bool> savecountryId(String countryId) {
return Observable.fromFuture(mmKvUtil.saveStringKv("country_id", countryId))
.map((value) {
if (value) {
this._countryId = countryId;
}
return value;
});
}
Observable<String> getcountryId() {
if (_countryId != null) {
return Observable.fromFuture(Future.value(_countryId));
}
return Observable.fromFuture(mmKvUtil.getStringKv("country_id"));
}
bool _detailSetted;
Observable<bool> savedetailSetted(bool detailSetted) {
return Observable.fromFuture(
mmKvUtil.saveBoolKv("detail_setted", detailSetted))
.map((value) {
if (value) {
this._detailSetted = detailSetted;
}
return value;
});
}
Observable<bool> getdetailSetted() {
if (_detailSetted != null) {
return Observable.fromFuture(Future.value(_detailSetted));
}
return Observable.fromFuture(mmKvUtil.getBoolKv("detail_setted"));
}
String _questionUrl;
Observable<bool> savequestionUrl(String questionUrl) {
return Observable.fromFuture(
mmKvUtil.saveStringKv("question_url", questionUrl))
.map((value) {
if (value) {
this._questionUrl = questionUrl;
}
return value;
});
}
Observable<String> getquestionUrl() {
if (_questionUrl != null) {
return Observable.fromFuture(Future.value(_questionUrl));
}
return Observable.fromFuture(mmKvUtil.getStringKv("question_url"));
}
bool _isBind;
Observable<bool> saveisBind(bool isBind) {
return Observable.fromFuture(
mmKvUtil.saveBoolKv("user_bind_mobile", isBind))
.map((value) {
if (value) {
this._isBind = isBind;
}
return value;
});
}
Observable<bool> getisBind() {
if (_isBind != null) {
return Observable.fromFuture(Future.value(_isBind));
}
return Observable.fromFuture(mmKvUtil.getBoolKv("user_bind_mobile"));
}
String _countryInfoName;
Observable<bool> savecountryInfoName(String countryInfoName) {
return Observable.fromFuture(
mmKvUtil.saveStringKv("country_name", countryInfoName))
.map((value) {
if (value) {
this._countryInfoName = countryInfoName;
}
return value;
});
}
Observable<String> getcountryInfoName() {
if (_countryInfoName != null) {
return Observable.fromFuture(Future.value(_countryInfoName));
}
return Observable.fromFuture(mmKvUtil.getStringKv("country_name"));
}
String _countryInfoId;
Observable<bool> savecountryInfoId(String countryInfoId) {
return Observable.fromFuture(
mmKvUtil.saveStringKv("country_id", countryInfoId))
.map((value) {
if (value) {
this._countryInfoId = countryInfoId;
}
return value;
});
}
Observable<String> getcountryInfoId() {
if (_countryInfoId != null) {
return Observable.fromFuture(Future.value(_countryInfoId));
}
return Observable.fromFuture(mmKvUtil.getStringKv("country_id"));
}
String _countryInfoLanguage;
Observable<bool> savecountryInfoLanguage(String countryInfoLanguage) {
return Observable.fromFuture(
mmKvUtil.saveStringKv("country_language", countryInfoLanguage))
.map((value) {
if (value) {
this._countryInfoLanguage = countryInfoLanguage;
}
return value;
});
}
Observable<String> getcountryInfoLanguage() {
if (_countryInfoLanguage != null) {
return Observable.fromFuture(Future.value(_countryInfoLanguage));
}
return Observable.fromFuture(mmKvUtil.getStringKv("country_language"));
}
}
/*
* @author lsy
* @date 2019-09-05
**/
class TestQuestionEntity {
Data data;
int errorCode;
String errorMsg;
TestQuestionEntity({this.data, this.errorCode, this.errorMsg});
TestQuestionEntity.fromJson(Map<String, dynamic> json) {
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
errorCode = json['errorCode'];
errorMsg = json['errorMsg'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.data != null) {
data['data'] = this.data.toJson();
}
data['errorCode'] = this.errorCode;
data['errorMsg'] = this.errorMsg;
return data;
}
}
class Data {
bool admin;
List<String> chapterTops;
List<String> collectIds;
String email;
String icon;
int id;
String nickname;
String password;
String token;
int type;
String username;
Data(
{this.admin,
this.chapterTops,
this.collectIds,
this.email,
this.icon,
this.id,
this.nickname,
this.password,
this.token,
this.type,
this.username});
Data.fromJson(Map<String, dynamic> json) {
admin = json['admin'];
chapterTops = json['chapterTops'].cast<String>();
collectIds = json['collectIds'].cast<String>();
email = json['email'];
icon = json['icon'];
id = json['id'];
nickname = json['nickname'];
password = json['password'];
token = json['token'];
type = json['type'];
username = json['username'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['admin'] = this.admin;
data['chapterTops'] = this.chapterTops;
data['collectIds'] = this.collectIds;
data['email'] = this.email;
data['icon'] = this.icon;
data['id'] = this.id;
data['nickname'] = this.nickname;
data['password'] = this.password;
data['token'] = this.token;
data['type'] = this.type;
data['username'] = this.username;
return data;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment