Skip to content

Commit 76370bb

Browse files
committed
Merge branch 'release/0.0.2+1' into main
2 parents a5f1f8f + 832ac28 commit 76370bb

21 files changed

+540
-305
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.0.2+1
2+
3+
* Dartfmt line length changed from 120 to 80
4+
5+
16
## 0.0.2
27

38
### Add basic components

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
<p align="center">A powerful & easy to use timeline package for Flutter! 🚀</p>
1313

14+
> ***Caveat***: This package is an early stage. Not enough testing has been done to guarantee stability. And some apis can be change.
15+
1416
# Examples
1517

1618
Check it out on the [web](https://chulwoo.dev/timelines/) or look at the [source code](https://github.com/chulwoo-park/timelines/tree/main/example).

example/lib/component_page.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ class ComponentPage extends StatelessWidget {
106106
builder: TimelineTileBuilder.connectedFromStyle(
107107
connectionDirection: ConnectionDirection.before,
108108
connectorStyleBuilder: (context, index) {
109-
return (index == 1) ? ConnectorStyle.dashedLine : ConnectorStyle.solidLine;
109+
return (index == 1)
110+
? ConnectorStyle.dashedLine
111+
: ConnectorStyle.solidLine;
110112
},
111113
indicatorStyleBuilder: (context, index) => IndicatorStyle.dot,
112114
itemExtent: 40.0,
@@ -123,7 +125,9 @@ class ComponentPage extends StatelessWidget {
123125
builder: TimelineTileBuilder.connectedFromStyle(
124126
connectionDirection: ConnectionDirection.after,
125127
connectorStyleBuilder: (context, index) {
126-
return (index == 1) ? ConnectorStyle.dashedLine : ConnectorStyle.solidLine;
128+
return (index == 1)
129+
? ConnectorStyle.dashedLine
130+
: ConnectorStyle.solidLine;
127131
},
128132
indicatorStyleBuilder: (context, index) => IndicatorStyle.dot,
129133
itemExtent: 40.0,
@@ -149,7 +153,8 @@ class ComponentPage extends StatelessWidget {
149153
child: Text('Contents'),
150154
),
151155
),
152-
connectorStyleBuilder: (context, index) => ConnectorStyle.solidLine,
156+
connectorStyleBuilder: (context, index) =>
157+
ConnectorStyle.solidLine,
153158
indicatorStyleBuilder: (context, index) => IndicatorStyle.dot,
154159
itemCount: 3,
155160
),
@@ -173,7 +178,8 @@ class ComponentPage extends StatelessWidget {
173178
child: Text('Contents'),
174179
),
175180
),
176-
connectorStyleBuilder: (context, index) => ConnectorStyle.solidLine,
181+
connectorStyleBuilder: (context, index) =>
182+
ConnectorStyle.solidLine,
177183
indicatorStyleBuilder: (context, index) => IndicatorStyle.dot,
178184
itemCount: 3,
179185
),

example/lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ class WebAlert extends StatelessWidget {
107107
height: 80.0,
108108
child: Material(
109109
child: Center(
110-
child: Text('You are using the web version now.\nSome UI can be broken.'),
110+
child: Text(
111+
'You are using the web version now.\nSome UI can be broken.',
112+
textAlign: TextAlign.center,
113+
),
111114
),
112115
),
113116
);

example/lib/showcase/package_delivery_tracking.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ class _InnerTimeline extends StatelessWidget {
103103
),
104104
),
105105
builder: TimelineTileBuilder(
106-
indicatorBuilder: (_, index) => !isEdgeIndex(index) ? Indicator.outlined(borderWidth: 1.0) : null,
106+
indicatorBuilder: (_, index) =>
107+
!isEdgeIndex(index) ? Indicator.outlined(borderWidth: 1.0) : null,
107108
startConnectorBuilder: (_, index) => Connector.solidLine(),
108109
endConnectorBuilder: (_, index) => Connector.solidLine(),
109110
contentsBuilder: (_, index) {
@@ -117,7 +118,8 @@ class _InnerTimeline extends StatelessWidget {
117118
);
118119
},
119120
itemExtentBuilder: (_, index) => isEdgeIndex(index) ? 10.0 : 30.0,
120-
nodeItemOverlapBuilder: (_, index) => isEdgeIndex(index) ? true : null,
121+
nodeItemOverlapBuilder: (_, index) =>
122+
isEdgeIndex(index) ? true : null,
121123
itemCount: messages.length + 2,
122124
),
123125
),
@@ -257,7 +259,8 @@ _OrderInfo _data(int id) => _OrderInfo(
257259
date: DateTime.now(),
258260
driverInfo: _DriverInfo(
259261
name: 'Philipe',
260-
thumbnailUrl: 'https://i.pinimg.com/originals/08/45/81/084581e3155d339376bf1d0e17979dc6.jpg',
262+
thumbnailUrl:
263+
'https://i.pinimg.com/originals/08/45/81/084581e3155d339376bf1d0e17979dc6.jpg',
261264
),
262265
deliveryProcesses: [
263266
_DeliveryProcess(

example/lib/showcase/process_timeline.dart

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class _ProcessTimelinePageState extends State<ProcessTimelinePage> {
4646
),
4747
builder: TimelineTileBuilder.connected(
4848
connectionDirection: ConnectionDirection.before,
49-
itemExtentBuilder: (_, __) => MediaQuery.of(context).size.width / _processes.length,
49+
itemExtentBuilder: (_, __) =>
50+
MediaQuery.of(context).size.width / _processes.length,
5051
oppositeContentsBuilder: (context, index) {
5152
return Padding(
5253
padding: const EdgeInsets.only(bottom: 15.0),
@@ -137,7 +138,10 @@ class _ProcessTimelinePageState extends State<ProcessTimelinePage> {
137138
if (type == ConnectorType.start) {
138139
gradientColors = [Color.lerp(prevColor, color, 0.5), color];
139140
} else {
140-
gradientColors = [prevColor, Color.lerp(prevColor, color, 0.5)];
141+
gradientColors = [
142+
prevColor,
143+
Color.lerp(prevColor, color, 0.5)
144+
];
141145
}
142146
return DecoratedLineConnector(
143147
decoration: BoxDecoration(
@@ -211,7 +215,8 @@ class _BezierPainter extends CustomPainter {
211215
offset2 = _offset(radius, -angle);
212216
path = Path()
213217
..moveTo(offset1.dx, offset1.dy)
214-
..quadraticBezierTo(0.0, size.height / 2, -radius, radius) // TODO connector start & gradient
218+
..quadraticBezierTo(0.0, size.height / 2, -radius,
219+
radius) // TODO connector start & gradient
215220
..quadraticBezierTo(0.0, size.height / 2, offset2.dx, offset2.dy)
216221
..close();
217222

@@ -224,7 +229,8 @@ class _BezierPainter extends CustomPainter {
224229

225230
path = Path()
226231
..moveTo(offset1.dx, offset1.dy)
227-
..quadraticBezierTo(size.width, size.height / 2, size.width + radius, radius) // TODO connector end & gradient
232+
..quadraticBezierTo(size.width, size.height / 2, size.width + radius,
233+
radius) // TODO connector end & gradient
228234
..quadraticBezierTo(size.width, size.height / 2, offset2.dx, offset2.dy)
229235
..close();
230236

@@ -234,7 +240,9 @@ class _BezierPainter extends CustomPainter {
234240

235241
@override
236242
bool shouldRepaint(_BezierPainter oldDelegate) {
237-
return oldDelegate.color != color || oldDelegate.drawStart != drawStart || oldDelegate.drawEnd != drawEnd;
243+
return oldDelegate.color != color ||
244+
oldDelegate.drawStart != drawStart ||
245+
oldDelegate.drawEnd != drawEnd;
238246
}
239247
}
240248

example/lib/showcase/timeline_status.dart

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ class _Timeline2 extends StatelessWidget {
125125
connectorBuilder: (_, index, connectorType) {
126126
var color;
127127
if (index + 1 < data.length - 1) {
128-
color = data[index].isInProgress && data[index + 1].isInProgress ? Color(0xff193fcc) : null;
128+
color = data[index].isInProgress && data[index + 1].isInProgress
129+
? Color(0xff193fcc)
130+
: null;
129131
}
130132
return SolidLineConnector(
131133
indent: connectorType == ConnectorType.start ? 0 : 2.0,
@@ -169,14 +171,18 @@ class _Timeline3 extends StatelessWidget {
169171
indicatorBuilder: (context, index) {
170172
final status = data[index];
171173
return OutlinedDotIndicator(
172-
color: status.isInProgress ? Color(0xff6ad192) : Color(0xffe6e7e9),
173-
backgroundColor: status.isInProgress ? Color(0xffd4f5d6) : Color(0xffc2c5c9),
174+
color:
175+
status.isInProgress ? Color(0xff6ad192) : Color(0xffe6e7e9),
176+
backgroundColor:
177+
status.isInProgress ? Color(0xffd4f5d6) : Color(0xffc2c5c9),
174178
borderWidth: status.isInProgress ? 3.0 : 2.5,
175179
);
176180
},
177181
connectorBuilder: (context, index, connectorType) {
178182
var color;
179-
if (index + 1 < data.length - 1 && data[index].isInProgress && data[index + 1].isInProgress) {
183+
if (index + 1 < data.length - 1 &&
184+
data[index].isInProgress &&
185+
data[index + 1].isInProgress) {
180186
color = data[index].isInProgress ? Color(0xff6ad192) : null;
181187
}
182188
return SolidLineConnector(
@@ -185,7 +191,9 @@ class _Timeline3 extends StatelessWidget {
185191
},
186192
contentsBuilder: (context, index) {
187193
var height;
188-
if (index + 1 < data.length - 1 && data[index].isInProgress && data[index + 1].isInProgress) {
194+
if (index + 1 < data.length - 1 &&
195+
data[index].isInProgress &&
196+
data[index + 1].isInProgress) {
189197
height = kTileHeight - 10;
190198
} else {
191199
height = kTileHeight + 5;

example/lib/showcase_page.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class ShowcasePage extends StatelessWidget {
2020
image: 'assets/images/timeline_status.png',
2121
title: 'Timeline Status',
2222
designer: 'Tridip Thrizu',
23-
url: 'https://dribbble.com/shots/5659998-Daily-UI-Component-4-Timeline-Status',
23+
url:
24+
'https://dribbble.com/shots/5659998-Daily-UI-Component-4-Timeline-Status',
2425
navigationBuilder: () => TimelineStatusPage(),
2526
),
2627
_ShowcaseCard(

example/lib/theme_page.dart

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ class _ThemePageState extends State<ThemePage> {
107107
Checkbox(
108108
value: _theme.nodeItemOverlap,
109109
onChanged: (overlap) {
110-
_updateTheme(_theme.copyWith(nodeItemOverlap: overlap));
110+
_updateTheme(
111+
_theme.copyWith(nodeItemOverlap: overlap));
111112
},
112113
),
113114
],
@@ -116,14 +117,16 @@ class _ThemePageState extends State<ThemePage> {
116117
title: 'Node Position',
117118
value: _theme.nodePosition,
118119
onChanged: (nodePosition) {
119-
_updateTheme(_theme.copyWith(nodePosition: nodePosition));
120+
_updateTheme(
121+
_theme.copyWith(nodePosition: nodePosition));
120122
},
121123
),
122124
_ThemeSlider(
123125
title: 'Indicator Position',
124126
value: _theme.indicatorPosition,
125127
onChanged: (indicatorPosition) {
126-
_updateTheme(_theme.copyWith(indicatorPosition: indicatorPosition));
128+
_updateTheme(_theme.copyWith(
129+
indicatorPosition: indicatorPosition));
127130
},
128131
),
129132
],
@@ -146,7 +149,8 @@ class _ThemePageState extends State<ThemePage> {
146149
onChanged: (color) {
147150
_updateTheme(
148151
_theme.copyWith(
149-
indicatorTheme: _theme.indicatorTheme.copyWith(color: color),
152+
indicatorTheme:
153+
_theme.indicatorTheme.copyWith(color: color),
150154
),
151155
);
152156
},
@@ -158,7 +162,8 @@ class _ThemePageState extends State<ThemePage> {
158162
onChanged: (position) {
159163
_updateTheme(
160164
_theme.copyWith(
161-
indicatorTheme: _theme.indicatorTheme.copyWith(position: position),
165+
indicatorTheme: _theme.indicatorTheme
166+
.copyWith(position: position),
162167
),
163168
);
164169
},
@@ -170,7 +175,8 @@ class _ThemePageState extends State<ThemePage> {
170175
onChanged: (size) {
171176
_updateTheme(
172177
_theme.copyWith(
173-
indicatorTheme: _theme.indicatorTheme.copyWith(size: size),
178+
indicatorTheme:
179+
_theme.indicatorTheme.copyWith(size: size),
174180
),
175181
);
176182
},
@@ -195,7 +201,8 @@ class _ThemePageState extends State<ThemePage> {
195201
onChanged: (color) {
196202
_updateTheme(
197203
_theme.copyWith(
198-
connectorTheme: _theme.connectorTheme.copyWith(color: color),
204+
connectorTheme:
205+
_theme.connectorTheme.copyWith(color: color),
199206
),
200207
);
201208
},
@@ -208,7 +215,8 @@ class _ThemePageState extends State<ThemePage> {
208215
onChanged: (space) {
209216
_updateTheme(
210217
_theme.copyWith(
211-
connectorTheme: _theme.connectorTheme.copyWith(space: space),
218+
connectorTheme:
219+
_theme.connectorTheme.copyWith(space: space),
212220
),
213221
);
214222
},
@@ -220,7 +228,8 @@ class _ThemePageState extends State<ThemePage> {
220228
onChanged: (indent) {
221229
_updateTheme(
222230
_theme.copyWith(
223-
connectorTheme: _theme.connectorTheme.copyWith(indent: indent),
231+
connectorTheme: _theme.connectorTheme
232+
.copyWith(indent: indent),
224233
),
225234
);
226235
},
@@ -232,7 +241,8 @@ class _ThemePageState extends State<ThemePage> {
232241
onChanged: (thickness) {
233242
_updateTheme(
234243
_theme.copyWith(
235-
connectorTheme: _theme.connectorTheme.copyWith(thickness: thickness),
244+
connectorTheme: _theme.connectorTheme
245+
.copyWith(thickness: thickness),
236246
),
237247
);
238248
},

example/lib/widget.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class NavigationCard extends StatelessWidget with NavigateMixin {
2323
const NavigationCard({
2424
Key key,
2525
this.margin,
26-
this.borderRadius = const BorderRadius.all(Radius.circular(kNavigationCardRadius)),
26+
this.borderRadius =
27+
const BorderRadius.all(Radius.circular(kNavigationCardRadius)),
2728
this.navigationBuilder,
2829
@required this.child,
2930
}) : super(key: key);

0 commit comments

Comments
 (0)