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
68bd27f1
Commit
68bd27f1
authored
Jul 08, 2020
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comit
parent
2c32540d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
9 deletions
+35
-9
FilterView.dart
lib/ClueModel/page/plan/FilterView.dart
+10
-2
PlanModel.dart
lib/ClueModel/page/plan/PlanModel.dart
+1
-0
PlanProgressBar.dart
lib/ClueModel/page/plan/PlanProgressBar.dart
+24
-7
No files found.
lib/ClueModel/page/plan/FilterView.dart
View file @
68bd27f1
...
@@ -15,9 +15,17 @@ class FilterView extends StatelessWidget {
...
@@ -15,9 +15,17 @@ class FilterView extends StatelessWidget {
int
min
=
0
;
int
min
=
0
;
int
max
=
0
;
int
max
=
0
;
PlanProgressBar
planProgressBar
;
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
planProgressBar
=
PlanProgressBar
(
0
,
5
,
0
,
10000
,
padding:
15
,
);
return
Container
(
return
Container
(
color:
Colors
.
white
,
color:
Colors
.
white
,
height:
186
,
height:
186
,
...
@@ -28,7 +36,7 @@ class FilterView extends StatelessWidget {
...
@@ -28,7 +36,7 @@ class FilterView extends StatelessWidget {
left:
0
,
left:
0
,
child:
Container
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
child:
PlanProgressBar
(
0
,
5
,
0
,
10000
,
padding:
15
,)
,
child:
planProgressBar
,
),
),
),
),
Positioned
(
Positioned
(
...
@@ -58,7 +66,7 @@ class FilterView extends StatelessWidget {
...
@@ -58,7 +66,7 @@ class FilterView extends StatelessWidget {
child:
baseText
(
"重置"
,
16
,
Color
(
0xff3FB5AF
)),
child:
baseText
(
"重置"
,
16
,
Color
(
0xff3FB5AF
)),
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
).
gestureDetector
(()
{
).
gestureDetector
(()
{
//TODO
planProgressBar
.
changeNotifier
.
notifyListeners
();
}),
}),
),
),
Expanded
(
Expanded
(
...
...
lib/ClueModel/page/plan/PlanModel.dart
View file @
68bd27f1
...
@@ -51,6 +51,7 @@ class PlanModel extends BaseModel {
...
@@ -51,6 +51,7 @@ class PlanModel extends BaseModel {
int
sortPos
=
0
;
int
sortPos
=
0
;
void
init
({
VoidCallback
call
})
{
void
init
({
VoidCallback
call
})
{
print
(
"LSY PLANMODEL IIIIIINT "
);
if
(
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
PLAN_MODEL_BUFFER
)
!=
if
(
CacheManager
.
getInstance
().
get
(
MEMORY_CACHE
).
get
(
PLAN_MODEL_BUFFER
)
!=
null
)
{
null
)
{
var
event
=
PlanBean
.
fromJson
(
json
.
decode
(
var
event
=
PlanBean
.
fromJson
(
json
.
decode
(
...
...
lib/ClueModel/page/plan/PlanProgressBar.dart
View file @
68bd27f1
...
@@ -12,6 +12,7 @@ class PlanProgressBar extends StatefulWidget {
...
@@ -12,6 +12,7 @@ class PlanProgressBar extends StatefulWidget {
int
maxlow
;
int
maxlow
;
int
maxHigh
;
int
maxHigh
;
int
padding
;
int
padding
;
ChangeNotifier
changeNotifier
;
PlanProgressBar
(
this
.
low
,
this
.
high
,
this
.
maxlow
,
this
.
maxHigh
,
PlanProgressBar
(
this
.
low
,
this
.
high
,
this
.
maxlow
,
this
.
maxHigh
,
{
this
.
padding
});
{
this
.
padding
});
...
@@ -32,8 +33,6 @@ class PlanProgressBarState extends State<PlanProgressBar> {
...
@@ -32,8 +33,6 @@ class PlanProgressBarState extends State<PlanProgressBar> {
double
scrollDistance
;
double
scrollDistance
;
double
leftPos
;
double
textLeft
=
-
1
;
double
textLeft
=
-
1
;
bool
isLeftMove
=
true
;
bool
isLeftMove
=
true
;
...
@@ -41,6 +40,18 @@ class PlanProgressBarState extends State<PlanProgressBar> {
...
@@ -41,6 +40,18 @@ class PlanProgressBarState extends State<PlanProgressBar> {
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
distance
=
widget
.
maxHigh
-
widget
.
maxlow
-
0.0
;
distance
=
widget
.
maxHigh
-
widget
.
maxlow
-
0.0
;
widget
.
changeNotifier
=
ChangeNotifier
();
init
();
if
(
widget
.
changeNotifier
!=
null
&&
!
widget
.
changeNotifier
.
hasListeners
)
{
widget
.
changeNotifier
.
addListener
(()
{
print
(
"HHH"
);
init
();
setState
(()
{});
});
}
}
void
init
()
{
leftStarPosPercent
=
(
widget
.
low
/
distance
);
leftStarPosPercent
=
(
widget
.
low
/
distance
);
leftPosTempPercent
=
leftStarPosPercent
;
leftPosTempPercent
=
leftStarPosPercent
;
...
@@ -48,6 +59,12 @@ class PlanProgressBarState extends State<PlanProgressBar> {
...
@@ -48,6 +59,12 @@ class PlanProgressBarState extends State<PlanProgressBar> {
rightPosTempPercent
=
rightStarPosPercent
;
rightPosTempPercent
=
rightStarPosPercent
;
}
}
@override
void
dispose
()
{
widget
.
changeNotifier
.
dispose
();
super
.
dispose
();
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
double
totle
=
MediaQuery
.
of
(
context
).
size
.
width
-
widget
.
padding
*
2
;
double
totle
=
MediaQuery
.
of
(
context
).
size
.
width
-
widget
.
padding
*
2
;
...
@@ -58,7 +75,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
...
@@ -58,7 +75,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
.
toInt
();
.
toInt
();
String
textStr
=
"¥
${textInt}
"
;
String
textStr
=
"¥
${textInt}
"
;
double
textWidth
=
textStr
.
length
*
12.0
;
double
textWidth
=
textStr
.
length
*
12.0
;
double
textL
=
textLeft
*
totle
-
textWidth
/
2
+
9
;
double
textL
=
textLeft
*
totle
-
textWidth
/
2
+
9
;
// if (textL < 0) {
// if (textL < 0) {
...
@@ -83,7 +100,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
...
@@ -83,7 +100,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
),
),
),
),
Positioned
(
Positioned
(
left:
leftPosTempPercent
*
totle
+
5
+
15
,
left:
leftPosTempPercent
*
totle
+
5
+
15
,
bottom:
7.5
,
bottom:
7.5
,
child:
Container
(
child:
Container
(
height:
4
,
height:
4
,
...
@@ -92,7 +109,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
...
@@ -92,7 +109,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
),
),
),
),
Positioned
(
Positioned
(
left:
textL
+
11
,
left:
textL
+
11
,
bottom:
23
,
bottom:
23
,
child:
Visibility
(
child:
Visibility
(
visible:
true
,
visible:
true
,
...
@@ -136,7 +153,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
...
@@ -136,7 +153,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
),
),
Positioned
(
Positioned
(
bottom:
0
,
bottom:
0
,
left:
leftPosTempPercent
*
totle
+
11
,
left:
leftPosTempPercent
*
totle
+
11
,
child:
Listener
(
child:
Listener
(
onPointerDown:
(
p
)
{
onPointerDown:
(
p
)
{
leftDowPos
=
p
.
localPosition
.
dx
;
leftDowPos
=
p
.
localPosition
.
dx
;
...
@@ -170,7 +187,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
...
@@ -170,7 +187,7 @@ class PlanProgressBarState extends State<PlanProgressBar> {
)),
)),
Positioned
(
Positioned
(
bottom:
0
,
bottom:
0
,
left:
rightPosTempPercent
*
totle
+
11
,
left:
rightPosTempPercent
*
totle
+
11
,
child:
Listener
(
child:
Listener
(
onPointerDown:
(
p
)
{
onPointerDown:
(
p
)
{
rightDowPos
=
p
.
localPosition
.
dx
;
rightDowPos
=
p
.
localPosition
.
dx
;
...
...
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