refactor: ハードコード色をAppColorsセマンティックカラーに置換
意図的な箇所(カメラUI・AppBar白テキスト・ハート色・Proバッジ等)はKEEP。 以下のUIロジックに影響しない7ファイルのみ変更: - Colors.grey.shade400/[400] → appColors.iconSubtle (アイコン、無効状態) - Colors.grey.shade300 → appColors.divider (プレースホルダー背景) - Colors.grey → appColors.textSecondary / iconSubtle / divider (文脈別) - Colors.grey[200] → appColors.surfaceSubtle (プログレスバー背景) - Colors.orange → appColors.warning (警告スナックバー) - Colors.green / Colors.red → appColors.success / error (完了・失敗スナックバー) _createBackup()にappColorsをasync前にキャプチャするFlutterベストプラクティスを適用。 コメント化されていたデッドコメントも同時削除。 https://claude.ai/code/session_01DWQpnqrQWwxVKKWSL9kDPp
This commit is contained in:
parent
8ebd233305
commit
a62bcd1d11
|
|
@ -184,11 +184,11 @@ class HomeScreen extends ConsumerWidget {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Icon(LucideIcons.clipboardCheck, size: 60, color: Colors.grey[400]),
|
Icon(LucideIcons.clipboardCheck, size: 60, color: appColors.iconSubtle),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Text(t['noMenuItems'], style: const TextStyle(fontWeight: FontWeight.bold)),
|
Text(t['noMenuItems'], style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Text(t['goBackToList'], textAlign: TextAlign.center, style: const TextStyle(color: Colors.grey)),
|
Text(t['goBackToList'], textAlign: TextAlign.center, style: TextStyle(color: appColors.textSecondary)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ class _MainScreenState extends ConsumerState<MainScreen> {
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
Icon(featureIcon, size: 48, color: Colors.grey.shade400),
|
Icon(featureIcon, size: 48, color: appColors.iconSubtle),
|
||||||
Positioned(
|
Positioned(
|
||||||
right: -8,
|
right: -8,
|
||||||
top: -8,
|
top: -8,
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ class _MenuPricingScreenState extends ConsumerState<MenuPricingScreen> {
|
||||||
preferredSize: const Size.fromHeight(2),
|
preferredSize: const Size.fromHeight(2),
|
||||||
child: LinearProgressIndicator(
|
child: LinearProgressIndicator(
|
||||||
value: 2 / 3, // Step 2 of 3 = 66%
|
value: 2 / 3, // Step 2 of 3 = 66%
|
||||||
backgroundColor: Colors.grey[200],
|
backgroundColor: Theme.of(context).extension<AppColors>()!.surfaceSubtle,
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(Theme.of(context).primaryColor),
|
valueColor: AlwaysStoppedAnimation<Color>(Theme.of(context).primaryColor),
|
||||||
minHeight: 2,
|
minHeight: 2,
|
||||||
),
|
),
|
||||||
|
|
@ -320,9 +320,9 @@ class _MenuPricingScreenState extends ConsumerState<MenuPricingScreen> {
|
||||||
// Drag Handle
|
// Drag Handle
|
||||||
ReorderableDragStartListener(
|
ReorderableDragStartListener(
|
||||||
index: index,
|
index: index,
|
||||||
child: const Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(right: 12, top: 4, bottom: 4),
|
padding: const EdgeInsets.only(right: 12, top: 4, bottom: 4),
|
||||||
child: Icon(Icons.drag_indicator, color: Colors.grey),
|
child: Icon(Icons.drag_indicator, color: appColors.iconSubtle),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
|
||||||
|
|
@ -344,10 +344,10 @@ class _PendingAnalysisScreenState extends ConsumerState<PendingAnalysisScreen> {
|
||||||
width: 60,
|
width: 60,
|
||||||
height: 60,
|
height: 60,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey.shade300,
|
color: appColors.divider,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: const Icon(LucideIcons.image, color: Colors.grey),
|
child: Icon(LucideIcons.image, color: appColors.iconSubtle),
|
||||||
),
|
),
|
||||||
title: const Text(
|
title: const Text(
|
||||||
'解析待ち',
|
'解析待ち',
|
||||||
|
|
@ -390,7 +390,7 @@ class _PendingAnalysisScreenState extends ConsumerState<PendingAnalysisScreen> {
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: appColors.brandPrimary,
|
backgroundColor: appColors.brandPrimary,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
disabledBackgroundColor: Colors.grey.shade400,
|
disabledBackgroundColor: appColors.textTertiary,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ class PrefectureTileMap extends ConsumerWidget {
|
||||||
if (v.contains(prefName)) prefId = k;
|
if (v.contains(prefName)) prefId = k;
|
||||||
});
|
});
|
||||||
final regionId = JapanMapData.getRegionId(prefId);
|
final regionId = JapanMapData.getRegionId(prefId);
|
||||||
final regionColor = regionColors[regionId] ?? Colors.grey;
|
final regionColor = regionColors[regionId] ?? appColors.divider;
|
||||||
|
|
||||||
Color baseColor;
|
Color baseColor;
|
||||||
Color textColor;
|
Color textColor;
|
||||||
|
|
|
||||||
|
|
@ -75,9 +75,9 @@ class _SakeDetailSpecsState extends State<SakeDetailSpecs> {
|
||||||
if (_isEditing) {
|
if (_isEditing) {
|
||||||
// Warn user about external update while editing
|
// Warn user about external update while editing
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(
|
SnackBar(
|
||||||
content: Text('データが外部から更新されました。編集をキャンセルして再度お試しください。'),
|
content: const Text('データが外部から更新されました。編集をキャンセルして再度お試しください。'),
|
||||||
backgroundColor: Colors.orange,
|
backgroundColor: Theme.of(context).extension<AppColors>()!.warning,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
_cancel(); // Force exit edit mode
|
_cancel(); // Force exit edit mode
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ enum _BackupState { idle, signingIn, signingOut, backingUp, restoring }
|
||||||
|
|
||||||
Future<void> _createBackup() async {
|
Future<void> _createBackup() async {
|
||||||
final messenger = ScaffoldMessenger.of(context);
|
final messenger = ScaffoldMessenger.of(context);
|
||||||
|
final appColors = Theme.of(context).extension<AppColors>()!;
|
||||||
setState(() => _state = _BackupState.backingUp);
|
setState(() => _state = _BackupState.backingUp);
|
||||||
final success = await _backupService.createBackup();
|
final success = await _backupService.createBackup();
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
|
|
@ -93,11 +94,7 @@ enum _BackupState { idle, signingIn, signingOut, backingUp, restoring }
|
||||||
messenger.showSnackBar(
|
messenger.showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(success ? 'バックアップが完了しました' : 'バックアップに失敗しました'),
|
content: Text(success ? 'バックアップが完了しました' : 'バックアップに失敗しました'),
|
||||||
// Snackbars can keep Green/Red for semantic clarity, or be neutral.
|
backgroundColor: success ? appColors.success : appColors.error,
|
||||||
// User asked to remove Green/Red icons from the UI, but feedback (Snackbar) usually stays semantic.
|
|
||||||
// However, to be safe and "Washi", let's use Sumi (Black) for success?
|
|
||||||
// Or just leave snackbars as they are ephemeral. The request was likely about the visible static UI.
|
|
||||||
backgroundColor: success ? Colors.green : Colors.red,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -184,7 +181,7 @@ enum _BackupState { idle, signingIn, signingOut, backingUp, restoring }
|
||||||
messenger.showSnackBar(
|
messenger.showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(success ? '復元が完了しました' : '復元に失敗しました'),
|
content: Text(success ? '復元が完了しました' : '復元に失敗しました'),
|
||||||
backgroundColor: success ? Colors.green : Colors.red,
|
backgroundColor: success ? appColors.success : appColors.error,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue