improved BottomNavigationBar's looks by using CupertinoTabBar

This commit is contained in:
Matthew
2018-11-04 20:09:27 -05:00
parent 3098cef76f
commit da0406aa5a
4 changed files with 21 additions and 13 deletions

View File

@ -1,6 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.
## [1.2.1] - 2018-11-04
### Changes
- Changed `BottomNavigationBar` to `CupertinoTabBar` to remove empty space underneath icons
- Added highlighting for the active page on the `CupertinoTabBar`
## [1.2.0] - 2018-10-26
### Changes
- Added push notifications with Cloud Functions (Android)

View File

@ -27,7 +27,7 @@ android {
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.2"
versionName "1.2.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

Binary file not shown.

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'feed.dart';
import 'upload_page.dart';
import 'dart:async';
@ -239,32 +240,32 @@ class _HomePageState extends State<HomePage> {
physics: new NeverScrollableScrollPhysics(),
onPageChanged: onPageChanged,
),
bottomNavigationBar: new BottomNavigationBar(
bottomNavigationBar: new CupertinoTabBar(
activeColor: Colors.orange,
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(
icon: new Icon(Icons.home, color: Colors.grey),
title: new Container(),
icon: new Icon(Icons.home, color: (_page == 0) ? Colors.black : Colors.grey),
title: new Container(height: 0.0),
backgroundColor: Colors.white),
new BottomNavigationBarItem(
icon: new Icon(Icons.search, color: Colors.grey),
title: new Container(),
icon: new Icon(Icons.search, color: (_page == 1) ? Colors.black : Colors.grey),
title: new Container(height: 0.0),
backgroundColor: Colors.white),
new BottomNavigationBarItem(
icon: new Icon(Icons.add_circle, color: Colors.grey),
title: new Container(),
icon: new Icon(Icons.add_circle, color: (_page == 2) ? Colors.black : Colors.grey),
title: new Container(height: 0.0),
backgroundColor: Colors.white),
new BottomNavigationBarItem(
icon: new Icon(Icons.star, color: Colors.grey),
title: new Container(),
icon: new Icon(Icons.star, color: (_page == 3) ? Colors.black : Colors.grey),
title: new Container(height: 0.0),
backgroundColor: Colors.white),
new BottomNavigationBarItem(
icon: new Icon(Icons.person_outline, color: Colors.grey),
title: new Container(),
icon: new Icon(Icons.person, color: (_page == 4) ? Colors.black : Colors.grey),
title: new Container(height: 0.0),
backgroundColor: Colors.white),
],
onTap: navigationTapped,
currentIndex: _page,
type: BottomNavigationBarType.fixed,
),
);
}