touchable_opacity 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 81

touchable_opacity #

Version Build Status codecov Maintained

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: 0.0.1

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

[1.0.2] - May 2019

  • Fix issue cause by incorrect disposing of animation controller.

[1.0.1] - May 2019

  • Documentation changes

[1.0.0] - May 2019

  • Initial Release

example/README.md

#Example

You can run this project directly, or look at the source code on github.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  touchable_opacity: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:touchable_opacity/touchable_opacity.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
65
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
81
Learn more about scoring.

We analyzed this package on Oct 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/touchable_opacity.dart.

Run flutter format to format lib/touchable_opacity.dart.

Maintenance suggestions

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test