flutter_list_exposure

Last updated:

0 purchases

flutter_list_exposure Image
flutter_list_exposure Images
Add to Cart

Description:

flutter list exposure

Features #
A Flutter point-of-the-spot solution that currently supports scrollable Widget exposure

Scrollable Exposure: It can be used at all ScrollView Widgets like: ListView , GridView, CustomScrollView and so on.

Getting started #

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

dependencies:
flutter_exposure: ^0.0.1
copied to clipboard

Install it
You can install packages from the command line:
with pub:

$ pub get
copied to clipboard
with Flutter:
$ flutter pub get
copied to clipboard

Import it #
Now in your Dart code, you can use:

import 'package:exposure/exposure.dart';
copied to clipboard
Usage #
Wrap ScrollDetailProvider widget on your ScrollView,
then Wrap Exposure on the widget you want to know when user see it.
You can get onExpose callback when widget expose.
If you want to wait until the scroll is over to detect exposure,
you can set the lazy property of ScrollDetailProvider to true.
You can also control the proportion of widgets you want to expose through exposeFactor.
ScrollDetailProvider(
lazy: true, // default value: false
child: ListView.builder(
itemCount: 200,
itemBuilder: (context, index) {
return Exposure(
exposeFactor: 0.9, // default value: 0.5
onExpose: () { // required
debugPrint('$index');
},
onHide: (duration) {
debugPrint('$duration');
},
child: Text('$index'),
);
},
),
)
copied to clipboard
Example #
Here is some example of usage.
Track It Every Time
A ListView has items of different heights, tracking the time when each item enters the user's field of vision.

Lazy Track
A ListView has items of different heights, and only when the scrolling is over, the items in the field of view are tracked.

CustomScrollView
It also support track in CustomScrollView with different slivers.

Bugs or Requests #
If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull request are also welcome.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.