creativecreatorormaybenot
Committed by GitHub

Fix broken web builds due to FFI imports (#103)

## 0.5.0+1
* Fixed broken web builds due to FFI imports.
## 0.5.0
* Added Windows support 🚀
... ...
import 'package:wakelock_platform_interface/wakelock_platform_interface.dart';
/// Stub of the Windows implementation that is required because of https://github.com/creativecreatorormaybenot/wakelock/issues/102.
///
/// This should be removed as soon as https://github.com/flutter/flutter/issues/52267#issuecomment-792302417
/// is available.
class WakelockWindows extends WakelockPlatformInterface {}
... ...
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:wakelock/src/windows_stub.dart'
if (dart.library.io) 'package:wakelock_windows/wakelock_windows.dart';
import 'package:wakelock_macos/wakelock_macos.dart';
import 'package:wakelock_platform_interface/wakelock_platform_interface.dart';
import 'package:wakelock_windows/wakelock_windows.dart';
/// The [WakelockPlatformInterface] that is used by [Wakelock].
///
... ... @@ -17,6 +18,10 @@ var wakelockPlatformInstance = _defaultPlatformInstance;
/// Workaround for configuring platform instances until https://github.com/flutter/flutter/issues/52267
/// arrives on stable.
///
/// As soon as https://github.com/flutter/flutter/issues/52267#issuecomment-792302417
/// is available, this should be completely removed and both macOS & Windows
/// should use `dartPluginClass` instead.
WakelockPlatformInterface get _defaultPlatformInstance {
// We want to return early on web as the platform checks are unsupported on
// web.
... ...
... ... @@ -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.0
version: 0.5.0+1
homepage: https://github.com/creativecreatorormaybenot/wakelock/tree/master/wakelock
environment:
... ...