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
abc54df5
Commit
abc54df5
authored
Jul 06, 2020
by
朱璇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of git.wanmeizhensuo.com:linshengyu/gm_flutter into zx/gmFlutter
parents
b14e5400
cc889c68
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
83 additions
and
38 deletions
+83
-38
ClueRouterImpl.dart
lib/ClueModel/ClueRouterImpl.dart
+2
-2
PlansCompareFeedModel.dart
...lueModel/page/PlansCompareFeed/PlansCompareFeedModel.dart
+2
-2
PlansCompareFeedPage.dart
...ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
+10
-2
ProjectDetailsModel.dart
lib/ClueModel/page/ProjectDetails/ProjectDetailsModel.dart
+2
-2
ProjectDetailsPage.dart
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
+21
-5
LevelOnePage.dart
lib/ClueModel/page/levelOne/LevelOnePage.dart
+15
-9
ClueApi.dart
lib/ClueModel/server/api/ClueApi.dart
+2
-2
ClueApi.serv.dart
lib/ClueModel/server/api/ClueApi.serv.dart
+2
-2
DemoPage.dart
lib/DemoPage.dart
+0
-1
MainRouter.dart
lib/MainRouter/MainRouter.dart
+2
-0
MainRouterImpl.dart
lib/MainRouter/MainRouterImpl.dart
+5
-0
MainManager.dart
lib/MainRouter/manager/MainManager.dart
+19
-2
BaseUtil.dart
lib/commonModel/base/BaseUtil.dart
+0
-2
main.dart
lib/main.dart
+1
-7
No files found.
lib/ClueModel/ClueRouterImpl.dart
View file @
abc54df5
...
...
@@ -16,7 +16,7 @@ import 'package:gm_flutter/ClueModel/page/top/TopPage.dart';
class
ClueRouterImpl
implements
ClueRouter
{
@override
Widget
getProjectDetailsPage
()
{
return
ProjectDetailsPage
();
return
ProjectDetailsPage
(
1
);
}
@override
...
...
@@ -31,7 +31,7 @@ class ClueRouterImpl implements ClueRouter {
@override
Widget
getPlansCompareFeed
()
{
return
PlansCompareFeedPage
();
return
PlansCompareFeedPage
(
123
,
1
);
}
@override
...
...
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedModel.dart
View file @
abc54df5
...
...
@@ -10,9 +10,9 @@ class PlansCompareFeedModel extends BaseModel {
LiveData
<
PlansCompareFeed
>
liveData
=
LiveData
();
RxDispose
rxDispose
=
RxDispose
();
void
init
()
{
void
init
(
int
_planType
,
int
_planId
)
{
ClueApiImpl
.
getInstance
()
.
getPlansCompareFeed
(
DioUtil
.
getInstance
().
getDio
(),
123
,
1
)
.
getPlansCompareFeed
(
DioUtil
.
getInstance
().
getDio
(),
_planId
,
_planType
)
.
listen
((
event
)
{
liveData
.
notifyView
(
event
);
})
...
...
lib/ClueModel/page/PlansCompareFeed/PlansCompareFeedPage.dart
View file @
abc54df5
...
...
@@ -5,6 +5,7 @@
**/
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_boost/flutter_boost.dart'
;
import
'package:gm_flutter/ClueModel/page/PlansCompareFeed/PlansCompareFeedModel.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlansCompareFeed.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
...
...
@@ -14,6 +15,11 @@ import 'CallBackCompareItem.dart';
import
'PlansCompareFeedItemView.dart'
;
class
PlansCompareFeedPage
extends
StatefulWidget
{
int
_planType
;
int
_planId
;
PlansCompareFeedPage
(
this
.
_planType
,
this
.
_planId
);
@override
State
<
StatefulWidget
>
createState
()
=>
_PlansCompareFeedState
();
}
...
...
@@ -28,7 +34,7 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
void
initState
()
{
super
.
initState
();
_model
=
new
PlansCompareFeedModel
();
_model
.
init
();
_model
.
init
(
widget
.
_planType
,
widget
.
_planId
);
_compareColor
=
Color
(
0xFFCCCCCC
);
_setCompare
=
Set
();
}
...
...
@@ -101,7 +107,9 @@ class _PlansCompareFeedState extends BaseState<PlansCompareFeedPage>
onClickCompare
()
{
if
(
_compareColor
==
Color
(
0xFFCCCCCC
))
return
;
setState
(()
{
print
(
"onClickCompare=====_compareColor
$_compareColor
"
);
Map
<
String
,
dynamic
>
map
=
{};
map
[
"ids"
]
=
_setCompare
;
FlutterBoost
.
singleton
.
open
(
"sample"
,
urlParams:
map
);
});
}
...
...
lib/ClueModel/page/ProjectDetails/ProjectDetailsModel.dart
View file @
abc54df5
...
...
@@ -16,9 +16,9 @@ class ProjectDetailsModel extends BaseModel {
LiveData
<
ProjectDetailsItem
>
liveData
=
LiveData
();
RxDispose
rxDispose
=
RxDispose
();
void
init
()
{
void
init
(
int
_planId
)
{
ClueApiImpl
.
getInstance
()
.
getProjectDetails
(
DioUtil
.
getInstance
().
getDio
(),
123
)
.
getProjectDetails
(
DioUtil
.
getInstance
().
getDio
(),
_planId
)
.
listen
((
event
)
{
liveData
.
notifyView
(
event
);
})
...
...
lib/ClueModel/page/ProjectDetails/ProjectDetailsPage.dart
View file @
abc54df5
...
...
@@ -13,6 +13,10 @@ import 'package:gm_flutter/commonModel/base/BaseState.dart';
import
'../../server/entity/ProjectDetailsItem.dart'
;
class
ProjectDetailsPage
extends
StatefulWidget
{
int
_planId
;
ProjectDetailsPage
(
this
.
_planId
);
@override
State
<
StatefulWidget
>
createState
()
=>
_ProjectDetailsState
();
}
...
...
@@ -24,7 +28,7 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
void
initState
()
{
super
.
initState
();
_model
=
new
ProjectDetailsModel
();
_model
.
init
();
_model
.
init
(
widget
.
_planId
);
}
@override
...
...
@@ -58,12 +62,24 @@ class _ProjectDetailsState extends BaseState<ProjectDetailsPage> {
}
ProjectDetailsItem
item
=
data
.
data
;
if
(
item
==
null
||
item
.
data
==
null
||
item
.
data
.
groups
==
null
)
{
return
emptyItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
);
return
emptyItem
(
MediaQuery
.
of
(
context
)
.
size
.
width
,
MediaQuery
.
of
(
context
)
.
size
.
height
);
}
if
(
item
.
error
!=
0
)
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{});
return
errorItem
(
MediaQuery
.
of
(
context
)
.
size
.
width
,
MediaQuery
.
of
(
context
)
.
size
.
height
,
()
{});
}
return
ListView
.
builder
(
itemCount:
item
.
data
.
groups
.
length
,
...
...
lib/ClueModel/page/levelOne/LevelOnePage.dart
View file @
abc54df5
...
...
@@ -20,6 +20,7 @@ import 'package:gm_flutter/commonModel/base/BaseUtil.dart';
import
'package:gm_flutter/commonModel/eventbus/SimpleEventBus.dart'
;
import
'package:gm_flutter/commonModel/util/DartUtil.dart'
;
import
'package:gm_flutter/commonModel/view/baseRefreshIndicator.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
class
LevelOnePage
extends
StatefulWidget
{
...
...
@@ -40,14 +41,11 @@ class LevelOneState extends BaseState<LevelOnePage>
TabController
tabController
;
int
index
=
0
;
static
const
MethodChannel
_methodChannel
=
MethodChannel
(
'gm_method_channel'
);
int
index
=
0
;
@override
void
initState
()
{
super
.
initState
();
_methodChannel
.
invokeMethod
(
"WHAT "
,
"www"
);
_model
.
init
(()
{
_initTabBar
();
});
...
...
@@ -57,7 +55,8 @@ class LevelOneState extends BaseState<LevelOnePage>
if
(
tabController
!=
null
)
{
tabController
.
removeListener
(
tabControlerListener
);
}
tabController
=
TabController
(
initialIndex:
index
,
length:
_model
.
tabsList
.
length
,
vsync:
this
);
tabController
=
TabController
(
initialIndex:
index
,
length:
_model
.
tabsList
.
length
,
vsync:
this
);
tabController
.
addListener
(
tabControlerListener
);
setState
(()
{});
}
...
...
@@ -71,7 +70,6 @@ class LevelOneState extends BaseState<LevelOnePage>
super
.
dispose
();
}
void
tabControlerListener
()
{
if
(
index
!=
tabController
.
index
)
{
index
=
tabController
.
index
;
...
...
@@ -163,9 +161,10 @@ class LevelOneState extends BaseState<LevelOnePage>
List
<
Widget
>
list
=
[];
var
d
=
MediaQueryData
.
fromWindow
(
window
).
padding
.
top
;
for
(
int
i
=
0
;
i
<
_model
.
tabsList
.
length
;
i
++)
{
list
.
add
(
extend
.
NestedScrollViewInnerScrollPositionKeyWidget
(
Key
(
"Tab
${i}
"
),
LevelOneList
(
planId
,
_model
.
tabsList
[
i
].
tabType
,
kToolbarHeight
+
d
))
);
list
.
add
(
extend
.
NestedScrollViewInnerScrollPositionKeyWidget
(
Key
(
"Tab
${i}
"
),
LevelOneList
(
planId
,
_model
.
tabsList
[
i
].
tabType
,
kToolbarHeight
+
d
)));
}
final
double
statusBarHeight
=
MediaQuery
.
of
(
context
).
padding
.
top
;
final
double
pinnedHeaderHeight
=
statusBarHeight
+
kToolbarHeight
;
...
...
@@ -356,6 +355,13 @@ class LevelOneState extends BaseState<LevelOnePage>
GestureDetector
(
onTap:
()
{
//TODO
Map
<
String
,
dynamic
>
map
=
{};
map
[
"page_name"
]
=
"plan_home"
;
map
[
"referrer_link"
]
=
[];
RouterCenterImpl
()
.
findMainRouter
()
.
buriedEvent
(
"on_click_navbar_search"
,
map
);
},
behavior:
HitTestBehavior
.
opaque
,
child:
baseText
(
"了解更多"
,
12
,
Color
(
0xff3FB5AF
)),
...
...
lib/ClueModel/server/api/ClueApi.dart
View file @
abc54df5
...
...
@@ -19,11 +19,11 @@ import 'package:gm_flutter/ClueModel/server/entity/DiscussLowPriceAuthBean.dart'
@ServiceCenter
()
abstract
class
ClueApi
{
@Get
(
"/api/janus/plans/plan_detail"
)
ProjectDetailsItem
getProjectDetails
(
@Query
(
"plan_id"
)
double
plan_id
);
ProjectDetailsItem
getProjectDetails
(
@Query
(
"plan_id"
)
int
plan_id
);
@Get
(
"/api/janus/plans/compare_feed"
)
PlansCompareFeed
getPlansCompareFeed
(
@Query
(
"plan_id"
)
double
plan_id
,
@Query
(
"plan_type"
)
double
plan_type
);
@Query
(
"plan_id"
)
int
plan_id
,
@Query
(
"plan_type"
)
int
plan_type
);
@Get
(
"api/janus/plans/plan_feed"
)
LevelOneFeedList
getLevelOneList
(
@Query
(
"plan_id"
)
int
plan_id
,
...
...
lib/ClueModel/server/api/ClueApi.serv.dart
View file @
abc54df5
...
...
@@ -41,7 +41,7 @@ class ClueApiImpl {
return
_instance
;
}
Stream
<
ProjectDetailsItem
>
getProjectDetails
(
Dio
_dio
,
double
plan_id
)
{
Stream
<
ProjectDetailsItem
>
getProjectDetails
(
Dio
_dio
,
int
plan_id
)
{
return
Stream
.
fromFuture
(
get
(
_dio
,
'/api/janus/plans/plan_detail'
,
data:
{
'plan_id'
:
plan_id
,
})).
flatMap
((
value
)
{
...
...
@@ -56,7 +56,7 @@ class ClueApiImpl {
}
Stream
<
PlansCompareFeed
>
getPlansCompareFeed
(
Dio
_dio
,
double
plan_id
,
double
plan_type
)
{
Dio
_dio
,
int
plan_id
,
int
plan_type
)
{
return
Stream
.
fromFuture
(
get
(
_dio
,
'/api/janus/plans/compare_feed'
,
data:
{
'plan_id'
:
plan_id
,
'plan_type'
:
plan_type
,
...
...
lib/DemoPage.dart
View file @
abc54df5
...
...
@@ -19,7 +19,6 @@ class DemoState extends State<DemoPage> {
@override
void
initState
()
{
super
.
initState
();
flutterChannel
.
invokeMethod
(
"method!!!"
,
"wwww"
);
}
@override
...
...
lib/MainRouter/MainRouter.dart
View file @
abc54df5
...
...
@@ -12,4 +12,6 @@ abstract class MainRouter extends RouterBaser {
void
init
();
Widget
getTestPage
();
void
buriedEvent
(
String
name
,
Map
<
String
,
dynamic
>
map
);
}
lib/MainRouter/MainRouterImpl.dart
View file @
abc54df5
...
...
@@ -18,4 +18,9 @@ class MainRouterImpl implements MainRouter {
Widget
getTestPage
()
{
return
TestPage
();
}
@override
void
buriedEvent
(
String
name
,
Map
<
String
,
dynamic
>
map
)
{
MainManager
.
getInstance
().
buriedEvent
(
name
,
map
);
}
}
lib/MainRouter/manager/MainManager.dart
View file @
abc54df5
...
...
@@ -7,7 +7,9 @@ import 'package:flutter_boost/flutter_boost.dart';
import
'package:gm_flutter/commonModel/base/BaseUtil.dart'
;
class
MainManager
{
MethodChannel
flutterChannel
;
EventChannel
flutterEvent
;
bool
isInit
=
false
;
MainManager
.
_
()
{}
...
...
@@ -21,9 +23,24 @@ class MainManager {
}
startInit
()
{
if
(
isInit
)
{
return
;
}
isInit
=
true
;
print
(
"LSY STATEINIT METHOD AND CHANNEL "
);
flutterChannel
=
MethodChannel
(
'gm_method_channel'
);
flutterEvent
=
EventChannel
(
'gm_method_event'
);
flutterEvent
.
receiveBroadcastStream
().
listen
((
data
)
{
print
(
"LSY FLUTTER EVENT
${data}
"
);
});
flutterChannel
.
invokeMethod
(
"WHAT "
,
"www"
);
}
void
buriedEvent
(
String
name
,
Map
<
String
,
dynamic
>
map
)
{
if
(!
isInit
)
{
return
;
}
if
(
flutterChannel
!=
null
)
{
flutterChannel
.
invokeMethod
(
"buried-
${name}
"
,
map
);
}
}
}
lib/commonModel/base/BaseUtil.dart
View file @
abc54df5
...
...
@@ -8,6 +8,4 @@ import 'dart:ui';
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
const
flutterChannel
=
const
MethodChannel
(
'gm_method_channel'
);
const
flutterEvent
=
const
EventChannel
(
'flutter_plugin_event'
);
const
bool
isDebug
=
!
const
bool
.
fromEnvironment
(
"dart.vm.product"
);
lib/main.dart
View file @
abc54df5
...
...
@@ -39,7 +39,6 @@ void main() {
SharedPreferences
.
getInstance
().
then
((
value
)
{
sharedPreferences
=
value
;
});
// RouterCenterImpl().findMainRouter().init();
},
(
Object
error
,
StackTrace
stack
)
{
//TODO
print
(
"lsy EEEEEE
${error.toString()}
${stack.toString()}
"
);
...
...
@@ -70,12 +69,7 @@ class MyApp extends State<MyAppWidget> {
.
addBoostContainerLifeCycleObserver
((
state
,
settings
)
{
print
(
"LSY
${state}
"
);
if
(
state
==
ContainerLifeCycle
.
Init
)
{
const
EventChannel
flutterEvent
=
const
EventChannel
(
'flutter_plugin_event'
);
flutterEvent
.
receiveBroadcastStream
().
listen
((
data
)
{
print
(
"LSY FLUTTER EVENT
${data}
"
);
});
MethodChannel
flutterChannel
=
const
MethodChannel
(
'gm_method_channel'
);
flutterChannel
.
invokeMethod
(
"FFINIT"
,
"Fff"
);
RouterCenterImpl
().
findMainRouter
().
init
();
}
});
// FlutterBoost.singleton.addBoostNavigatorObserver(TestBoostNavigatorObserver());
...
...
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