@@ -16,107 +16,6 @@ This package defines the common API contract (Dart side) that all platform imple
1616
1717---
1818
19- ## ✨ What it provides
19+ ## License
2020
21- * ` AppInfo ` model → metadata for installed apps (package name, version, install/update times, system flag, optional icon bytes).
22- * ` AppChangeEvent ` model → events for install, uninstall, update.
23- * ` FlutterDeviceAppsPlatform ` abstract class → base interface every platform package must extend.
24- - ` listApps() ` - List installed applications
25- - ` getApp() ` - Get details for a specific app
26- - ` openApp() ` - Launch an application
27- - ` openAppSettings() ` - Open app settings page
28- - ` uninstallApp() ` - Uninstall an application
29- - ` getInstallerStore() ` - Get installer store information
30- - ` appChanges ` - Stream of app change events
31- - ` startAppChangeStream() ` / ` stopAppChangeStream() ` - Control event monitoring
32-
33- ---
34-
35- ## 🚫 When NOT to use this package
36-
37- You should ** not** depend on this package directly in your Flutter apps.
38-
39- Instead, use the umbrella package:
40-
41- ``` yaml
42- dependencies :
43- flutter_device_apps : latest_version
44- ` ` `
45-
46- This interface is only intended for platform implementors (e.g. ` flutter_device_apps_android`).
47-
48- ---
49-
50- # # 🛠 For platform implementors
51-
52- To add support for a new platform :
53-
54- 1. Create a new package (e.g. `flutter_device_apps_linux`).
55-
56- 2. Add a dependency on this package :
57-
58- ` ` ` yaml
59- dependencies:
60- flutter_device_apps_platform_interface: latest_version
61- ` ` `
62-
63- 3. Extend `FlutterDeviceAppsPlatform` and override the required methods :
64-
65- ` ` ` dart
66- class FlutterDeviceAppsLinux extends FlutterDeviceAppsPlatform {
67- @override
68- Future<List<AppInfo>> listApps({bool includeSystem = false, bool onlyLaunchable = true, bool includeIcons = false}) {
69- // implement using Linux APIs
70- }
71-
72- @override
73- Future<AppInfo?> getApp(String packageName, {bool includeIcon = false}) {
74- // implement
75- }
76-
77- @override
78- Future<bool> openApp(String packageName) {
79- // implement
80- }
81-
82- @override
83- Future<bool> openAppSettings(String packageName) {
84- // implement - open app settings page
85- }
86-
87- @override
88- Future<bool> uninstallApp(String packageName) {
89- // implement - uninstall app
90- }
91-
92- @override
93- Future<String?> getInstallerStore(String packageName) {
94- // implement - get installer store information
95- }
96-
97- @override
98- Stream<AppChangeEvent> get appChanges => _streamController.stream;
99-
100- @override
101- Future<void> startAppChangeStream() async {
102- // setup listener
103- }
104-
105- @override
106- Future<void> stopAppChangeStream() async {
107- // tear down listener
108- }
109- }
110- ` ` `
111-
112- 4. Register your implementation by setting :
113-
114- ` ` ` dart
115- FlutterDeviceAppsPlatform.instance = FlutterDeviceAppsLinux();
116- ` ` `
117-
118- ---
119-
120- # # 📄 License
121-
122- MIT © 2025 okmsbun
21+ MIT © 2026 okmsbun
0 commit comments