Enhance postcard puzzles and narration

This commit is contained in:
Hadrian Burkhardt
2026-11-14 08:55:48 +01:00
parent abaab927d9
commit b19295472d
158 changed files with 5257 additions and 1695 deletions
+97 -6
View File
@@ -120,11 +120,14 @@ class Board extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
clue(
'${puzzle.rows[row]}',
complete(
List.generate(n, (i) => row * n + i),
puzzle.rows[row],
),
puzzle.hiddenRow == row
? '?'
: '${puzzle.rows[row]}',
puzzle.hiddenRow != row &&
complete(
List.generate(n, (i) => row * n + i),
puzzle.rows[row],
),
),
for (var col = 0; col < n; col++)
Builder(
@@ -132,6 +135,16 @@ class Board extends StatelessWidget {
final i = row * n + col,
value = cells[i],
fixed = puzzle.given[i],
lantern = puzzle.lanternPairs.any(
(pair) => pair.contains(i),
),
mirrored = puzzle.mirrorPairs.any(
(pair) => pair.contains(i),
),
footprint = puzzle.footprintTrails
.any(
(trail) => trail.contains(i),
),
inside = r?.contains(i, n) ?? false;
final state = value == 0
? 'empty'
@@ -142,7 +155,7 @@ class Board extends StatelessWidget {
selected: inside,
label: CopyScope.text(
context,
'Row ${row + 1}, column ${col + 1}, $state${fixed ? ', fixed clue' : ''}',
'Row ${row + 1}, column ${col + 1}, $state${fixed ? ', fixed clue' : ''}${lantern ? ', lantern pair: exactly one is lit' : ''}${mirrored ? ', mirrored pair: both cells match' : ''}${footprint ? ', footprint trail: two adjacent cells are lit' : ''}',
),
button: !fixed && !won,
enabled: !fixed && !won,
@@ -199,6 +212,84 @@ class Board extends StatelessWidget {
),
),
),
if (lantern)
Positioned(
left: 1,
top: 1,
child: Container(
key: ValueKey(
'lantern-$i',
),
decoration:
const BoxDecoration(
color: cream,
shape: BoxShape
.circle,
),
padding:
const EdgeInsets.all(
1,
),
child: Icon(
Icons
.lightbulb_outline,
size: u * .31,
color: regionInk,
),
),
),
if (mirrored)
Positioned(
left: 1,
top: 1,
child: Container(
key: ValueKey(
'mirror-$i',
),
decoration:
const BoxDecoration(
color: cream,
shape: BoxShape
.circle,
),
padding:
const EdgeInsets.all(
1,
),
child: Icon(
Icons
.auto_awesome,
size: u * .31,
color: regionInk,
),
),
),
if (footprint)
Positioned(
left: 1,
top: 1,
child: Container(
key: ValueKey(
'footprint-$i',
),
decoration:
const BoxDecoration(
color: cream,
shape: BoxShape
.circle,
),
padding:
const EdgeInsets.all(
1,
),
child: Icon(
Icons
.directions_walk,
size: u * .31,
color: regionInk,
),
),
),
if (fixed)
Positioned(
right: 3,