Token导航 LogoToken导航

Agent Skill · 前端设计

flutter-home-screen-widget(Flutter home screen widget 命令行)

flutter-home-screen-widget 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

flutter-home-screen-widget 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 734。

总安装 12,949周安装 545GitHub Stars 1,310下载 4,534核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:flutter-home-screen-widget(Flutter home screen widget 命令行)
来源仓库:https://github.com/flutter/skills
仓库路径:skills/flutter-home-screen-widget
安装命令:
npx skills add https://github.com/flutter/skills --skill flutter-home-screen-widget
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/flutter/skills --skill flutter-home-screen-widget

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

适用于 iOS 和 Android 上 Flutter 应用程序的本机主屏幕小部件,具有跨平台数据共享功能。

通过应用程序组 (iOS) 和 SharedPreferences (Android) 在 Dart 和本机平台之间建立数据共享,从而可以从 Flutter 应用程序更新小部件 支持简单的基于文本的小部件和复杂的 Flutter UI 呈现为静态图像以进行本机显示 需要在 Xcode(带有 Swift TimelineProvider 的 Widget Extension 目标)和 Android Studio(带有 XML 布局和 Kotlin 实现的 AppWidgetProvider)中进行本机设置 应用程序组 ID 和小部件名称必须在 Dart、Swift 和 Kotlin 中完全匹配;本机代码更改需要完全重建并在主屏幕上重新添加小部件

来源仓库内路径:skills/flutter-home-screen-widget

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/flutter/skills --skill flutter-home-screen-wid…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

flutter-home-screen-widget 怎么安装?

在终端执行 npx skills add https://github.com/flutter/skills --skill flutter-home-screen-widget。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

flutter-home-screen-widget 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

flutter-home-screen-widget 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

flutter-home-screen-widget 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

flutter-home-screen-widget 用的人多吗?

公开数据是累计安装 12,949 次,近一周安装 545 次,下载 4,534 次,GitHub 1,310 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

flutter-home-screen-widget 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 1,310 星,维护活跃度相对可查。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
flutter-home-screen-widget

Flutter home screen widget 命令行 · 本页

12,9491,310需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

flutter-home-screen-widgets

Goal

Implements native home screen widgets (iOS and Android) for a Flutter application using the home_widget package. It establishes data sharing between the Dart environment and native platforms via App Groups (iOS) and SharedPreferences (Android), enabling text updates and rendering Flutter UI components as images for native display. Assumes a pre-existing Flutter project environment with native build tools (Xcode and Android Studio) configured.

Instructions

  1. Initialize Dependencies Add the home_widget package to the Flutter project. flutter pub add home_widget flutter pub get
  2. Decision Logic: Platform & Feature Selection Determine the target platforms and required widget capabilities. [BLOCKING] User Consultation BEFORE performing any implementation, you MUST ask: *Flowchart:*

