Buscar pacotes, repositórios e categorias de apps

Capa de touchable_opacity
Detalhes do pacotev1.2.0

touchable_opacity

Este widget permite fornecer um feedback visual mais claro aos usuários quando eles interagem com seu aplicativo, semelhante ao TouchableOpacity do React Native.

AndroidiOSWebmacOSWindowsLinux
Downloads em 30 dias
7 mil
Curtidas
17
Pontos Pub
140

Instalar pacote

flutter pub add touchable_opacity

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

O pacote touchable_opacity fornece um widget Flutter que oferece feedback visual quando os usuários interagem com elementos da interface, imitando o comportamento do TouchableOpacity do React Native. Ele melhora a experiência do usuário ao alterar sutilmente a opacidade ao pressionar, tornando as interações mais responsivas. Compatível com todas as principais plataformas, incluindo Android, iOS, Web, macOS, Windows e Linux, integra-se perfeitamente em projetos Flutter existentes. O pacote é leve e projetado para simplicidade, focando em feedback tátil intuitivo sem complexidade adicional.

Casos de uso

  • Adicionando feedback interativo a botões
  • Melhorando a UX em aplicativos móveis e web
  • Criando elementos de interface responsivos
  • Melhorando a acessibilidade por meio de pistas visuais
  • Simplificando o tratamento de gestos em formulários

Principais recursos

  • Feedback de pressão baseado em opacidade
  • Compatibilidade multiplataforma
  • Configuração mínima necessária
  • Corresponde ao comportamento do TouchableOpacity do React Native
  • Leve e eficiente

Indicado para

  • Desenvolvedores Flutter familiarizados com o React Native
  • Aplicativos que exigem feedback de toque consistente
  • aplicações com foco em UI
  • Desenvolvedores procurando melhorias simples de gestos
  • Projetos direcionados para múltiplas plataformas

Considerações

  • Limitado a mudanças de opacidade (sem outras animações)
  • Não adequado para interações de gestos complexas
  • Pode exigir estilos adicionais para efeitos personalizados
  • Depende de repositório externo de código-fonte
  • Sem suporte embutido para feedback háptico

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

touchable_opacity

Version Build Status codecov

This package gives you access to the Touchableopacity widget. This widget uses the GestureDetector to allow interaction and animated to opacity of the widget on touch events.

Installing

Add the package to your pubspec.yaml file

dependencies:
	touchable_opacity: 1.2.0
Usage

Import the package using

import 'package:touchable_opacity/touchable_opacity.dart';

And simply use it as any other widget.

Container(
	child: TouchableOpacity(
		activeOpacity: 0.4,
		child: FlutterLogo(),
	),
),
Configuration

TouchableOpacity uses gestureDetector internally and tries to maintain all the different behaviours and interactions that gesture detector enables. To understand the different touch events that you can configure please visit the GestureDetector API docs here.

activeOpacity: double value that TouchableOpacity uses to animate the opacity of the child when a touch down event is received. The value must be between 1.0 and 0.0, the default value is 0.2 .

Example

The code found in the example folder of this repo shows how to use this package to render the content shown in the sample GIF. The folder contains a Flutter application that you can run yourself. Go here to jump into the code.

Support

If you have any issues with using this package, or have any ideas you thnk are good additions please create an issue here

Known Issues

Because of the way GestureDetector renders, TouchableOpacity fills its parent. If you want to bound the size to that of its child simply place the TouchableOpacity widget in any one of the Layout widgets, you can see a list of layout widgets available in flutter here

Categorias

Repositório-fonte

Projetos que usam este pacote