flutter_govar_foreground_service 0.0.7 copy "flutter_govar_foreground_service: ^0.0.7" to clipboard
flutter_govar_foreground_service: ^0.0.7 copied to clipboard

Foreground service for the Android platform, keeps app running even when in background.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:flutter_govar_foreground_service/flutter_govar_foreground_service.dart';

void main() {
  runApp(MyApp());
  startForegroundService();
}

void startForegroundService() async {
  FlutterGovarForegroundService.startService('test title', 'test text');
  debugPrint("Started service");
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Foreground Service Example'),
        ),
        body: Center(
            child: Text('Foreground service example, check notification bar')),
      ),
    );
  }

  @override
  void dispose() {
    FlutterGovarForegroundService.stopService();
    super.dispose();
  }
}
0
likes
140
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

Foreground service for the Android platform, keeps app running even when in background.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_govar_foreground_service

Packages that implement flutter_govar_foreground_service