Commit d455e16f authored by 林生雨's avatar 林生雨

commit

parent f64b7c33
This diff is collapsed.
......@@ -26,8 +26,8 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def isLib = false
//def isLib = true
//def isLib = false
def isLib = true
if (isLib) {
apply plugin: 'com.android.library'
......@@ -84,6 +84,7 @@ flutter {
source '../..'
}
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gmalpha_flutter">
<application
android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher"
android:label="gmalpha_flutter"
android:theme="@style/LaunchTheme">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
</activity>
</application>
<!-- <application-->
<!-- android:name="io.flutter.app.FlutterApplication"-->
<!-- android:icon="@mipmap/ic_launcher"-->
<!-- android:label="gmalpha_flutter"-->
<!-- android:theme="@style/AppTheme"-->
<!-- >-->
<!-- <activity-->
<!-- android:name=".MainActivity"-->
<!-- android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"-->
<!-- android:hardwareAccelerated="true"-->
<!-- android:launchMode="singleTop"-->
<!-- android:windowSoftInputMode="adjustResize">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- <meta-data-->
<!-- android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"-->
<!-- android:value="true" />-->
<!-- </activity>-->
<!-- </application>-->
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
sdk.dir=/Users/gengmei/Library/Android/sdk
flutter.sdk=/Users/gengmei/flutter
sdk.dir=/Users/apple/Library/Android/sdk
flutter.sdk=/Users/apple/Downloads/flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
\ No newline at end of file
{"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"images/arrow_right.png":["images/arrow_right.png"],"images/message_att.png":["images/message_att.png"],"images/message_like.png":["images/message_like.png"],"images/message_noti.png":["images/message_noti.png"],"images/nav_back.png":["images/nav_back.png"]}
\ No newline at end of file
{"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"images/arrow_right.png":["images/arrow_right.png"],"images/black_person.png":["images/black_person.png"],"images/dark_grey_person.png":["images/dark_grey_person.png"],"images/golden_person.png":["images/golden_person.png"],"images/light_grey_person.png":["images/light_grey_person.png"],"images/message_att.png":["images/message_att.png"],"images/message_like.png":["images/message_like.png"],"images/message_noti.png":["images/message_noti.png"],"images/nav_back.png":["images/nav_back.png"],"images/right_icon.png":["images/right_icon.png"],"images/you_icon.png":["images/you_icon.png"]}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"version":"20e59316b8b8474554b38493b8ca888794b0234a","properties":{"buildMode":"BuildMode.release","targetPlatform":"TargetPlatform.android_arm","entryPoint":"build/flutteroutput/aot/app.dill","sharedLib":"false","extraGenSnapshotOptions":"","engineHash":"fee001c93f25a1e7258e762781a7361f122d29f5","buildersUsed":"false"},"files":{"/Users/apple/Downloads/flutter/bin/cache/pkg/sky_engine/lib/ui/ui.dart":"eb7755654f7eeb3b79fe0e7292ba8b7b","/Users/apple/Downloads/flutter/bin/cache/pkg/sky_engine/sdk_ext/vmservice_io.dart":"6137595b8118b04910c4f137a94bad5f","build/flutteroutput/aot/app.dill":"140fecba370687cf7dbd0b92dec54481","build/flutteroutput/aot/isolate_snapshot_data":"3999d48fcd0fd4ac7dd19af1cb64581d","build/flutteroutput/aot/isolate_snapshot_instr":"c81cc1018d6eafd496746d90b19f9feb","build/flutteroutput/aot/vm_snapshot_data":"9df51beb7ff50608e0e854f7232fd2f4","build/flutteroutput/aot/vm_snapshot_instr":"4f207dc4df14e95febb3bb4e4c611765"}}
\ No newline at end of file
{"version":"20e59316b8b8474554b38493b8ca888794b0234a","properties":{"buildMode":"BuildMode.release","targetPlatform":"TargetPlatform.android_arm","entryPoint":"build/flutteroutput/aot/app.dill","sharedLib":"false","extraGenSnapshotOptions":"","engineHash":"fee001c93f25a1e7258e762781a7361f122d29f5","buildersUsed":"false"},"files":{"/Users/apple/Downloads/flutter/bin/cache/pkg/sky_engine/lib/ui/ui.dart":"eb7755654f7eeb3b79fe0e7292ba8b7b","/Users/apple/Downloads/flutter/bin/cache/pkg/sky_engine/sdk_ext/vmservice_io.dart":"6137595b8118b04910c4f137a94bad5f","build/flutteroutput/aot/app.dill":"4d882d47f90757937fa96c19d33f76a6","build/flutteroutput/aot/isolate_snapshot_data":"2a1abe745ecf854ea9ee88e36ceb42fa","build/flutteroutput/aot/isolate_snapshot_instr":"6557f2af55e619a64fc9ef0d81b469d7","build/flutteroutput/aot/vm_snapshot_data":"9df51beb7ff50608e0e854f7232fd2f4","build/flutteroutput/aot/vm_snapshot_instr":"4f207dc4df14e95febb3bb4e4c611765"}}
\ No newline at end of file
......@@ -8,6 +8,12 @@ rootDir=${rootFlutter%/*}
buildDebug=1
upload=0
suff=debug
dif=debug
#dif=release
message=增加他人的专家页面
if [ $buildDebug -eq 0 ]; then
suff=debug
else
......@@ -84,6 +90,10 @@ cd ..
rm -rf /Users/apple/lsy/aar/
mkdir /Users/apple/lsy/aar/
rm -rf /Users/apple/lsy/aar_update/
mkdir /Users/apple/lsy/aar_update/
mkdir /Users/apple/lsy/aar_update/androd${message}/
mkdir /Users/apple/lsy/aar_update/ios${message}/
cp -r /Users/apple/lsy/gmalpha_flutter/build/app/outputs/aar/app-${suff}.aar /Users/apple/lsy/MergeTest/app/libs/app.aar
cp -r /Users/apple/lsy/gmalpha_flutter/build/flutter_boost/outputs/aar/flutter_boost-${suff}.aar /Users/apple/lsy/MergeTest/app/libs/flutter_boost.aar
cp -r /Users/apple/lsy/gmalpha_flutter/build/gengmei_flutter_plugin/outputs/aar/gengmei_flutter_plugin-${suff}.aar /Users/apple/lsy/MergeTest/app/libs/gengmei_flutter_plugin.aar
......@@ -98,6 +108,7 @@ unzip /Users/apple/lsy/aar/app-${suff}.zip
cp -r /Users/apple/lsy/aar/jni/armeabi-v7a/* /Users/apple/lsy/MergeTest/app/libs/jniLibs/armeabi-v7a/
cp -r /Users/apple/lsy/aar/jni/armeabi-v7a/* /Users/apple/lsy/Test/app/libs/armeabi-v7a/
cp -r /Users/apple/lsy/aar/jni/armeabi-v7a/* /Users/apple/lsy/gmalpha_flutter/build/
cp -r /Users/apple/lsy/aar/jni/armeabi-v7a/* /Users/apple/lsy/aar_update/androd${message}/
#====upload
cd /Users/apple/lsy/MergeTest
......@@ -115,6 +126,14 @@ git push
# ios!!!
#cd ${projectDir}
#flutter build ios --release --no-codesign
#cp -r /Users/apple/lsy/gmalpha_flutter/ios/Flutter/App.framework /Users/apple/lsy/aar_update/ios${message}/
#cp -r /Users/apple/lsy/gmalpha_flutter/ios/Flutter/Flutter.framework /Users/apple/lsy/aar_update/ios${message}/
#cd /Users/apple/lsy/aar_update/
#open .
#cd ios/Pods
#/usr/bin/env xcrun xcodebuild build -configuration Release ARCHS='arm64 armv7' -target flutter_boost BUILD_DIR=../../build/ios -sdk iphoneos -quiet
#/usr/bin/env xcrun xcodebuild build -configuration Release ARCHS='arm64 armv7' -target FMDB BUILD_DIR=../../build/ios -sdk iphoneos -quiet
......
/Users/apple/Downloads/flutter/.pub-cache/hosted/pub.flutter-io.cn/gengmei_flutter_plugin-0.0.730
\ No newline at end of file
/Users/apple/Downloads/flutter/.pub-cache/hosted/pub.flutter-io.cn/gengmei_flutter_plugin-0.0.731
\ No newline at end of file
File mode changed from 100755 to 100644
{"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"images/arrow_right.png":["images/arrow_right.png"],"images/message_att.png":["images/message_att.png"],"images/message_like.png":["images/message_like.png"],"images/message_noti.png":["images/message_noti.png"],"images/nav_back.png":["images/nav_back.png"]}
\ No newline at end of file
{"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"images/arrow_right.png":["images/arrow_right.png"],"images/black_person.png":["images/black_person.png"],"images/dark_grey_person.png":["images/dark_grey_person.png"],"images/golden_person.png":["images/golden_person.png"],"images/light_grey_person.png":["images/light_grey_person.png"],"images/message_att.png":["images/message_att.png"],"images/message_like.png":["images/message_like.png"],"images/message_noti.png":["images/message_noti.png"],"images/nav_back.png":["images/nav_back.png"],"images/right_icon.png":["images/right_icon.png"],"images/you_icon.png":["images/you_icon.png"]}
\ No newline at end of file
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/gengmei/flutter
FLUTTER_APPLICATION_PATH=/Users/gengmei/Documents/workspace/gmalpha_flutter
FLUTTER_ROOT=/Users/apple/Downloads/flutter
FLUTTER_APPLICATION_PATH=/Users/apple/lsy/gmalpha_flutter
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios
......
PODS:
- Flutter (1.0.0)
- flutter_boost (0.0.1):
- Flutter
- xservice_kit
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- gengmei_flutter_plugin (0.0.1):
- Flutter
- path_provider (0.0.1):
- Flutter
- sqflite (0.0.1):
- Flutter
- FMDB (~> 2.7.2)
- xservice_kit (0.0.1):
- Flutter
DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios-release`)
- flutter_boost (from `.symlinks/plugins/flutter_boost/ios`)
- gengmei_flutter_plugin (from `.symlinks/plugins/gengmei_flutter_plugin/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- xservice_kit (from `.symlinks/plugins/xservice_kit/ios`)
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- FMDB
EXTERNAL SOURCES:
Flutter:
:path: ".symlinks/flutter/ios-release"
flutter_boost:
:path: ".symlinks/plugins/flutter_boost/ios"
gengmei_flutter_plugin:
:path: ".symlinks/plugins/gengmei_flutter_plugin/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
xservice_kit:
:path: ".symlinks/plugins/xservice_kit/ios"
SPEC CHECKSUMS:
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
flutter_boost: 0e85ea37c74ed39ee7b91a35612afa1605557484
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
gengmei_flutter_plugin: 9461e8644c06c4a0e38292ddcca1cc55e6ac6156
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a
xservice_kit: a2f1b35addc126fce8687aeb183ab0c1ada5b7f3
PODFILE CHECKSUM: 7f6a4806cddf47207b1cc19727536fd9f167aaa3
COCOAPODS: 1.7.4
This diff is collapsed.
......@@ -9,7 +9,6 @@ import 'package:gmalpha_flutter/Annotations/anno/Router.dart';
import 'package:gmalpha_flutter/ActivityReportModel/ActivityReportRouterImpl.dart';
@Router("ActivityReportModel", ActivityReportRouterImpl)
abstract class ActivityReportRouter implements RouterBaser{
Widget getActivityReportPage(String cookie, int id, int type);
abstract class ActivityReportRouter implements RouterBaser {
Widget getActivityReportPage(int id, int type, String fromPage);
}
......@@ -8,7 +8,7 @@ import 'package:gmalpha_flutter/ActivityReportModel/page/ActivityReportPage.dart
class ActivityReportRouterImpl implements ActivityReportRouter {
@override
Widget getActivityReportPage(String cookie, int id, int type) {
return ActivityReportPage(cookie, id, type);
Widget getActivityReportPage(int id, int type,String fromPage) {
return ActivityReportPage(id, type,fromPage);
}
}
......@@ -5,27 +5,25 @@
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/ActivityReportModel/service/ActivityReportRepository.dart';
import 'package:gmalpha_flutter/ActivityReportModel/service/remote/entity/ActivityReportEntity.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/live/BaseModel.dart';
import 'package:gmalpha_flutter/commonModel/live/LiveData.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
class ActivityReportModel extends BaseModel {
LiveData<ActivityReportEntity> activityReportLive = new LiveData();
final String cookie;
final int id;
final int type;
final String fromPage;
ActivityReportModel(this.cookie, this.id, this.type);
ActivityReportModel(this.id, this.type, this.fromPage);
init(BuildContext context) {
Map<String, dynamic> headMap = new Map();
headMap.putIfAbsent("Cookie", () => cookie);
DioUtil().addHead = headMap;
ActivityReportRepository.getInstance().getActivityReport(id, type).listen((value) {
ActivityReportRepository.getInstance()
.getActivityReport(id, type)
.listen((value) {
if (value != null) {
activityReportLive.notifyView(value);
}
......@@ -35,9 +33,25 @@ class ActivityReportModel extends BaseModel {
});
}
start() {
pageStart(fromPage, "activity_report", DateTime.now().second)
.listen((value) {
print("埋点 pageStart 成功?:$value");
}).onError((error) {
print(error);
});
}
end() {
pageEnd(fromPage, "activity_report", DateTime.now().second).listen((value) {
print("埋点 pageEnd 成功?:$value");
}).onError((error) {
print(error);
});
}
@override
void dispose() {
activityReportLive.dispost();
}
}
......@@ -39,10 +39,10 @@ class AlbumRepository {
}
Observable<String> nativeCamera() {
return Observable.fromFuture(GengmeiFlutterPlugin.nativeCamera());
// return Observable.fromFuture(GengmeiFlutterPlugin.nativeCamera());
}
Observable<String> aiCamera() {
return Observable.fromFuture(GengmeiFlutterPlugin.aiCamera());
// return Observable.fromFuture(GengmeiFlutterPlugin.aiCamera());
}
}
......@@ -8,7 +8,7 @@ import 'package:gmalpha_flutter/PrestigeModel/page/reputation/ReputationsPage.da
class PrestigeImpl implements PrestigeRouter {
@override
Widget getReputationsPage(String cookie, int userId) {
return ReputationsPage(cookie, userId);
Widget getReputationsPage(int userId,String userName,String fromPage) {
return ReputationsPage(userId,userName,fromPage);
}
}
......@@ -9,5 +9,5 @@ import 'package:gmalpha_flutter/PrestigeModel/PrestigeImpl.dart';
@Router("prestigeModel", PrestigeImpl)
abstract class PrestigeRouter implements RouterBaser {
Widget getReputationsPage(String cookie,int userId);
Widget getReputationsPage(int userId,String userName,String fromPage);
}
......@@ -5,6 +5,7 @@
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/PrestigeModel/service/PrestigeRepository.dart';
import 'package:gmalpha_flutter/PrestigeModel/service/remote/entity/PrestigeEntity.dart';
import 'package:gmalpha_flutter/commonModel/base/Temp.dart';
import 'package:gmalpha_flutter/commonModel/live/BaseModel.dart';
import 'package:gmalpha_flutter/commonModel/live/LiveData.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
......@@ -12,21 +13,32 @@ import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
class ReputationsModel extends BaseModel {
LiveData<PrestigeEntity> prestigeLive = new LiveData();
LiveData<String> titleLive = new LiveData();
final String cookie;
final int userId;
final String userName;
final String fromPage;
ReputationsModel(this.cookie, this.userId);
ReputationsModel(this.userId, this.userName, this.fromPage);
init(BuildContext context) {
if (cookie == null || userId == null) {
Toast.show(
context, "传递给flutter参数错误!! \ncookie:${cookie} \nuserId:${userId}");
return;
start() {
pageStart(fromPage, "prestige", DateTime.now().second).listen((value) {
print("埋点 pageStart 成功?:$value");
}).onError((error) {
print(error);
});
}
Map<String, dynamic> headMap = new Map();
headMap.putIfAbsent("Cookie", () => cookie);
DioUtil.addHeadMap = headMap;
end() {
pageEnd(fromPage, "prestige", DateTime.now().second).listen((value) {
print("埋点 pageEnd 成功?:$value");
}).onError((error) {
print(error);
});
}
init(BuildContext context) {
titleLive.notifyView(userName);
PrestigeRepository.getInstance().getReputations(userId).listen((value) {
if (value != null) {
prestigeLive.notifyView(value);
......@@ -40,5 +52,6 @@ class ReputationsModel extends BaseModel {
@override
void dispose() {
prestigeLive.dispost();
titleLive.dispost();
}
}
......@@ -12,8 +12,8 @@ import 'package:cached_network_image/cached_network_image.dart';
class ReputationsPage extends StatefulWidget {
ReputationsModel _model;
ReputationsPage(String cookie, int userId) {
_model = new ReputationsModel(cookie, userId);
ReputationsPage(int userId, String userName, String fromPage) {
_model = new ReputationsModel(userId, userName, fromPage);
}
@override
......@@ -29,15 +29,30 @@ class ReputationsState extends State<ReputationsPage> {
@override
void initState() {
super.initState();
_model.start();
_model.init(context);
}
@override
Widget build(BuildContext context) {
FlutterBoost.singleton.openPage("UUUURRRLLL", {"aa": "aa"});
screenWidth = MediaQuery.of(context).size.width;
return Scaffold(
appBar: AppBar(
title: MyText(16, '我的专家声望', 0xff323232),
title: StreamBuilder<String>(
stream: _model.titleLive.stream,
initialData: _model.titleLive.data,
builder: (context, data) {
if (data.data == null) {
return MyText(16, '我的专家声望', 0xff323232);
}
String titleWord = '${data.data}的专家声望';
if (titleWord.length > 10) {
titleWord = titleWord.substring(0, 10) + "...";
}
return MyText(16, titleWord, 0xff323232);
},
),
centerTitle: true,
leading: IconButton(
onPressed: () =>
......@@ -212,6 +227,7 @@ class ReputationsState extends State<ReputationsPage> {
@override
void dispose() {
super.dispose();
_model.end();
_model.dispose();
}
}
/*
* @author lsy
* @date 2019-09-24
**/
import 'package:flutter/material.dart';
abstract class BaseState<T extends StatefulWidget> extends State<T>{
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
}
\ No newline at end of file
/*
* @author lsy
* @date 2019-09-24
**/
import 'package:flutter/services.dart';
import 'package:rxdart/rxdart.dart';
const platform = const MethodChannel('flutter_bury_channel');
Observable<bool> pageStart(String nowPage, String beforPage, int time) {
return Observable.fromFuture(platform.invokeMethod(
"PAGE_START", {"page_name": nowPage, "referrer": beforPage, "in": time}));
}
Observable<bool> pageEnd(String nowPage, String beforPage, int time) {
return Observable.fromFuture(platform.invokeMethod(
"PAGE_END", {"page_name": nowPage, "referrer": beforPage, "out": time}));
}
Observable<bool> click(String page_name, String button_name) {
return Observable.fromFuture(platform.invokeMethod(
"CLICK_EVENT", {"page_name": page_name, "button_name": button_name}));
}
Observable<bool> jumpToH5() {
return Observable.fromFuture(platform.invokeMethod("FLUTTER_TO_H5"));
}
Observable<bool> jumpToPictorial(String url) {
return Observable.fromFuture(
platform.invokeMethod("FLUTTER_TO_PICTORIAL", {"url": url}));
}
Observable<bool> jumpToSearch() {
return Observable.fromFuture(platform.invokeMethod("FLUTTER_TO_SEARCH"));
}
......@@ -3,6 +3,11 @@
* @date 2019-09-16
**/
import 'dart:math';
import 'package:dio/dio.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
/**
* 生产环境
*/
......@@ -16,6 +21,42 @@ const String APP_HOST_DEBUG = "http://earth.gmapp.env";
* 开发环境
*/
const String APP_HOST_DEV = "http://earth.alpha.newdev";
class Api{
class Api {
static Api intance = new Api._();
Api._();
static Api getInstance() {
return intance;
}
bool initBuildConfig(Map params) {
print("PARAMS!! ${params}");
String baseUrl = getBaseUrl(params["buildConfig"]) + "/";
if (baseUrl == null) {
return false;
}
var cookie = params["cookie"] == null ? params["Cookie"] : params["cookie"];
Map cookieMap = {};
cookieMap.putIfAbsent("Cookie", () => cookie);
DioUtil().setConfig(HttpConfig(
options: BaseOptions(
baseUrl: baseUrl,
),
nativeCookie: cookieMap));
return true;
}
String getBaseUrl(String string) {
if (string == "debug") {
return APP_HOST_DEBUG;
} else if (string == "dev") {
return APP_HOST_DEV;
} else if (string == "release") {
return APP_HOST_RELEASE;
} else {
return null;
}
}
}
......@@ -172,6 +172,7 @@ class DioUtil {
var headers = opt.headers;
if (addHeadMap != null) {
print("请求之前");
print("BASEURL!! ${opt.baseUrl}");
addHeadMap.forEach((k, v) {
headers.putIfAbsent(k, () => v);
print("HEADDD ${k} ${v}");
......@@ -205,7 +206,7 @@ class DioUtil {
_pem = config.pem ?? _pem;
if (_dio != null) {
// _dio.options = _options;
_dio.options = _options;
// (_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate = (client) {
// client.findProxy = (url) {
// return _isDebug ? 'PROXY $_proxy' : 'DIRECT';
......@@ -502,7 +503,6 @@ class DioUtil {
// options.baseUrl = 'https://earth.iyanzhi.com/';
// options.baseUrl = 'http://earth.gmapp.env/';
options.baseUrl = getBaseUrl() + "/";
print("BASEURL!! ${getBaseUrl()}");
Map<String, dynamic> headers = Map<String, dynamic>();
headers['Accept'] = 'application/json';
headers['version'] = '1.0.0';
......
......@@ -4,10 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/Error_Page.dart';
import 'package:gmalpha_flutter/commonModel/app_module.dart';
import 'package:gmalpha_flutter/commonModel/ui/ALColors.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
import 'package:dio/dio.dart';
import 'package:gmalpha_flutter/commonModel/net/Api.dart';
import 'package:gmalpha_flutter/messageModel/home/message_home.dart';
import 'comment_suggest.dart';
......@@ -27,7 +24,6 @@ class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
FlutterBoost.singleton.registerPageBuilders({
'comment_suggest': (pageName, params, _) => CommentSuggest(params),
'message_home': (pageName, params, _) => MessageHomePage(params),
......@@ -40,26 +36,29 @@ class _MyAppState extends State<MyApp> {
.getAlbumPage(param, param1, param2);
},
"prestige": (pageName, params, _) {
print("PARAMS!! ${params}");
if (params == null) {
return ErrorPage("出错:传递参数为空");
String fromPage = params["fromPage"];
if (params == null ||
fromPage == null ||
Api.getInstance().initBuildConfig(params) == null) {
return ErrorPage("出错:需要传递的参数为空");
}
var cookie =
params["cookie"] == null ? params["Cookie"] : params["cookie"];
int userId = int.parse(params["userId"]);
return RouterCenterImpl()
.findPrestigeRouter()
?.getReputationsPage(cookie, params["userId"]);
?.getReputationsPage(userId, params["userName"], fromPage);
},
"activity_report": (pageName, params, _) {
print("PARAMS!! ${params}");
if (params == null) {
return ErrorPage("出错:传递参数为空");
String fromPage = params["fromPage"];
if (params == null ||
fromPage == null ||
Api.getInstance().initBuildConfig(params) == null) {
return ErrorPage("出错:需要传递的参数为空");
}
var cookie =
params["cookie"] == null ? params["Cookie"] : params["cookie"];
int survey_record_id = int.parse(params["survey_record_id"]);
int template_id = int.parse(params["template_id"]);
return RouterCenterImpl()
.findActivityReportRouter()
?.getActivityReportPage(cookie, params["survey_record_id"], params["template_id"]);
?.getActivityReportPage(survey_record_id, template_id, fromPage);
}
});
FlutterBoost.handleOnStartPage();
......@@ -72,14 +71,14 @@ class _MyAppState extends State<MyApp> {
debugShowCheckedModeBanner: false,
// initialRoute: '/test',
//// 调试的时候可以打开
routes: {
// '/': (context) => CommentSuggest({"Cookie":" _gm_token=7e48641558699683; sessionid=nb3ze4ur7ucosln8sd8pzwojddenv9ym; _gtid=a1bc0a387e1911e996b9525400fa516d4094"}),
'/': (context) {
// return RouterCenterImpl().findPrestigeRouter()?.getReputationsPage("sessionid=9odo0sov71x66ke9dlphibnq9i9gduxj; _gtid=3fbe9b78d2cb11e98bc1525400e82fab5270; _gm_token=db88861568285036"
// ,241757630);
return RouterCenterImpl().findActivityReportRouter()?.getActivityReportPage("sessionid=i72bq75swus6okvk0k6aihbkb5s7g0hv; _gtid=51efc540de9411e9ac1f525400e82fab3414; _gm_token=1dd15b1569307596", 2, 1);
},
},
// routes: {
// // '/': (context) => CommentSuggest({"Cookie":" _gm_token=7e48641558699683; sessionid=nb3ze4ur7ucosln8sd8pzwojddenv9ym; _gtid=a1bc0a387e1911e996b9525400fa516d4094"}),
// '/': (context) {
// return RouterCenterImpl().findPrestigeRouter()?.getReputationsPage("sessionid=9odo0sov71x66ke9dlphibnq9i9gduxj; _gtid=3fbe9b78d2cb11e98bc1525400e82fab5270; _gm_token=db88861568285036"
// ,241757630);
// },
// },
//调试的时候可以打开
builder: FlutterBoost.init(postPush: _onRoutePushed),
theme: new ThemeData(
......
......@@ -194,7 +194,7 @@ packages:
name: flutter_screenutil
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.0"
version: "0.5.3"
flutter_test:
dependency: "direct dev"
description: flutter
......@@ -213,7 +213,7 @@ packages:
name: gengmei_flutter_plugin
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.730"
version: "0.0.731"
glob:
dependency: transitive
description:
......
......@@ -28,9 +28,9 @@ dependencies:
rxdart: ^0.22.0 #链式编程
pull_to_refresh: ^1.5.0
flutter_boost: ^0.0.420
gengmei_flutter_plugin: ^0.0.730
gengmei_flutter_plugin: ^0.0.731
cached_network_image: ^1.1.1
flutter_screenutil:
flutter_screenutil: ^0.5.3
dev_dependencies:
......
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