Skip to content

Instantly share code, notes, and snippets.

@DirkWillem
Created December 17, 2017 19:51
Show Gist options
  • Save DirkWillem/454f0fa60ede93a6cb40f0208a291e20 to your computer and use it in GitHub Desktop.
Save DirkWillem/454f0fa60ede93a6cb40f0208a291e20 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(home: new TestApplication()));
}
class TestApplication extends StatelessWidget {
final PageController _pageController = new PageController(initialPage: 1);
final int _pageIndex = 1;
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: _pageIndex == 0 ? null : new AppBar(
title: new Text("My cool app"),
),
body: new PageView(
children: [
new Container(color: Colors.grey),
new Container(color: Colors.grey),
new Container(color: Colors.grey),
new Container(color: Colors.grey)
],
controller: _pageController,
physics: new NeverScrollableScrollPhysics(),
),
bottomNavigationBar: new BottomNavigationBar(
items: [
new BottomNavigationBarItem(icon: new Icon(Icons.calendar_today), title: new Text("A")),
new BottomNavigationBarItem(icon: new Icon(Icons.location_city), title: new Text("B")),
new BottomNavigationBarItem(icon: new Icon(Icons.people_outline), title: new Text("C")),
// To see "normal" behaviour, comment this line
new BottomNavigationBarItem(icon: new Icon(Icons.settings), title: new Text("D")),
],
onTap: (_) { },
currentIndex: _pageIndex,
fixedColor: Theme.of(context).accentColor,
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment