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
8c323111
Commit
8c323111
authored
Jul 02, 2020
by
杜欣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' into featrue/duxin
parents
59341041
a5a10489
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
24 deletions
+83
-24
FilterView.dart
lib/ClueModel/page/plan/FilterView.dart
+3
-3
PlanProgressBar.dart
lib/ClueModel/page/plan/PlanProgressBar.dart
+80
-21
No files found.
lib/ClueModel/page/plan/FilterView.dart
View file @
8c323111
...
...
@@ -25,10 +25,10 @@ class FilterView extends StatelessWidget {
children:
<
Widget
>[
Positioned
(
bottom:
74.5
,
left:
15
,
left:
0
,
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
30
,
child:
PlanProgressBar
(
0
,
5
,
0
,
10
,
padding:
15
,),
width:
MediaQuery
.
of
(
context
).
size
.
width
,
child:
PlanProgressBar
(
0
,
5
,
0
,
10
000
,
padding:
15
,),
),
),
Positioned
(
...
...
lib/ClueModel/page/plan/PlanProgressBar.dart
View file @
8c323111
...
...
@@ -50,14 +50,22 @@ class PlanProgressBarState extends State<PlanProgressBar> {
@override
Widget
build
(
BuildContext
context
)
{
double
totle
=
MediaQuery
.
of
(
context
).
size
.
width
-
widget
.
padding
*
2
-
8
;
double
totle
=
MediaQuery
.
of
(
context
).
size
.
width
-
widget
.
padding
*
2
;
scrollDistance
=
0.05
;
double
textL
=
textLeft
*
totle
-
67.5
/
2
+
9
;
if
(
textL
<
0
)
{
textL
=
0
;
}
else
if
(
textL
+
67.5
>
totle
)
{
textL
=
totle
-
67.5
;
}
int
textInt
=
(
widget
.
maxlow
+
(
isLeftMove
?
leftPosTempPercent
:
rightPosTempPercent
+
0.03
)
*
distance
)
.
toInt
();
String
textStr
=
"¥
${textInt}
"
;
double
textWidth
=
textStr
.
length
*
12.0
;
double
textL
=
textLeft
*
totle
-
textWidth
/
2
+
9
;
// if (textL < 0) {
// textL = 0;
// } else if (textL + textWidth > totle) {
// textL = totle - textWidth;
// }
return
Container
(
width:
double
.
maxFinite
,
height:
65
,
...
...
@@ -65,7 +73,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
children:
<
Widget
>[
Positioned
(
bottom:
7.5
,
left:
4
,
left:
15
,
child:
Container
(
width:
totle
,
height:
4
,
...
...
@@ -75,7 +83,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
),
),
Positioned
(
left:
leftPosTempPercent
*
totle
+
5
,
left:
leftPosTempPercent
*
totle
+
5
+
15
,
bottom:
7.5
,
child:
Container
(
height:
4
,
...
...
@@ -84,21 +92,43 @@ class PlanProgressBarState extends State<PlanProgressBar> {
),
),
Positioned
(
left:
textL
,
left:
textL
+
11
,
bottom:
23
,
child:
Visibility
(
visible:
textLeft
>=
0
,
visible:
true
,
// textLeft >= 0
child:
Container
(
width:
67.5
,
width:
textWidth
,
height:
42
,
color:
Color
(
0x66000000
),
alignment:
Alignment
.
center
,
child:
Column
(
child:
Stack
(
alignment:
AlignmentDirectional
.
topCenter
,
children:
<
Widget
>[
baseText
(
"
${(widget.maxlow + (isLeftMove?leftPosTempPercent:rightPosTempPercent+0.03) * distance).toInt()}
"
,
13
,
Colors
.
white
)
Container
(
width:
textWidth
,
height:
37
,
decoration:
BoxDecoration
(
color:
Color
(
0x99000000
),
borderRadius:
BorderRadius
.
circular
(
6
),
),
),
Positioned
(
top:
36.9
,
child:
Container
(
width:
9
,
height:
5
,
child:
CustomPaint
(
painter:
TrianglePainter
(
Color
(
0x99000000
)),
),
),
),
Positioned
(
top:
12
,
child:
Container
(
width:
textWidth
,
alignment:
Alignment
.
topCenter
,
child:
baseText
(
textStr
,
13
,
Colors
.
white
),
),
)
],
),
),
...
...
@@ -106,7 +136,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
),
Positioned
(
bottom:
0
,
left:
leftPosTempPercent
*
totle
,
left:
leftPosTempPercent
*
totle
+
11
,
child:
Listener
(
onPointerDown:
(
p
)
{
leftDowPos
=
p
.
localPosition
.
dx
;
...
...
@@ -140,7 +170,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
)),
Positioned
(
bottom:
0
,
left:
rightPosTempPercent
*
totle
,
left:
rightPosTempPercent
*
totle
+
11
,
child:
Listener
(
onPointerDown:
(
p
)
{
rightDowPos
=
p
.
localPosition
.
dx
;
...
...
@@ -177,3 +207,32 @@ class PlanProgressBarState extends State<PlanProgressBar> {
);
}
}
class
TrianglePainter
extends
CustomPainter
{
Color
color
;
//填充颜色
Paint
_paint
;
//画笔
Path
_path
;
//绘制路径
double
angle
;
//角度
TrianglePainter
(
this
.
color
)
{
_paint
=
Paint
()
..
color
=
color
..
isAntiAlias
=
true
;
_path
=
Path
();
}
@override
void
paint
(
Canvas
canvas
,
Size
size
)
{
final
baseX
=
size
.
width
;
final
baseY
=
size
.
height
;
_path
.
moveTo
(
0
,
0
);
_path
.
lineTo
(
baseX
/
2
,
baseY
);
_path
.
lineTo
(
baseX
,
0
);
canvas
.
drawPath
(
_path
,
_paint
);
}
@override
bool
shouldRepaint
(
CustomPainter
oldDelegate
)
{
return
false
;
}
}
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