From a23fb9ffbdaa2dcdcd6d2aaa7b3e88c49376ea06 Mon Sep 17 00:00:00 2001 From: Matej Marinko Date: Fri, 4 May 2018 21:37:41 +0200 Subject: [PATCH] fix package to work with dart 2.0 --- lib/screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screen.dart b/lib/screen.dart index 0770a88..4dbc0d1 100644 --- a/lib/screen.dart +++ b/lib/screen.dart @@ -5,8 +5,8 @@ import 'package:flutter/services.dart'; class Screen { static const MethodChannel _channel = const MethodChannel('github.com/clovisnicolas/flutter_screen'); - static Future get brightness => _channel.invokeMethod('brightness'); + static Future get brightness async => (await _channel.invokeMethod('brightness')) as double; static Future setBrightness(double brightness) =>_channel.invokeMethod('setBrightness',{"brightness" : brightness}); - static Future get isKeptOn => _channel.invokeMethod('isKeptOn'); + static Future get isKeptOn async => (await _channel.invokeMethod('isKeptOn')) as bool; static Future keepOn(bool on) => _channel.invokeMethod('keepOn', {"on" : on}); }