80 lines
2.0 KiB
Dart
80 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'core/theme.dart';
|
|
import 'core/config.dart';
|
|
import 'features/webview/webview_screen.dart';
|
|
import 'features/input/input_screen.dart';
|
|
import 'features/settings/settings_screen.dart';
|
|
|
|
void main() {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
runApp(const InouApp());
|
|
}
|
|
|
|
class InouApp extends StatelessWidget {
|
|
const InouApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
title: AppConfig.appName,
|
|
theme: AppTheme.darkTheme,
|
|
debugShowCheckedModeBanner: false,
|
|
home: const MainScaffold(),
|
|
);
|
|
}
|
|
}
|
|
|
|
class MainScaffold extends StatefulWidget {
|
|
const MainScaffold({super.key});
|
|
|
|
@override
|
|
State<MainScaffold> createState() => _MainScaffoldState();
|
|
}
|
|
|
|
class _MainScaffoldState extends State<MainScaffold> {
|
|
int _currentIndex = 0;
|
|
|
|
final List<Widget> _screens = const [
|
|
WebViewScreen(),
|
|
InputScreen(),
|
|
SettingsScreen(),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: IndexedStack(
|
|
index: _currentIndex,
|
|
children: _screens,
|
|
),
|
|
bottomNavigationBar: NavigationBar(
|
|
selectedIndex: _currentIndex,
|
|
onDestinationSelected: (index) {
|
|
setState(() {
|
|
_currentIndex = index;
|
|
});
|
|
},
|
|
backgroundColor: AppTheme.surfaceColor,
|
|
indicatorColor: AppTheme.primaryColor.withOpacity(0.2),
|
|
destinations: const [
|
|
NavigationDestination(
|
|
icon: Icon(Icons.home_outlined),
|
|
selectedIcon: Icon(Icons.home),
|
|
label: 'Home',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.edit_outlined),
|
|
selectedIcon: Icon(Icons.edit),
|
|
label: 'Input',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.settings_outlined),
|
|
selectedIcon: Icon(Icons.settings),
|
|
label: 'Settings',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|