Sebelumnya baca tutorial : LATIHAN FLUTTER WEEK#1 : BOTTOM NAVIGATION BAR
hal1.dart
class hal1 extends StatelessWidget{ @override Widget build(BuildContext context) { return new Scaffold( backgroundColor: Colors.grey, appBar: new AppBar( title: new Text('Photograph'), backgroundColor: Colors.blue[300], ), body: new Center( child: new Text( 'Aplikasi Photograph', style: TextStyle(color: Colors.white), ), ), floatingActionButton: FloatingActionButton( onPressed: null, tooltip: 'Camera Shoot', child: Icon(Icons.camera), backgroundColor: Colors.blue, ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, bottomNavigationBar: BottomNavigationBar( items: const<BottomNavigationBarItem>[ BottomNavigationBarItem( icon: Icon(Icons.home), title: Text('Home') ), BottomNavigationBarItem( icon: Icon(Icons.people), title: Text('Profil') ), ], backgroundColor: Colors.blue, selectedItemColor: Colors.white, unselectedItemColor: Colors.black, ), ); } }
main.dart
import 'package:flutter/material.dart'; import 'package:flutter_p1/hal1.dart'; void main(){ runApp( new MaterialApp( home: new hal1(), ) ); }
