macos_user_attention

Last updated:

0 purchases

macos_user_attention Image
macos_user_attention Images
Add to Cart

Description:

macos user attention

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:
copied to clipboard
Step 2: Initialize MacosUserAttention() #
import 'package:macos_user_attention/macos_user_attention.dart';

final _plugin = MacosUserAttention();
copied to clipboard
Request User Attention #
There are two types of requests you can ask for
enum RequestUserAttentionType {
critical,
informational,
}
copied to clipboard
Critical Request
final requestId = await _plugin.requestUserAttention(
RequestUserAttentionType.critical,
);

copied to clipboard
Informational Request
final requestId = await _plugin.requestUserAttention(
RequestUserAttentionType.informational,
);

copied to clipboard
Cancel Request
await _plugin.cancelAttentionRequest(requestId);

copied to clipboard
NOTE: #

You can only request user attention if your app is not in focus.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.