Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
Flutter App for Memri
Commits
7dad38cb
Commit
7dad38cb
authored
4 years ago
by
Amirjanyan
Browse files
Options
Download
Email Patches
Plain Diff
To next/previous item actions
parent
b4b0b404
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/MemriApp/CVU/actions/CVUAction.dart
+38
-0
lib/MemriApp/CVU/actions/CVUAction.dart
with
38 additions
and
0 deletions
+38
-0
lib/MemriApp/CVU/actions/CVUAction.dart
+
38
-
0
View file @
7dad38cb
...
...
@@ -118,6 +118,10 @@ CVUAction Function({Map<String, CVUValue>? vars})? cvuAction(String named) {
return
({
Map
?
vars
})
=
>
CVUActionSelectAll
(
vars:
vars
);
case
"deselectall"
:
return
({
Map
?
vars
})
=
>
CVUActionDeselectAll
(
vars:
vars
);
case
"tonextitem"
:
return
({
Map
?
vars
})
=
>
CVUActionToNextItem
(
vars:
vars
);
case
"topreviousitem"
:
return
({
Map
?
vars
})
=
>
CVUActionToPreviousItem
(
vars:
vars
);
default
:
return
null
;
}
...
...
@@ -839,6 +843,40 @@ class CVUActionSetSetting extends CVUAction {
}
}
class
CVUActionToNextItem
extends
CVUAction
{
Map
<
String
,
CVUValue
>
vars
;
CVUActionToNextItem
({
vars
})
:
this
.
vars
=
vars
??
{};
@override
void
execute
(
SceneController
sceneController
,
CVUContext
context
)
{
if
(
sceneController
.
topMostContext
==
null
)
{
return
;
}
var
index
=
sceneController
.
topMostContext
!.
focusedIndex
;
sceneController
.
topMostContext
?.
focusedIndex
=
index
<
=
0
?
sceneController
.
topMostContext
!.
items
.
length
-
1
:
index
-
1
;
sceneController
.
scheduleUIUpdate
();
}
}
class
CVUActionToPreviousItem
extends
CVUAction
{
Map
<
String
,
CVUValue
>
vars
;
CVUActionToPreviousItem
({
vars
})
:
this
.
vars
=
vars
??
{};
@override
void
execute
(
SceneController
sceneController
,
CVUContext
context
)
{
if
(
sceneController
.
topMostContext
==
null
)
{
return
;
}
var
index
=
sceneController
.
topMostContext
!.
focusedIndex
;
sceneController
.
topMostContext
?.
focusedIndex
=
index
>
=
sceneController
.
topMostContext
!.
items
.
length
-
1
?
0
:
index
+
1
;
sceneController
.
scheduleUIUpdate
();
}
}
class
CVUActionNoop
extends
CVUAction
{
Map
<
String
,
CVUValue
>
vars
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets