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
a8260add
Commit
a8260add
authored
Jun 30, 2020
by
杜欣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into featrue/duxin
# Conflicts: # lib/main.dart
parents
3a5d1c31
54cb8cd7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
101 additions
and
23 deletions
+101
-23
left_arrow.png
assets/left_arrow.png
+0
-0
LevelOneModel.dart
lib/ClueModel/page/levelOne/LevelOneModel.dart
+50
-12
LevelOnePage.dart
lib/ClueModel/page/levelOne/LevelOnePage.dart
+0
-0
MainRouter.dart
lib/MainRouter/MainRouter.dart
+2
-0
MainRouterImpl.dart
lib/MainRouter/MainRouterImpl.dart
+6
-0
TestPage.dart
lib/MainRouter/page/test/TestPage.dart
+4
-3
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+27
-6
main.dart
lib/main.dart
+12
-2
No files found.
assets/left_arrow.png
View replaced file @
3a5d1c31
View file @
a8260add
776 Bytes
|
W:
|
H:
992 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
lib/ClueModel/page/levelOne/LevelOneModel.dart
View file @
a8260add
...
...
@@ -2,6 +2,7 @@
* @author lsy
* @date 2020/6/29
**/
import
'package:flutter/material.dart'
;
import
'package:flutter_common/commonModel/live/BaseModel.dart'
;
import
'package:flutter_common/commonModel/live/LiveData.dart'
;
import
'package:gm_flutter/ClueModel/server/api/ClueApi.serv.dart'
;
...
...
@@ -18,27 +19,55 @@ class LevelOneModel extends BaseModel {
LiveData
<
bool
>
showTab
=
LiveData
();
LiveData
<
int
>
topIndexLive
=
new
LiveData
();
LiveData
<
double
>
topScrollLive
=
new
LiveData
();
LiveData
<
bool
>
loadingLive
=
LiveData
();
RxDispose
rxDispose
=
RxDispose
();
LiveData
<
Pair
<
int
,
List
<
Cards
>>>
cardsLive
=
LiveData
();
LiveData
<
Pair
<
int
,
List
<
Cards
>>>
cardsLive
=
LiveData
();
Map
<
int
,
List
<
Cards
>>
data
=
new
Map
();
List
list
=
[
"plan"
,
"hospital"
,
"doctor"
,
"diary"
];
List
pageList
=
[
1
,
1
,
1
,
1
];
List
pageHeightList
=
[
118
,
149
,
118
,
118
];
void
refreshView
(
bool
clear
,
{
RefreshController
refreshListener
})
{
int
index
=
currentIndex
;
if
(
clear
)
{
data
.
clear
();
pageList
=
[
1
,
1
,
1
,
1
];
}
ClueApiImpl
.
getInstance
()
.
getLevelOneList
(
DioUtil
.
getInstance
().
getDio
(),
123
,
list
[
index
],
pageList
[
index
])
.
listen
((
event
)
{
}).
addToDispose
(
rxDispose
).
onError
((
err
)
{
Future
.
delayed
(
Duration
(
seconds:
1
),
()
{
Cards
cards
=
Cards
(
cardType:
"plan"
,
plan:
Plan
(
planName:
"ww"
,
minPrice:
"50"
,
maxPrice:
"500"
));
List
<
Cards
>
a
=
[
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
cards
,
];
List
<
Cards
>
b
=
[
cards
];
print
(
"INDEX
${currentIndex}
"
);
if
(
currentIndex
==
1
)
{
data
[
currentIndex
]
=
b
;
}
else
{
data
[
currentIndex
]
=
a
;
}
cardsLive
.
notifyView
(
Pair
(
ENDLOADING
,
data
));
});
// int index = currentIndex;
// if (clear) {
// data.clear();
// pageList = [1, 1, 1, 1];
// }
// ClueApiImpl.getInstance()
// .getLevelOneList(
// DioUtil.getInstance().getDio(), 123, list[index], pageList[index])
// .listen((event) {})
// .addToDispose(rxDispose)
// .onError((err) {});
}
int
currentIndex
=
0
;
...
...
@@ -51,6 +80,7 @@ class LevelOneModel extends BaseModel {
rectLive
.
dispost
();
topIndexLive
.
dispost
();
topScrollLive
.
dispost
();
loadingLive
.
dispost
();
}
void
selectPage
(
int
index
)
{
...
...
@@ -58,5 +88,13 @@ class LevelOneModel extends BaseModel {
return
;
}
currentIndex
=
index
;
if
(
data
[
currentIndex
]
==
null
)
{
cardsLive
.
notifyView
(
Pair
(
LOADING
,
null
));
refreshView
(
true
);
}
else
{
cardsLive
.
notifyView
(
Pair
(
ENDLOADING
,
data
[
currentIndex
]));
}
}
void
loadMore
()
{}
}
lib/ClueModel/page/levelOne/LevelOnePage.dart
View file @
a8260add
This diff is collapsed.
Click to expand it.
lib/MainRouter/MainRouter.dart
View file @
a8260add
...
...
@@ -10,4 +10,6 @@ import 'MainRouterImpl.dart';
@Router
(
"MainRouter"
,
MainRouterImpl
,
true
)
abstract
class
MainRouter
extends
RouterBaser
{
void
init
();
Widget
getTestPage
();
}
lib/MainRouter/MainRouterImpl.dart
View file @
a8260add
...
...
@@ -4,6 +4,7 @@
**/
import
'package:flutter/src/widgets/framework.dart'
;
import
'package:gm_flutter/MainRouter/manager/MainManager.dart'
;
import
'package:gm_flutter/MainRouter/page/test/TestPage.dart'
;
import
'MainRouter.dart'
;
...
...
@@ -12,4 +13,9 @@ class MainRouterImpl implements MainRouter {
void
init
()
{
MainManager
.
getInstance
().
startInit
();
}
@override
Widget
getTestPage
()
{
return
TestPage
();
}
}
lib/MainRouter/page/test/TestPage.dart
View file @
a8260add
...
...
@@ -8,6 +8,7 @@ import 'package:flutter_common/commonModel/util/JumpUtil.dart';
import
'package:gm_flutter/MainRouter/page/proxy/NetProxyPage.dart'
;
import
'package:gm_flutter/commonModel/base/BaseComponent.dart'
;
import
'package:gm_flutter/commonModel/base/BaseState.dart'
;
import
'package:gm_flutter/main.mark.dart'
;
import
'TP.dart'
;
...
...
@@ -24,8 +25,8 @@ class TestState extends BaseState<TestPage> {
list
.
add
(
listItem
(
"设置代理页面"
,
()
{
JumpUtil
.
jumpToPageRight
(
context
,
NetProxyPage
());
}));
list
.
add
(
listItem
(
"
测试测试
"
,
()
{
JumpUtil
.
jumpToPageRight
(
context
,
TP
());
list
.
add
(
listItem
(
"
一级列表页
"
,
()
{
JumpUtil
.
jumpToPageRight
(
context
,
RouterCenterImpl
().
findClueRouter
().
getLevelOnePage
());
}));
return
list
;
}
...
...
@@ -40,7 +41,7 @@ class TestState extends BaseState<TestPage> {
Navigator
.
pop
(
context
);
}),
body:
Container
(
child:
Column
(
child:
ListView
(
children:
innerList
(),
),
),
...
...
lib/commonModel/base/BaseComponent.dart
View file @
a8260add
...
...
@@ -70,7 +70,7 @@ AppBar _baseAppBarChangeTitle(
width:
30
,
height:
30
,
child:
Image
.
asset
(
"
image
s/left_arrow.png"
,
"
asset
s/left_arrow.png"
,
color:
Color
(
0xff323232
),
),
))),
...
...
@@ -272,16 +272,17 @@ Widget baseRefreshView(RefreshController refreshController,
footer:
CustomFooter
(
builder:
(
BuildContext
context
,
LoadStatus
mode
)
{
Widget
body
;
// if (mode == LoadStatus.idle) {
// body = baseText("准备加载", 12, Color(0xff545454));
// } else
if
(
mode
==
LoadStatus
.
loading
)
{
print
(
"LOAD STATUE
${mode}
"
);
if
(
mode
==
LoadStatus
.
idle
)
{
body
=
baseText
(
"上拉加载更多"
,
12
,
Color
(
0xff545454
));
}
else
if
(
mode
==
LoadStatus
.
loading
)
{
body
=
baseText
(
"加载中"
,
12
,
Color
(
0xff545454
));
}
else
if
(
mode
==
LoadStatus
.
failed
)
{
body
=
baseText
(
"加载失败"
,
12
,
Color
(
0xff545454
));
}
else
if
(
mode
==
LoadStatus
.
noMore
)
{
body
=
baseText
(
"没有更多数据了"
,
12
,
Color
(
0xff545454
));
}
else
{
}
else
{
body
=
Container
();
}
return
Container
(
...
...
@@ -333,3 +334,23 @@ Widget normalRefreshHeader() {
},
);
}
Widget
emptyItem
(
{
String
detail
})
{
return
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Container
(
height:
210
,
width:
210
,
color:
Colors
.
red
,
),
Container
(
margin:
EdgeInsets
.
only
(
top:
8
),
child:
baseText
(
detail
==
null
?
"暂无消息,找人聊聊去"
:
detail
,
15
,
Color
(
0xff9B9B9B
)),
),
],
);
}
lib/main.dart
View file @
a8260add
...
...
@@ -69,9 +69,19 @@ class MyApp extends State<MyAppWidget> {
Widget
build
(
BuildContext
context
)
{
WindowUtil
.
setBarStatus
(
true
);
return
MaterialApp
(
theme:
ThemeData
(),
theme:
ThemeData
(
primaryColor:
Colors
.
white
,
cursorColor:
Color
(
0xff20BDBB
),
canvasColor:
Colors
.
white
),
builder:
FlutterBoost
.
init
(
postPush:
_onRoutePushed
),
home:
RouterCenterImpl
().
findClueRouter
().
getLevelTwoPage
());
home:
isDebug
?
RouterCenterImpl
().
findMainRouter
().
getTestPage
()
:
Container
(
color:
Colors
.
white
,
child:
Center
(
child:
loadingItem
(),
),
));
}
void
_onRoutePushed
(
...
...
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