Flutter library for iOS Widgets Extensions. Integrate a Widget into your App ๐Ÿ๐Ÿ“ฑ

Overview

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.

Comments
  • Migrate package to null-safety

    Migrate package to null-safety

    First of all thanks so much for creating this package. Working with iOS 14 widgets is so much faster without having to write all the boilerplate for reloading timelines or setting NSDefault values on the native side.

    I ran the migration tool for null-safety and this is what it came up with(the changes are really minimal because it doesn't depend on anything in pubspec.yaml).

    One thing I'm not really sure about is restricting the flutter version to >=2.0.0 under environment in pubspec.yaml. I checked a few other packages and some seem to make the restriction while others don't.

    opened by ThrowJojo 15
  • Build Failed

    Build Failed

    hello

    When I am trying to build for ios I get the following error

    `Automatically signing iOS for device deployment using specified development team in Xcode project: TYR8M23SD7 Running Xcode build...
    Xcode build done. 8.8s Failed to build iOS app Error output from Xcode build: โ†ณ ** BUILD FAILED **

    Xcode's output: โ†ณ /Users/mac/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_wi dgetkit-1.0.0/ios/Classes/SwiftFlutterWidgetkitPlugin.swift:15:9: error: cannot find 'WidgetCenter' in scope WidgetCenter.shared.reloadAllTimelines() ^~~~~~~~~~~~ /Users/mac/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_wi dgetkit-1.0.0/ios/Classes/SwiftFlutterWidgetkitPlugin.swift:23:11: error: cannot find 'WidgetCenter' in scope WidgetCenter.shared.reloadTimelines(ofKind: ofKind) ^~~~~~~~~~~~ /Users/mac/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_wi dgetkit-1.0.0/ios/Classes/SwiftFlutterWidgetkitPlugin.swift:58:36: warning: conditional cast from 'Any?' to 'Any' always succeeds let value = args["value"] as? Any { ^ Command CompileSwift failed with a nonzero exit code Command CompileSwift failed with a nonzero exit code note: Using new build system note: Building targets in parallel note: Planning build note: Constructing build description warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'flutter_widgetkit' from project 'Pods') warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'Flutter' from project 'Pods')

    It appears that your application still contains the default signing identifier. Try replacing 'com.example' with your signing id in Xcode: open ios/Runner.xcworkspace Encountered error while building for device.`

    opened by evripidesk 6
  • deleteItem / removeItem missing

    deleteItem / removeItem missing

    At first: Thank you soo much for this awesome Plugin! Very good job!

    But I am missing the remove/delete function in Flutter. I can get and set items, but not deleting a key/value pair from UserDefaults.

    Is that possible?

    best regards Rebar :)

    enhancement good first issue 
    opened by Ahmadre 4
  • List Widget

    List Widget

    Hello

    Excellent package! I tired your example and is working perfectly

    Now the question is how we can send a list of data and how we can change the code in swift?

    Thanks Evripides

    opened by evripidesk 3
  • Works in debug mode, does not in production

    Works in debug mode, does not in production

    Hello there, this is very strange and don't really know why.

    The library works perfectly in debug mode (running in simulator or on an iphone) when sending the app to the apple store via testflight nothing is returned from the library.

    The appgroup in my app was already present before using this library.

    Using the latest library version and latest xcode on Big Sur.

    [โœ“] Flutter (Channel stable, 1.22.2, on macOS 11.0.1 20B50, locale it-IT)
     
    [โœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    [โœ“] Xcode - develop for iOS and macOS (Xcode 12.2)
    [โœ“] Android Studio (version 4.1)
    [โœ“] VS Code (version 1.51.1)
    [!] Connected device
        ! No devices available
    ```
    opened by majindageta 2
  • Fixed

    Fixed "Table of Contents" in Readme

    Problem

    The link in "Table of Contents" didn't worked. See in this GIF QuickTime movie

    So I fixed it ๐Ÿ˜‰ You can try it out here: https://github.com/AndroidNils/flutter_widgetkit/tree/patch-1

    opened by nilsreichardt 1
  • Compatibility with IOS lock screen widgets

    Compatibility with IOS lock screen widgets

    Hi to all,

    is this library compatible also with lock screen widgets? https://developer.apple.com/documentation/widgetkit/creating-lock-screen-widgets-and-watch-complications

    there is some demo?

    Thanks

    opened by Cm-8 0
  • iOS 15.2 Widget flickering

    iOS 15.2 Widget flickering

    I am building a simple widget following your blog: https://itnext.io/develop-an-ios-14-widget-in-flutter-with-swiftui-e98eaff2c606

    I use almost exactly the same code, but after installed, the widget sometimes flickering(Also, caused another widget flickering). I don't see any patterns, but I captured some logs from XCode that might be related.

    2022-01-10 19:17:36.728257-0800 Runner[9972:877508] [widget] WidgetCenter connection interrupted.
    2022-01-10 19:17:45.321013-0800 Runner[9972:876637] [connection] nw_read_request_report [C10] Receive failed with error "Software caused connection abort"
    

    Could you please advise what to do?

    opened by FelixLou 0
  • How to debug the widget real-time?

    How to debug the widget real-time?

    Hey!

    Sorry for the question, but how can I debug or test this? For example, I am writing code on the flutter side and run the app, but I want to debug the widget and see the information coming to the widget and debug it. How can I achieve this? I have tried running the project on XCode but nothing happens

    opened by armandojimenez 0
Owner
Fasky
Fasky
Plugin to retrieve a persistent UDID across app reinstalls on iOS and Android.

flutter_udid Plugin to retrieve a persistent UDID across app reinstalls on iOS and Android. Getting Started import 'package:flutter_udid/flutter_udid.

Leon Kukuk 183 Dec 21, 2022
File picker plugin for Flutter, compatible with both iOS & Android and desktop (go-flutter).

File Picker A package that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support. Currently s

Miguel Ruivo 985 Jan 5, 2023
A Flutter plugin to easily handle realtime location in iOS and Android. Provides settings for optimizing performance or battery.

Flutter Location Plugin This plugin for Flutter handles getting location on Android and iOS. It also provides callbacks when location is changed. Gett

Guillaume Bernos 953 Dec 22, 2022
Flutter geolocation plugin for Android and iOS.

geolocation Flutter geolocation plugin for Android API 16+ and iOS 9+. Features: Manual and automatic location permission management Current one-shot

Loup 221 Dec 27, 2022
A Flutter plugin for displaying local notifications on Android, iOS and macOS

Flutter Local Notifications plugin This repository consists hosts the following packages flutter_local_notifications: code for the cross-platform faci

Michael Bui 2.1k Dec 30, 2022
Flutter Downloader - A plugin for creating and managing download tasks. Supports iOS and Android. Maintainer: @hnvn

Flutter Downloader A plugin for creating and managing download tasks. Supports iOS and Android. This plugin is based on WorkManager in Android and NSU

Flutter Community 789 Jan 3, 2023
Android and iOS Geolocation plugin for Flutter

Flutter Geolocator Plugin A Flutter geolocation plugin which provides easy access to platform specific location services (FusedLocationProviderClient

Baseflow 1k Jan 5, 2023
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.

On most operating systems, permissions aren't just granted to apps at install time. Rather, developers have to ask the user for permissions while the

Baseflow 1.7k Jan 3, 2023
Flutter Plugin for AR (Augmented Reality) - Supports ARKit on iOS and ARCore on Android devices

ar_flutter_plugin Flutter Plugin for AR (Augmented Reality) - Supports ARKit for iOS and ARCore for Android devices. Many thanks to Oleksandr Leuschen

Lars Carius 222 Jan 4, 2023
Telegram stickers importing Flutter plugin for iOS and Android

TelegramStickersImport โ€” Telegram stickers importing Flutter plugin for iOS and Android TelegramStickersImport helps your users import third-party pro

Iurii Dorofeev 20 Dec 3, 2022
A Flutter plugin that allows you to check if an app is installed/enabled, launch an app and get the list of installed apps.

Flutter AppAvailability Plugin A Flutter plugin that allows you to check if an app is installed/enabled, launch an app and get the list of installed a

Lorenzo Pichilli 89 Dec 2, 2022
A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.

Flutter InAppWebView Plugin A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser windo

Lorenzo Pichilli 2.3k Jan 8, 2023
Plugin to access VPN service for Flutter | Flutter ็š„ VPN ๆ’ไปถ

Flutter VPN plugin This plugin help developers to access VPN service in their flutter app. ๆœฌๆ’ไปถๅธฎๅŠฉๅผ€ๅ‘่€…ๅœจ่‡ชๅทฑ็š„ๅบ”็”จๅ†…่ฐƒ็”จ VPN ๆœๅŠกใ€‚ The Android part was implemented

Xdea 277 Dec 28, 2022
Community WebView Plugin - Allows Flutter to communicate with a native WebView.

NOTICE We are working closely with the Flutter Team to integrate all the Community Plugin features in the Official WebView Plugin. We will try our bes

Flutter Community 1.4k Jan 7, 2023
A lightweight Flutter plugin for making payments and printing on MyPos

my_poster ?? my_poster is in beta - please provide feedback (and/or contribute) if you find issues ??๏ธ A lightweight Flutter plugin for making payment

Antonio Mentone 3 Oct 10, 2022
Integrate easily the Paygate Global Platform into your Flutter app

Integrate easily the Paygate Global Platform into your Flutter app Features Implement payment with the Paygate Global Platform. Support for two paymen

Kokou AGBAVON 7 Dec 15, 2022
Flutter: Integrate Google Maps Tutorial Flutter: Integrate Google Maps Tutorial

Flutter Google Maps APP Show some โค๏ธ and star the repo to support the project A new Flutter project. Getting Started Flutter Project Add this to your

Pawan Kumar 69 Oct 27, 2022
Responsive Sizer helps implement are responsive layout by providing helper widgets and extensions

Responsive Sizer Responsive Sizer helps implement a responsive layout by providing helper widgets and extensions Content Installation Parameters Take

CoderUni 71 Jan 3, 2023
Material io ext - A collection of extensions for creating widgets following material.io guidelines

material_io_ext It is a collection of extensions for creating widgets following

null 3 Jan 28, 2022
Material io ext - A collection of extensions for creating widgets following material.io guidelines

material_io_ext It is a collection of extensions for creating widgets following

BetterX.io 3 Jan 28, 2022