Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
9
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
DeepDaikon
Zoysii
Commits
3e49f849
Commit
3e49f849
authored
Jul 23, 2019
by
DeepDaikon
Browse files
Fix ranking
parent
db98468d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
lib/src/screens/ranking/ranking.dart
lib/src/screens/ranking/ranking.dart
+2
-2
lib/src/screens/ranking/resources/ranking_controller.dart
lib/src/screens/ranking/resources/ranking_controller.dart
+4
-4
No files found.
lib/src/screens/ranking/ranking.dart
View file @
3e49f849
...
...
@@ -39,11 +39,11 @@ class _RankingPageState extends State<RankingPage> {
},
itemBuilder:
(
BuildContext
context
)
=>
<
PopupMenuEntry
<
int
>>[
const
PopupMenuItem
<
int
>(
value:
3
,
value:
4
,
child:
Text
(
'Moves'
),
),
const
PopupMenuItem
<
int
>(
value:
4
,
value:
5
,
child:
Text
(
'Points'
),
),
]),
...
...
lib/src/screens/ranking/resources/ranking_controller.dart
View file @
3e49f849
...
...
@@ -2,14 +2,13 @@ import 'package:zoysii/src/resources/globals.dart';
int
sorter
=
4
;
int
filter
;
var
shownResults
=
results
.
where
((
result
)
=>
result
[
2
]
>=
0
).
toList
()
;
List
<
List
<
int
>>
shownResults
=
[]
;
// Sort ranking list
sortList
(
int
element
)
{
int
order
;
switch
(
element
)
{
case
3
:
order
=
1
;
break
;
case
4
:
order
=
-
1
;
break
;
case
5
:
order
=
-
1
;
break
;
default
:
order
=
1
;
break
;
}
shownResults
.
sort
((
n0
,
n1
)
=>
order
*
(
n0
[
element
]
-
n1
[
element
]));
...
...
@@ -17,5 +16,6 @@ sortList(int element) {
// Filter ranking list
filterList
(
int
size
)
{
shownResults
=
shownResults
.
where
((
result
)
=>
result
[
3
]
==
size
).
toList
();
shownResults
=
results
.
where
((
result
)
=>
result
[
3
]
==
size
&&
result
[
2
]
>=
0
).
toList
();
}
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