Commit 9f134c24 authored by 林生雨's avatar 林生雨

commit

parent c6262e53
......@@ -28,7 +28,7 @@ class LevelTwoPage extends StatefulWidget {
}
class LevelTwoState extends BaseState<LevelTwoPage>
with SingleTickerProviderStateMixin {
with TickerProviderStateMixin {
int planId = 10;
LevelOneModel _model = new LevelOneModel();
RefreshController _refreshController = RefreshController();
......@@ -147,8 +147,14 @@ class LevelTwoState extends BaseState<LevelTwoPage>
},
child: newHome(),
)),
baseSliverTitle(_model.planoverItem?.name,
MediaQuery.of(context).size.width, _model.textLive),
Positioned(
top: 57,
child: Container(
alignment: Alignment.center,
width: MediaQuery.of(context).size.width,
child: baseText("文案", 18, Color(0xff333333)),
),
),
baseSliverBack(() {
Navigator.of(context).pop();
}),
......@@ -175,6 +181,11 @@ class LevelTwoState extends BaseState<LevelTwoPage>
},
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverOverlapAbsorber(
handle: extend.NestedScrollView.sliverOverlapAbsorberHandleFor(
context),
sliver: baseSliverAppBar(_model.imageUrl,
height: pinnedHeaderHeight, needpic: false)),
SliverList(
delegate: SliverChildBuilderDelegate((BuildContext c, int i) {
if (i == 0) {
......
......@@ -144,11 +144,11 @@ Widget loadingItem({bool needBackground = false}) {
Widget netErrorItem() {}
Widget errorItem(double width, double height, VoidCallback retry,
{String errorText, String retryText,double paddingTop}) {
{String errorText, String retryText, double paddingTop}) {
return Container(
width: width,
height: height,
padding: EdgeInsets.only(top: paddingTop??0),
padding: EdgeInsets.only(top: paddingTop ?? 0),
alignment: Alignment.topCenter,
child: Container(
width: 180,
......@@ -377,46 +377,46 @@ Widget normalRefreshHeader() {
);
}
Widget emptyItem(double width, double height, {String detail,double paddingTop}) {
Widget emptyItem(double width, double height,
{String detail, double paddingTop}) {
return Container(
padding: EdgeInsets.only(top: paddingTop??0),
padding: EdgeInsets.only(top: paddingTop ?? 0),
width: width,
height: height,
color: Colors.white,
alignment: Alignment.topCenter,
child: Container(
width: 175,
height: 188,
margin: EdgeInsets.only(top: 62.5),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
width: 175,
height: 188,
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)),
)
],
width: 175,
height: 188,
margin: EdgeInsets.only(top: 62.5),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
width: 175,
height: 188,
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)),
)
],
),
),
),
Container(
height:0,
color: Colors.white,
)
],
)
),
Container(
height: 0,
color: Colors.white,
)
],
)),
);
}
......@@ -453,7 +453,8 @@ Widget baseTabBarItem(String text,
);
}
Widget baseSliverAppBar(String url, {double height, double elevation}) {
Widget baseSliverAppBar(String url,
{double height, double elevation, bool needpic = true}) {
return SliverAppBar(
pinned: true,
centerTitle: true,
......@@ -461,10 +462,12 @@ Widget baseSliverAppBar(String url, {double height, double elevation}) {
expandedHeight: height ?? 200,
automaticallyImplyLeading: false,
flexibleSpace: FlexibleSpaceBar(
background: Image.network(
url ?? '',
fit: BoxFit.cover,
),
background: needpic
? Image.network(
url ?? '',
fit: BoxFit.cover,
)
: Container(),
),
);
}
......@@ -510,7 +513,8 @@ Widget baseSliverTitle(String text, double width, LiveData liveData) {
}
Widget baseStateView(double width, double height, LiveData<int> stateLive,
Widget home, VoidCallback retry,{double paddingTop}) {
Widget home, VoidCallback retry,
{double paddingTop}) {
return StreamBuilder(
stream: stateLive.stream,
initialData: stateLive.data ?? LOADING,
......@@ -518,9 +522,9 @@ Widget baseStateView(double width, double height, LiveData<int> stateLive,
if (data.data == LOADING) {
return loadingItem();
} else if (data.data == FAIL) {
return errorItem(width, height, retry,paddingTop: paddingTop);
return errorItem(width, height, retry, paddingTop: paddingTop);
} else if (data.data == EMPTY) {
return emptyItem(width, height,paddingTop: paddingTop);
return emptyItem(width, height, paddingTop: paddingTop);
}
return home;
},
......
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