$ show ABausG/home_widget
This monorepo provides a Flutter plugin ecosystem for creating native home screen widgets on iOS (WidgetKit) and Android (Jetpack Glance). It consists of three core packages: `home_widget` (Dart API for data persistence, updates, scheduling, and background interactions), `home_widget_generator` (annotation-based code generation emitting SwiftUI and Kotlin code from `@HomeWidget` annotations), and `home_widget_cli` (command-line tool for scaffolding and patching native projects). The plugin handles cross-platform widget lifecycle, configuration, localized text, timed data, interactive clicks, image assets, and widget previews. Multiple example apps demonstrate features like configurable widgets, file sharing, lock screen widgets, and generator-based layouts. The architecture is a developer toolchain with a monorepo structure using Melos, extensive CI/CD workflows, and comprehensive unit and integration tests.
The LLM identified 4 files worth highlighting for reuse:
Programmatic patcher for Xcode project.pbxproj files. Adds widget extension targets, build configurations, file references, entitlements, and localized catalogs. Uses deterministic UUID generation and handles flavor-aware setups. Highly reusable for any Flutter plugin or tool that needs to modify Xcode projects without manual steps.
Enum defining all native utility functions (locale resolution, formatting, image decoding) with paired Swift and Kotlin body templates. Each helper includes dependency ordering and is emitted only when required. Demonstrates a clean pattern for maintaining parallel native code across platforms from a single Dart source.
Core Dart API exposing methods like saveWidgetData, updateWidget, scheduleWidgetUpdates, registerBackgroundCallback, and widget pinning. Abstracts over MethodChannel for Android and iOS, handling data serialization, file isolation via app groups, and error recovery. A well-structured example of a Flutter platform channel surface.
Decodes constant analyzer objects from @HomeWidget annotations into a typed widget tree. Handles nested widget structures, data fields, and configuration. Demonstrates robust use of the Dart analyzer API for code generation, including error handling for unsupported types.