- "Which platforms are you targeting?" - "Do you need simple text or complex UI?" - If iOS -> Proceed to Step 4 (iOS Native Setup). - If Android -> Proceed to Step 5 (Android Native Setup). - If rendering Flutter UI as images -> Proceed to Step 6 after basic setup.

  1. Implement Dart Data Sharing Logic Create the Dart logic to save data to the native key/value store and trigger widget updates. import 'package:home_widget/home_widget.dart'; // Replace with actual App Group ID for iOS const String appGroupId = 'group.com.yourcompany.app'; const String iOSWidgetName = 'NewsWidgets'; const String androidWidgetName = 'NewsWidget'; Future<void> updateWidgetData(String title, String description) async {await HomeWidget.setAppGroupId(appGroupId); await HomeWidget.saveWidgetData<String>('headline_title', title); await HomeWidget.saveWidgetData<String>('headline_description', description); await HomeWidget.updateWidget(iOSName: iOSWidgetName, androidName: androidWidgetName,);}
  2. iOS Native Setup (If applicable) import WidgetKit import SwiftUI struct NewsArticleEntry: TimelineEntry {let date: Date let title: String let description: String} struct Provider: TimelineProvider {func placeholder(in context: Context) -> NewsArticleEntry {NewsArticleEntry(date: Date(), title: "Placeholder Title", description: "Placeholder description")} func getSnapshot(in context: Context, completion: @escaping (NewsArticleEntry) -> ()) {let entry: NewsArticleEntry if context.isPreview {entry = placeholder(in: context)} else {// Replace with actual App Group ID let userDefaults = UserDefaults(suiteName: "group.com.yourcompany.app") let title = userDefaults?.string(forKey: "headline_title")?? "No Title Set" let description = userDefaults?.string(forKey: "headline_description")?? "No Description Set" entry = NewsArticleEntry(date: Date(), title: title, description: description)} completion(entry)} func getTimeline(in context: Context, completion: @escaping (Timeline<Entry>) -> ()) {getSnapshot(in: context) {(entry) in let timeline = Timeline(entries: [entry], policy:.atEnd) completion(timeline)}}} struct NewsWidgetsEntryView: View {var entry: Provider.Entry var body: some View {VStack(alignment:.leading) {Text(entry.title).font(.headline) Text(entry.description).font(.subheadline)}}} *Validate-and-Fix:* Run flutter build ios --config-only to ensure the Flutter configuration syncs with the new Xcode targets. If build fails, verify the App Group ID matches exactly between Dart and Swift.

- Configure an App Group in Xcode for both the Runner target and the Widget Extension target. - Create a Widget Extension target in Xcode (e.g., NewsWidgets). Uncheck "Include Live Activity" and "Include Configuration Intent". - Implement the TimelineProvider and View in Swift:

  1. Android Native Setup (If applicable) <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget_container" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/white"> <TextView android:id="@+id/headline_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Title" android:textStyle="bold" android:textSize="20sp" /> <TextView android:id="@+id/headline_description" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/headline_title" android:text="Description" android:textSize="16sp" /> </RelativeLayout> package com.yourdomain.yourapp import android.appwidget.AppWidgetManager import android.appwidget.AppWidgetProvider import android.content.Context import android.widget.RemoteViews import es.antonborri.home_widget.HomeWidgetPlugin class NewsWidget: AppWidgetProvider() {override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) {for (appWidgetId in appWidgetIds) {val widgetData = HomeWidgetPlugin.getData(context) val views = RemoteViews(context.packageName, R.layout.news_widget).apply {val title = widgetData.getString("headline_title", null) setTextViewText(R.id.headline_title, title?: "No title set") val description = widgetData.getString("headline_description", null) setTextViewText(R.id.headline_description, description?: "No description set")} appWidgetManager.updateAppWidget(appWidgetId, views)}}}

- Create an AppWidgetProvider in Android Studio (New -> Widget -> App Widget). - Define the XML layout (res/layout/news_widget.xml): - Implement the Kotlin Provider (NewsWidget.kt):

  1. Render Flutter Widgets as Images (Optional) If the user requires complex UI (like charts) on the widget, render the Flutter widget to a PNG and pass the file path. *Dart Implementation:* final _globalKey = GlobalKey(); // Wrap your target widget with a RepaintBoundary/Key // Center(key: _globalKey, child: const LineChart()) Future<void> renderAndSaveWidget() async {if (_globalKey.currentContext!= null) {var path = await HomeWidget.renderFlutterWidget(const LineChart(), fileName: 'screenshot', key: 'filename', logicalSize: _globalKey.currentContext!.size, pixelRatio: MediaQuery.of(_globalKey.currentContext!).devicePixelRatio,); await HomeWidget.updateWidget(iOSName: iOSWidgetName, androidName: androidWidgetName);}} *Native Image Loading (Android Example):* // Inside RemoteViews apply block: val imageName = widgetData.getString("filename", null) val imageFile = java.io.File(imageName) if (imageFile.exists()) {val myBitmap = android.graphics.BitmapFactory.decodeFile(imageFile.absolutePath) setImageViewBitmap(R.id.widget_image, myBitmap)}

Constraints

  • Immutable Native Identifiers: The iOSName and androidName in Dart MUST exactly match the Swift struct name and Kotlin class name respectively.
  • App Group Prefix: iOS App Group IDs MUST be prefixed with group. and match exactly in Xcode capabilities, Swift UserDefaults(suiteName:), and Dart HomeWidget.setAppGroupId().
  • No Direct Flutter UI: Never attempt to render Flutter widgets directly in the native widget lifecycle. You MUST use renderFlutterWidget to generate a static image if complex UI is required.
  • Full Re-run Required: Changing native code (PendingIntents, Layouts, Manifest) requires a full flutter run.
  • Widget Re-add: After native changes, it is often necessary to remove and re-add the widget on the home screen for changes to take effect.
  • Android Cell Sizing: Android widget dimensions in res/xml/*_info.xml must be calculated in cells (e.g., minWidth="250dp"). Do not use arbitrary pixel values.
  • Validate-and-Fix: Always instruct the user to run native builds (flutter build ios / flutter build apk) after modifying native files to catch syntax or linking errors immediately.

平台分布

Codex

34.87%
按下载量换算1,581

Claude

30.51%
按下载量换算1,383

Cursor

19.42%
按下载量换算881

Gemini CLI

11.16%
按下载量换算506

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills