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:
Claude 2026-04-16 23:50:39 +00:00
parent 8ebd233305
commit a62bcd1d11
No known key found for this signature in database
7 changed files with 17 additions and 20 deletions

View File

@ -184,11 +184,11 @@ class HomeScreen extends ConsumerWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(LucideIcons.clipboardCheck, size: 60, color: Colors.grey[400]),
Icon(LucideIcons.clipboardCheck, size: 60, color: appColors.iconSubtle),
const SizedBox(height: 16),
Text(t['noMenuItems'], style: const TextStyle(fontWeight: FontWeight.bold)),
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)),
],
),
);

View File

@ -65,7 +65,7 @@ class _MainScreenState extends ConsumerState<MainScreen> {
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
Icon(featureIcon, size: 48, color: Colors.grey.shade400),
Icon(featureIcon, size: 48, color: appColors.iconSubtle),
Positioned(
right: -8,
top: -8,

View File

@ -123,7 +123,7 @@ class _MenuPricingScreenState extends ConsumerState<MenuPricingScreen> {
preferredSize: const Size.fromHeight(2),
child: LinearProgressIndicator(
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),
minHeight: 2,
),
@ -320,9 +320,9 @@ class _MenuPricingScreenState extends ConsumerState<MenuPricingScreen> {
// Drag Handle
ReorderableDragStartListener(
index: index,
child: const Padding(
padding: EdgeInsets.only(right: 12, top: 4, bottom: 4),
child: Icon(Icons.drag_indicator, color: Colors.grey),
child: Padding(
padding: const EdgeInsets.only(right: 12, top: 4, bottom: 4),
child: Icon(Icons.drag_indicator, color: appColors.iconSubtle),
),
),
Expanded(

View File

@ -344,10 +344,10 @@ class _PendingAnalysisScreenState extends ConsumerState<PendingAnalysisScreen> {
width: 60,
height: 60,
decoration: BoxDecoration(
color: Colors.grey.shade300,
color: appColors.divider,
borderRadius: BorderRadius.circular(8),
),
child: const Icon(LucideIcons.image, color: Colors.grey),
child: Icon(LucideIcons.image, color: appColors.iconSubtle),
),
title: const Text(
'解析待ち',
@ -390,7 +390,7 @@ class _PendingAnalysisScreenState extends ConsumerState<PendingAnalysisScreen> {
style: ElevatedButton.styleFrom(
backgroundColor: appColors.brandPrimary,
foregroundColor: Colors.white,
disabledBackgroundColor: Colors.grey.shade400,
disabledBackgroundColor: appColors.textTertiary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),

View File

@ -76,7 +76,7 @@ class PrefectureTileMap extends ConsumerWidget {
if (v.contains(prefName)) prefId = k;
});
final regionId = JapanMapData.getRegionId(prefId);
final regionColor = regionColors[regionId] ?? Colors.grey;
final regionColor = regionColors[regionId] ?? appColors.divider;
Color baseColor;
Color textColor;

View File

@ -75,9 +75,9 @@ class _SakeDetailSpecsState extends State<SakeDetailSpecs> {
if (_isEditing) {
// Warn user about external update while editing
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('データが外部から更新されました。編集をキャンセルして再度お試しください。'),
backgroundColor: Colors.orange,
SnackBar(
content: const Text('データが外部から更新されました。編集をキャンセルして再度お試しください。'),
backgroundColor: Theme.of(context).extension<AppColors>()!.warning,
),
);
_cancel(); // Force exit edit mode

View File

@ -86,6 +86,7 @@ enum _BackupState { idle, signingIn, signingOut, backingUp, restoring }
Future<void> _createBackup() async {
final messenger = ScaffoldMessenger.of(context);
final appColors = Theme.of(context).extension<AppColors>()!;
setState(() => _state = _BackupState.backingUp);
final success = await _backupService.createBackup();
if (mounted) {
@ -93,11 +94,7 @@ enum _BackupState { idle, signingIn, signingOut, backingUp, restoring }
messenger.showSnackBar(
SnackBar(
content: Text(success ? 'バックアップが完了しました' : 'バックアップに失敗しました'),
// Snackbars can keep Green/Red for semantic clarity, or be neutral.
// 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,
backgroundColor: success ? appColors.success : appColors.error,
),
);
}
@ -184,7 +181,7 @@ enum _BackupState { idle, signingIn, signingOut, backingUp, restoring }
messenger.showSnackBar(
SnackBar(
content: Text(success ? '復元が完了しました' : '復元に失敗しました'),
backgroundColor: success ? Colors.green : Colors.red,
backgroundColor: success ? appColors.success : appColors.error,
),
);
}