rtc_prd/airhub_app/lib/main.dart
2026-02-06 16:03:32 +08:00

45 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'pages/login_page.dart';
import 'pages/webview_page.dart';
import 'pages/home_page.dart';
import 'pages/bluetooth_page.dart';
import 'pages/wifi_config_page.dart';
import 'pages/device_control_page.dart';
import 'theme/app_theme.dart';
import 'pages/profile/profile_page.dart'; // Import ProfilePage
void main() {
runApp(const AirhubApp());
}
class AirhubApp extends StatelessWidget {
const AirhubApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Airhub',
debugShowCheckedModeBanner: false,
theme: AppTheme.lightTheme,
// Initial Route
home: const DeviceControlPage(),
// Named Routes
routes: {
'/login': (context) => const LoginPage(),
'/home': (context) => const HomePage(), // Native Home
'/profile': (context) => const ProfilePage(), // Added Profile Route
'/webview_fallback': (context) =>
const WebViewPage(), // Keep for fallback
'/bluetooth': (context) => const BluetoothPage(),
'/wifi-config': (context) => const WifiConfigPage(),
'/device-control': (context) => const DeviceControlPage(),
},
// Handle unknown routes
onUnknownRoute: (settings) {
return MaterialPageRoute(builder: (_) => const WebViewPage());
},
);
}
}