drifter_app/lib/widgets/main_screen/main_screen_widget.dart

59 lines
1.5 KiB
Dart
Raw Normal View History

2023-05-11 13:48:05 +00:00
import 'package:flutter/material.dart';
// import 'package:drifter/widgets/home_screen/home_screen_widget.dart';
import 'package:drifter/widgets/message_screen/message_screen_widget.dart';
import 'package:drifter/widgets/profile_screen/profile_screen.dart';
class MainScreenWidget extends StatefulWidget {
const MainScreenWidget({super.key});
@override
State<MainScreenWidget> createState() => _MainScreenWidgetState();
}
class _MainScreenWidgetState extends State<MainScreenWidget> {
int _selectedTap = 0;
void onSelectedtap(int index) {
if (_selectedTap == index) return;
setState(() {
_selectedTap = index;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Drifter'),
centerTitle: true,
),
body: IndexedStack(
index: _selectedTap,
children: [
2023-05-11 14:58:14 +00:00
// HomeScreen(),
2023-05-11 13:48:05 +00:00
MessageScreen(),
ProfileScreen(),
],
),
bottomNavigationBar: BottomNavigationBar(
currentIndex: _selectedTap,
items: [
// BottomNavigationBarItem(
// icon: Icon(Icons.home),
// label: 'Home',
// ),
BottomNavigationBarItem(
icon: Icon(Icons.message),
label: 'Message',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Profile',
),
],
onTap: onSelectedtap,
),
);
}
}