Implement static 6-arrow layout with logical grouping system

- Fix dynamic column generation issue that created 6 columns instead of 3
- Implement static 12-row grid with intelligent visual state management
- Add visual-to-logical mapping system for proper end/arrow indexing
- Fix sum calculations using logical end groupings instead of visual rows
- Replace ends per set selector with automatic ruleset inference
- Convert to percentage-based responsive layout eliminating viewport overflow
- Add clean merged arrow header replacing individual column indices

Core improvements:
- 3-arrow (Indoor): 10 ends, sum-3 active, sum-6 on even ends
- 6-arrow (Outdoor): 6 ends, sum-3 greyed, sum-6 every 2 visual rows
- No more RenderFlex overflow errors with responsive column widths
- Proper bounds checking prevents range errors on inactive rows
- Package identifier updated to com.novoyuuparosk.archery_bookkeeper

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Mikkeli Matlock
2025-08-23 10:55:58 +09:00
parent a1642c1fe7
commit 75b350f08d
5 changed files with 317 additions and 125 deletions
@@ -2,17 +2,16 @@ import 'package:flutter/material.dart';
class ToggleSwitches extends StatelessWidget {
final int arrowsPerEnd;
final int endsPerSet;
final Function(int) onArrowsPerEndChanged;
final Function(int) onEndsPerSetChanged;
const ToggleSwitches({
super.key,
required this.arrowsPerEnd,
required this.endsPerSet,
required this.onArrowsPerEndChanged,
required this.onEndsPerSetChanged,
});
// Inferred ends per set based on ruleset
int get endsPerSet => arrowsPerEnd == 3 ? 10 : 6;
@override
Widget build(BuildContext context) {
@@ -27,12 +26,7 @@ class ToggleSwitches extends StatelessWidget {
arrowsPerEnd,
onArrowsPerEndChanged,
),
_buildToggleGroup(
'Ends per set',
[10, 12],
endsPerSet,
onEndsPerSetChanged,
),
_buildRulesetInfo(),
],
),
],
@@ -71,4 +65,46 @@ class ToggleSwitches extends StatelessWidget {
],
);
}
Widget _buildRulesetInfo() {
final rulesetName = arrowsPerEnd == 3 ? 'Indoor' : 'Outdoor';
return Column(
children: [
Text(
'Ruleset',
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 8),
Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
decoration: BoxDecoration(
color: Colors.blue.shade50,
border: Border.all(color: Colors.blue.shade200),
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: [
Text(
rulesetName,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.blue.shade700,
),
),
Text(
'$endsPerSet ends',
style: TextStyle(
fontSize: 12,
color: Colors.blue.shade600,
),
),
],
),
),
],
);
}
}