gg_timeline

Last updated:

0 purchases

gg_timeline Image
gg_timeline Images
Add to Cart

Description:

gg timeline

GgTimeline allows you to manage arbitrary data like on a timeline.
Features #

Arrange arbitrary data on a timeline
Retrieve data values from arbitrary time positions
Replace existing items on a timeline
There is always a valid value on the timeline

Usage #
Derive your custom timeline class by extending GgTimeline<T>.
class ExampleTimeline extends GgTimeline<int> {
}
copied to clipboard
Implement the seed property providing an initial value. GgTimeline will add
the seed into the timeline at position 0. Thus timeline will always provide a
valid value.
@override
int get seed => 0;
copied to clipboard
Add additional items using addOrReplaceItem(...):
ExampleTimeline() {
for (int i = 0; i < 20; i++) {
addOrReplaceItem(
data: i,
validFrom: i.toDouble(),
);
}
}
copied to clipboard
Now you can instantiate your timeline and retrieve values from arbitrary time positions:
final timeline = ExampleTimeline();
final firstItem = timeline.item(0.0);
final secondItem = timeline.item(1.0);
final lastItem = timeline.item(50.0);
copied to clipboard
You can also retrieve timeline items for positions in between:
final firstItem2 = timeline.item(0.5);
copied to clipboard
Features and bugs #
Please file feature requests and bugs at GitHub.

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.