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
bec8036f
Commit
bec8036f
authored
Jul 02, 2020
by
朱璇
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of git.wanmeizhensuo.com:linshengyu/gm_flutter into zx/gmFlutter
parents
d8041060
59af1797
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
120 additions
and
84 deletions
+120
-84
empty.png
assets/empty.png
+0
-0
triangle.png
assets/triangle.png
+0
-0
LevelOnePage.dart
lib/ClueModel/page/levelOne/LevelOnePage.dart
+6
-8
PlanPage.dart
lib/ClueModel/page/plan/PlanPage.dart
+11
-10
PlanProgressBar.dart
lib/ClueModel/page/plan/PlanProgressBar.dart
+8
-5
BaseComponent.dart
lib/commonModel/base/BaseComponent.dart
+87
-61
pubspec.lock
pubspec.lock
+7
-0
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
assets/empty.png
0 → 100644
View file @
bec8036f
73.7 KB
assets/triangle.png
0 → 100644
View file @
bec8036f
504 Bytes
lib/ClueModel/page/levelOne/LevelOnePage.dart
View file @
bec8036f
...
...
@@ -42,10 +42,10 @@ class LevelOneState extends BaseState<LevelOnePage>
@override
void
initState
()
{
super
.
initState
();
Future
.
delayed
(
Duration
(
seconds:
3
),
()
{
_model
.
loadingLive
.
notifyView
(
false
);
_model
.
refreshView
(
true
);
});
//
Future.delayed(Duration(seconds: 3), () {
//
_model.loadingLive.notifyView(false);
//
_model.refreshView(true);
//
});
pageController
.
addListener
(()
{
if
(
screenWidth
!=
null
)
{
_model
.
topScrollLive
.
notifyView
(
...
...
@@ -121,8 +121,6 @@ class LevelOneState extends BaseState<LevelOnePage>
}
},
)));
}
Widget
home
()
{
...
...
@@ -492,7 +490,7 @@ class LevelOneState extends BaseState<LevelOnePage>
child:
PageView
.
builder
(
itemBuilder:
(
c
,
pageIndex
)
{
if
(
data
.
data
.
first
==
FAIL
)
{
return
errorItem
(()
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
height
,
()
{
_model
.
refreshView
(
true
);
});
}
...
...
@@ -502,7 +500,7 @@ class LevelOneState extends BaseState<LevelOnePage>
}
if
(
data
.
data
.
second
.
length
==
0
)
{
if
(
_model
.
pageList
[
pageIndex
]
==
1
)
{
return
emptyItem
();
return
emptyItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
height
);
}
else
{
_refreshController
.
loadNoData
();
}
...
...
lib/ClueModel/page/plan/PlanPage.dart
View file @
bec8036f
...
...
@@ -185,7 +185,8 @@ class PlanState extends BaseState<PlanPage> {
width:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
272
,
listener:
sortMenuListener
,
child:
SortView
(
_model
.
sortList
,
_model
.
sortPos
,
(
index
)
{
child:
SortView
(
_model
.
sortList
,
_model
.
sortPos
,
(
index
)
{
clickIndexOther
(
1
);
_model
.
sortClick
(
index
);
}),
...
...
@@ -207,7 +208,7 @@ class PlanState extends BaseState<PlanPage> {
listener:
filterMenuListener
,
child:
FilterView
((
max
,
min
)
{
clickIndexOther
(
2
);
_model
.
filterClick
(
max
,
min
);
_model
.
filterClick
(
max
,
min
);
}),
proListener:
(
pro
)
{
_model
.
backProgress
(
pro
,
2
);
...
...
@@ -232,14 +233,13 @@ class PlanState extends BaseState<PlanPage> {
child:
loadingItem
(),
);
}
else
if
(
data
.
data
==
FAIL
)
{
return
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
color:
Colors
.
white
,
child:
errorItem
(()
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
MediaQuery
.
of
(
context
).
size
.
height
,
()
{
_model
.
stateLive
.
notifyView
(
LOADING
);
_model
.
init
();
}
)
,
},
);
}
else
{
return
Container
(
...
...
@@ -455,7 +455,8 @@ class PlanState extends BaseState<PlanPage> {
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
c
,
index
)
{
if
(
data
.
data
.
first
==
FAIL
)
{
return
errorItem
(()
{
return
errorItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
height
,
()
{
_model
.
refreshFeed
(
true
);
});
}
...
...
@@ -464,7 +465,7 @@ class PlanState extends BaseState<PlanPage> {
}
if
(
data
.
data
.
second
.
length
==
0
)
{
if
(
_model
.
page
==
1
)
{
return
emptyItem
();
return
emptyItem
(
MediaQuery
.
of
(
context
).
size
.
width
,
height
);
}
else
{
refreshController
.
loadNoData
();
}
...
...
lib/ClueModel/page/plan/PlanProgressBar.dart
View file @
bec8036f
...
...
@@ -93,10 +93,14 @@ class PlanProgressBarState extends State<PlanProgressBar> {
height:
42
,
color:
Color
(
0x66000000
),
alignment:
Alignment
.
center
,
child:
baseText
(
"
${(widget.maxlow + (isLeftMove?leftPosTempPercent:rightPosTempPercent+0.03) * distance).toInt()}
"
,
13
,
Colors
.
white
),
child:
Column
(
children:
<
Widget
>[
baseText
(
"
${(widget.maxlow + (isLeftMove?leftPosTempPercent:rightPosTempPercent+0.03) * distance).toInt()}
"
,
13
,
Colors
.
white
)
],
),
),
),
),
...
...
@@ -144,7 +148,6 @@ class PlanProgressBarState extends State<PlanProgressBar> {
},
onPointerMove:
(
p
)
{
var
d
=
p
.
localPosition
.
dx
-
rightDowPos
;
print
(
"D
${d}
"
);
rightPosTempPercent
=
rightStarPosPercent
+
(
d
/
totle
);
if
(
rightPosTempPercent
<
leftPosTempPercent
+
scrollDistance
)
{
...
...
lib/commonModel/base/BaseComponent.dart
View file @
bec8036f
...
...
@@ -3,6 +3,7 @@
* @date 2019-10-13
**/
import
'package:app_settings/app_settings.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
...
...
@@ -138,56 +139,72 @@ Widget loadingItem({bool needBackground = false}) {
Widget
netErrorItem
(
)
{}
Widget
errorItem
(
VoidCallback
retry
,
{
String
errorText
,
String
retryText
})
{
Widget
errorItem
(
double
width
,
double
height
,
VoidCallback
retry
,
{
String
errorText
,
String
retryText
})
{
return
Container
(
width:
SCREENWIDTH
,
height:
SCREENHEIGHT
,
width:
width
,
height:
height
,
color:
Colors
.
white
,
alignment:
Alignment
.
c
enter
,
alignment:
Alignment
.
topC
enter
,
child:
Container
(
height:
SCREENHEIGHT
,
child:
Container
(
margin:
EdgeInsets
.
only
(
top:
70
),
width:
175
,
height:
249
,
child:
Stack
(
children:
<
Widget
>[
Positioned
(
left:
0
,
top:
0
,
child:
Container
(
width:
175
,
height:
199
,
child:
Image
.
asset
(
"assets/error.png"
),
),
),
Positioned
(
left:
0
,
top:
166
,
child:
Container
(
width:
175
,
alignment:
Alignment
.
center
,
child:
baseText
(
errorText
??
"网络错误"
,
15
,
Color
(
0xff666666
)),
),
),
Positioned
(
top:
216
,
left:
12
,
child:
Container
(
width:
150
,
height:
33
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
22.5
),
color:
Color
(
0xff51CDC7
)),
alignment:
Alignment
.
center
,
child:
baseText
(
retryText
??
"重新加载"
,
16
,
Colors
.
white
),
).
gestureDetector
(()
{
retry
();
}),
)
],
width:
180
,
height:
315.5
,
margin:
EdgeInsets
.
only
(
top:
62
),
child:
Stack
(
alignment:
AlignmentDirectional
.
center
,
children:
<
Widget
>[
Positioned
(
left:
0
,
top:
0
,
child:
Container
(
width:
180
,
height:
186.5
,
child:
Image
.
asset
(
"assets/error.png"
),
),
),
Positioned
(
top:
166
,
child:
Container
(
width:
180
,
alignment:
Alignment
.
center
,
child:
baseText
(
errorText
??
"原谅我一看到美人就不淡定"
,
15
,
Color
(
0xff666666
)),
),
),
)));
Positioned
(
bottom:
60
,
child:
Container
(
width:
150
,
height:
40
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
20
),
gradient:
LinearGradient
(
colors:
[
Color
(
0xFFFF5963
),
Color
(
0xffFF7096
)],
begin:
FractionalOffset
(
1
,
0
),
end:
FractionalOffset
(
0
,
1
))),
alignment:
Alignment
.
center
,
child:
baseText
(
retryText
??
"重新加载"
,
16
,
Colors
.
white
),
).
gestureDetector
(()
{
retry
();
}),
),
Positioned
(
bottom:
0
,
child:
Container
(
width:
150
,
height:
40
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
20
),
border:
Border
.
all
(
color:
Color
(
0xffFF5963
),
width:
0.5
)),
alignment:
Alignment
.
center
,
child:
baseText
(
"检查网络设置"
,
16
,
Color
(
0xffFF5963
)),
).
gestureDetector
(()
{
AppSettings
.
openWIFISettings
();
}),
)
],
),
));
}
//TODO
...
...
@@ -352,21 +369,30 @@ 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
)),
Widget
emptyItem
(
double
width
,
double
height
,
{
String
detail
})
{
return
Container
(
width:
width
,
height:
height
,
color:
Colors
.
white
,
alignment:
Alignment
.
topCenter
,
child:
Container
(
width:
175
,
height:
188
,
margin:
EdgeInsets
.
only
(
top:
62.5
),
child:
Stack
(
alignment:
AlignmentDirectional
.
bottomCenter
,
children:
<
Widget
>[
Container
(
width:
175
,
height:
188
,
child:
Image
.
asset
(
"assets/empty.png"
),
),
Positioned
(
bottom:
17
,
child:
baseText
(
detail
??
"此处太寂寥,转转别处吧"
,
15
,
Color
(
0xff666666
)),
)
],
),
]
,
)
,
);
}
pubspec.lock
View file @
bec8036f
...
...
@@ -15,6 +15,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.39.10"
app_settings:
dependency: "direct main"
description:
name: app_settings
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.1+1"
archive:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
bec8036f
...
...
@@ -32,6 +32,7 @@ dependencies:
#轻量级存储
shared_preferences
:
^0.5.7+1
lottie
:
^0.4.0+1
app_settings
:
^4.0.1+1
dev_dependencies
:
...
...
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