creativecreatorormaybenot
Committed by GitHub

Upgrade packages to Flutter 2.5.0 (#137)

* Upgrade packages to Flutter 2.5.0

* Fix generated

* Fix import
include: package:pedantic/analysis_options.yaml
include: package:flutter_lints/flutter.yaml
linter:
rules:
... ...
## 0.5.4
* Upgraded `pigeon` and lints.
## 0.5.3+3
* Updated GitHub references to use `main` instead of `master`.
... ...
// Autogenerated from Pigeon (v0.2.1), do not edit directly.
// Autogenerated from Pigeon (v1.0.2), 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.MessageCodec;
import io.flutter.plugin.common.StandardMessageCodec;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
... ... @@ -51,24 +56,64 @@ public class Messages {
return fromMapResult;
}
}
private static class WakelockApiCodec extends StandardMessageCodec {
public static final WakelockApiCodec INSTANCE = new WakelockApiCodec();
private WakelockApiCodec() {}
@Override
protected Object readValueOfType(byte type, ByteBuffer buffer) {
switch (type) {
case (byte)128:
return IsEnabledMessage.fromMap((Map<String, Object>) readValue(buffer));
case (byte)129:
return ToggleMessage.fromMap((Map<String, Object>) readValue(buffer));
default:
return super.readValueOfType(type, buffer);
}
}
@Override
protected void writeValue(ByteArrayOutputStream stream, Object value) {
if (value instanceof IsEnabledMessage) {
stream.write(128);
writeValue(stream, ((IsEnabledMessage) value).toMap());
} else
if (value instanceof ToggleMessage) {
stream.write(129);
writeValue(stream, ((ToggleMessage) value).toMap());
} else
{
super.writeValue(stream, value);
}
}
}
/** Generated interface from Pigeon that represents a handler of messages from Flutter.*/
public interface WakelockApi {
void toggle(ToggleMessage arg);
void toggle(ToggleMessage msg);
IsEnabledMessage isEnabled();
/** The codec used by WakelockApi. */
static MessageCodec<Object> getCodec() {
return WakelockApiCodec.INSTANCE;
}
/** 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());
new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.WakelockApi.toggle", getCodec());
if (api != null) {
channel.setMessageHandler((message, reply) -> {
Map<String, Object> wrapped = new HashMap<>();
try {
@SuppressWarnings("ConstantConditions")
ToggleMessage input = ToggleMessage.fromMap((Map<String, Object>)message);
api.toggle(input);
ArrayList<Object> args = (ArrayList<Object>)message;
ToggleMessage msgArg = (ToggleMessage)args.get(0);
if (msgArg == null) {
throw new NullPointerException("msgArg unexpectedly null.");
}
api.toggle(msgArg);
wrapped.put("result", null);
}
catch (Error | RuntimeException exception) {
... ... @@ -82,13 +127,13 @@ public class Messages {
}
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.WakelockApi.isEnabled", new StandardMessageCodec());
new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.WakelockApi.isEnabled", getCodec());
if (api != null) {
channel.setMessageHandler((message, reply) -> {
Map<String, Object> wrapped = new HashMap<>();
try {
IsEnabledMessage output = api.isEnabled();
wrapped.put("result", output.toMap());
wrapped.put("result", output);
}
catch (Error | RuntimeException exception) {
wrapped.put("error", wrapError(exception));
... ...
... ... @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:wakelock/wakelock.dart';
void main() {
runApp(WakelockExampleApp());
runApp(const WakelockExampleApp());
}
/// Example app widget demonstrating how to use the wakelock plugin.
... ... @@ -10,6 +10,9 @@ void main() {
/// The example implementation is located inside [OutlinedButton.onPressed]
/// callback functions and a [FutureBuilder].
class WakelockExampleApp extends StatefulWidget {
/// Creates the [WakelockExampleApp] widget.
const WakelockExampleApp({Key key}) : super(key: key);
@override
_WakelockExampleAppState createState() => _WakelockExampleAppState();
}
... ...
... ... @@ -28,11 +28,10 @@ dev_dependencies:
sdk: flutter
flutter_driver:
sdk: flutter
integration_test:
sdk: flutter
integration_test: ^1.0.1
test: any
pedantic: ^1.11.0
flutter_lints: ^1.0.4
dependency_overrides:
# We override the platform dependencies of wakelock here because we use the example app for
... ...
... ... @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//
// clang-format off
#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_
... ...
// Autogenerated from Pigeon (v0.2.1), do not edit directly.
// Autogenerated from Pigeon (v1.0.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#import <Foundation/Foundation.h>
@protocol FlutterBinaryMessenger;
@protocol FlutterMessageCodec;
@class FlutterError;
@class FlutterStandardTypedData;
... ... @@ -18,11 +19,14 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, strong, nullable) NSNumber * enabled;
@end
/// The codec used by FLTWakelockApi.
NSObject<FlutterMessageCodec> *FLTWakelockApiGetCodec(void);
@protocol FLTWakelockApi
-(void)toggle:(FLTToggleMessage*)input error:(FlutterError *_Nullable *_Nonnull)error;
-(nullable FLTIsEnabledMessage *)isEnabled:(FlutterError *_Nullable *_Nonnull)error;
- (void)toggleMsg:(FLTToggleMessage *)msg error:(FlutterError *_Nullable *_Nonnull)error;
- (nullable FLTIsEnabledMessage *)isEnabledWithError:(FlutterError *_Nullable *_Nonnull)error;
@end
extern void FLTWakelockApiSetup(id<FlutterBinaryMessenger> binaryMessenger, id<FLTWakelockApi> _Nullable api);
extern void FLTWakelockApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<FLTWakelockApi> *_Nullable api);
NS_ASSUME_NONNULL_END
... ...
// Autogenerated from Pigeon (v0.2.1), do not edit directly.
// Autogenerated from Pigeon (v1.0.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#import "messages.h"
#import <Flutter/Flutter.h>
... ... @@ -7,7 +7,7 @@
#error File requires ARC to be enabled.
#endif
static NSDictionary<NSString*, id>* wrapResult(NSDictionary *result, FlutterError *error) {
static NSDictionary<NSString *, id> *wrapResult(id result, FlutterError *error) {
NSDictionary *errorDict = (NSDictionary *)[NSNull null];
if (error) {
errorDict = @{
... ... @@ -23,53 +23,116 @@ static NSDictionary<NSString*, id>* wrapResult(NSDictionary *result, FlutterErro
}
@interface FLTToggleMessage ()
+(FLTToggleMessage*)fromMap:(NSDictionary*)dict;
-(NSDictionary*)toMap;
+ (FLTToggleMessage *)fromMap:(NSDictionary *)dict;
- (NSDictionary *)toMap;
@end
@interface FLTIsEnabledMessage ()
+(FLTIsEnabledMessage*)fromMap:(NSDictionary*)dict;
-(NSDictionary*)toMap;
+ (FLTIsEnabledMessage *)fromMap:(NSDictionary *)dict;
- (NSDictionary *)toMap;
@end
@implementation FLTToggleMessage
+(FLTToggleMessage*)fromMap:(NSDictionary*)dict {
FLTToggleMessage* result = [[FLTToggleMessage alloc] init];
+ (FLTToggleMessage *)fromMap:(NSDictionary *)dict {
FLTToggleMessage *result = [[FLTToggleMessage alloc] init];
result.enable = dict[@"enable"];
if ((NSNull *)result.enable == [NSNull null]) {
result.enable = nil;
}
return result;
}
-(NSDictionary*)toMap {
- (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.enable ? self.enable : [NSNull null]), @"enable", nil];
}
@end
@implementation FLTIsEnabledMessage
+(FLTIsEnabledMessage*)fromMap:(NSDictionary*)dict {
FLTIsEnabledMessage* result = [[FLTIsEnabledMessage alloc] init];
+ (FLTIsEnabledMessage *)fromMap:(NSDictionary *)dict {
FLTIsEnabledMessage *result = [[FLTIsEnabledMessage alloc] init];
result.enabled = dict[@"enabled"];
if ((NSNull *)result.enabled == [NSNull null]) {
result.enabled = nil;
}
return result;
}
-(NSDictionary*)toMap {
- (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.enabled ? self.enabled : [NSNull null]), @"enabled", nil];
}
@end
void FLTWakelockApiSetup(id<FlutterBinaryMessenger> binaryMessenger, id<FLTWakelockApi> api) {
@interface FLTWakelockApiCodecReader : FlutterStandardReader
@end
@implementation FLTWakelockApiCodecReader
- (nullable id)readValueOfType:(UInt8)type
{
switch (type) {
case 128:
return [FLTIsEnabledMessage fromMap:[self readValue]];
case 129:
return [FLTToggleMessage fromMap:[self readValue]];
default:
return [super readValueOfType:type];
}
}
@end
@interface FLTWakelockApiCodecWriter : FlutterStandardWriter
@end
@implementation FLTWakelockApiCodecWriter
- (void)writeValue:(id)value
{
if ([value isKindOfClass:[FLTIsEnabledMessage class]]) {
[self writeByte:128];
[self writeValue:[value toMap]];
} else
if ([value isKindOfClass:[FLTToggleMessage class]]) {
[self writeByte:129];
[self writeValue:[value toMap]];
} else
{
[super writeValue:value];
}
}
@end
@interface FLTWakelockApiCodecReaderWriter : FlutterStandardReaderWriter
@end
@implementation FLTWakelockApiCodecReaderWriter
- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data {
return [[FLTWakelockApiCodecWriter alloc] initWithData:data];
}
- (FlutterStandardReader *)readerWithData:(NSData *)data {
return [[FLTWakelockApiCodecReader alloc] initWithData:data];
}
@end
NSObject<FlutterMessageCodec> *FLTWakelockApiGetCodec() {
static dispatch_once_t s_pred = 0;
static FlutterStandardMessageCodec *s_sharedObject = nil;
dispatch_once(&s_pred, ^{
FLTWakelockApiCodecReaderWriter *readerWriter = [[FLTWakelockApiCodecReaderWriter alloc] init];
s_sharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter];
});
return s_sharedObject;
}
void FLTWakelockApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<FLTWakelockApi> *api) {
{
FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel
messageChannelWithName:@"dev.flutter.pigeon.WakelockApi.toggle"
binaryMessenger:binaryMessenger];
binaryMessenger:binaryMessenger
codec:FLTWakelockApiGetCodec()];
if (api) {
NSCAssert([api respondsToSelector:@selector(toggleMsg:error:)], @"FLTWakelockApi api doesn't respond to @selector(toggleMsg:error:)");
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
FLTToggleMessage *input = [FLTToggleMessage fromMap:message];
NSArray *args = message;
FLTToggleMessage *arg_msg = args[0];
FlutterError *error;
[api toggle:input error:&error];
[api toggleMsg:arg_msg error:&error];
callback(wrapResult(nil, error));
}];
}
... ... @@ -81,12 +144,14 @@ void FLTWakelockApiSetup(id<FlutterBinaryMessenger> binaryMessenger, id<FLTWakel
FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel
messageChannelWithName:@"dev.flutter.pigeon.WakelockApi.isEnabled"
binaryMessenger:binaryMessenger];
binaryMessenger:binaryMessenger
codec:FLTWakelockApiGetCodec()];
if (api) {
NSCAssert([api respondsToSelector:@selector(isEnabledWithError:)], @"FLTWakelockApi api doesn't respond to @selector(isEnabledWithError:)");
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
FlutterError *error;
FLTIsEnabledMessage *output = [api isEnabled:&error];
callback(wrapResult([output toMap], error));
FLTIsEnabledMessage *output = [api isEnabledWithError:&error];
callback(wrapResult(output, error));
}];
}
else {
... ...
import 'package:pigeon/java_generator.dart';
import 'package:pigeon/objc_generator.dart';
import 'package:pigeon/pigeon.dart';
/// Message for toggling the wakelock on the platform side.
... ... @@ -12,22 +10,22 @@ class IsEnabledMessage {
bool? enabled;
}
@ConfigurePigeon(PigeonOptions(
dartOut: '../wakelock_platform_interface/lib/messages.dart',
dartTestOut: '../wakelock_platform_interface/test/messages.dart',
objcHeaderOut: 'ios/Classes/messages.h',
objcSourceOut: 'ios/Classes/messages.m',
objcOptions: ObjcOptions(
prefix: 'FLT',
),
javaOut: 'android/src/main/java/creativemaybeno/wakelock/Messages.java',
javaOptions: JavaOptions(
package: 'creativemaybeno.wakelock',
),
))
@HostApi(dartHostTestHandler: 'TestWakelockApi')
abstract class WakelockApi {
void toggle(ToggleMessage msg);
IsEnabledMessage isEnabled();
}
void configurePigeon(PigeonOptions options) {
options
..dartOut = '../wakelock_platform_interface/lib/messages.dart'
..dartTestOut = '../wakelock_platform_interface/test/messages.dart'
..objcHeaderOut = 'ios/Classes/messages.h'
..objcSourceOut = 'ios/Classes/messages.m'
..objcOptions = ObjcOptions()
..objcOptions?.prefix = 'FLT'
..javaOut = 'android/src/main/java/creativemaybeno/wakelock/Messages.java'
..javaOptions = JavaOptions()
..javaOptions?.package = 'creativemaybeno.wakelock';
}
... ...
... ... @@ -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, macOS, Windows, and web.
version: 0.5.3+3
version: 0.5.4
homepage: https://github.com/creativecreatorormaybenot/wakelock/tree/main/wakelock
environment:
... ... @@ -24,8 +24,8 @@ dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.11.0
pigeon: ^0.2.1 # flutter pub run pigeon --input "pigeons/messages.dart"
flutter_lints: ^1.0.4
pigeon: ^1.0.2 # flutter pub run pigeon --input "pigeons/messages.dart"
flutter:
plugin:
... ...
## 0.1.0+3
* Upgraded lints.
## 0.1.0+2
* Updated GitHub references to use `main` instead of `master`.
... ...
name: wakelock_macos
description: >-2
macOS platform implementation of the wakelock_platform_interface for the wakelock plugin.
version: 0.1.0+2
version: 0.1.0+3
homepage: https://github.com/creativecreatorormaybenot/wakelock/tree/main/wakelock_macos
environment:
... ... @@ -20,7 +20,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.11.0
flutter_lints: ^1.0.4
flutter:
plugin:
... ...
... ... @@ -12,7 +12,7 @@ void main() {
// Consequently, the macOS implementation will be tested in CI via the
// example integration test running on -d macos.
test('stub', () {
final acceptUnitTestingDefeat = true;
const acceptUnitTestingDefeat = true;
expect(acceptUnitTestingDefeat, isTrue);
});
}
... ...
## 0.2.1+3
* Upgraded lints.
## 0.2.1+2
* Updated GitHub references to use `main` instead of `master`.
... ...
// Autogenerated from Pigeon (v0.2.1), do not edit directly.
// Autogenerated from Pigeon (v1.0.2), 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, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name
// @dart = 2.12
import 'dart:async';
import 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List;
import 'package:flutter/foundation.dart' show WriteBuffer, ReadBuffer;
import 'package:flutter/services.dart';
class ToggleMessage {
... ... @@ -37,6 +38,36 @@ class IsEnabledMessage {
}
}
class _WakelockApiCodec extends StandardMessageCodec {
const _WakelockApiCodec();
@override
void writeValue(WriteBuffer buffer, Object? value) {
if (value is IsEnabledMessage) {
buffer.putUint8(128);
writeValue(buffer, value.encode());
} else if (value is ToggleMessage) {
buffer.putUint8(129);
writeValue(buffer, value.encode());
} else {
super.writeValue(buffer, value);
}
}
@override
Object? readValueOfType(int type, ReadBuffer buffer) {
switch (type) {
case 128:
return IsEnabledMessage.decode(readValue(buffer)!);
case 129:
return ToggleMessage.decode(readValue(buffer)!);
default:
return super.readValueOfType(type, buffer);
}
}
}
class WakelockApi {
/// Constructor for [WakelockApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
... ... @@ -46,13 +77,14 @@ class WakelockApi {
final BinaryMessenger? _binaryMessenger;
Future<void> toggle(ToggleMessage arg) async {
final Object encoded = arg.encode();
static const MessageCodec<Object?> codec = _WakelockApiCodec();
Future<void> toggle(ToggleMessage arg_msg) async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.WakelockApi.toggle', const StandardMessageCodec(),
'dev.flutter.pigeon.WakelockApi.toggle', codec,
binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap =
await channel.send(encoded) as Map<Object?, Object?>?;
await channel.send(<Object>[arg_msg]) as Map<Object?, Object?>?;
if (replyMap == null) {
throw PlatformException(
code: 'channel-error',
... ... @@ -68,14 +100,13 @@ class WakelockApi {
details: error['details'],
);
} else {
// noop
return;
}
}
Future<IsEnabledMessage> isEnabled() async {
final BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.WakelockApi.isEnabled',
const StandardMessageCodec(),
'dev.flutter.pigeon.WakelockApi.isEnabled', codec,
binaryMessenger: _binaryMessenger);
final Map<Object?, Object?>? replyMap =
await channel.send(null) as Map<Object?, Object?>?;
... ... @@ -94,7 +125,7 @@ class WakelockApi {
details: error['details'],
);
} else {
return IsEnabledMessage.decode(replyMap['result']!);
return (replyMap['result'] as IsEnabledMessage?)!;
}
}
}
... ...
... ... @@ -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.2.1+2
version: 0.2.1+3
homepage: >-2
https://github.com/creativecreatorormaybenot/wakelock/tree/main/wakelock_platform_interface
... ... @@ -19,4 +19,4 @@ dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.11.0
flutter_lints: ^1.0.4
... ...
// Autogenerated from Pigeon (v0.2.1), do not edit directly.
// Autogenerated from Pigeon (v1.0.2), 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.12
import 'dart:async';
import 'dart:typed_data' show Uint8List, Int32List, Int64List, Float64List;
import 'package:flutter/foundation.dart' show WriteBuffer, ReadBuffer;
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:wakelock_platform_interface/messages.dart';
class _TestWakelockApiCodec extends StandardMessageCodec {
const _TestWakelockApiCodec();
@override
void writeValue(WriteBuffer buffer, Object? value) {
if (value is IsEnabledMessage) {
buffer.putUint8(128);
writeValue(buffer, value.encode());
} else if (value is ToggleMessage) {
buffer.putUint8(129);
writeValue(buffer, value.encode());
} else {
super.writeValue(buffer, value);
}
}
@override
Object? readValueOfType(int type, ReadBuffer buffer) {
switch (type) {
case 128:
return IsEnabledMessage.decode(readValue(buffer)!);
case 129:
return ToggleMessage.decode(readValue(buffer)!);
default:
return super.readValueOfType(type, buffer);
}
}
}
abstract class TestWakelockApi {
void toggle(ToggleMessage arg);
static const MessageCodec<Object?> codec = _TestWakelockApiCodec();
void toggle(ToggleMessage msg);
IsEnabledMessage isEnabled();
static void setup(TestWakelockApi? api) {
{
const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.WakelockApi.toggle', StandardMessageCodec());
'dev.flutter.pigeon.WakelockApi.toggle', codec);
if (api == null) {
channel.setMockMessageHandler(null);
} else {
channel.setMockMessageHandler((Object? message) async {
assert(message != null,
'Argument for dev.flutter.pigeon.WakelockApi.toggle was null. Expected ToggleMessage.');
final ToggleMessage input = ToggleMessage.decode(message!);
api.toggle(input);
'Argument for dev.flutter.pigeon.WakelockApi.toggle was null.');
final List<Object?> args = (message as List<Object?>?)!;
final ToggleMessage? arg_msg = args[0] as ToggleMessage?;
assert(arg_msg != null,
'Argument for dev.flutter.pigeon.WakelockApi.toggle was null, expected non-null ToggleMessage.');
api.toggle(arg_msg!);
return <Object?, Object?>{};
});
}
}
{
const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
'dev.flutter.pigeon.WakelockApi.isEnabled', StandardMessageCodec());
'dev.flutter.pigeon.WakelockApi.isEnabled', codec);
if (api == null) {
channel.setMockMessageHandler(null);
} else {
channel.setMockMessageHandler((Object? message) async {
// ignore message
final IsEnabledMessage output = api.isEnabled();
return <Object?, Object?>{'result': output.encode()};
return <Object?, Object?>{'result': output};
});
}
}
... ...
... ... @@ -34,13 +34,13 @@ void main() {
test('Cannot be implemented with `implements`', () {
expect(() {
WakelockPlatformInterface.instance =
ImplementsWakelockPlatformInterface(false);
const ImplementsWakelockPlatformInterface(false);
}, throwsA(isInstanceOf<NoSuchMethodError>()));
});
test('Can be mocked with `implements`', () {
WakelockPlatformInterface.instance =
ImplementsWakelockPlatformInterface(true);
const ImplementsWakelockPlatformInterface(true);
});
test('Can be extended', () {
... ...
## 0.2.0+3
* Upgraded lints.
## 0.2.0+2
* Updated GitHub references to use `main` instead of `master`.
... ...
... ... @@ -41,13 +41,13 @@ Future<void> _importJSLibraries(List<String> libraries) {
final loading = <Future<void>>[];
final head = html.querySelector('head');
libraries.forEach((String library) {
for (final library in libraries) {
if (!_isImported(library)) {
final scriptTag = _createScriptTag(library);
head!.children.add(scriptTag);
loading.add(scriptTag.onLoad.first);
}
});
}
return Future.wait(loading);
}
... ...
name: wakelock_web
description: Web platform implementation of the wakelock_platform_interface for the wakelock plugin.
version: 0.2.0+2
version: 0.2.0+3
homepage: https://github.com/creativecreatorormaybenot/wakelock/tree/main/wakelock_web
environment:
... ... @@ -21,7 +21,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.11.0
flutter_lints: ^1.0.4
wakelock:
path: ../wakelock
... ...
## 0.1.0+2
* Upgraded lints.
## 0.1.0+1
* Updated GitHub references to use `main` instead of `master`.
... ...
... ... @@ -8,11 +8,13 @@ import 'package:win32/win32.dart';
/// cleared.
///
/// See https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate#parameters.
// ignore: constant_identifier_names
const _ES_CONTINUOUS = 0x80000000;
/// Forces the display to be on by resetting the display idle timer.
///
/// See https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate#parameters.
// ignore: constant_identifier_names
const _ES_DISPLAY_REQUIRED = 0x00000002;
/// The Windows implementation of the [WakelockPlatformInterface].
... ...
name: wakelock_windows
description: >-2
Windows platform implementation of the wakelock_platform_interface for the wakelock plugin.
version: 0.1.0+1
version: 0.1.0+2
homepage: https://github.com/creativecreatorormaybenot/wakelock/tree/main/wakelock_windows
environment:
... ... @@ -19,7 +19,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.11.0
flutter_lints: ^1.0.4
# todo: use dartPluginClass declaration once that lands on stable (https://github.com/flutter/flutter/issues/52267_
#flutter:
... ...
... ... @@ -9,7 +9,7 @@ void main() {
// before being published. For that, we use dependency overrides in the
// example app.
test('stub', () {
final acceptUnitTestingDefeat = true;
const acceptUnitTestingDefeat = true;
expect(acceptUnitTestingDefeat, isTrue);
});
}
... ...