Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0fatal/flutter_macos_widget
Develop for macOS app widget.
https://github.com/0fatal/flutter_macos_widget
Last synced: 23 days ago
JSON representation
Develop for macOS app widget.
- Host: GitHub
- URL: https://github.com/0fatal/flutter_macos_widget
- Owner: 0fatal
- License: mit
- Created: 2023-01-06T09:34:41.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-09T08:02:20.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T10:23:00.301Z (2 months ago)
- Language: Swift
- Homepage: https://pub.dev/packages/flutter_macos_widget
- Size: 184 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# flutter_macos_widget
Flutter Library for macOS WidgetKit and Widget Communication
## 💡 Usage
### 1. Flutter
```dart
import 'package:flutter_macos_widget/flutter_macos_widget.dart';final widgetKit = FlutterMacosWidget("appGroup");
// use "UseDefaults" to communicate with Widget
widgetKit.set("key", "value")
widgetKit.get("key")
widgetKit.remove("key")// force reload macOS widget
FlutterMacosWidget.reloadAllTimelines();
FlutterMacosWidget.reloadTimelines("ofKind");
```
### 2. Swift
```swift
let value = UserDefaults(suiteName: "appGroup")!.string(forKey: "key")
```