All Projects → ChangJoo-Park → Flutter_foreground_service_plugin

ChangJoo-Park / Flutter_foreground_service_plugin

Licence: mit

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Flutter foreground service plugin

Responsiveframework
Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
Stars: ✭ 476 (+2405.26%)
Mutual labels:  flutter-plugin
Flutter candies
custom flutter candies(widgets) for you to build flutter app easily, enjoy it
Stars: ✭ 638 (+3257.89%)
Mutual labels:  flutter-plugin
Flutter image cropper
A Flutter plugin for Android and iOS supports cropping images
Stars: ✭ 723 (+3705.26%)
Mutual labels:  flutter-plugin
Dart pdf
Pdf creation module for dart/flutter
Stars: ✭ 500 (+2531.58%)
Mutual labels:  flutter-plugin
Flutter downloader
Flutter Downloader - A plugin for creating and managing download tasks. Supports iOS and Android. Maintainer: @hnvn
Stars: ✭ 546 (+2773.68%)
Mutual labels:  flutter-plugin
Flutter Examples
An ultimate cheatbook of curated designs
Stars: ✭ 675 (+3452.63%)
Mutual labels:  flutter-plugin
Flutter Development Roadmap
Flutter App Developer Roadmap - A complete roadmap to learn Flutter App Development. I tried to learn flutter using this roadmap. If you want to add something please contribute to the project. Happy Learning
Stars: ✭ 474 (+2394.74%)
Mutual labels:  flutter-plugin
Fludex
Flutter + Redux = Fludex
Stars: ✭ 17 (-10.53%)
Mutual labels:  flutter-plugin
Flutter secure storage
A Flutter plugin to store data in secure storage
Stars: ✭ 587 (+2989.47%)
Mutual labels:  flutter-plugin
Flutter thrio
flutter_thrio makes it easy and fast to add flutter to existing mobile applications, and provide a simple and consistent navigator APIs.
Stars: ✭ 717 (+3673.68%)
Mutual labels:  flutter-plugin
Flutter showcaseview
Flutter plugin that allows you to showcase your features on iOS and Android. 👌🔝🎉
Stars: ✭ 502 (+2542.11%)
Mutual labels:  flutter-plugin
Flutter Learning
🔥 👍 🌟 ⭐ ⭐⭐ Flutter all you want.Flutter install,flutter samples,Flutter projects,Flutter plugin,Flutter problems,Dart codes,etc.Flutter安装和配置,Flutter开发遇到的难题,Flutter示例代码和模板,Flutter项目实战,Dart语言学习示例代码。
Stars: ✭ 4,941 (+25905.26%)
Mutual labels:  flutter-plugin
Liquid swipe flutter
A flutter based liquid swipe
Stars: ✭ 680 (+3478.95%)
Mutual labels:  flutter-plugin
Flutter Ffmpeg
FFmpeg plugin for Flutter
Stars: ✭ 494 (+2500%)
Mutual labels:  flutter-plugin
Flutter Geolocator
Android and iOS Geolocation plugin for Flutter
Stars: ✭ 759 (+3894.74%)
Mutual labels:  flutter-plugin
Amap map fluttify
高德地图 地图组件 Flutter插件
Stars: ✭ 479 (+2421.05%)
Mutual labels:  flutter-plugin
Bottom navy bar
A beautiful and animated bottom navigation
Stars: ✭ 653 (+3336.84%)
Mutual labels:  flutter-plugin
Table calendar
Highly customizable, feature-packed Flutter Calendar with gestures, animations and multiple formats
Stars: ✭ 897 (+4621.05%)
Mutual labels:  flutter-plugin
Multi image picker
Flutter plugin that allows you to display multi image picker on iOS and Android. 👌🔝🎉
Stars: ✭ 889 (+4578.95%)
Mutual labels:  flutter-plugin
Flutterlocation
A Flutter plugin to easily handle realtime location in iOS and Android. Provides settings for optimizing performance or battery.
Stars: ✭ 711 (+3642.11%)
Mutual labels:  flutter-plugin

flutter_foreground_service_plugin

You Can Do this plugin with..

  • Start Foreground Service (with callback)
  • Stop Foreground Service (with callback)
  • Using infinite interval on your configurations
  • Change Notification title and contents

You Can Not Do this plugin with...

  • [ ] Change Notification Level

If you use this plugin.

  1. Add dependency to your pubspec.yaml
dependencies:
    ...

  flutter_foreground_plugin: ^0.4.0
  1. Add permission for ForegroundService to AndroidManifest.xml
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
  1. Add service for ForegroundService to AndroidManifest.xml below </activity>
<service android:name="changjoopark.com.flutter_foreground_plugin.FlutterForegroundService"/>
  1. Add use-sdk under application
    <uses-sdk
        android:minSdkVersion="23"
        tools:overrideLibrary="changjoopark.com.flutter_foreground_plugin" />
  1. Add icon image for notification.

Notification Icon Generator will be helpful.

path: android/app/src/main/res/drawable-*

  1. Write code for foreground service
void main() {
  runApp(MyApp());
  startForegroundService();

  // if you need to stop foreground service,
  // await FlutterForegroundPlugin.stopForegroundService();
}

void startForegroundService() async {
  await FlutterForegroundPlugin.setServiceMethodInterval(seconds: 5);
  await FlutterForegroundPlugin.setServiceMethod(globalForegroundService);
  await FlutterForegroundPlugin.startForegroundService(
    holdWakeLock: false,
    onStarted: () {
      print("Foreground on Started");
    },
    onStopped: () {
      print("Foreground on Stopped");
    },
    title: "Flutter Foreground Service",
    content: "This is Content",
    iconName: "ic_stat_hot_tub",
  );
}

void globalForegroundService() {
  debugPrint("current datetime is ${DateTime.now()}");
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].