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
2463d3fb
Commit
2463d3fb
authored
Jul 08, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
96727ad9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
189 additions
and
182 deletions
+189
-182
StickyTabBarDelegateWithSize.dart
lib/ClueModel/page/common/StickyTabBarDelegateWithSize.dart
+30
-0
PlanPage.dart
lib/ClueModel/page/plan/PlanPage.dart
+153
-178
TopList.dart
lib/ClueModel/page/top/TopList.dart
+1
-0
TopListModel.dart
lib/ClueModel/page/top/TopListModel.dart
+1
-3
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+4
-1
No files found.
lib/ClueModel/page/common/StickyTabBarDelegateWithSize.dart
0 → 100644
View file @
2463d3fb
/*
* @author lsy
* @date 2020/7/8
**/
import
'package:flutter/material.dart'
;
class
StickyTabBarDelegateWithSize
extends
SliverPersistentHeaderDelegate
{
final
Widget
child
;
final
double
height
;
StickyTabBarDelegateWithSize
({
@required
this
.
child
,
this
.
height
});
@override
Widget
build
(
BuildContext
context
,
double
shrinkOffset
,
bool
overlapsContent
)
{
return
this
.
child
;
}
@override
double
get
maxExtent
=>
height
??
40
;
@override
double
get
minExtent
=>
height
??
40
;
@override
bool
shouldRebuild
(
SliverPersistentHeaderDelegate
oldDelegate
)
{
return
true
;
}
}
lib/ClueModel/page/plan/PlanPage.dart
View file @
2463d3fb
...
...
@@ -11,6 +11,7 @@ import 'package:cached_network_image/cached_network_image.dart';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:gm_flutter/ClueModel/page/common/StickyTabBarDelegate.dart'
;
import
'package:gm_flutter/ClueModel/page/common/StickyTabBarDelegateWithSize.dart'
;
import
'package:gm_flutter/ClueModel/page/levelTwo/LevelTwoPage.dart'
;
import
'package:gm_flutter/ClueModel/page/plan/FilterView.dart'
;
import
'package:gm_flutter/ClueModel/page/plan/PlanBar.dart'
;
...
...
@@ -60,6 +61,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override
void
initState
()
{
print
(
"LSY PLAN INIT"
);
// DioUtil.getInstance().setProxy("172.30.8.245");
super
.
initState
();
_model
.
init
();
...
...
@@ -89,191 +91,163 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
removeTop:
true
,
context:
context
,
child:
SafeArea
(
top:
false
,
child:
Stack
(
children:
<
Widget
>[
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
Stack
(
children:
<
Widget
>[
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
top:
false
,
child:
baseStateView
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
_model
.
stateLive
,
newHome
(),
()
{
_model
.
stateLive
.
notifyView
(
LOADING
);
_model
.
init
();
},
paddingTop:
stateBarHeight
+
kToolbarHeight
)),
));
}
Widget
newHome
()
{
return
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
//主页 剪去tabbar高度
height:
MediaQuery
.
of
(
context
).
size
.
height
-
79
,
child:
Stack
(
children:
<
Widget
>[
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
-
79
,
// child: child(),
child:
homeWarp
(),
),
StreamBuilder
<
List
<
double
>>(
stream:
_model
.
backLive
.
stream
,
initialData:
[
0.0
,
0.0
,
0.0
],
builder:
(
c
,
data
)
{
return
Positioned
(
left:
0.0
,
top:
0.0
,
child:
Visibility
(
visible:
data
.
data
[
2
]
>
0.1
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
Column
(
children:
<
Widget
>[
Container
(
height:
data
.
data
[
1
]
-
45
<
0
?
0
:
data
.
data
[
1
]
-
45
,
color:
Colors
.
transparent
,
),
Container
(
height:
45
,
child:
Row
(
children:
<
Widget
>[
Expanded
(
child:
Container
().
gestureDetector
(()
{
clickIndexOther
(
0
);
}),
),
Expanded
(
child:
Container
().
gestureDetector
(()
{
clickIndexOther
(
1
);
}),
),
Expanded
(
child:
Container
().
gestureDetector
(()
{
clickIndexOther
(
2
);
}),
),
],
),
),
Expanded
(
child:
Container
(
color:
Color
.
fromARGB
(
(
data
.
data
[
2
]
*
153
).
toInt
(),
0
,
0
,
0
),
).
gestureDetector
(()
{
hideAllMenuListener
.
notifyListeners
();
}),
)
],
),
child:
homeWarp
(),
),
StreamBuilder
<
List
<
double
>>(
stream:
_model
.
backLive
.
stream
,
initialData:
[
0.0
,
0.0
,
0.0
],
builder:
(
c
,
data
)
{
return
Positioned
(
left:
0.0
,
top:
0.0
,
child:
Visibility
(
visible:
data
.
data
[
2
]
>
0.1
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
Column
(
children:
<
Widget
>[
Container
(
height:
data
.
data
[
1
]
-
45
<
0
?
0
:
data
.
data
[
1
]
-
45
,
color:
Colors
.
transparent
,
),
Container
(
height:
45
,
child:
Row
(
children:
<
Widget
>[
Expanded
(
child:
Container
().
gestureDetector
(()
{
clickIndexOther
(
0
);
}),
),
Expanded
(
child:
Container
().
gestureDetector
(()
{
clickIndexOther
(
1
);
}),
),
Expanded
(
child:
Container
().
gestureDetector
(()
{
clickIndexOther
(
2
);
}),
),
],
),
),
);
}),
StreamBuilder
<
List
<
double
>>(
stream:
_model
.
posLive
.
stream
,
initialData:
[
0.0
,
0.0
],
builder:
(
c
,
data
)
{
return
BasePopMenu
(
leftPos:
data
.
data
[
0
],
topPos:
data
.
data
[
1
],
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
450
,
listener:
projectMenuListener
,
child:
ProjectView
(
_model
.
projectData
,
(
id
)
{
clickIndexOther
(
0
);
_model
.
projectClick
(
id
);
}),
proListener:
(
pro
)
{
_model
.
backProgress
(
pro
,
0
);
},
);
}),
StreamBuilder
<
List
<
double
>>(
stream:
_model
.
posLive
.
stream
,
initialData:
[
0.0
,
0.0
],
builder:
(
c
,
data
)
{
return
BasePopMenu
(
leftPos:
data
.
data
[
0
],
topPos:
data
.
data
[
1
],
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
272
,
listener:
sortMenuListener
,
child:
SortView
(
_model
.
sortList
,
_model
.
sortPos
,
(
index
)
{
clickIndexOther
(
1
);
_model
.
sortClick
(
index
);
}),
proListener:
(
pro
)
{
_model
.
backProgress
(
pro
,
1
);
},
);
},
Expanded
(
child:
Container
(
color:
Color
.
fromARGB
(
(
data
.
data
[
2
]
*
153
).
toInt
(),
0
,
0
,
0
),
).
gestureDetector
(()
{
hideAllMenuListener
.
notifyListeners
();
}),
)
],
),
),
),
StreamBuilder
<
List
<
double
>>(
stream:
_model
.
posLive
.
stream
,
initialData:
[
0.0
,
0.0
],
builder:
(
c
,
data
)
{
return
BasePopMenu
(
leftPos:
data
.
data
[
0
],
topPos:
data
.
data
[
1
],
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
186
,
listener:
filterMenuListener
,
child:
FilterView
((
max
,
min
)
{
clickIndexOther
(
2
);
_model
.
filterClick
(
max
,
min
);
}),
proListener:
(
pro
)
{
_model
.
backProgress
(
pro
,
2
);
},
);
}),
StreamBuilder
<
bool
>(
stream:
_model
.
showTab
.
stream
,
initialData:
_model
.
showTab
.
data
??
false
,
builder:
(
c
,
data
)
{
return
Visibility
(
visible:
data
.
data
,
child:
Container
(
color:
Colors
.
white
,
child:
planBarView
,
),
);
},
)
],
),
),
StreamBuilder
(
stream:
_model
.
stateLive
.
stream
,
initialData:
_model
.
stateLive
.
data
??
LOADING
,
);
}),
StreamBuilder
<
List
<
double
>>(
stream:
_model
.
posLive
.
stream
,
initialData:
[
0.0
,
0.0
],
builder:
(
c
,
data
)
{
if
(
data
.
data
==
LOADING
)
{
return
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
color:
Colors
.
white
,
child:
loadingItem
(),
);
}
else
if
(
data
.
data
==
FAIL
)
{
return
Container
(
color:
Colors
.
white
,
child:
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
_model
.
stateLive
.
notifyView
(
LOADING
);
_model
.
init
();
},
paddingTop:
stateBarHeight
+
kToolbarHeight
),
);
}
else
{
return
Container
(
width:
0
,
height:
0
,
);
}
},
)
],
),
return
BasePopMenu
(
leftPos:
data
.
data
[
0
],
topPos:
data
.
data
[
1
],
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
450
,
listener:
projectMenuListener
,
child:
ProjectView
(
_model
.
projectData
,
(
id
)
{
clickIndexOther
(
0
);
_model
.
projectClick
(
id
);
}),
proListener:
(
pro
)
{
_model
.
backProgress
(
pro
,
0
);
},
);
}),
StreamBuilder
<
List
<
double
>>(
stream:
_model
.
posLive
.
stream
,
initialData:
[
0.0
,
0.0
],
builder:
(
c
,
data
)
{
return
BasePopMenu
(
leftPos:
data
.
data
[
0
],
topPos:
data
.
data
[
1
],
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
272
,
listener:
sortMenuListener
,
child:
SortView
(
_model
.
sortList
,
_model
.
sortPos
,
(
index
)
{
clickIndexOther
(
1
);
_model
.
sortClick
(
index
);
}),
proListener:
(
pro
)
{
_model
.
backProgress
(
pro
,
1
);
},
);
},
),
StreamBuilder
<
List
<
double
>>(
stream:
_model
.
posLive
.
stream
,
initialData:
[
0.0
,
0.0
],
builder:
(
c
,
data
)
{
return
BasePopMenu
(
leftPos:
data
.
data
[
0
],
topPos:
data
.
data
[
1
],
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
186
,
listener:
filterMenuListener
,
child:
FilterView
((
max
,
min
)
{
clickIndexOther
(
2
);
_model
.
filterClick
(
max
,
min
);
}),
proListener:
(
pro
)
{
_model
.
backProgress
(
pro
,
2
);
},
);
}),
StreamBuilder
<
bool
>(
stream:
_model
.
showTab
.
stream
,
initialData:
_model
.
showTab
.
data
??
false
,
builder:
(
c
,
data
)
{
return
Visibility
(
visible:
data
.
data
,
child:
Container
(
color:
Colors
.
white
,
child:
planBarView
,
),
);
},
)
],
),
)
)
;
);
}
//搜索框
Widget
head
()
{
return
Container
(
height:
topHeight
,
...
...
@@ -364,7 +338,8 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
},
childCount:
2
)),
SliverPersistentHeader
(
pinned:
true
,
delegate:
StickyTabBarDelegate
(
child:
planBar
()),
delegate:
StickyTabBarDelegateWithSize
(
child:
planBar
(),
height:
45
),
)
];
},
...
...
lib/ClueModel/page/top/TopList.dart
View file @
2463d3fb
...
...
@@ -32,6 +32,7 @@ class TopListState extends State<TopList>
@override
void
initState
()
{
super
.
initState
();
_model
.
tagId
=
"
${widget.id}
"
;
_model
.
getData
(
true
);
refresh
=
(
str
)
{
_model
.
stateLive
.
notifyView
(
LOADING
);
...
...
lib/ClueModel/page/top/TopListModel.dart
View file @
2463d3fb
...
...
@@ -43,12 +43,10 @@ class TopListModel extends BaseModel {
datasLive
.
notifyView
([]);
}
}
else
{
stateLive
.
notifyView
(
ENDLOADING
);
datas
.
addAll
(
event
.
data
.
plans
);
datasLive
.
notifyView
(
datas
);
}
if
(
page
==
1
)
{
stateLive
.
notifyView
(
ENDLOADING
);
}
}
else
{
NativeToast
.
showNativeToast
(
event
.
message
);
stateLive
.
notifyView
(
FAIL
);
...
...
lib/commonModel/base/BaseComponent.dart
View file @
2463d3fb
...
...
@@ -521,7 +521,10 @@ Widget baseStateView(double width, double height, LiveData<int> stateLive,
initialData:
stateLive
.
data
??
LOADING
,
builder:
(
c
,
data
)
{
if
(
data
.
data
==
LOADING
)
{
return
loadingItem
();
return
Container
(
color:
Colors
.
white
,
child:
loadingItem
(),
);
}
else
if
(
data
.
data
==
FAIL
)
{
return
errorItem
(
width
,
height
,
retry
,
paddingTop:
paddingTop
);
}
else
if
(
data
.
data
==
EMPTY
)
{
...
...
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