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

commit

parent 9fa0ddbd
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="android" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/../build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
......
This diff is collapsed.
......@@ -2,6 +2,8 @@ package com.example.gmalpha_flutter
import android.app.Activity
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
......@@ -16,25 +18,57 @@ import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.GeneratedPluginRegistrant
import java.lang.ref.WeakReference
import java.util.HashMap
class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
// setContentView(R.layout.activity_main)
// findViewById<View>(R.id.hello).setOnClickListener {
// val intent = Intent()
// intent.putExtra("name","prestige")
// PageRouter.openPageByUrl(this, PageRouter.FLUTTER_PAGE_URL, intent)
// startActivity(intent)
//
// }
MethodChannel(flutterView, "flutter_bury_channel").setMethodCallHandler { methodCall, result ->
if (methodCall.method.equals("FLUTTER_TO_H5")) {
Log.e("lsy"," WQEWQEWQEQW")
startActivity(Intent(this, Temp::class.java));
MethodChannel(flutterView, "flutter_bury_channel").setMethodCallHandler { call, result ->
if (call.method == "FLUTTER_TO_H5") {
} else if (call.method == "FLUTTER_TO_NATIVE") {
} else if (call.method == "FLUTTER_BURIED") {
val buriedMap = HashMap<String, Any>()
//APPInfo
buriedMap["app_name"] = "app_name"
buriedMap["app_version_name"] = "app_version_name"
buriedMap["channel"] = "channel"
buriedMap["current_city_id"] = "current_city_id"
buriedMap["user_type"] = "user_type"
//TODO
// buriedMap.put("serial_id", serial_id++);
buriedMap["grey_type"] = "unknown"
//DeviceInfo
buriedMap["device_id"] = "device_id"
buriedMap["manufacturer"] = Build.MANUFACTURER
buriedMap["lat"] = "lat"
buriedMap["lng"] = "lng"
buriedMap["is_WiFi"] = "is_WiFi"
buriedMap["ip"] = "ip"
buriedMap["model"] = Build.MODEL
buriedMap["sys_version"] = Build.VERSION.RELEASE
buriedMap["android_device_id"] = "android_device_id"
buriedMap["user_id"] = "user_id"
buriedMap["app_session_id"] = "app_session_id"
buriedMap["create_at"] = (System.currentTimeMillis() / 1000).toString()
buriedMap["version"] = "version"
result.success(buriedMap)
} else if (call.method == "GET_NET_TYPE") {
result.success("wifi")
} else if (call.method == "INIT_PARAMS") {
val map = HashMap<String, String>()
map.put("buildConfig", "debug")
//HERE
// map.put("proxy", "172.30.9.84:6666");
result.success(map)
} else {
result.notImplemented()
}
}
}
......
sdk.dir=/Users/apple/Library/Android/sdk
flutter.sdk=/Users/apple/Downloads/flutter
flutter.buildMode=release
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
\ No newline at end of file
......@@ -46,9 +46,11 @@ class Api {
if (buildConfig == "debug" || buildConfig == "dev") {
String httpProxy = params["proxy"];
if (httpProxy != null && httpProxy.isNotEmpty) {
print("PROXY --> $httpProxy");
DioUtil().setProxy(httpProxy);
}
}
print("baseUrl --> $baseUrl");
DioUtil().setConfig(HttpConfig(
options: BaseOptions(
baseUrl: baseUrl,
......
......@@ -179,9 +179,9 @@ class DioUtil {
});
}
}, onResponse: (response) {
print("应之前");
print("应之前");
}, onError: (e) {
print("网络错误 $e");
print("网络错误 $e message ${e.message}");
});
DioUtil._init() {
......@@ -264,7 +264,7 @@ class DioUtil {
// response.request; 请求体
// response.statusCode; 状态码
} on DioError catch (e) {
print('get error---------$e');
print('get error---------$e formatError');
formatError(e);
}
return response;
......@@ -280,7 +280,7 @@ class DioUtil {
queryParameters: data, options: options, cancelToken: cancelToken);
print('post success---------${response.statusCode} ${response.data}');
} on DioError catch (e) {
print('post error---------$e');
print('post error---------$e message${e.message}');
formatError(e);
}
return response;
......@@ -299,7 +299,7 @@ class DioUtil {
});
print('downloadFile success---------${response.data}');
} on DioError catch (e) {
print('downloadFile error---------$e');
print('downloadFile error---------$e formatError');
formatError(e);
}
return response.data;
......
......@@ -84,23 +84,21 @@ class _MyAppState extends State<MyApp> {
return MaterialApp(
title: 'Flutter Boost example',
debugShowCheckedModeBanner: false,
// routes: {
// '/': (context) {
// Api.getInstance().initBuildConfig({
// 'Cookie':
// '_gm_token=72ee1c1569466411; _gtid=58d3cc14df8711e99736525400e82fab81; sessionid=vhksn66854pejzjwi8ljhrmcew3domh2',
// "buildConfig": "debug"
// });
routes: {
'/': (context) {
Api.getInstance().setDioCookie({
'Cookie': 'sessionid=iro2ke6i7rc9qselm7yogjf5xvgwzn1p; _gtid=203c91f8ebd811e981aa525400e82fab6765; _gm_token=2927681570850359'
});
return RouterCenterImpl()
.findActivityReportRouter()
?.getActivityReportPage(279, 1, '');
// return RouterCenterImpl().findPrestigeRouter()?.getReputationsPage(1, "ww", "ww");
// return RouterCenterImpl()
// .findActivityReportRouter()
// ?.getActivityReportPage(279, 1, '');
//// return RouterCenterImpl().findPrestigeRouter()?.getReputationsPage(1, "ww", "ww");
//// return RouterCenterImpl()
//// .findAlbumRouter()
//// .getAlbumPage("com.example.gengmei_flutter_plugin_example",true, 2, null);
// },
// },
builder: FlutterBoost.init(postPush: _onRoutePushed),
// .findAlbumRouter()
// .getAlbumPage("com.example.gengmei_flutter_plugin_example",true, 2, null);
},
},
// builder: FlutterBoost.init(postPush: _onRoutePushed),
theme: new ThemeData(
primaryColor: Colors.white,
backgroundColor: Color(0xFFEFEFEF),
......
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