2847092782
Test / test (push) Successful in 7m16s
- no stubs for iOS and macOS yet Signed-off-by: Peter Siegmund <developer@mars3142.org>
59 lines
1.2 KiB
Dart
59 lines
1.2 KiB
Dart
// ToasterUtilsApi must be abstract.
|
|
// ignore_for_file: one_member_abstracts
|
|
|
|
import 'package:pigeon/pigeon.dart';
|
|
|
|
@ConfigurePigeon(
|
|
PigeonOptions(
|
|
dartOut: 'lib/src/messages.g.dart',
|
|
dartPackageName: 'toaster_utils',
|
|
swiftOut: 'macos/toaster_utils_macos/Sources/toaster_utils_macos/Messages.g.swift',
|
|
swiftOptions: SwiftOptions(),
|
|
copyrightHeader: 'pigeons/copyright.txt',
|
|
),
|
|
)
|
|
@HostApi()
|
|
abstract class ToasterUtilsApi {
|
|
@async
|
|
String? getPlatformName();
|
|
|
|
@async
|
|
List<App> getInstalledApps();
|
|
|
|
@async
|
|
App? getInstalledApp(String packageName);
|
|
|
|
@async
|
|
List<Toast> getToasts(String packageName);
|
|
|
|
@async
|
|
List<Toast> getToastFiltered(String packageName, int from);
|
|
|
|
@async
|
|
bool isServiceRunning();
|
|
|
|
@async
|
|
void showSettings();
|
|
|
|
@async
|
|
void exampleToast();
|
|
}
|
|
|
|
class App {
|
|
const App(this.packageName, this.appName, this.installedBy, this.icon);
|
|
|
|
final String packageName;
|
|
final String appName;
|
|
final String installedBy;
|
|
final Uint8List icon;
|
|
}
|
|
|
|
class Toast {
|
|
const Toast(this.app, this.message, this.timestamp, this.duration);
|
|
|
|
final App app;
|
|
final String message;
|
|
final int timestamp;
|
|
final int duration;
|
|
}
|