Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'package:flutter/services.dart';
class Screen {
static const MethodChannel _channel = const MethodChannel('github.com/clovisnicolas/flutter_screen');

static Future<double> get brightness async => (await _channel.invokeMethod('brightness')) as double;
static Future<double?> get brightness async => (await _channel.invokeMethod('brightness')) as double?;
static Future setBrightness(double brightness) =>_channel.invokeMethod('setBrightness',{"brightness" : brightness});
static Future<bool> get isKeptOn async => (await _channel.invokeMethod('isKeptOn')) as bool;
static Future<bool?> get isKeptOn async => (await _channel.invokeMethod('isKeptOn')) as bool?;
static Future keepOn(bool on) => _channel.invokeMethod('keepOn', {"on" : on});
}
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
homepage: https://github.com/clovisnicolas/flutter_screen

environment:
sdk: '>=2.0.0 <3.0.0'
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
Expand Down