搜索插件、代码仓与 APP 分类

flutter_widgetkit 封面
插件详情v1.0.3

flutter_widgetkit

适用于 iOS 小部件扩展的 Flutter 库。将小部件集成到您的应用中

iOS
近 30 天下载
7050
喜欢数
63
Pub 分数
140

安装插件

flutter pub add flutter_widgetkit

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Flutter WidgetKit 是一个库,可让 Flutter 应用程序集成 iOS 小部件扩展,使开发者能够在 iOS 主屏幕上显示动态内容。它将 Flutter UI 与 Apple 的 WidgetKit 框架连接起来,实现 Flutter 构建的小部件无缝集成到 iOS 应用小部件中。此包简化了创建交互式且视觉上一致的小部件的过程,能够实时反映应用数据。专为 iOS 设计,它通过提供快速访问关键信息的途径来增强用户参与度,而无需启动完整应用。

适合场景

  • 在主屏幕上显示实时应用数据
  • 为生产力应用程序创建交互式小部件
  • 通过快速应用访问提升用户参与度
  • 展示实时更新,例如天气或通知
  • 使用动态内容构建自定义应用图标

主要特点

  • 与 iOS WidgetKit 的无缝集成
  • 支持动态和静态小部件内容
  • 实时数据同步
  • 跨平台一致性与Flutter UI
  • 通过 pub add 命令轻松设置

适合对象

  • 专注于 iOS 的 Flutter 开发者
  • 需要主屏幕小部件的应用程序
  • 开发交互式仪表板的开发者
  • 针对苹果生态系统用户的团队
  • 需要实时小部件更新的项目

使用建议

  • 需要 iOS 平台目标
  • 仅限iOS;Android上不可用
  • 需要 Xcode 配置以扩展小部件
  • 可能需要额外的代码来处理复杂交互
  • 依赖于苹果的 WidgetKit API 的稳定性

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

flutter_widgetkit

flutter widgetkit

Flutter Library for the iOS 🍏 WidgetKit framework and Widget Communication

widget_small widget_medium widget_small

Table of Contents 📚

Introduction 👨‍🏫

This library allows you to call essential methods from the iOS "WidgetKit Framework", which are needed when developing a widget. For example updating the widget timelines. It is also possible to communicate with the widget via App Groups/UserDefaults.

🚨 To be on the safe side: This library exposes API functionality of WidgetKit. The widgets themselves must be developed natively in SwiftUI.

ℹ️ Blog about writing a Widget with this library

Installation 🖇‍

Add flutter_widgetkit as a dependency in your pubspec.yaml file.

Usage 👨🏻‍💻

import 'package:flutter_widgetkit/flutter_widgetkit.dart';

// Reloading Widget Timelines
WidgetKit.reloadAllTimelines();
WidgetKit.reloadTimelines('test');

// Communicate with Widget
WidgetKit.setItem('testString', 'Hello World', 'group.com.fasky');

Methods 📖‍

WidgetKit.reloadAllTimelines()

Reloads the timelines for all configured widgets belonging to the containing app.


WidgetKit.reloadTimelines(ofKind: String)

Reloads the timelines for all widgets of a particular kind.


WidgetKit.setItem(String key, dynamic value, String appGroup)

Writes Key-Value to UserDefaults database.


WidgetKit.getItem(String key, String appGroup)

Reads Value from UserDefaults database.


WidgetKit.removeItem(String key, String appGroup)

Removes Value for Key from UserDefaults database.


Contributors 🤓

Thomas Leiter

Thomas Leiter

License 🔖

MIT License

Copyright (c) 2020 Thomas Leiter, Fasky OG

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。