This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8dd53c
commit afd369e
Showing
6 changed files
with
126 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
wakelock/android/src/main/java/creativemaybeno/wakelock/Messages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
// Autogenerated from Pigeon (v0.1.14), do not edit directly. | ||
// See also: https://pub.dev/packages/pigeon | ||
|
||
package creativemaybeno.wakelock; | ||
|
||
import io.flutter.plugin.common.BasicMessageChannel; | ||
import io.flutter.plugin.common.BinaryMessenger; | ||
import io.flutter.plugin.common.StandardMessageCodec; | ||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
|
||
/** Generated class from Pigeon. */ | ||
@SuppressWarnings("unused") | ||
public class Messages { | ||
|
||
/** Generated class from Pigeon that represents data sent in messages. */ | ||
public static class ToggleMessage { | ||
private Boolean enable; | ||
public Boolean getEnable() { return enable; } | ||
public void setEnable(Boolean setterArg) { this.enable = setterArg; } | ||
|
||
HashMap toMap() { | ||
HashMap<String, Object> toMapResult = new HashMap<>(); | ||
toMapResult.put("enable", enable); | ||
return toMapResult; | ||
} | ||
static ToggleMessage fromMap(HashMap map) { | ||
ToggleMessage fromMapResult = new ToggleMessage(); | ||
Object enable = map.get("enable"); | ||
fromMapResult.enable = (Boolean)enable; | ||
return fromMapResult; | ||
} | ||
} | ||
|
||
/** Generated class from Pigeon that represents data sent in messages. */ | ||
public static class IsEnabledMessage { | ||
private Boolean enabled; | ||
public Boolean getEnabled() { return enabled; } | ||
public void setEnabled(Boolean setterArg) { this.enabled = setterArg; } | ||
|
||
HashMap toMap() { | ||
HashMap<String, Object> toMapResult = new HashMap<>(); | ||
toMapResult.put("enabled", enabled); | ||
return toMapResult; | ||
} | ||
static IsEnabledMessage fromMap(HashMap map) { | ||
IsEnabledMessage fromMapResult = new IsEnabledMessage(); | ||
Object enabled = map.get("enabled"); | ||
fromMapResult.enabled = (Boolean)enabled; | ||
return fromMapResult; | ||
} | ||
} | ||
|
||
/** Generated interface from Pigeon that represents a handler of messages from Flutter.*/ | ||
public interface WakelockApi { | ||
void toggle(ToggleMessage arg); | ||
IsEnabledMessage isEnabled(); | ||
|
||
/** Sets up an instance of `WakelockApi` to handle messages through the `binaryMessenger` */ | ||
static void setup(BinaryMessenger binaryMessenger, WakelockApi api) { | ||
{ | ||
BasicMessageChannel<Object> channel = | ||
new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.WakelockApi.toggle", new StandardMessageCodec()); | ||
if (api != null) { | ||
channel.setMessageHandler((message, reply) -> { | ||
HashMap<String, HashMap> wrapped = new HashMap<>(); | ||
try { | ||
@SuppressWarnings("ConstantConditions") | ||
ToggleMessage input = ToggleMessage.fromMap((HashMap)message); | ||
api.toggle(input); | ||
wrapped.put("result", null); | ||
} | ||
catch (Exception exception) { | ||
wrapped.put("error", wrapError(exception)); | ||
} | ||
reply.reply(wrapped); | ||
}); | ||
} else { | ||
channel.setMessageHandler(null); | ||
} | ||
} | ||
{ | ||
BasicMessageChannel<Object> channel = | ||
new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.WakelockApi.isEnabled", new StandardMessageCodec()); | ||
if (api != null) { | ||
channel.setMessageHandler((message, reply) -> { | ||
HashMap<String, HashMap> wrapped = new HashMap<>(); | ||
try { | ||
IsEnabledMessage output = api.isEnabled(); | ||
wrapped.put("result", output.toMap()); | ||
} | ||
catch (Exception exception) { | ||
wrapped.put("error", wrapError(exception)); | ||
} | ||
reply.reply(wrapped); | ||
}); | ||
} else { | ||
channel.setMessageHandler(null); | ||
} | ||
} | ||
} | ||
} | ||
private static HashMap wrapError(Exception exception) { | ||
HashMap<String, Object> errorMap = new HashMap<>(); | ||
errorMap.put("message", exception.toString()); | ||
errorMap.put("code", exception.getClass().getSimpleName()); | ||
errorMap.put("details", null); | ||
return errorMap; | ||
} | ||
} |
121 changes: 0 additions & 121 deletions
121
wakelock/android/src/main/kotlin/creativemaybeno/wakelock/Messages.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters