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
fc13ae98
Commit
fc13ae98
authored
Jul 13, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
w
parent
ef179381
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
127 additions
and
147 deletions
+127
-147
LevelOneItem.dart
lib/ClueModel/page/levelOne/LevelOneItem.dart
+37
-23
FilterView.dart
lib/ClueModel/page/plan/FilterView.dart
+1
-1
PlanPage.dart
lib/ClueModel/page/plan/PlanPage.dart
+71
-106
TopPage.dart
lib/ClueModel/page/top/TopPage.dart
+2
-4
MainManager.dart
lib/MainRouter/manager/MainManager.dart
+11
-6
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+1
-1
DioUtil.dart
lib/commonModel/net/DioUtil.dart
+4
-6
No files found.
lib/ClueModel/page/levelOne/LevelOneItem.dart
View file @
fc13ae98
...
...
@@ -173,15 +173,20 @@ class LevelOneItem extends StatelessWidget {
),
),
),
Positioned
(
left:
0
,
bottom:
0
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
30
,
height:
0.5
,
color:
Color
(
0xffE5E5E5
),
),
)
allSize
!=
null
&&
position
!=
null
&&
position
<
allSize
-
1
?
Positioned
(
left:
0
,
bottom:
0
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
30
,
height:
0.5
,
color:
Color
(
0xffE5E5E5
),
),
)
:
Container
(
width:
0
,
height:
0
,
)
],
),
),
...
...
@@ -305,15 +310,20 @@ class LevelOneItem extends StatelessWidget {
// top: 47,
// child: FiveStarView(int.parse(cards.hospital.star), 5),
// ),
Positioned
(
left:
0
,
bottom:
0
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
30
,
height:
0.5
,
color:
Color
(
0xffE5E5E5
),
),
)
allSize
!=
null
&&
position
!=
null
&&
position
<
allSize
-
1
?
Positioned
(
left:
0
,
bottom:
0
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
30
,
height:
0.5
,
color:
Color
(
0xffE5E5E5
),
),
)
:
Container
(
width:
0
,
height:
0
,
)
],
),
));
...
...
@@ -634,11 +644,15 @@ class LevelOneItem extends StatelessWidget {
],
),
),
Container
(
width:
double
.
maxFinite
,
height:
0.5
,
color:
Color
(
0xffE5E5E5
),
)
allSize
!=
null
&&
position
!=
null
&&
position
<
allSize
-
1
?
Container
(
width:
double
.
maxFinite
,
height:
0.5
,
color:
Color
(
0xffE5E5E5
),
)
:
Container
(
height:
0.5
,
)
],
),
).
gestureDetector
(()
{
...
...
lib/ClueModel/page/plan/FilterView.dart
View file @
fc13ae98
...
...
@@ -134,7 +134,7 @@ class FilterViewState extends State<FilterView> {
),
Expanded
(
child:
Container
(
color:
Color
(
0xff
3FB5AF
),
color:
Color
(
0xff
51CDC7
),
alignment:
Alignment
.
center
,
child:
baseText
(
"确定"
,
16
,
Colors
.
white
),
).
gestureDetector
(()
{
...
...
lib/ClueModel/page/plan/PlanPage.dart
View file @
fc13ae98
...
...
@@ -60,10 +60,21 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
PlanBarView
planBarView
;
double
stateBarHeight
;
double
topHeight
;
Function
(
String
str
)
func
;
@override
void
initState
()
{
_model
.
init
(
needCache:
true
);
if
(
RouterCenterImpl
().
findMainRouter
().
isWithNative
()
&&
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
BASE_URL
).
empty
())
{
func
=
(
str
)
{
if
(
str
==
"init"
)
{
_model
.
init
(
needCache:
true
);
}
};
SimpleEventBus
.
instance
().
resignEvent
(
"clueModel|Plan|PlanPage"
,
func
);
}
else
{
_model
.
init
(
needCache:
true
);
}
super
.
initState
();
planBarView
=
PlanBarView
(
_model
.
managerLive
,
clickIndex
,
hideAllMenuListener
);
...
...
@@ -71,6 +82,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override
void
dispose
()
{
SimpleEventBus
.
instance
().
unResignEvent
(
"clueModel|Plan|PlanPage"
,
func
);
hideAllMenuListener
.
dispose
();
projectMenuListener
.
dispose
();
sortMenuListener
.
dispose
();
...
...
@@ -84,24 +96,15 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
@override
Widget
buildItem
(
BuildContext
context
)
{
stateBarHeight
=
MediaQueryData
.
fromWindow
(
window
)
.
padding
.
top
;
stateBarHeight
=
MediaQueryData
.
fromWindow
(
window
).
padding
.
top
;
topHeight
=
stateBarHeight
+
kToolbarHeight
;
return
Scaffold
(
body:
MediaQuery
.
removePadding
(
removeTop:
true
,
context:
context
,
child:
baseStateView
(
MediaQuery
.
of
(
context
)
.
size
.
width
,
MediaQuery
.
of
(
context
)
.
size
.
height
,
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
_model
.
stateLive
,
newHome
(),
()
{
_model
.
stateLive
.
notifyView
(
LOADING
);
...
...
@@ -113,26 +116,14 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
Widget
newHome
()
{
double
diff
=
Platform
.
isAndroid
?
50.0
:
0.0
;
return
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
//主页 剪去tabbar高度
height:
MediaQuery
.
of
(
context
)
.
size
.
height
-
diff
,
height:
MediaQuery
.
of
(
context
).
size
.
height
-
diff
,
child:
Stack
(
children:
<
Widget
>[
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
height:
MediaQuery
.
of
(
context
)
.
size
.
height
-
diff
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
-
diff
,
// child: child(),
child:
homeWarp
(),
),
...
...
@@ -146,19 +137,13 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
child:
Visibility
(
visible:
data
.
data
[
2
]
>
0.1
,
child:
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
height:
MediaQuery
.
of
(
context
)
.
size
.
height
,
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
,
data
.
data
[
1
]
-
45
<
0
?
0
:
data
.
data
[
1
]
-
45
,
color:
Colors
.
transparent
,
),
Container
(
...
...
@@ -204,18 +189,15 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return
BasePopMenu
(
leftPos:
data
.
data
[
0
],
topPos:
data
.
data
[
1
],
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
450
,
listener:
projectMenuListener
,
child:
ProjectView
(
_model
.
projectSelectIndex
,
_model
.
projectData
,
ProjectView
(
_model
.
projectSelectIndex
,
_model
.
projectData
,
(
id
,
name
,
index
)
{
clickIndexOther
(
0
);
_model
.
projectClick
(
id
,
name
,
index
);
}),
clickIndexOther
(
0
);
_model
.
projectClick
(
id
,
name
,
index
);
}),
proListener:
(
pro
)
{
_model
.
backProgress
(
pro
,
0
);
},
...
...
@@ -228,10 +210,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return
BasePopMenu
(
leftPos:
data
.
data
[
0
],
topPos:
data
.
data
[
1
],
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
45
*
_model
.
sortList
.
length
,
listener:
sortMenuListener
,
child:
SortView
(
_model
.
sortList
,
_model
.
sortPos
,
(
index
)
{
...
...
@@ -251,14 +230,11 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return
BasePopMenu
(
leftPos:
data
.
data
[
0
],
topPos:
data
.
data
[
1
],
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
186
,
listener:
filterMenuListener
,
child:
FilterView
(
(
max
,
min
)
{
(
max
,
min
)
{
clickIndexOther
(
2
);
_model
.
filterClick
(
max
,
min
);
},
...
...
@@ -369,23 +345,23 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
return
<
Widget
>[
SliverOverlapAbsorber
(
handle:
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
NestedScrollView
.
sliverOverlapAbsorberHandleFor
(
context
),
sliver:
baseSliverAppBar
(
null
,
height:
kToolbarHeight
+
stateBarHeight
-
39
,
needpic:
false
)),
SliverList
(
delegate:
SliverChildBuilderDelegate
((
BuildContext
c
,
int
i
)
{
if
(
i
==
0
)
{
return
Container
(
height:
kToolbarHeight
,
);
}
return
towPic
();
},
childCount:
2
)),
if
(
i
==
0
)
{
return
Container
(
height:
kToolbarHeight
,
);
}
return
towPic
();
},
childCount:
2
)),
SliverPersistentHeader
(
pinned:
true
,
delegate:
StickyTabBarDelegateWithSize
(
child:
planBar
(),
height:
45
),
StickyTabBarDelegateWithSize
(
child:
planBar
(),
height:
45
),
)
];
},
...
...
@@ -398,47 +374,29 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
initialData:
_model
.
feedsLive
.
data
??
Pair
(
LOADING
,
null
),
builder:
(
c
,
data
)
{
if
(
data
.
data
.
first
==
FAIL
)
{
return
errorItem
(
MediaQuery
.
of
(
context
)
.
size
.
width
,
MediaQuery
.
of
(
context
)
.
size
.
height
,
()
{
_model
.
feedsLive
.
notifyView
(
Pair
(
LOADING
,
null
));
_model
.
refreshFeed
(
true
);
});
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
_model
.
feedsLive
.
notifyView
(
Pair
(
LOADING
,
null
));
_model
.
refreshFeed
(
true
);
});
}
if
(
data
.
data
.
first
==
LOADING
)
{
return
Container
(
color:
Colors
.
white
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
height:
MediaQuery
.
of
(
context
)
.
size
.
height
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
loadingItem
(),
);
}
if
(
data
.
data
.
first
==
EMPTY
)
{
return
emptyItem
(
MediaQuery
.
of
(
context
)
.
size
.
width
,
MediaQuery
.
of
(
context
)
.
size
.
height
);
return
emptyItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
);
}
return
Container
(
color:
Color
(
0xffF7F6FA
),
child:
baseRefreshView
(
refreshController
,
()
{
()
{
_model
.
refreshFeed
(
true
,
controller:
refreshController
);
},
null
,
...
...
@@ -448,7 +406,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
slivers:
<
Widget
>[
SliverList
(
delegate:
SliverChildBuilderDelegate
(
(
BuildContext
context
,
int
index
)
{
(
BuildContext
context
,
int
index
)
{
if
(
data
.
data
.
second
.
length
==
0
)
{
if
(
_model
.
page
!=
1
)
{
refreshController
.
loadNoData
();
...
...
@@ -486,8 +444,10 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
margin:
EdgeInsets
.
only
(
left:
15
,
right:
15
,
top:
0
,
bottom:
0
),
child:
Row
(
children:
<
Widget
>[
Expanded
(
child:
Container
(
// Expanded(
// child:
AspectRatio
(
aspectRatio:
335
/
180
,
child:
StreamBuilder
<
List
<
Ranks
>>(
stream:
_model
.
picLive
.
stream
,
initialData:
_model
.
picLive
.
data
??
null
,
...
...
@@ -496,7 +456,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
borderRadius:
BorderRadius
.
circular
(
3
),
child:
CachedNetworkImage
(
imageUrl:
data
.
data
==
null
?
""
:
data
.
data
[
0
].
icon
??
""
,
data
.
data
==
null
?
""
:
data
.
data
[
0
].
icon
??
""
,
fit:
BoxFit
.
cover
,
)).
gestureDetector
(()
{
Map
<
String
,
dynamic
>
map
=
{
...
...
@@ -514,13 +474,18 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
},
),
),
),
Container
(
width:
10
,
),
Expanded
(
child:
Container
(
child:
StreamBuilder
<
List
<
Ranks
>>(
// ),
Expanded
(
child:
Container
(),
),
// Container(
// width: 10,
// ),
// Expanded(
// child:
AspectRatio
(
aspectRatio:
335
/
180
,
child:
StreamBuilder
<
List
<
Ranks
>>(
stream:
_model
.
picLive
.
stream
,
initialData:
_model
.
picLive
.
data
??
null
,
builder:
(
c
,
data
)
{
...
...
@@ -528,7 +493,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
borderRadius:
BorderRadius
.
circular
(
3
),
child:
CachedNetworkImage
(
imageUrl:
data
.
data
==
null
?
""
:
data
.
data
[
1
].
icon
??
""
,
data
.
data
==
null
?
""
:
data
.
data
[
1
].
icon
??
""
,
fit:
BoxFit
.
cover
,
)).
gestureDetector
(()
{
Map
<
String
,
dynamic
>
map
=
{
...
...
@@ -545,7 +510,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
});
},
),
),
//
),
)
],
),
...
...
@@ -585,7 +550,7 @@ class PlanState extends BaseState<PlanPage> with TickerProviderStateMixin {
double
bottom
=
// WidgetUtil.buttonLeftMenuPosition(globalKey.currentContext)?.top ??
topPos
==
null
?
0.0
:
topPos
.
dy
+
45
;
topPos
==
null
?
0.0
:
topPos
.
dy
+
45
;
if
(
bottom
<
45
)
{
bottom
=
45
;
}
...
...
lib/ClueModel/page/top/TopPage.dart
View file @
fc13ae98
...
...
@@ -81,9 +81,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
@override
Widget
buildItem
(
BuildContext
context
)
{
return
Scaffold
(
body:
SafeArea
(
top:
false
,
child:
baseStateView
(
body:
baseStateView
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
_model
.
stateLive
,
...
...
@@ -104,7 +102,7 @@ class TopPageState extends BaseState<TopPage> with TickerProviderStateMixin {
},
paddingTop:
MediaQueryData
.
fromWindow
(
window
).
padding
.
top
+
kToolbarHeight
),
)
)
;
);
}
Widget
homeWarp
()
{
...
...
lib/MainRouter/manager/MainManager.dart
View file @
fc13ae98
...
...
@@ -12,6 +12,7 @@ import 'package:flutter_common/commonModel/toast/toast.dart';
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
import
'package:gm_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'../../commonModel/App.dart'
;
...
...
@@ -72,7 +73,15 @@ class MainManager {
innerSetData
(
map
,
USER_ID
);
innerSetData
(
map
,
USER_AGENT
);
// innerSetData(map, BASE_URL);
innerSetData
(
map
,
BASE_URL
);
if
(
map
[
BASE_URL
]
!=
null
)
{
DioUtil
.
getInstance
();
DioUtil
.
setDefOptions
(
baseUrl:
"
${map[BASE_URL]}
/"
,
agent:
map
[
USER_AGENT
]);
DioUtil
.
getInstance
().
changeOpt
();
}
SimpleEventBus
.
instance
().
notifyListener
(
"clueModel|Plan|PlanPage"
,
"init"
);
// if (map[COOKIE] == null) {
// CacheManager.getInstance().get(MEMORY_CACHE).save(COOKIE,
// "_gm_token=1da6071594101423; csrftoken=rUrkkYYMOVZfIIQnU2IH09QIGmsfe8tE; sessionid=uz7f70uap76r6og48znci5l2hbr9vm5c; _gtid=5af9a5deba8511ea8d4082a085c393c93393");
...
...
@@ -88,11 +97,7 @@ class MainManager {
print
(
"LSY QQWWEERRTTYY
${CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE)}
"
"
${CacheManager.getInstance().get(MEMORY_CACHE).get(COOKIE) is String}
"
);
if
(
map
[
BASE_URL
]
!=
null
)
{
DioUtil
.
setDefOptions
(
baseUrl:
"
${map[BASE_URL]}
/"
,
agent:
map
[
USER_AGENT
]);
DioUtil
.
getInstance
().
changeOpt
();
}
// SimpleEventBus.instance().notifyListener("PlanPage!initState", "");
}
...
...
lib/commonModel/base/BaseComponent.dart
View file @
fc13ae98
...
...
@@ -547,7 +547,7 @@ Widget baseSliverTitle(String text, double width, LiveData liveData) {
child:
Container
(
alignment:
Alignment
.
center
,
width:
width
,
child:
baseText
(
text
,
1
8
,
Color
(
0xff333333
)),
child:
baseText
(
text
,
1
6
,
Color
(
0xff333333
)),
),
);
},
...
...
lib/commonModel/net/DioUtil.dart
View file @
fc13ae98
...
...
@@ -53,7 +53,7 @@ class DioUtil {
(
_dio
.
httpClientAdapter
as
DefaultHttpClientAdapter
).
onHttpClientCreate
=
(
client
)
{
client
.
findProxy
=
(
url
)
{
return
'PROXY
$proxy
:
${port
??
8888}
'
;
return
'PROXY
$proxy
:
${port
??
8888}
'
;
};
};
}
...
...
@@ -62,7 +62,7 @@ class DioUtil {
return
_dio
;
}
static
void
setDefOptions
({
String
baseUrl
,
String
cookie
,
String
agent
})
{
static
void
setDefOptions
({
String
baseUrl
,
String
agent
})
{
_options
.
connectTimeout
=
10
*
1000
;
_options
.
receiveTimeout
=
20
*
1000
;
_options
.
responseType
=
ResponseType
.
plain
;
...
...
@@ -71,10 +71,8 @@ class DioUtil {
if
(
agent
!=
null
)
{
headers
[
'User-Agent'
]
=
agent
;
}
if
(
cookie
!=
null
)
{
headers
[
HttpHeaders
.
cookieHeader
]
=
cookie
;
}
_options
.
headers
=
headers
;
_options
.
baseUrl
=
baseUrl
??
Api
.
getInstance
().
getBaseUrl
()
+
"/"
;
print
(
"ISEMPTY ??
${baseUrl}
"
);
_options
.
baseUrl
=
baseUrl
??
"
${Api.getInstance().getBaseUrl()}
/"
;
}
}
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