59 lines
1.6 KiB
Dart
59 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'battle_screen.dart';
|
|
import 'inventory_screen.dart';
|
|
import 'settings_screen.dart';
|
|
import '../widgets/responsive_container.dart';
|
|
|
|
class MainWrapper extends StatefulWidget {
|
|
const MainWrapper({super.key});
|
|
|
|
@override
|
|
State<MainWrapper> createState() => _MainWrapperState();
|
|
}
|
|
|
|
class _MainWrapperState extends State<MainWrapper> {
|
|
int _currentIndex = 0;
|
|
|
|
final List<Widget> _screens = [
|
|
const BattleScreen(),
|
|
const InventoryScreen(),
|
|
const SettingsScreen(),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.black, // Outer background for web
|
|
body: Center(
|
|
child: ResponsiveContainer(
|
|
child: Scaffold(
|
|
body: IndexedStack(index: _currentIndex, children: _screens),
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
currentIndex: _currentIndex,
|
|
onTap: (index) {
|
|
setState(() {
|
|
_currentIndex = index;
|
|
});
|
|
},
|
|
items: const [
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.flash_on),
|
|
label: 'Battle',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.backpack),
|
|
label: 'Inventory',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.settings),
|
|
label: 'Settings',
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|