macos_user_attention 0.0.2 copy "macos_user_attention: ^0.0.2" to clipboard
macos_user_attention: ^0.0.2 copied to clipboard

PlatformmacOS

A Flutter Plugin for MacOS User Attention API

macos_user_attention #

A Flutter Plugin for MacOS User Attention API

Getting Started #

Step 1: Add the package to pubspec.yaml #


dependencies:
    macos_user_attention:

Step 2: Initialize MacosUserAttention() #

import 'package:macos_user_attention/macos_user_attention.dart';

final _plugin = MacosUserAttention();

Request User Attention #

There are two types of requests you can ask for

enum RequestUserAttentionType {
  critical,
  informational,
}

Critical Request

final requestId = await _plugin.requestUserAttention(
        RequestUserAttentionType.critical,
    );

Informational Request

final requestId = await _plugin.requestUserAttention(
        RequestUserAttentionType.informational,
    );

Cancel Request

await _plugin.cancelAttentionRequest(requestId);

NOTE: #

  • You can only request user attention if your app is not in focus.
2
likes
150
points
39
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter Plugin for MacOS User Attention API

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on macos_user_attention