Skip to content

Commit

Permalink
Player: improve Stop()
Browse files Browse the repository at this point in the history
  • Loading branch information
m0nac0 committed Dec 27, 2021
1 parent fc7a994 commit c43cebb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/compiler/parse_statement.dart
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,20 @@ class StatementParser {
return r(getPropertyDartName(instanceName, "Player"))
.property("play")([])
.statement;
} else if (methodName == "Pause" || methodName == "Stop") {
} else if (methodName == "Pause") {
return r(getPropertyDartName(instanceName, "Player"))
.property(methodName.toLowerCase())([])
.property("pause")([])
.statement;
} else if (methodName == "Stop") {
return r(getPropertyDartName(instanceName, "Player"))
.property("pause")([])
.property("then")([
Method((b) => b
..requiredParameters.add(Parameter((p) => p..name = "_"))
..body = r(getPropertyDartName(instanceName, "Player"))
.property("seek")([r("Duration").newInstance([])])
.statement).closure
])
.statement;
}
} else if (componentType == "Notifier") {
Expand Down

0 comments on commit c43cebb

Please sign in to comment.