launch_at_startup

pub version

This plugin allows Flutter desktop apps to Auto launch on startup / login.


English | 简体中文


Platform Support

LinuxmacOSWindows
✔️✔️✔️

⚠️ macOS only supports non-sandbox mode.

Quick Start

Installation

Add this to your package's pubspec.yaml file:

dependencies:
  launch_at_startup: ^0.2.0

Or

dependencies:
  launch_at_startup:
    git:
      url: https://github.com/leanflutter/launch_at_startup.git
      ref: main

Usage

import 'dart:io';

import 'package:launch_at_startup/launch_at_startup.dart';
import 'package:package_info_plus/package_info_plus.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  PackageInfo packageInfo = await PackageInfo.fromPlatform();

  launchAtStartup.setup(
    appName: packageInfo.appName,
    appPath: Platform.resolvedExecutable,
  );

  
  await launchAtStartup.enable();
  await launchAtStartup.disable();
  bool isEnabled = await launchAtStartup.isEnabled();

  runApp(const MyApp());
}

// ...

Please see the example app of this plugin for a full example.

Who's using it?

License

MIT

Libraries

launch_at_startup