Skip to content

Commit bdf213e

Browse files
committed
Update README and pubspec
1 parent f4ab42d commit bdf213e

File tree

3 files changed

+72
-4
lines changed

3 files changed

+72
-4
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Changelog
22

33
## 0.0.1
4+
5+
Initial release

README.md

+69-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,72 @@
1-
# Occurrence Time Range Selector
1+
# 📊 Occurrence Time Range Selector
22

3-
Flutter widget that lets the user "select" a time range while displaying an events occurrence chart.
3+
A highly interactive and customizable Flutter widget that allows users to select a time range while visualizing event occurrences on a dynamic chart.
44

5-
![image](https://github.com/user-attachments/assets/23c158d2-0a73-46fd-a872-6304ca07bc1b)
5+
![example_screenshot](https://github.com/user-attachments/assets/23c158d2-0a73-46fd-a872-6304ca07bc1b)
66

7+
## ✨ Features
8+
9+
- 🔍 Zoom and pan functionality for detailed exploration
10+
- 📅 Dynamic time scale adapting to the selected range
11+
- 📊 Stacked vertical bars for multiple event classes
12+
- 🎨 Customizable colors and styles
13+
- ⏱️ Millisecond precision for high-detail views
14+
- 🖱️ Optimized for desktop use with mouse and keyboard
15+
16+
## 🚀 Getting Started
17+
18+
### Usage
19+
20+
Import the package in your Dart code:
21+
22+
```dart
23+
import 'package:occurrence_time_range_selector/occurrence_time_range_selector.dart';
24+
```
25+
26+
Then, you can use the `TimeRangeSelector` widget in your Flutter app:
27+
28+
```dart
29+
final now = DateTime.now();
30+
31+
TimeRangeSelector(
32+
startDate: now.subtract(Duration(days: 30)),
33+
endDate: now.add(Duration(days: 30)),
34+
events: [
35+
TimeEvent(tag: 'Class A', dateTime: now.subtract(Duration(days: 15))),
36+
TimeEvent(tag: 'Class B', dateTime: now.subtract(Duration(days: 7))),
37+
TimeEvent(tag: 'Class A', dateTime: now),
38+
TimeEvent(tag: 'Class C', dateTime: now.add(Duration(days: 10))),
39+
TimeEvent(tag: 'Class B', dateTime: now.add(Duration(days: 20))),
40+
],
41+
tagStyles: const {
42+
'Class A': TagStyle(color: Colors.blue),
43+
'Class B': TagStyle(color: Colors.red),
44+
'Class C': TagStyle(color: Colors.green),
45+
},
46+
onRangeChanged: (DateTime newStart, DateTime newEnd) {
47+
print('New range: $newStart to $newEnd');
48+
},
49+
style: const TimelineStyle(
50+
axisColor: Colors.black,
51+
axisLabelStyle: TextStyle(fontSize: 18, color: Colors.black),
52+
barSpacing: 2,
53+
backgroundColor: Colors.white,
54+
),
55+
)
56+
```
57+
58+
## 🛠️ Customization
59+
60+
The `TimeRangeSelector` widget offers various customization options:
61+
62+
- `tagStyles`: Define colors for different event classes
63+
- `style`: Customize the appearance of the timeline
64+
- `minZoomFactor` and `maxZoomFactor`: Set limits for zooming capabilities
65+
66+
## 📄 License
67+
68+
This project is licensed under the MIT License - see the [LICENSE](link_to_license_file) file for details.
69+
70+
---
71+
72+
Made with ❤️ by [odd.io](https://odd.io/)

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: flutter_occurrence_time_range_selector
2-
description: "Flutter widget that lets the user select a time range while displaying an events occurrence chart."
2+
description: "A highly interactive and customizable Flutter widget that allows users to select a time range while visualizing event occurrences on a dynamic chart."
33
version: 0.0.1
44
homepage: https://github.com/odd-io/flutter_occurrence_time_range_selector
55

0 commit comments

Comments
 (0)