Skip to content

Commit 1b53fd8

Browse files
✅ added indicator position. just for skeleton
1 parent 0c4d6b8 commit 1b53fd8

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ packages:
7373
path: ".."
7474
relative: true
7575
source: path
76-
version: "0.0.4+2"
76+
version: "0.0.4+4"
7777
matcher:
7878
dependency: transitive
7979
description:

lib/indicator_position.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
enum IndicatorPosition{
2+
top,
3+
center,
4+
bottom
5+
}

lib/timeline_theme_data.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import 'package:flutter/foundation.dart';
22
import 'package:flutter/material.dart';
3+
import 'package:flutter_timeline/indicator_position.dart';
34

4-
@immutable
5+
/// [TimelineThemeData] is passed through [TimelineTheme], works like general flutter theme object.
56
class TimelineThemeData with Diagnosticable {
67
TimelineThemeData({
78
this.gutterSpacing = 12.0,
@@ -11,6 +12,7 @@ class TimelineThemeData with Diagnosticable {
1112
this.strokeCap = StrokeCap.butt,
1213
this.lineColor = Colors.lightBlueAccent,
1314
this.style = PaintingStyle.stroke,
15+
this.indicatorPosition = IndicatorPosition.center,
1416
}) : assert(itemGap >= 0),
1517
assert(lineGap >= 0);
1618

@@ -22,6 +24,9 @@ class TimelineThemeData with Diagnosticable {
2224
final double itemGap;
2325
final double gutterSpacing;
2426

27+
/// the position of the indicator. this affects the placing of the indicator, and following line measurement
28+
final IndicatorPosition indicatorPosition;
29+
2530
/// Whether all the properties of this object are non-null.
2631
bool get isConcrete => lineColor != null; // &&
2732

@@ -35,11 +40,8 @@ class TimelineThemeData with Diagnosticable {
3540
strokeWidth = 4.0,
3641
style = PaintingStyle.stroke,
3742
itemGap = 24.0,
38-
gutterSpacing = 12.0;
39-
40-
// : color = const Color(0xFF000000),
41-
// _opacity = 1.0,
42-
// size = 24.0;
43+
gutterSpacing = 12.0,
44+
indicatorPosition = IndicatorPosition.center;
4345

4446
TimelineThemeData copyWith(
4547
{Color lineColor, StrokeCap strokeCap, double strokeWidth}) {

0 commit comments

Comments
 (0)