Last updated:
0 purchases
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.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.