Skip to content

Commit

Permalink
✅ added indicator position. just for skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
softmarshmallow committed Aug 26, 2020
1 parent 0c4d6b8 commit 1b53fd8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.4+2"
version: "0.0.4+4"
matcher:
dependency: transitive
description:
Expand Down
5 changes: 5 additions & 0 deletions lib/indicator_position.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enum IndicatorPosition{
top,
center,
bottom
}
14 changes: 8 additions & 6 deletions lib/timeline_theme_data.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_timeline/indicator_position.dart';

@immutable
/// [TimelineThemeData] is passed through [TimelineTheme], works like general flutter theme object.
class TimelineThemeData with Diagnosticable {
TimelineThemeData({
this.gutterSpacing = 12.0,
Expand All @@ -11,6 +12,7 @@ class TimelineThemeData with Diagnosticable {
this.strokeCap = StrokeCap.butt,
this.lineColor = Colors.lightBlueAccent,
this.style = PaintingStyle.stroke,
this.indicatorPosition = IndicatorPosition.center,
}) : assert(itemGap >= 0),
assert(lineGap >= 0);

Expand All @@ -22,6 +24,9 @@ class TimelineThemeData with Diagnosticable {
final double itemGap;
final double gutterSpacing;

/// the position of the indicator. this affects the placing of the indicator, and following line measurement
final IndicatorPosition indicatorPosition;

/// Whether all the properties of this object are non-null.
bool get isConcrete => lineColor != null; // &&

Expand All @@ -35,11 +40,8 @@ class TimelineThemeData with Diagnosticable {
strokeWidth = 4.0,
style = PaintingStyle.stroke,
itemGap = 24.0,
gutterSpacing = 12.0;

// : color = const Color(0xFF000000),
// _opacity = 1.0,
// size = 24.0;
gutterSpacing = 12.0,
indicatorPosition = IndicatorPosition.center;

TimelineThemeData copyWith(
{Color lineColor, StrokeCap strokeCap, double strokeWidth}) {
Expand Down

0 comments on commit 1b53fd8

Please sign in to comment.