69 lines
2.2 KiB
Dart
69 lines
2.2 KiB
Dart
/// The five reflective piles used during the initial card sort.
|
|
library;
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
/// Pile ranks from most to least important (design labels 5→1).
|
|
enum ValuePile {
|
|
mostImportant,
|
|
veryImportant,
|
|
important,
|
|
somewhatImportant,
|
|
notImportant,
|
|
}
|
|
|
|
extension ValuePileX on ValuePile {
|
|
/// Short UI label (e.g. "Most Important").
|
|
String get label => switch (this) {
|
|
ValuePile.mostImportant => 'Most Important',
|
|
ValuePile.veryImportant => 'Very Important',
|
|
ValuePile.important => 'Important',
|
|
ValuePile.somewhatImportant => 'Somewhat Important',
|
|
ValuePile.notImportant => 'Not Important',
|
|
};
|
|
|
|
/// Compact chip label used in filters and progress bars.
|
|
String get shortLabel => switch (this) {
|
|
ValuePile.mostImportant => 'Most',
|
|
ValuePile.veryImportant => 'Very',
|
|
ValuePile.important => 'Important',
|
|
ValuePile.somewhatImportant => 'Somewhat',
|
|
ValuePile.notImportant => 'Not',
|
|
};
|
|
|
|
/// Supporting line under pile buttons on the sort screen.
|
|
String get subtitle => switch (this) {
|
|
ValuePile.mostImportant => 'Non-negotiable core',
|
|
ValuePile.veryImportant => 'Deeply held guide',
|
|
ValuePile.important => 'Valued aspect',
|
|
ValuePile.somewhatImportant => 'Contextual',
|
|
ValuePile.notImportant => 'Not a current compass',
|
|
};
|
|
|
|
/// Numeric rank shown in the Stitch designs (5 = most).
|
|
int get rank => switch (this) {
|
|
ValuePile.mostImportant => 5,
|
|
ValuePile.veryImportant => 4,
|
|
ValuePile.important => 3,
|
|
ValuePile.somewhatImportant => 2,
|
|
ValuePile.notImportant => 1,
|
|
};
|
|
|
|
/// Accent color for this pile.
|
|
Color get accent => switch (this) {
|
|
ValuePile.mostImportant => const Color(0xFFC45C3E),
|
|
ValuePile.veryImportant => const Color(0xFFC87D55),
|
|
ValuePile.important => const Color(0xFF6B8168),
|
|
ValuePile.somewhatImportant => const Color(0xFF5B7A8C),
|
|
ValuePile.notImportant => const Color(0xFF8A847C),
|
|
};
|
|
|
|
static ValuePile? fromName(String? name) {
|
|
if (name == null) return null;
|
|
for (final pile in ValuePile.values) {
|
|
if (pile.name == name) return pile;
|
|
}
|
|
return null;
|
|
}
|
|
}
|