diff --git a/.gitignore b/.gitignore index 14c7d4c..b8508f5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,10 @@ .idea .packages .pub/ +.dart_tool/ build/ ios/.generated/ packages pubspec.lock +example/.flutter-plugins-dependencies +example/ios/Flutter/flutter_export_environment.sh diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 91bd273..0822f38 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,9 @@ name: screen_example description: Demonstrates how to use the screen plugin. +environment: + sdk: '>=2.10.0 <3.0.0' + dependencies: flutter: sdk: flutter diff --git a/lib/screen.dart b/lib/screen.dart index 4dbc0d1..f4f406e 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 async => (await _channel.invokeMethod('brightness')) as double; + 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 async => (await _channel.invokeMethod('isKeptOn')) as bool; + static Future get isKeptOn async => (await _channel.invokeMethod('isKeptOn')) as bool?; static Future keepOn(bool on) => _channel.invokeMethod('keepOn', {"on" : on}); } diff --git a/pubspec.yaml b/pubspec.yaml index c3531d0..bfb8680 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: screen description: A Flutter plugin to manage the device's screen on Android and iOS. -version: 0.0.5 +version: 1.0.5 author: Clovis Nicolas homepage: https://github.com/clovisnicolas/flutter_screen environment: - sdk: '>=2.0.0 <3.0.0' + sdk: '>=2.12.0 <3.0.0' dependencies: flutter: