Step 1 Polish: dart fix --apply (Resolved 47 analysis issues)
This commit is contained in:
parent
c948164d39
commit
2eb451296b
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(Get-ChildItem libwidgets -Filter *.dart -Recurse)"
|
||||
"Bash(dir libsecrets.dart)",
|
||||
"Bash(flutter analyze:*)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
|
|
|
|||
|
|
@ -8,12 +8,6 @@ import 'models/menu_settings.dart';
|
|||
import 'providers/theme_provider.dart';
|
||||
import 'screens/main_screen.dart';
|
||||
|
||||
import 'models/schema/display_data.dart';
|
||||
import 'models/schema/hidden_specs.dart';
|
||||
import 'models/schema/user_data.dart';
|
||||
import 'models/schema/gamification.dart';
|
||||
import 'models/schema/metadata.dart';
|
||||
import 'models/schema/item_type.dart';
|
||||
import 'services/migration_service.dart';
|
||||
|
||||
void main() async {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:pdf/pdf.dart'; // PdfPageFormat
|
||||
import '../models/sake_item.dart';
|
||||
|
||||
// 1. Menu Mode Toggle
|
||||
final menuModeProvider = NotifierProvider<MenuModeNotifier, bool>(MenuModeNotifier.new);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:async'; // Timer
|
||||
import 'dart:io';
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
|
@ -13,7 +12,6 @@ import '../services/gemini_service.dart';
|
|||
import '../services/ocr_service.dart';
|
||||
import '../widgets/analyzing_dialog.dart';
|
||||
import '../models/sake_item.dart';
|
||||
import '../providers/sake_list_provider.dart';
|
||||
import '../theme/app_theme.dart';
|
||||
import 'package:lucide_icons/lucide_icons.dart';
|
||||
|
||||
|
|
@ -166,7 +164,7 @@ class _CameraScreenState extends ConsumerState<CameraScreen> with SingleTickerPr
|
|||
}
|
||||
}
|
||||
|
||||
List<String> _capturedImages = [];
|
||||
final List<String> _capturedImages = [];
|
||||
|
||||
Future<void> _takePicture() async {
|
||||
// Check Quota Lockout
|
||||
|
|
@ -294,7 +292,7 @@ class _CameraScreenState extends ConsumerState<CameraScreen> with SingleTickerPr
|
|||
final extractedText = extractedBuffer.toString().trim();
|
||||
debugPrint('OCR Extracted Text (${extractedText.length} chars):');
|
||||
if (extractedText.isNotEmpty) {
|
||||
debugPrint(extractedText.substring(0, extractedText.length > 100 ? 100 : extractedText.length) + '...');
|
||||
debugPrint('${extractedText.substring(0, extractedText.length > 100 ? 100 : extractedText.length)}...');
|
||||
}
|
||||
|
||||
// Hybrid Decision Logic (Threshold: 30 chars)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
import 'package:flutter/cupertino.dart'; // CupertinoPicker
|
||||
// CupertinoPicker
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../providers/theme_provider.dart';
|
||||
import '../providers/display_mode_provider.dart';
|
||||
import 'camera_screen.dart';
|
||||
import 'sake_detail_screen.dart';
|
||||
import 'menu_pricing_screen.dart';
|
||||
import 'menu_creation_screen.dart';
|
||||
import '../theme/app_theme.dart';
|
||||
|
||||
import 'dart:io';
|
||||
import '../providers/sake_list_provider.dart';
|
||||
import '../providers/filter_providers.dart';
|
||||
import '../providers/menu_providers.dart'; // Phase 2-1
|
||||
|
|
@ -20,12 +17,10 @@ import 'package:flutter/services.dart'; // Haptic
|
|||
import '../services/gemini_service.dart';
|
||||
import '../services/image_compression_service.dart';
|
||||
import '../widgets/analyzing_dialog.dart';
|
||||
import '../widgets/quota_warning_dialog.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:path/path.dart' show join;
|
||||
import 'package:reorderable_grid_view/reorderable_grid_view.dart';
|
||||
import '../widgets/sake_search_delegate.dart';
|
||||
import '../widgets/onboarding_dialog.dart';
|
||||
import '../widgets/home/sake_filter_chips.dart';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import '../providers/sake_list_provider.dart';
|
||||
import '../providers/menu_providers.dart';
|
||||
import '../providers/display_mode_provider.dart';
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ class _MenuPricingScreenState extends ConsumerState<MenuPricingScreen> {
|
|||
style: TextStyle(fontSize: 14, color: Colors.grey),
|
||||
),
|
||||
Text(
|
||||
'${PricingHelper.formatPrice(currentPrice!)}円',
|
||||
'${PricingHelper.formatPrice(currentPrice)}円',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
|
|||
|
|
@ -5,12 +5,10 @@ import 'package:flutter/cupertino.dart'; // For Rolling Picker
|
|||
import 'pdf_preview_screen.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import '../providers/menu_providers.dart';
|
||||
import '../services/pdf_service.dart';
|
||||
import '../models/sake_item.dart';
|
||||
import '../models/menu_settings.dart';
|
||||
import '../providers/sake_list_provider.dart';
|
||||
import '../widgets/step_indicator.dart';
|
||||
import 'package:printing/printing.dart';
|
||||
import '../theme/app_theme.dart';
|
||||
|
||||
class MenuSettingsScreen extends ConsumerStatefulWidget {
|
||||
|
|
@ -196,7 +194,7 @@ class _MenuSettingsScreenState extends ConsumerState<MenuSettingsScreen> {
|
|||
title: Text(sake.displayData.name),
|
||||
subtitle: Text('${sake.displayData.brewery} / ${sake.displayData.prefecture}'),
|
||||
dense: true,
|
||||
)).toList(),
|
||||
)),
|
||||
|
||||
const Divider(height: 32),
|
||||
|
||||
|
|
@ -332,7 +330,7 @@ class _MenuSettingsScreenState extends ConsumerState<MenuSettingsScreen> {
|
|||
Text('縦向き', style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
Switch(
|
||||
value: ref.watch(pdfIsPortraitProvider),
|
||||
activeColor: AppTheme.posimaiBlue,
|
||||
activeThumbColor: AppTheme.posimaiBlue,
|
||||
onChanged: (val) => ref.read(pdfIsPortraitProvider.notifier).set(val),
|
||||
),
|
||||
],
|
||||
|
|
@ -386,7 +384,7 @@ class _MenuSettingsScreenState extends ConsumerState<MenuSettingsScreen> {
|
|||
const Text('カラー', style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
Switch(
|
||||
value: !isMonochrome, // ON = Color (!Monochrome)
|
||||
activeColor: AppTheme.posimaiBlue,
|
||||
activeThumbColor: AppTheme.posimaiBlue,
|
||||
onChanged: (val) => setState(() {
|
||||
isMonochrome = !val; // Toggle logic
|
||||
ref.read(pdfIsMonochromeProvider.notifier).set(isMonochrome);
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ class _BreweryMapScreenState extends ConsumerState<BreweryMapScreen> {
|
|||
// Extract visited prefectures
|
||||
final visitedPrefectures = sakeList
|
||||
.map((s) => s.displayData.prefecture)
|
||||
.where((p) => p != null && p.isNotEmpty)
|
||||
.where((p) => p.isNotEmpty)
|
||||
.where((p) => p != '不明' && p != '海外')
|
||||
.map((p) => p!)
|
||||
.map((p) => p)
|
||||
.toSet();
|
||||
|
||||
final totalPrefs = 47;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../providers/theme_provider.dart';
|
||||
|
||||
export 'brewery_map_screen.dart';
|
||||
export 'sommelier_screen.dart';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:lucide_icons/lucide_icons.dart';
|
||||
|
|
|
|||
|
|
@ -800,7 +800,7 @@ class _SakeDetailScreenState extends ConsumerState<SakeDetailScreen> {
|
|||
const SizedBox(height: 4),
|
||||
Text(
|
||||
calculatedPrice > 0
|
||||
? '現在${calculatedPrice}円'
|
||||
? '現在$calculatedPrice円'
|
||||
: '未設定',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
|
|
@ -998,7 +998,7 @@ class _SakeDetailScreenState extends ConsumerState<SakeDetailScreen> {
|
|||
),
|
||||
if (e.key != variants.keys.last) const Divider(height: 1),
|
||||
],
|
||||
)).toList(),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import 'dart:convert';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||
import '../theme/app_theme.dart';
|
||||
import '../models/schema/sake_taste_stats.dart';
|
||||
import '../widgets/sake_radar_chart.dart';
|
||||
|
||||
class ScanARScreen extends StatefulWidget {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:lucide_icons/lucide_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import '../providers/theme_provider.dart';
|
||||
import '../widgets/settings/app_settings_section.dart';
|
||||
import '../widgets/settings/other_settings_section.dart';
|
||||
|
|
|
|||
|
|
@ -277,11 +277,9 @@ class BackupService {
|
|||
try {
|
||||
final check = await driveApi.files.get(uploadedFile.id!);
|
||||
// getが成功すればファイルは存在する
|
||||
if (check != null) {
|
||||
verified = true;
|
||||
print('✅ アップロード検証成功: ファイル存在確認済み');
|
||||
}
|
||||
} catch (e) {
|
||||
verified = true;
|
||||
print('✅ アップロード検証成功: ファイル存在確認済み');
|
||||
} catch (e) {
|
||||
print('⚠️ 検証試行 ${retryCount + 1} 失敗: $e');
|
||||
}
|
||||
retryCount++;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class ImageCompressionService {
|
|||
|
||||
// リサイズが不要な場合はそのまま返す
|
||||
if (originalWidth <= maxDimension && originalHeight <= maxDimension) {
|
||||
debugPrint('Image already optimized: ${originalWidth}x${originalHeight}');
|
||||
debugPrint('Image already optimized: ${originalWidth}x$originalHeight');
|
||||
return sourcePath;
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ class ImageCompressionService {
|
|||
final int newWidth = (originalWidth * scale).round();
|
||||
final int newHeight = (originalHeight * scale).round();
|
||||
|
||||
debugPrint('Compressing image: ${originalWidth}x${originalHeight} -> ${newWidth}x${newHeight}');
|
||||
debugPrint('Compressing image: ${originalWidth}x$originalHeight -> ${newWidth}x$newHeight');
|
||||
|
||||
// Flutter標準の画像処理では詳細なリサイズができないため、
|
||||
// 代わりにファイルサイズ削減のみ実施
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:pdf/pdf.dart';
|
||||
import 'package:pdf/widgets.dart' as pw;
|
||||
|
|
|
|||
|
|
@ -20,15 +20,13 @@ class ShukoDiagnosisService {
|
|||
|
||||
for (var item in items) {
|
||||
final stats = item.hiddenSpecs.sakeTasteStats;
|
||||
if (stats != null) {
|
||||
totalAroma += stats.aroma;
|
||||
totalRichness += stats.richness;
|
||||
totalSweetness += stats.sweetness;
|
||||
totalAlcohol += stats.alcoholFeeling;
|
||||
totalFruity += stats.fruitiness;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
totalAroma += stats.aroma;
|
||||
totalRichness += stats.richness;
|
||||
totalSweetness += stats.sweetness;
|
||||
totalAlcohol += stats.alcoholFeeling;
|
||||
totalFruity += stats.fruitiness;
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
return ShukoProfile.empty();
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import 'package:uuid/uuid.dart';
|
|||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import '../models/sake_item.dart';
|
||||
import '../providers/sake_list_provider.dart';
|
||||
import '../theme/app_theme.dart';
|
||||
import 'package:lucide_icons/lucide_icons.dart';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../../providers/sake_list_provider.dart';
|
||||
import '../../providers/filter_providers.dart';
|
||||
import '../../models/sake_item.dart';
|
||||
import '../../theme/app_theme.dart';
|
||||
import 'package:lucide_icons/lucide_icons.dart';
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import '../../providers/menu_providers.dart';
|
|||
import '../../screens/sake_detail_screen.dart';
|
||||
import '../../theme/app_theme.dart';
|
||||
import 'package:lucide_icons/lucide_icons.dart';
|
||||
import 'package:flutter/services.dart'; // Haptic via InkWell? No, explicit HapticFeedback used generally.
|
||||
// Haptic via InkWell? No, explicit HapticFeedback used generally.
|
||||
|
||||
class SakeListItem extends ConsumerWidget {
|
||||
final SakeItem sake;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import 'package:flutter/cupertino.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import '../theme/app_theme.dart';
|
||||
import '../providers/sake_list_provider.dart';
|
||||
import '../providers/filter_providers.dart';
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class _OtherSettingsSectionState extends ConsumerState<OtherSettingsSection> {
|
|||
trailing: Switch(
|
||||
value: userProfile.isBusinessMode,
|
||||
onChanged: (val) => ref.read(userProfileProvider.notifier).toggleBusinessMode(),
|
||||
activeColor: Colors.orange,
|
||||
activeThumbColor: Colors.orange,
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import '../lib/secrets.dart';
|
||||
import 'package:ponshu_room_lite/secrets.dart';
|
||||
|
||||
void main() async {
|
||||
print('Checking available Gemini models via API...');
|
||||
|
|
|
|||
Loading…
Reference in New Issue