You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
ozgurkon-app/lib/screens/HomePage.dart

52 lines
1.3 KiB

import 'package:flutter/material.dart';
import 'package:ozgurkon_app/screens/About.dart';
import 'package:ozgurkon_app/screens/Chat.dart';
import 'package:ozgurkon_app/widgets/Schedule.dart';
class HomePage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _HomeState();
}
}
class _HomeState extends State<HomePage> {
int _currentIndex = 0;
final List<Widget> _children = [
PlaceholderWidget(Colors.white),
MyAbout(),
WebViewExample()
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('ÖzgürKon'),
),
body: _children[_currentIndex], // new
bottomNavigationBar: BottomNavigationBar(
onTap: onTabTapped, // new
currentIndex:
_currentIndex, // this will be set when a new tab is tapped
items: [
BottomNavigationBarItem(
icon: new Icon(Icons.chat),
label: 'Chat',
),
BottomNavigationBarItem(
icon: new Icon(Icons.live_tv),
label: 'Live',
),
BottomNavigationBarItem(
icon: Icon(Icons.date_range), label: 'Schedule')
],
),
);
}
void onTabTapped(int index) {
setState(() {
_currentIndex = index;
});
}
}