widget

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package widget updates the app's home-screen widget.

widget.Update(a, widget.Content{Title: "Inbox", Text: "3 unread"})

Android: the host's AppWidget (org.tango.host.TangoWidget), added to the manifest when tan.json "permissions" lists "widget". It shows a title and a text; tapping it opens the app. The content is stored and survives restarts and reboots, so the widget shows the last value even while the app is not running.

iOS widgets are WidgetKit extensions written in SwiftUI and are not built by tan yet (see docs/specs/mobile-extensions.md): Update returns ErrUnsupported there, as on desktop.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupported   = platform.ErrUnsupported
	ErrNotConfigured = platform.ErrNotConfigured // the app does not declare the widget
)

Functions

func Update

func Update(a *tango.App, c Content) error

Update replaces what the widget shows.

Types

type Content

type Content = platform.WidgetContent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL