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

commit

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