Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
gm_flutter
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林生雨
gm_flutter
Commits
9f134c24
Commit
9f134c24
authored
Jul 06, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
c6262e53
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
46 deletions
+61
-46
LevelTwoModel.dart
lib/ClueModel/page/levelTwo/LevelTwoModel.dart
+0
-0
LevelTwoPage.dart
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
+14
-3
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+47
-43
No files found.
lib/ClueModel/page/levelTwo/Level
One
Model.dart
→
lib/ClueModel/page/levelTwo/Level
Two
Model.dart
View file @
9f134c24
File moved
lib/ClueModel/page/levelTwo/LevelTwoPage.dart
View file @
9f134c24
...
...
@@ -28,7 +28,7 @@ class LevelTwoPage extends StatefulWidget {
}
class
LevelTwoState
extends
BaseState
<
LevelTwoPage
>
with
Single
TickerProviderStateMixin
{
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
)
{
...
...
lib/commonModel/base/BaseComponent.dart
View file @
9f134c24
...
...
@@ -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
;
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment