Commit bec8036f authored by 朱璇's avatar 朱璇

Merge branch 'test' of git.wanmeizhensuo.com:linshengyu/gm_flutter into zx/gmFlutter

parents d8041060 59af1797
......@@ -42,10 +42,10 @@ class LevelOneState extends BaseState<LevelOnePage>
@override
void initState() {
super.initState();
Future.delayed(Duration(seconds: 3), () {
_model.loadingLive.notifyView(false);
_model.refreshView(true);
});
// Future.delayed(Duration(seconds: 3), () {
// _model.loadingLive.notifyView(false);
// _model.refreshView(true);
// });
pageController.addListener(() {
if (screenWidth != null) {
_model.topScrollLive.notifyView(
......@@ -121,8 +121,6 @@ class LevelOneState extends BaseState<LevelOnePage>
}
},
)));
}
Widget home() {
......@@ -492,7 +490,7 @@ class LevelOneState extends BaseState<LevelOnePage>
child: PageView.builder(
itemBuilder: (c, pageIndex) {
if (data.data.first == FAIL) {
return errorItem(() {
return errorItem(MediaQuery.of(context).size.width, height, () {
_model.refreshView(true);
});
}
......@@ -502,7 +500,7 @@ class LevelOneState extends BaseState<LevelOnePage>
}
if (data.data.second.length == 0) {
if (_model.pageList[pageIndex] == 1) {
return emptyItem();
return emptyItem(MediaQuery.of(context).size.width, height);
} else {
_refreshController.loadNoData();
}
......
......@@ -185,7 +185,8 @@ class PlanState extends BaseState<PlanPage> {
width: MediaQuery.of(context).size.width,
maxHeight: 272,
listener: sortMenuListener,
child: SortView(_model.sortList, _model.sortPos, (index) {
child: SortView(_model.sortList, _model.sortPos,
(index) {
clickIndexOther(1);
_model.sortClick(index);
}),
......@@ -207,7 +208,7 @@ class PlanState extends BaseState<PlanPage> {
listener: filterMenuListener,
child: FilterView((max, min) {
clickIndexOther(2);
_model.filterClick(max,min);
_model.filterClick(max, min);
}),
proListener: (pro) {
_model.backProgress(pro, 2);
......@@ -232,14 +233,13 @@ class PlanState extends BaseState<PlanPage> {
child: loadingItem(),
);
} else if (data.data == FAIL) {
return Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
color: Colors.white,
child: errorItem(() {
return errorItem(
MediaQuery.of(context).size.width,
MediaQuery.of(context).size.height,
() {
_model.stateLive.notifyView(LOADING);
_model.init();
}),
},
);
} else {
return Container(
......@@ -455,7 +455,8 @@ class PlanState extends BaseState<PlanPage> {
physics: NeverScrollableScrollPhysics(),
itemBuilder: (c, index) {
if (data.data.first == FAIL) {
return errorItem(() {
return errorItem(MediaQuery.of(context).size.width, height,
() {
_model.refreshFeed(true);
});
}
......@@ -464,7 +465,7 @@ class PlanState extends BaseState<PlanPage> {
}
if (data.data.second.length == 0) {
if (_model.page == 1) {
return emptyItem();
return emptyItem(MediaQuery.of(context).size.width, height);
} else {
refreshController.loadNoData();
}
......
......@@ -93,10 +93,14 @@ class PlanProgressBarState extends State<PlanProgressBar> {
height: 42,
color: Color(0x66000000),
alignment: Alignment.center,
child: baseText(
"${(widget.maxlow + (isLeftMove?leftPosTempPercent:rightPosTempPercent+0.03) * distance).toInt()}",
13,
Colors.white),
child: Column(
children: <Widget>[
baseText(
"${(widget.maxlow + (isLeftMove?leftPosTempPercent:rightPosTempPercent+0.03) * distance).toInt()}",
13,
Colors.white)
],
),
),
),
),
......@@ -144,7 +148,6 @@ class PlanProgressBarState extends State<PlanProgressBar> {
},
onPointerMove: (p) {
var d = p.localPosition.dx - rightDowPos;
print("D ${d}");
rightPosTempPercent = rightStarPosPercent + (d / totle);
if (rightPosTempPercent <
leftPosTempPercent + scrollDistance) {
......
......@@ -3,6 +3,7 @@
* @date 2019-10-13
**/
import 'package:app_settings/app_settings.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
......@@ -138,56 +139,72 @@ Widget loadingItem({bool needBackground = false}) {
Widget netErrorItem() {}
Widget errorItem(VoidCallback retry, {String errorText, String retryText}) {
Widget errorItem(double width, double height, VoidCallback retry,
{String errorText, String retryText}) {
return Container(
width: SCREENWIDTH,
height: SCREENHEIGHT,
width: width,
height: height,
color: Colors.white,
alignment: Alignment.center,
alignment: Alignment.topCenter,
child: Container(
height: SCREENHEIGHT,
child: Container(
margin: EdgeInsets.only(top: 70),
width: 175,
height: 249,
child: Stack(
children: <Widget>[
Positioned(
left: 0,
top: 0,
child: Container(
width: 175,
height: 199,
child: Image.asset("assets/error.png"),
),
),
Positioned(
left: 0,
top: 166,
child: Container(
width: 175,
alignment: Alignment.center,
child: baseText(errorText ?? "网络错误", 15, Color(0xff666666)),
),
),
Positioned(
top: 216,
left: 12,
child: Container(
width: 150,
height: 33,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22.5),
color: Color(0xff51CDC7)),
alignment: Alignment.center,
child: baseText(retryText ?? "重新加载", 16, Colors.white),
).gestureDetector(() {
retry();
}),
)
],
width: 180,
height: 315.5,
margin: EdgeInsets.only(top: 62),
child: Stack(
alignment: AlignmentDirectional.center,
children: <Widget>[
Positioned(
left: 0,
top: 0,
child: Container(
width: 180,
height: 186.5,
child: Image.asset("assets/error.png"),
),
),
Positioned(
top: 166,
child: Container(
width: 180,
alignment: Alignment.center,
child: baseText(
errorText ?? "原谅我一看到美人就不淡定", 15, Color(0xff666666)),
),
),
)));
Positioned(
bottom: 60,
child: Container(
width: 150,
height: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: LinearGradient(
colors: [Color(0xFFFF5963), Color(0xffFF7096)],
begin: FractionalOffset(1, 0),
end: FractionalOffset(0, 1))),
alignment: Alignment.center,
child: baseText(retryText ?? "重新加载", 16, Colors.white),
).gestureDetector(() {
retry();
}),
),
Positioned(
bottom: 0,
child: Container(
width: 150,
height: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
border: Border.all(color: Color(0xffFF5963), width: 0.5)),
alignment: Alignment.center,
child: baseText("检查网络设置", 16, Color(0xffFF5963)),
).gestureDetector(() {
AppSettings.openWIFISettings();
}),
)
],
),
));
}
//TODO
......@@ -352,21 +369,30 @@ Widget normalRefreshHeader() {
);
}
Widget emptyItem({String detail}) {
return Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
height: 210,
width: 210,
color: Colors.red,
),
Container(
margin: EdgeInsets.only(top: 8),
child: baseText(
detail == null ? "暂无消息,找人聊聊去" : detail, 15, Color(0xff9B9B9B)),
Widget emptyItem(double width, double height, {String detail}) {
return Container(
width: width,
height: height,
color: Colors.white,
alignment: Alignment.topCenter,
child: Container(
width: 175,
height: 188,
margin: EdgeInsets.only(top: 62.5),
child: Stack(
alignment: AlignmentDirectional.bottomCenter,
children: <Widget>[
Container(
width: 175,
height: 188,
child: Image.asset("assets/empty.png"),
),
Positioned(
bottom: 17,
child: baseText(detail ?? "此处太寂寥,转转别处吧", 15, Color(0xff666666)),
)
],
),
],
),
);
}
......@@ -15,6 +15,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.39.10"
app_settings:
dependency: "direct main"
description:
name: app_settings
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.1+1"
archive:
dependency: transitive
description:
......
......@@ -32,6 +32,7 @@ dependencies:
#轻量级存储
shared_preferences: ^0.5.7+1
lottie: ^0.4.0+1
app_settings: ^4.0.1+1
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