84 lines
2.3 KiB
Dart
84 lines
2.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'pokemon_list.dart';
|
|
import 'guess_page.dart';
|
|
|
|
class MainPage extends StatefulWidget {
|
|
const MainPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<MainPage> createState() => MainPageState();
|
|
}
|
|
|
|
class MainPageState extends State<MainPage> {
|
|
int _currentIndex = 0;
|
|
|
|
void setIndex(int index) {
|
|
setState(() {
|
|
_currentIndex = index;
|
|
});
|
|
}
|
|
|
|
final List<Widget> _pages = [
|
|
const PokemonListPage(),
|
|
const GuessPage(),
|
|
const Center(child: Text("SYSTEM PAGE placeholder")),
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: const Color(0xFF1B2333), // Dark blue background behind the pokedex
|
|
body: SafeArea(
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 20.0),
|
|
child: Container(
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xFFD32F2F), // Pokedex Red
|
|
borderRadius: BorderRadius.circular(30),
|
|
border: Border.all(color: const Color(0xFFA12020), width: 4),
|
|
),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(26),
|
|
child: IndexedStack(
|
|
index: _currentIndex,
|
|
children: _pages,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
bottomNavigationBar: Theme(
|
|
data: Theme.of(context).copyWith(
|
|
splashColor: Colors.transparent,
|
|
highlightColor: Colors.transparent,
|
|
),
|
|
child: BottomNavigationBar(
|
|
currentIndex: _currentIndex,
|
|
onTap: (index) {
|
|
setState(() {
|
|
_currentIndex = index;
|
|
});
|
|
},
|
|
type: BottomNavigationBarType.fixed,
|
|
selectedItemColor: const Color(0xFFD32F2F),
|
|
unselectedItemColor: Colors.grey,
|
|
items: const [
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.grid_view),
|
|
label: 'LIST',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.games),
|
|
label: 'GUESS',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.settings),
|
|
label: 'SYSTEM',
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|