IframeEmbed class

Embute uma URL qualquer (outro site, vídeo do YouTube, mapa, formulário…) dentro do seu site, num <iframe> responsivo e seguro.

Exemplos:

IframeEmbed('https://exemplo.com')                       // altura fixa (480px)
IframeEmbed('https://youtube.com/embed/ID', ratio: '16 / 9') // responsivo
IframeEmbed('https://site.com', height: 600, rounded: false)
Inheritance

Constructors

IframeEmbed(String url, {String title = 'Conteúdo incorporado', String? ratio, int height = 480, String? cssHeight, bool rounded = true, bool lazy = true, bool allowFullscreen = true, String? allow, String? sandbox, String? classes, Key? key})
const

Properties

allow → String?
Permissões extras (ex.: 'clipboard-write; geolocation; encrypted-media').
final
allowFullscreen → bool
Permite tela cheia (adiciona fullscreen ao allow).
final
classes → String?
Classes CSS aplicadas ao elemento externo.
final
cssHeight → String?
Altura em CSS puro (ex.: 'calc(100vh - 72px)'). Tem prioridade sobre height quando definido. Ignorado quando ratio estiver definido.
final
hashCode → int
The hash code for this object.
no setterinherited
height → int
Altura fixa em px quando ratio e cssHeight são nulos.
final
key → Key?
Controls how one component replaces another component in the tree.
finalinherited
lazy → bool
Carregamento adiado (só carrega ao chegar perto da viewport).
final
ratio → String?
Proporção responsiva (ex.: '16 / 9', '4 / 3'). Se definido, ignora height e o iframe ocupa 100% da largura mantendo a proporção.
final
rounded → bool
Cantos arredondados.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sandbox → String?
sandbox do iframe. null = sem sandbox (carrega tudo); '' = restrição máxima; ou tokens (ex.: 'allow-scripts allow-same-origin').
final
title → String
Título acessível do quadro.
final
url → String
URL a carregar (pode ser outro site).
final

Methods

build(BuildContext context) → Component
Describes the part of the user interface represented by this component.
override
createElement() → Element
Creates a StatelessElement to manage this component's location in the tree.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRebuild(covariant Component newComponent) → bool
Implement this method to determine whether a rebuild can be skipped.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited