Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
Bump pigeon (#50)
Browse files Browse the repository at this point in the history
* Bump pigeon

* Finish
  • Loading branch information
creativecreatorormaybenot committed Oct 24, 2020
1 parent 99305b8 commit ae37c19
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 131 deletions.
4 changes: 4 additions & 0 deletions wakelock/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.0+2

* Bumped pigeon to `0.1.14`.

## 0.2.0+1

* Fix iOS build issue by bumping the `wakelock_web` dependency.
Expand Down
191 changes: 96 additions & 95 deletions wakelock/android/src/main/kotlin/creativemaybeno/wakelock/Messages.kt
Original file line number Diff line number Diff line change
@@ -1,120 +1,121 @@
// Autogenerated from Pigeon (v0.1.7), do not edit directly.
// 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.*
import java.util.ArrayList
import java.util.HashMap

/** Generated class from Pigeon. */
object Messages {
private fun wrapError(exception: Exception): HashMap<*, *> {
val errorMap = HashMap<String, Any?>()
errorMap["message"] = exception.toString()
errorMap["code"] = null
errorMap["details"] = null
return errorMap
}

/** Generated class from Pigeon that represents data sent in messages. */
class ToggleMessage {
private var enable: Boolean? = null
fun getEnable(): Boolean? {
return enable
}

fun setEnable(setterArg: Boolean?) {
enable = setterArg
private fun wrapError(exception: Exception): HashMap {
val errorMap: HashMap<String, Object> = HashMap()
errorMap.put("message", exception.toString())
errorMap.put("code", exception.getClass().getSimpleName())
errorMap.put("details", null)
return errorMap
}

fun toMap(): HashMap<*, *> {
val toMapResult = HashMap<String, Any?>()
toMapResult["enable"] = enable
return toMapResult
}
/** Generated class from Pigeon that represents data sent in messages. */
class ToggleMessage {
private var enable: Boolean? = null
fun getEnable(): Boolean? {
return enable
}

companion object {
fun fromMap(map: HashMap<*, *>?): ToggleMessage {
val fromMapResult = ToggleMessage()
val enable = map!!["enable"]
fromMapResult.enable = enable as Boolean?
return fromMapResult
}
}
}
fun setEnable(setterArg: Boolean?) {
enable = setterArg
}

/** Generated class from Pigeon that represents data sent in messages. */
class IsEnabledMessage {
private var enabled: Boolean? = null
fun getEnabled(): Boolean? {
return enabled
}
fun toMap(): HashMap {
val toMapResult: HashMap<String, Object> = HashMap()
toMapResult.put("enable", enable)
return toMapResult
}

fun setEnabled(setterArg: Boolean?) {
enabled = setterArg
companion object {
fun fromMap(map: HashMap): ToggleMessage {
val fromMapResult = ToggleMessage()
val enable: Object = map.get("enable")
fromMapResult.enable = enable
return fromMapResult
}
}
}

fun toMap(): HashMap<*, *> {
val toMapResult = HashMap<String, Any?>()
toMapResult["enabled"] = enabled
return toMapResult
}
/** Generated class from Pigeon that represents data sent in messages. */
class IsEnabledMessage {
private var enabled: Boolean? = null
fun getEnabled(): Boolean? {
return enabled
}

companion object {
fun fromMap(map: HashMap<*, *>): IsEnabledMessage {
val fromMapResult = IsEnabledMessage()
val enabled = map["enabled"]
fromMapResult.enabled = enabled as Boolean?
return fromMapResult
}
}
}
fun setEnabled(setterArg: Boolean?) {
enabled = setterArg
}

/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
interface WakelockApi {
fun toggle(arg: ToggleMessage?)
val isEnabled: IsEnabledMessage
fun toMap(): HashMap {
val toMapResult: HashMap<String, Object> = HashMap()
toMapResult.put("enabled", enabled)
return toMapResult
}

companion object {
/** Sets up an instance of `WakelockApi` to handle messages through the `binaryMessenger` */
fun setup(binaryMessenger: BinaryMessenger?, api: WakelockApi?) {
run {
val channel = BasicMessageChannel(binaryMessenger!!, "dev.flutter.pigeon.WakelockApi.toggle", StandardMessageCodec())
if (api != null) {
channel.setMessageHandler { message: Any?, reply: BasicMessageChannel.Reply<Any> ->
val wrapped = HashMap<String, HashMap<*, *>?>()
try {
val input = ToggleMessage.fromMap(message as HashMap<*, *>?)
api.toggle(input)
wrapped["result"] = null
} catch (exception: Exception) {
wrapped["error"] = wrapError(exception)
}
reply.reply(wrapped)
companion object {
fun fromMap(map: HashMap): IsEnabledMessage {
val fromMapResult = IsEnabledMessage()
val enabled: Object = map.get("enabled")
fromMapResult.enabled = enabled
return fromMapResult
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel = BasicMessageChannel(binaryMessenger!!, "dev.flutter.pigeon.WakelockApi.isEnabled", StandardMessageCodec())
if (api != null) {
channel.setMessageHandler { message: Any?, reply: BasicMessageChannel.Reply<Any> ->
val wrapped = HashMap<String, HashMap<*, *>>()
try {
val output = api.isEnabled
wrapped["result"] = output.toMap()
} catch (exception: Exception) {
wrapped["error"] = wrapError(exception)
}
reply.reply(wrapped)
}

/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
interface WakelockApi {
fun toggle(arg: ToggleMessage?)
val isEnabled: IsEnabledMessage

companion object {
/** Sets up an instance of `WakelockApi` to handle messages through the `binaryMessenger` */
fun setup(binaryMessenger: BinaryMessenger?, api: WakelockApi?) {
run {
val channel: BasicMessageChannel<Object> = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.WakelockApi.toggle", StandardMessageCodec())
if (api != null) {
channel.setMessageHandler { message, reply ->
val wrapped: HashMap<String, HashMap> = HashMap()
try {
@SuppressWarnings("ConstantConditions") val input = ToggleMessage.fromMap(message as HashMap)
api.toggle(input)
wrapped.put("result", null)
} catch (exception: Exception) {
wrapped.put("error", wrapError(exception))
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
run {
val channel: BasicMessageChannel<Object> = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.WakelockApi.isEnabled", StandardMessageCodec())
if (api != null) {
channel.setMessageHandler { message, reply ->
val wrapped: HashMap<String, HashMap> = HashMap()
try {
val output = api.isEnabled
wrapped.put("result", output.toMap())
} catch (exception: Exception) {
wrapped.put("error", wrapError(exception))
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
}
} else {
channel.setMessageHandler(null)
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion wakelock/ios/Classes/messages.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v0.1.7), do not edit directly.
// Autogenerated from Pigeon (v0.1.14), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#import <Foundation/Foundation.h>
@protocol FlutterBinaryMessenger;
Expand Down
28 changes: 14 additions & 14 deletions wakelock/ios/Classes/messages.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v0.1.7), do not edit directly.
// Autogenerated from Pigeon (v0.1.14), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#import "messages.h"
#import <Flutter/Flutter.h>
Expand All @@ -11,15 +11,15 @@
NSDictionary *errorDict = (NSDictionary *)[NSNull null];
if (error) {
errorDict = [NSDictionary dictionaryWithObjectsAndKeys:
(error.code ? error.code : [NSNull null]), @"code",
(error.message ? error.message : [NSNull null]), @"message",
(error.details ? error.details : [NSNull null]), @"details",
nil];
(error.code ? error.code : [NSNull null]), @"code",
(error.message ? error.message : [NSNull null]), @"message",
(error.details ? error.details : [NSNull null]), @"details",
nil];
}
return [NSDictionary dictionaryWithObjectsAndKeys:
(result ? result : [NSNull null]), @"result",
errorDict, @"error",
nil];
(result ? result : [NSNull null]), @"result",
errorDict, @"error",
nil];
}

@interface FLTToggleMessage ()
Expand Down Expand Up @@ -62,9 +62,9 @@ -(NSDictionary*)toMap {
void FLTWakelockApiSetup(id<FlutterBinaryMessenger> binaryMessenger, id<FLTWakelockApi> api) {
{
FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel
messageChannelWithName:@"dev.flutter.pigeon.WakelockApi.toggle"
binaryMessenger:binaryMessenger];
[FlutterBasicMessageChannel
messageChannelWithName:@"dev.flutter.pigeon.WakelockApi.toggle"
binaryMessenger:binaryMessenger];
if (api) {
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
FlutterError *error;
Expand All @@ -79,9 +79,9 @@ void FLTWakelockApiSetup(id<FlutterBinaryMessenger> binaryMessenger, id<FLTWakel
}
{
FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel
messageChannelWithName:@"dev.flutter.pigeon.WakelockApi.isEnabled"
binaryMessenger:binaryMessenger];
[FlutterBasicMessageChannel
messageChannelWithName:@"dev.flutter.pigeon.WakelockApi.isEnabled"
binaryMessenger:binaryMessenger];
if (api) {
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
FlutterError *error;
Expand Down
4 changes: 2 additions & 2 deletions wakelock/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: wakelock
description: >-2
Plugin that allows you to keep the device screen awake, i.e. prevent the screen from sleeping on
Android, iOS, and web.
version: 0.2.0+1
version: 0.2.0+2
homepage: https://github.com/creativecreatorormaybenot/wakelock/tree/master/wakelock

environment:
Expand All @@ -23,7 +23,7 @@ dev_dependencies:
sdk: flutter

pedantic: ^1.9.2
pigeon: 0.1.7
pigeon: ^0.1.14

flutter:
plugin:
Expand Down
4 changes: 4 additions & 0 deletions wakelock_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.0

* Updated messages with upgraded version of pigeon.

## 0.1.0

* Initial release.
38 changes: 20 additions & 18 deletions wakelock_platform_interface/lib/messages.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v0.1.7), do not edit directly.
// Autogenerated from Pigeon (v0.1.14), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import
// @dart = 2.8
Expand All @@ -17,9 +17,6 @@ class ToggleMessage {

// ignore: unused_element
static ToggleMessage _fromMap(Map<dynamic, dynamic> pigeonMap) {
if (pigeonMap == null) {
return null;
}
final ToggleMessage result = ToggleMessage();
result.enable = pigeonMap['enable'];
return result;
Expand All @@ -37,9 +34,6 @@ class IsEnabledMessage {

// ignore: unused_element
static IsEnabledMessage _fromMap(Map<dynamic, dynamic> pigeonMap) {
if (pigeonMap == null) {
return null;
}
final IsEnabledMessage result = IsEnabledMessage();
result.enabled = pigeonMap['enabled'];
return result;
Expand Down Expand Up @@ -98,21 +92,29 @@ abstract class TestWakelockApi {
{
const BasicMessageChannel<dynamic> channel = BasicMessageChannel<dynamic>(
'dev.flutter.pigeon.WakelockApi.toggle', StandardMessageCodec());
channel.setMockMessageHandler((dynamic message) async {
final Map<dynamic, dynamic> mapMessage =
message as Map<dynamic, dynamic>;
final ToggleMessage input = ToggleMessage._fromMap(mapMessage);
api.toggle(input);
return <dynamic, dynamic>{};
});
if (api == null) {
channel.setMockMessageHandler(null);
} else {
channel.setMockMessageHandler((dynamic message) async {
final Map<dynamic, dynamic> mapMessage =
message as Map<dynamic, dynamic>;
final ToggleMessage input = ToggleMessage._fromMap(mapMessage);
api.toggle(input);
return <dynamic, dynamic>{};
});
}
}
{
const BasicMessageChannel<dynamic> channel = BasicMessageChannel<dynamic>(
'dev.flutter.pigeon.WakelockApi.isEnabled', StandardMessageCodec());
channel.setMockMessageHandler((dynamic message) async {
final IsEnabledMessage output = api.isEnabled();
return <dynamic, dynamic>{'result': output._toMap()};
});
if (api == null) {
channel.setMockMessageHandler(null);
} else {
channel.setMockMessageHandler((dynamic message) async {
final IsEnabledMessage output = api.isEnabled();
return <dynamic, dynamic>{'result': output._toMap()};
});
}
}
}
}
2 changes: 1 addition & 1 deletion wakelock_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: wakelock_platform_interface
description: >-2
A common platform interface for the wakelock plugin used by the different platform
implementations.
version: 0.1.0
version: 0.1.0+1
homepage: >-2
https://github.com/creativecreatorormaybenot/wakelock/tree/master/wakelock_platform_interface
Expand Down

0 comments on commit ae37c19

Please sign in to comment.