Skip to content

Commit 1ee8acf

Browse files
authored
Add web feature and fix example bug (chulwoo-park#13)
1 parent 9af7743 commit 1ee8acf

File tree

5 files changed

+60
-26
lines changed

5 files changed

+60
-26
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy github pages
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build:
8+
name: Build Web
9+
env:
10+
my_secret: ${{secrets.commit_secret}}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: subosito/flutter-action@v1
15+
with:
16+
channel: 'beta'
17+
- run: flutter config --enable-web
18+
- run: flutter pub get
19+
- run: |
20+
cd example
21+
flutter build web --release
22+
- run: |
23+
cd example/build/web
24+
git init
25+
git config --global user.email [email protected]
26+
git config --global user.name chulwoo.park
27+
git status
28+
git remote add origin https://${{secrets.commit_secret}}@github.com/chulwoo-park/timelines.git
29+
git checkout -b gh-pages
30+
git add --all
31+
git commit -m "Update gh-pages"
32+
git push origin gh-pages -f

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,6 @@ app.*.symbols
117117
!**/ios/**/default.pbxuser
118118
!**/ios/**/default.perspectivev3
119119
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
120-
!/dev/ci/**/Gemfile.lock
120+
!/dev/ci/**/Gemfile.lock
121+
122+
.fvm

example/lib/showcase/process_timeline.dart

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,6 @@ class _ProcessTimelinePageState extends State<ProcessTimelinePage> {
102102
if (index <= _processIndex) {
103103
return Stack(
104104
children: [
105-
// if (index < _processIndex)
106-
DotIndicator(
107-
size: 30.0,
108-
color: color,
109-
child: child,
110-
),
111105
CustomPaint(
112106
size: Size(30.0, 30.0),
113107
painter: _BezierPainter(
@@ -116,23 +110,27 @@ class _ProcessTimelinePageState extends State<ProcessTimelinePage> {
116110
drawEnd: index < _processIndex,
117111
),
118112
),
113+
DotIndicator(
114+
size: 30.0,
115+
color: color,
116+
child: child,
117+
),
119118
],
120119
);
121120
} else {
122121
return Stack(
123122
children: [
124-
// if (index < _processIndex)
125-
OutlinedDotIndicator(
126-
borderWidth: 4.0,
127-
color: color,
128-
),
129123
CustomPaint(
130124
size: Size(15.0, 15.0),
131125
painter: _BezierPainter(
132126
color: color,
133127
drawEnd: index < processes.length - 1,
134128
),
135129
),
130+
OutlinedDotIndicator(
131+
borderWidth: 4.0,
132+
color: color,
133+
),
136134
],
137135
);
138136
}
@@ -218,8 +216,8 @@ class _BezierPainter extends CustomPainter {
218216
@override
219217
void paint(Canvas canvas, Size size) {
220218
final paint = Paint()
221-
..color = color
222-
..style = PaintingStyle.fill;
219+
..style = PaintingStyle.fill
220+
..color = color;
223221

224222
final radius = size.width / 2;
225223

@@ -229,28 +227,27 @@ class _BezierPainter extends CustomPainter {
229227

230228
var path;
231229

232-
if (drawEnd) {
233-
angle = -pi / 4;
230+
if (drawStart) {
231+
angle = 3 * pi / 4;
234232
offset1 = _offset(radius, angle);
235233
offset2 = _offset(radius, -angle);
236-
237234
path = Path()
238235
..moveTo(offset1.dx, offset1.dy)
239-
..quadraticBezierTo(size.width, size.height / 2, radius + size.width, radius)
240-
..quadraticBezierTo(size.width, size.height / 2, offset2.dx, offset2.dy)
236+
..quadraticBezierTo(0.0, size.height / 2, -radius, radius) // TODO connector start & gradient
237+
..quadraticBezierTo(0.0, size.height / 2, offset2.dx, offset2.dy)
241238
..close();
242239

243240
canvas.drawPath(path, paint);
244241
}
245-
246-
if (drawStart) {
247-
angle = 3 * pi / 4;
242+
if (drawEnd) {
243+
angle = -pi / 4;
248244
offset1 = _offset(radius, angle);
249245
offset2 = _offset(radius, -angle);
246+
250247
path = Path()
251248
..moveTo(offset1.dx, offset1.dy)
252-
..quadraticBezierTo(0.0, size.height / 2, -size.width, radius)
253-
..quadraticBezierTo(0.0, size.height / 2, offset2.dx, offset2.dy)
249+
..quadraticBezierTo(size.width, size.height / 2, size.width + radius, radius) // TODO connector end & gradient
250+
..quadraticBezierTo(size.width, size.height / 2, offset2.dx, offset2.dy)
254251
..close();
255252

256253
canvas.drawPath(path, paint);

example/pubspec.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ dependencies:
1010
flutter:
1111
sdk: flutter
1212

13+
# TODO use pub.dev version
1314
timelines:
14-
path: ../
15+
git:
16+
url: https://github.com/chulwoo-park/timelines.git
17+
ref: develop
1518

1619
font_awesome_flutter: ^8.10.0
1720
url_launcher: ^5.7.10

example/web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Fore more details:
1212
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
1313
-->
14-
<base href="/">
14+
<base href="/timelines/">
1515

1616
<meta charset="UTF-8">
1717
<meta content="IE=Edge" http-equiv="X-UA-Compatible">

0 commit comments

Comments
 (0)