Orientação gerada a partir de informações públicas. Apenas para referência.
Octo Image é um widget versátil do Flutter projetado para lidar com o carregamento de imagens com recursos avançados, como espaços reservados, tratamento de erros e transições suaves de desvanecimento. Ele suporta transformações de imagem e oferece uma interface limpa e personalizável para exibir imagens em múltiplas plataformas. Construído para desempenho e conveniência do desenvolvedor, simplifica os desafios comuns de exibição de imagens em aplicativos Flutter. O pacote se integra perfeitamente aos fluxos existentes de carregamento de imagens e melhora a experiência do usuário com feedback visual durante os estados de carregamento.
Casos de uso
Exibindo imagens de rede com alternativas
Implementando placeholders de carregamento
Lidar com erros de carregamento de imagem com elegância
Aplicando filtros de imagem ou transformações
Criando efeitos de desvanecimento suave
Melhorando a responsividade da interface com pré-carregamento
Principais recursos
Suporta espaços reservados e widgets de erro
Recursos embutidos de transformação de imagem
Transições de desvanecimento suave
Compatibilidade multiplataforma
Estados personalizáveis de carregamento e erro
Cache eficiente e gerenciamento de memória
Indicado para
Aplicativos que exigem carregamento de imagem robusto
Desenvolvedores procurando por UX de imagem aprimorada
Projetos com fontes de imagem dinâmicas ou remotas
Aplicações com interface pesada e atualizações frequentes de imagem
Equipes que priorizam o comportamento consistente da imagem entre plataformas
Considerações
Requer configuração adicional para transformações avançadas
Pode aumentar ligeiramente o tamanho do pacote
Limitado a casos de uso específicos de imagem
Depende das bibliotecas de carregamento de imagem subjacentes
Não é ideal para exibições simples de imagens estáticas
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
OctoImage
An image library for showing placeholders, error widgets and transform your image.
The CircleAvatar set shows a colored circle with the text inside during loading and when the image failed loading. When the image loads it animates to the image clipped as a circle.
ImageProviders
The recommended one is CachedNetworkImageProvider, as that supports the progress indicator, error and caching.
It also works on Android, iOS, web and macOS, although without caching on the web. Make sure you use at least version 2.2.0.
The second best is NetworkImage, but any ImageProvider works in theory. However, for some ImageProviders (such as MemoryImage)
it doesn't make sense to use OctoImage.
Placeholders and progress indicators
It would be best if you used either a placeholder or a progress indicator, but not both.
Placeholders are only building once the image starts loading, but progress indicators are rebuilt every time new progress information is received.
So if you don't use that progress indication, for example, with a static image, you should use a placeholder.
The most simple progress indicators use a CircularProgressIndicator.
Shows a circularProgressIndicator with indeterminate progress.
frame
Shows the Flutter Placeholder
OctoProgressIndicator
Explanation
circularProgressIndicator
Shows a simple CircularProgressIndicator
Error widgets
Error widgets are shown when the ImageProvider throws an error because the image failed loading. You can build a custom widget, or use the prebuild widgets:
Image builders can be used to adapt the image before it is shown. For example the circleAvatar clips the image in a circle, but you could also add an overlay or anything else.
The builder function supplies a context and a child. The child is the image widget that is rendered.
You get the most out of OctoImage when you use OctoSets. These sets contain a combination of a placeholder or progress indicator,
an image builder and/or an error widget builder. It always contains at least a placeholder or progress indicator and an error widget.
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.
PR's with any new prebuild widgets or sets are highly appreciated.
Support
Feel free to open an issue. Make sure to use one of the templates!
Commercial support is available. Integration with your app or services, samples, feature request, etc. Email: [hello@baseflow.com](mailto:hello@baseflow.com)