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
2c32540d
Commit
2c32540d
authored
Jul 08, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
3e44d1a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
PlanModel.dart
lib/ClueModel/page/plan/PlanModel.dart
+24
-1
MainManager.dart
lib/MainRouter/manager/MainManager.dart
+2
-1
No files found.
lib/ClueModel/page/plan/PlanModel.dart
View file @
2c32540d
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
* @author lsy
* @author lsy
* @date 2020/6/30
* @date 2020/6/30
**/
**/
import
'dart:convert'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
...
@@ -12,11 +14,13 @@ import 'package:gm_flutter/ClueModel/server/entity/PlanBean.dart';
...
@@ -12,11 +14,13 @@ import 'package:gm_flutter/ClueModel/server/entity/PlanBean.dart';
import
'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart'
;
import
'package:gm_flutter/ClueModel/server/entity/PlanFeedBean.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/GMBase.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/bean/Pair.dart'
;
import
'package:gm_flutter/commonModel/cache/CacheManager.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/rx/RxDispose.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:gm_flutter/commonModel/util/PrintUtil.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
import
'package:pull_to_refresh/pull_to_refresh.dart'
;
class
PlanModel
extends
BaseModel
{
class
PlanModel
extends
BaseModel
{
final
String
PLAN_MODEL_BUFFER
=
"PLAN_MODEL_BUFFER"
;
LiveData
<
List
>
managerLive
=
new
LiveData
();
LiveData
<
List
>
managerLive
=
new
LiveData
();
LiveData
<
List
<
double
>>
posLive
=
new
LiveData
();
LiveData
<
List
<
double
>>
posLive
=
new
LiveData
();
LiveData
<
List
<
double
>>
backLive
=
new
LiveData
();
LiveData
<
List
<
double
>>
backLive
=
new
LiveData
();
...
@@ -47,6 +51,22 @@ class PlanModel extends BaseModel {
...
@@ -47,6 +51,22 @@ class PlanModel extends BaseModel {
int
sortPos
=
0
;
int
sortPos
=
0
;
void
init
({
VoidCallback
call
})
{
void
init
({
VoidCallback
call
})
{
if
(
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
PLAN_MODEL_BUFFER
)
!=
null
)
{
var
event
=
PlanBean
.
fromJson
(
json
.
decode
(
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
PLAN_MODEL_BUFFER
)));
projectData
=
event
.
data
.
tags
;
sortList
=
event
.
data
.
orders
;
picLive
.
notifyView
(
event
.
data
.
ranks
);
stateLive
.
notifyView
(
ENDLOADING
);
normalData
[
1
]
=
event
.
data
.
orders
[
0
].
name
;
managerLive
.
notifyView
(
normalData
);
if
(
call
!=
null
)
{
call
();
}
refreshFeed
(
true
);
return
;
}
ClueApiImpl
.
getInstance
()
ClueApiImpl
.
getInstance
()
.
getPlan
(
DioUtil
.
getInstance
().
getDio
())
.
getPlan
(
DioUtil
.
getInstance
().
getDio
())
.
listen
((
event
)
{
.
listen
((
event
)
{
...
@@ -61,6 +81,9 @@ class PlanModel extends BaseModel {
...
@@ -61,6 +81,9 @@ class PlanModel extends BaseModel {
call
();
call
();
}
}
refreshFeed
(
true
);
refreshFeed
(
true
);
CacheManager
.
getInstance
()
.
get
(
MEMORY_CACHE
)
.
save
(
PLAN_MODEL_BUFFER
,
json
.
encode
(
event
.
toJson
()));
}
else
{
}
else
{
stateLive
.
notifyView
(
FAIL
);
stateLive
.
notifyView
(
FAIL
);
NativeToast
.
showNativeToast
(
event
.
message
);
NativeToast
.
showNativeToast
(
event
.
message
);
...
@@ -149,7 +172,7 @@ class PlanModel extends BaseModel {
...
@@ -149,7 +172,7 @@ class PlanModel extends BaseModel {
}
}
sortPos
=
index
;
sortPos
=
index
;
order_by
=
sortList
[
index
].
id
.
toString
();
order_by
=
sortList
[
index
].
id
.
toString
();
normalData
[
1
]
=
"
${sortList[index].name}
"
;
normalData
[
1
]
=
"
${sortList[index].name}
"
;
managerLive
.
notifyView
(
normalData
);
managerLive
.
notifyView
(
normalData
);
feedsLive
.
notifyView
(
Pair
(
LOADING
,
null
));
feedsLive
.
notifyView
(
Pair
(
LOADING
,
null
));
refreshFeed
(
true
);
refreshFeed
(
true
);
...
...
lib/MainRouter/manager/MainManager.dart
View file @
2c32540d
...
@@ -116,7 +116,8 @@ class MainManager {
...
@@ -116,7 +116,8 @@ class MainManager {
if
(
flutterChannel
!=
null
)
{
if
(
flutterChannel
!=
null
)
{
var
data
=
await
flutterChannel
.
invokeMethod
(
"get_common_params"
);
var
data
=
await
flutterChannel
.
invokeMethod
(
"get_common_params"
);
if
(
data
is
Map
)
{
if
(
data
is
Map
)
{
initParams
(
data
);
var
map
=
Map
<
String
,
dynamic
>.
from
(
data
);
initParams
(
map
);
}
}
}
}
}
}
...
...
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