Skip to content

Instantly share code, notes, and snippets.

@tianhaoz95
Last active October 10, 2019 23:28
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 tianhaoz95/78da0f9f1e0596e558a070bc1ca02274 to your computer and use it in GitHub Desktop.
Save tianhaoz95/78da0f9f1e0596e558a070bc1ca02274 to your computer and use it in GitHub Desktop.
Create a dummy bottom nav bar
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Rock Paper Scissors',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
final List<BottomNavigationBarItem> navItemList = [
BottomNavigationBarItem(
icon: Icon(Icons.casino),
title: Text('Rock!'),
),
BottomNavigationBarItem(
icon: Icon(Icons.casino),
title: Text('Paper!'),
),
BottomNavigationBarItem(
icon: Icon(Icons.casino),
title: Text('Scissor!'),
)
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Rock Paper Scissors')),
body: Center(child: Text('Coming soon ...')),
bottomNavigationBar: BottomNavigationBar(
currentIndex: 0,
onTap: (int index) {},
items: navItemList,
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment