Screen Brightness
Step 1: We cannot directly remove the time stamp from Screen Brightness but using the intl.dart package we can easily filter the date stamp from time stamp. So open your flutter project’s pubspec.yaml in code
dependencies: flutter: sdk: flutter screen: ^0.0.5
Step 2: After done saving the pubspec.yaml file, Open your flutter project root folder in Command Prompt or Terminal and execute flutter pub get command.
flutter pub get
import 'package:screen/screen.dart';
import 'dart:async'; import 'package:flutter/material.dart'; import 'package:screen/screen.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( theme: ThemeData( primarySwatch: Colors.green, ), home: MyHomePage(), debugShowCheckedModeBanner: false, ); } } class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> { @override bool _isKeptOn = false; double _brightness = 1.0; @override initState() { super.initState(); initPlatformState(); } initPlatformState() async { bool keptOn = await Screen.isKeptOn; double brightness = await Screen.brightness; setState((){ _isKeptOn = keptOn; _brightness = brightness; }); } @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( backgroundColor: Colors.lightGreen, title: new Text('Screen Brightness' )), body: new Center( child: new Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ new Text("Brightness :",style: TextStyle(fontSize:15, fontWeight: FontWeight.bold),), new Slider(value : _brightness, activeColor: Colors.lightGreen, onChanged : (double b){ setState((){_brightness = b;}); Screen.setBrightness(b); }) ] ) ), ); } }