We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Deva Rajhansa • 3 years ago

Thanks for the nice article.

The hour and minute hands would move more gradually if we use:

transform: Matrix4.rotationZ(pi + pi / 12 * 2 * (dateTime.hour + dateTime.minute/60)),
child: Container(height: 50, width: 5, color: Colors.black),
for hour hand, used 12 instead of 24:

transform: Matrix4.rotationZ(pi + pi / 60 * 2 * (dateTime.minute + dateTime.second/60)),
child: Container(height: 70, width: 4, color: Colors.grey),
for minute hand.

This is the first time I tried a test by copying your code into the test folder.
It produced the following error:

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: one widget whose rasterized image matches golden image "initial_frame.png"
Actual: _WidgetTypeFinder:<exactly one="" widget="" with="" type="" "animatedclock"="" (ignoring="" offstage="" widgets):="" animatedclock(state:="" _animatedclockstate#22671(ticker="" active))="">
Which: Could not be compared against non-existent file: "initial_frame.png"

When the exception was thrown, this was the stack:
#0 fail (package:test_api/src/expect/expect.dart:137:31)
#1 _expect.<anonymous closure=""> (package:test_api/src/expect/expect.dart:112:9)
<asynchronous suspension="">
<asynchronous suspension="">
(elided 6 frames from dart:async and package:stack_trace)

The test description was:
renders our clock
════════════════════════════════════════════════════════════════════════════════════════════════════

Test failed. See exception logs above.
The test description was: renders our clock

Maybe I missed something.

Simon Matthew • 3 years ago

That was a wonderful read! I have been working with my remote developers for the past few years. But, due to the lack of technological advancement in my project, I never faced any major issues. But, since I have introduced new projects, they are less proficient at working upon them, so I was actively looking to hire new experts, and the day I got Eiliana.com, my sorrows were solved.

Curtis Eckhart • 4 years ago

I found one small error. A ticker is created by default in the disabled state. In order to make it run, I had to add _ticker.start() to the init code.

https://api.flutter.dev/flu...

Great article!

🙏

Sander Roest • 5 years ago

Excellent explanation! Learned something new today and that makes me happy.