Skip to content

Commit cd3c741

Browse files
author
Adam Hammer
committed
Added semantics to ticker for accessibility
Updated docs
1 parent 47e4249 commit cd3c741

File tree

2 files changed

+22
-17
lines changed

2 files changed

+22
-17
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Time and Space
44

5+
![6:30:30 Light](https://raw.githubusercontent.com/ahammer/adams_clock/master/screenshots/light063030.png)
56
![Adams Clock](https://raw.githubusercontent.com/ahammer/adams_clock/master/screenshots/preview.webp)
67

78
This clock was an experiment in iterative development. As it progressed it gained a clear goal of the Time and Space clock. The entire thing is a function of time, completely deterministic. Two devices will show the same image at the same time. The goal was to visually push Flutter's limits, while not pushing a devices limits. There is roughly 25-30 draw calls for the entire scene.

lib/ui/ticker.dart

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,27 @@ class _TickerWidgetState extends State<TickerWidget> {
8585
/// 3) Return that row.
8686
@override
8787
Widget build(BuildContext context) =>
88-
widget.builder().chain((currentString) => Row(
89-
mainAxisSize: MainAxisSize.min,
90-
children: <Widget>[
91-
...List.generate(
92-
currentString.length,
93-
(idx) => _TickerCharacterView(
94-
duration: Duration(
95-
milliseconds: widget.tickerBaseTimeMs +
96-
(_random[idx % _random.length] *
97-
widget.tickerRandomnessMs)
98-
.toInt()),
99-
first: idx == 0,
100-
last: idx == (currentString.length - 1),
101-
builder: widget.digitBuilder,
102-
digit: currentString.charAt(idx)))
103-
],
104-
));
88+
Semantics(
89+
header: true,
90+
value: widget.builder(),
91+
child: widget.builder().chain((currentString) => Row(
92+
mainAxisSize: MainAxisSize.min,
93+
children: <Widget>[
94+
...List.generate(
95+
currentString.length,
96+
(idx) => _TickerCharacterView(
97+
duration: Duration(
98+
milliseconds: widget.tickerBaseTimeMs +
99+
(_random[idx % _random.length] *
100+
widget.tickerRandomnessMs)
101+
.toInt()),
102+
first: idx == 0,
103+
last: idx == (currentString.length - 1),
104+
builder: widget.digitBuilder,
105+
digit: currentString.charAt(idx)))
106+
],
107+
)),
108+
);
105109
}
106110

107111
/// Ticker Character View

0 commit comments

Comments
 (0)