Skip to content

Instantly share code, notes, and snippets.

@ijoschek
Last active April 7, 2019 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ijoschek/57710a33eecc111474146013fff36d77 to your computer and use it in GitHub Desktop.
Save ijoschek/57710a33eecc111474146013fff36d77 to your computer and use it in GitHub Desktop.
flutter_bnb_tut
import 'package:flutter/material.dart';
// Here will be code
void main() => runApp(Main());
class Main extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter BottomNavigationBar Tutorial',
theme: ThemeData(
primarySwatch: Colors.red,
),
home: MainPage(),
);
}
}
class MainPage extends StatefulWidget {
@override
_MainPageState createState() => _MainPageState();
}
class _MainPageState extends State<MainPage> {
// Here will be code
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Flutter BottomNavigationBar Tutorial"),
),
body: _children[_currentIndex],
bottomNavigationBar: BottomNavigationBar(
currentIndex: _currentIndex,
onTap: _onBottomNavBarTab,
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home),
title: Text('Home'),
),
BottomNavigationBarItem(
icon: Icon(Icons.mail),
title: Text('Messages'),
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
title: Text('Profile'),
)
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment