GithubHelp home page GithubHelp logo

goswamijay / flutter_system_action Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 85 KB

Flutter package that provides functionality to access system button actions

Home Page: https://pub.dev/packages/flutter_system_action

License: MIT License

Kotlin 32.75% Dart 67.25%

flutter_system_action's Introduction

๐Ÿ“ฑ Flutter System Action Plugins

flutter_system_action is a Flutter plugin that provides a set of system actions such as adjusting volume, toggling the torch, changing brightness, and more on Android devices.

๐ŸŒŸ Features

  • ๐Ÿ”Š Adjust music volume (raise/lower)
  • ๐Ÿ”ฆ Toggle the torch (flashlight) on/off
  • ๐ŸŒž Adjust screen brightness (raise/lower/max/zero)
  • ๐Ÿ“ž Adjust ringtone volume (raise/lower)
  • ๐Ÿ”” Adjust notification volume (raise/lower)
  • ๐Ÿ“ณ Toggle vibration mode on/off
  • ๐Ÿ“ณ Toggle ring mode on
  • ๐ŸŒ‘ Open display settings for dark mode

๐Ÿš€ Getting Started

Installation

Add the following line to your pubspec.yaml file:

dependencies:
  flutter_system_action: ^1.0.2

Then, run flutter pub get to install the package.

Android Permissions

This plugin requires certain permissions to function properly. Make sure to add the following permissions to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.VIBRATE" />

Permission For Flashlight

<uses-permission android:name="android.permission.CAMERA" />

Permission For Brightness

<uses-permission android:name="android.permission.WRITE_SETTINGS" />

Usage

Import the package in your Dart code:

import 'package:flutter_system_action/flutter_system_action.dart';

API

Methods

  • volumeButtonRaiseEvent(): Increases the music volume.
  • volumeButtonLowerEvent(): Decreases the music volume.
  • torchButtonOnEvent(): Turns on the torch (flashlight)
  • torchButtonOffEvent(): Turns off the torch (flashlight).
  • brightnessRaiseEvent(): Increases the screen brightness.
  • brightnessLowerEvent(): Decreases the screen brightness.
  • brightnessMaxEvent(): Sets the screen brightness to maximum.
  • brightnessZeroEvent(): Sets the screen brightness to zero.
  • ringtoneVolumeRaiseEvent(): Increases the ringtone volume.
  • ringtoneVolumeDownEvent(): Decreases the ringtone volume.
  • notificationVolumeRaisePress(): Increases the notification volume.
  • notificationVolumeDownPress(): Decreases the notification volume.
  • vibrationButtonPress(): Sets the phone to vibration mode.
  • ringModeOnButtonPress(): Sets the phone to ring mode.
  • darkModeEventButtonPressed(): Opens the display settings for dark mode.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

flutter_system_action's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.