background_to_foreground 0.0.1 copy "background_to_foreground: ^0.0.1" to clipboard
background_to_foreground: ^0.0.1 copied to clipboard

A plugin to bring the app from background to foreground.

example/lib/main.dart

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

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

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

  final _backgroundToForegroundPlugin = BackgroundToForeground();

  @override
  void initState() {
    super.initState();

  }

  // Platform messages are asynchronous, so we initialize in an async method.


  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Background to Foreground'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              BackgroundToForeground.bringToForeground();
            },
            child: Text('Bring to Foreground'),
          ),
        ),
      ),
    );
  }
}
2
likes
140
points
69
downloads

Publisher

verified publisherthecodeit.com

Weekly Downloads

A plugin to bring the app from background to foreground.

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on background_to_foreground