LATIHAN FLUTTER WEEK#1 : BOTTOM NAVIGATION BAR

LATIHAN FLUTTER WEEK#1 : BOTTOM NAVIGATION BAR

sebelumnya baca tutorial : LATIHAN FLUTTER WEEK#1 : FLOATING ACTION BUTTON

main.dart

import 'package:flutter/material.dart';

void main(){
  runApp(
    new MaterialApp(
      home: new Widget1(),
    )
  );
}

class Widget1 extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      backgroundColor: Colors.yellow[200],
      appBar: new AppBar(
        title: new Text("FLutter App #1"),
        backgroundColor: Color(0xFFFF7043),
      ),
      body: new Center(
        child: new Text(
            "meetAp Flutter Basic",
             style: TextStyle(color: Colors.redAccent[400]),
        ),
      ),

      floatingActionButton: FloatingActionButton(
          onPressed: null,
        tooltip: 'Camera',
        child: Icon(Icons.camera),
        backgroundColor: Colors.blue[400],
      ),
      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.deepOrange,
        selectedItemColor: Colors.white,
        unselectedItemColor: Colors.black,
      ),
    );
  }
}

Flutter Developer