Commit 9c0c815d authored by 朱翠翠's avatar 朱翠翠

Merge branch 'test' of http://git.wanmeizhensuo.com/linshengyu/gm_flutter into zcc/flutter

parents 386c886a d9cb642b
......@@ -173,7 +173,8 @@ class LevelOneItem extends StatelessWidget {
),
),
),
Positioned(
allSize != null && position != null && position < allSize - 1
? Positioned(
left: 0,
bottom: 0,
child: Container(
......@@ -182,6 +183,10 @@ class LevelOneItem extends StatelessWidget {
color: Color(0xffE5E5E5),
),
)
: Container(
width: 0,
height: 0,
)
],
),
),
......@@ -305,7 +310,8 @@ class LevelOneItem extends StatelessWidget {
// top: 47,
// child: FiveStarView(int.parse(cards.hospital.star), 5),
// ),
Positioned(
allSize != null && position != null && position < allSize - 1
? Positioned(
left: 0,
bottom: 0,
child: Container(
......@@ -314,6 +320,10 @@ class LevelOneItem extends StatelessWidget {
color: Color(0xffE5E5E5),
),
)
: Container(
width: 0,
height: 0,
)
],
),
));
......@@ -634,11 +644,15 @@ class LevelOneItem extends StatelessWidget {
],
),
),
Container(
allSize != null && position != null && position < allSize - 1
? Container(
width: double.maxFinite,
height: 0.5,
color: Color(0xffE5E5E5),
)
: Container(
height: 0.5,
)
],
),
).gestureDetector(() {
......
......@@ -134,7 +134,7 @@ class FilterViewState extends State<FilterView> {
),
Expanded(
child: Container(
color: Color(0xff3FB5AF),
color: Color(0xff51CDC7),
alignment: Alignment.center,
child: baseText("确定", 16, Colors.white),
).gestureDetector(() {
......
......@@ -60,10 +60,21 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
PlanBarView planBarView;
double stateBarHeight;
double topHeight;
Function(String str) func;
@override
void initState() {
if (RouterCenterImpl().findMainRouter().isWithNative() &&
CacheManager.getInstance().get(MEMORY_CACHE).get(BASE_URL).empty()) {
func = (str) {
if (str == "init") {
_model.init(needCache: true);
}
};
SimpleEventBus.instance().resignEvent("clueModel|Plan|PlanPage", func);
} else {
_model.init(needCache: true);
}
super.initState();
planBarView =
PlanBarView(_model.managerLive, clickIndex, hideAllMenuListener);
......@@ -71,6 +82,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override
void dispose() {
SimpleEventBus.instance().unResignEvent("clueModel|Plan|PlanPage", func);
hideAllMenuListener.dispose();
projectMenuListener.dispose();
sortMenuListener.dispose();
......@@ -84,24 +96,15 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override
Widget buildItem(BuildContext context) {
stateBarHeight = MediaQueryData
.fromWindow(window)
.padding
.top;
stateBarHeight = MediaQueryData.fromWindow(window).padding.top;
topHeight = stateBarHeight + kToolbarHeight;
return Scaffold(
body: MediaQuery.removePadding(
removeTop: true,
context: context,
child: baseStateView(
MediaQuery
.of(context)
.size
.width,
MediaQuery
.of(context)
.size
.height,
MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height,
_model.stateLive,
newHome(), () {
_model.stateLive.notifyView(LOADING);
......@@ -113,26 +116,14 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
Widget newHome() {
double diff = Platform.isAndroid ? 50.0 : 0.0;
return Container(
width: MediaQuery
.of(context)
.size
.width,
width: MediaQuery.of(context).size.width,
//主页 剪去tabbar高度
height: MediaQuery
.of(context)
.size
.height -diff,
height: MediaQuery.of(context).size.height - diff,
child: Stack(
children: <Widget>[
Container(
width: MediaQuery
.of(context)
.size
.width,
height: MediaQuery
.of(context)
.size
.height - diff,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - diff,
// child: child(),
child: homeWarp(),
),
......@@ -146,14 +137,8 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
child: Visibility(
visible: data.data[2] > 0.1,
child: Container(
width: MediaQuery
.of(context)
.size
.width,
height: MediaQuery
.of(context)
.size
.height,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: Column(
children: <Widget>[
Container(
......@@ -204,10 +189,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return BasePopMenu(
leftPos: data.data[0],
topPos: data.data[1],
width: MediaQuery
.of(context)
.size
.width,
width: MediaQuery.of(context).size.width,
maxHeight: 450,
listener: projectMenuListener,
child:
......@@ -228,10 +210,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return BasePopMenu(
leftPos: data.data[0],
topPos: data.data[1],
width: MediaQuery
.of(context)
.size
.width,
width: MediaQuery.of(context).size.width,
maxHeight: 45 * _model.sortList.length,
listener: sortMenuListener,
child: SortView(_model.sortList, _model.sortPos, (index) {
......@@ -251,10 +230,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return BasePopMenu(
leftPos: data.data[0],
topPos: data.data[1],
width: MediaQuery
.of(context)
.size
.width,
width: MediaQuery.of(context).size.width,
maxHeight: 186,
listener: filterMenuListener,
child: FilterView(
......@@ -398,14 +374,8 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
initialData: _model.feedsLive.data ?? Pair(LOADING, null),
builder: (c, data) {
if (data.data.first == FAIL) {
return errorItem(MediaQuery
.of(context)
.size
.width,
MediaQuery
.of(context)
.size
.height, () {
return errorItem(MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height, () {
_model.feedsLive.notifyView(Pair(LOADING, null));
_model.refreshFeed(true);
});
......@@ -413,26 +383,14 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
if (data.data.first == LOADING) {
return Container(
color: Colors.white,
width: MediaQuery
.of(context)
.size
.width,
height: MediaQuery
.of(context)
.size
.height,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: loadingItem(),
);
}
if (data.data.first == EMPTY) {
return emptyItem(MediaQuery
.of(context)
.size
.width,
MediaQuery
.of(context)
.size
.height);
return emptyItem(MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height);
}
return Container(
color: Color(0xffF7F6FA),
......@@ -486,8 +444,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
margin: EdgeInsets.only(left: 15, right: 15, top: 0, bottom: 0),
child: Row(
children: <Widget>[
Expanded(
child: Container(
// Expanded(
// child:
AspectRatio(
aspectRatio: 335/180,
child: StreamBuilder<List<Ranks>>(
stream: _model.picLive.stream,
initialData: _model.picLive.data ?? null,
......@@ -514,12 +474,17 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
},
),
),
),
Container(
width: 10,
),
// ),
Expanded(
child: Container(
child: Container(),
),
// Container(
// width: 10,
// ),
// Expanded(
// child:
AspectRatio(
aspectRatio: 335/180,
child: StreamBuilder<List<Ranks>>(
stream: _model.picLive.stream,
initialData: _model.picLive.data ?? null,
......@@ -545,7 +510,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
});
},
),
),
// ),
)
],
),
......
......@@ -81,9 +81,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
@override
Widget buildItem(BuildContext context) {
return Scaffold(
body: SafeArea(
top: false,
child: baseStateView(
body: baseStateView(
MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height,
_model.stateLive,
......@@ -104,7 +102,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
},
paddingTop:
MediaQueryData.fromWindow(window).padding.top + kToolbarHeight),
));
);
}
Widget homeWarp() {
......
......@@ -12,6 +12,7 @@ import 'package:flutter_common/commonModel/toast/toast.dart';
import 'package:gm_flutter/commonModel/GMBase.dart';
import 'package:gm_flutter/commonModel/base/BaseUtil.dart';
import 'package:gm_flutter/commonModel/cache/CacheManager.dart';
import 'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart';
import 'package:gm_flutter/commonModel/util/DartUtil.dart';
import '../../commonModel/App.dart';
......@@ -72,7 +73,15 @@ class MainManager {
innerSetData(map, USER_ID);
innerSetData(map, USER_AGENT);
// innerSetData(map, BASE_URL);
innerSetData(map, BASE_URL);
if (map[BASE_URL] != null) {
DioUtil.getInstance();
DioUtil.setDefOptions(
baseUrl: "${map[BASE_URL]}/", agent: map[USER_AGENT]);
DioUtil.getInstance().changeOpt();
}
SimpleEventBus.instance().notifyListener("clueModel|Plan|PlanPage", "init");
// if (map[COOKIE] == null) {
// CacheManager.getInstance().get(MEMORY_CACHE).save(COOKIE,
// "_gm_token=1da6071594101423; csrftoken=rUrkkYYMOVZfIIQnU2IH09QIGmsfe8tE; sessionid=uz7f70uap76r6og48znci5l2hbr9vm5c; _gtid=5af9a5deba8511ea8d4082a085c393c93393");
......@@ -88,11 +97,7 @@ class MainManager {
print(
"LSY QQWWEERRTTYY ${CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE)}"
" ${CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE) is String}");
if (map[BASE_URL] != null) {
DioUtil.setDefOptions(
baseUrl: "${map[BASE_URL]}/", agent: map[USER_AGENT]);
DioUtil.getInstance().changeOpt();
}
// SimpleEventBus.instance().notifyListener("PlanPage!initState", "");
}
......
......@@ -53,7 +53,7 @@ class DioUtil {
(_dio.httpClientAdapter as DefaultHttpClientAdapter).onHttpClientCreate =
(client) {
client.findProxy = (url) {
return 'PROXY $proxy:${port??8888}';
return 'PROXY $proxy:${port ?? 8888}';
};
};
}
......@@ -62,7 +62,7 @@ class DioUtil {
return _dio;
}
static void setDefOptions({String baseUrl, String cookie, String agent}) {
static void setDefOptions({String baseUrl, String agent}) {
_options.connectTimeout = 10 * 1000;
_options.receiveTimeout = 20 * 1000;
_options.responseType = ResponseType.plain;
......@@ -71,10 +71,8 @@ class DioUtil {
if (agent != null) {
headers['User-Agent'] = agent;
}
if (cookie != null) {
headers[HttpHeaders.cookieHeader] = cookie;
}
_options.headers = headers;
_options.baseUrl = baseUrl ?? Api.getInstance().getBaseUrl() + "/";
print("ISEMPTY ?? ${baseUrl}");
_options.baseUrl = baseUrl ?? "${Api.getInstance().getBaseUrl()}/";
}
}
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