import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:lucide_icons/lucide_icons.dart'; import '../providers/theme_provider.dart'; /// Pro版限定機能のロック画面 /// /// Lite版で使用制限されている機能を表示する際に使用。 /// 和モダンなデザインで、王冠アイコンと共に「Pro版限定」であることを伝える。 class ProLockedScreen extends ConsumerWidget { final String featureName; final IconData featureIcon; final String? description; const ProLockedScreen({ super.key, required this.featureName, required this.featureIcon, this.description, }); @override Widget build(BuildContext context, WidgetRef ref) { final userProfile = ref.watch(userProfileProvider); final appColors = Theme.of(context).colorScheme; // デフォルトの説明文を生成 final String displayDescription = description ?? _getDefaultDescription(featureName, userProfile.locale); return Scaffold( appBar: AppBar( title: Text(featureName), backgroundColor: Colors.transparent, elevation: 0, ), body: Center( child: Padding( padding: const EdgeInsets.all(32.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ // 機能アイコン(グレーアウト) Icon( featureIcon, size: 64, color: appColors.onSurface.withValues(alpha: 0.3), ), const SizedBox(height: 24), // 王冠アイコン(和モダンな細いライン) Icon( LucideIcons.crown, size: 48, color: appColors.primary.withValues(alpha: 0.7), ), const SizedBox(height: 16), // Pro版限定メッセージ Text( userProfile.locale == 'ja' ? 'Pro版限定機能' : 'Pro Version Only', style: TextStyle( fontSize: 24, fontWeight: FontWeight.w600, color: appColors.onSurface, ), ), const SizedBox(height: 8), // 機能名 Text( featureName, style: TextStyle( fontSize: 18, fontWeight: FontWeight.w500, color: appColors.primary, ), textAlign: TextAlign.center, ), const SizedBox(height: 24), // 説明文 Container( padding: const EdgeInsets.all(20), decoration: BoxDecoration( color: appColors.primary.withValues(alpha: 0.05), borderRadius: BorderRadius.circular(16), border: Border.all( color: appColors.primary.withValues(alpha: 0.2), width: 1, ), ), child: Text( displayDescription, style: TextStyle( fontSize: 14, height: 1.6, color: appColors.onSurface.withValues(alpha: 0.8), ), textAlign: TextAlign.center, ), ), const SizedBox(height: 32), // Pro版へのアップグレード案内(将来実装用) TextButton.icon( onPressed: () { // TODO: Pro版購入画面への遷移(Phase 2で実装) ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text( userProfile.locale == 'ja' ? 'Pro版は近日公開予定です' : 'Pro version coming soon', ), duration: const Duration(seconds: 2), ), ); }, icon: const Icon(LucideIcons.sparkles, size: 18), label: Text( userProfile.locale == 'ja' ? 'Pro版について' : 'About Pro Version', style: const TextStyle(fontSize: 16), ), style: TextButton.styleFrom( foregroundColor: appColors.primary, padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12), ), ), ], ), ), ), ); } /// 機能名に応じたデフォルト説明文を生成 String _getDefaultDescription(String featureName, String locale) { if (locale == 'ja') { return 'この機能はPonshu Room Pro版でご利用いただけます。\n' 'Pro版では、より充実した酒ライフをサポートする\n' '多彩な機能をお楽しみいただけます。'; } else { return 'This feature is available in Ponshu Room Pro.\n' 'Enjoy enhanced sake experience with\n' 'a wide range of premium features.'; } } }