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

commit

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