import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import './house/house_note_manager.dart'; void main() { // 確保 Flutter 引擎初始化 WidgetsFlutterBinding.ensureInitialized(); runApp(const HouseHunterApp()); } class HouseHunterApp extends StatelessWidget { const HouseHunterApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'House Hunter Pro', debugShowCheckedModeBanner: false, // 設定全域主題:採用現代化的 Material 3 設計 theme: ThemeData( useMaterial3: true, colorScheme: ColorScheme.fromSeed( seedColor: const Color(0xFF2196F3), // 專業藍色調 primary: const Color(0xFF2196F3), secondary: const Color(0xFF00BCD4), surface: Colors.white, ), // 設定表單預設樣式 (對應 house_note_form.dart) inputDecorationTheme: InputDecorationTheme( filled: true, fillColor: Colors.grey.shade50, border: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: Colors.grey.shade300), ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: Colors.grey.shade300), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(12), borderSide: const BorderSide(color: Color(0xFF2196F3), width: 2), ), contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), ), // 設定卡片預設樣式 (對應 house_note_manager.dart) cardTheme: CardThemeData( elevation: 0, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16), side: BorderSide(color: Colors.grey.shade200), ), color: Colors.white, ), // 設定 AppBar 樣式 appBarTheme: const AppBarTheme( centerTitle: true, backgroundColor: Colors.white, foregroundColor: Colors.black87, elevation: 0.5, titleTextStyle: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, color: Colors.black87, ), ), ), // 支援語系 (處理日期選擇器等元件的繁體中文顯示) localizationsDelegates: const [ GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], supportedLocales: const [ Locale('zh', 'TW'), // 繁體中文 ], // 根據需求描述:主頁面直接設定為房屋資訊列表 // 且不必登入即可使用 home: const HouseNoteManager(), ); } }