Skip to content

Commit

Permalink
Linking bottom nav (#37)
Browse files Browse the repository at this point in the history
* added a new splash screen and a bottom app bar

* linked the add account and the favourites with there respective bottom bar icons

* removed the floating button since the bottom app bar has the add account route

* Update home.dart

* Update home.dart

---------

Co-authored-by: Zikani Nyirenda Mwase <[email protected]>
  • Loading branch information
Bitblender2 and zikani03 authored Nov 1, 2023
1 parent b192568 commit 13a2884
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions app/lib/presentation/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@ class Home extends StatelessWidget {
),
),
),
ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, favouritePage);
},
child: const Text("Favourites")),
const SizedBox(
height: 5,
),
ListView.builder(
padding: const EdgeInsets.only(bottom: 100),
shrinkWrap: true,
Expand Down Expand Up @@ -252,30 +244,31 @@ class Home extends StatelessWidget {
}
},
),
floatingActionButton: FloatingActionButton(
onPressed: () {
Navigator.pushNamed(context, addAccount);
},
child: const Icon(Icons.add),
),
bottomNavigationBar: BottomAppBar(
color: Color.fromARGB(255, 15, 91, 254),
shape: const CircularNotchedRectangle(),
padding:
EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
IconButton(
// ignore: prefer_const_constructors
icon: Icon(
Icons.home,
color: Colors.white, // Set the icon color to white
),
onPressed: () {},
onPressed: () {
Navigator.pushNamed(context, Home as String);
},
),
// ignore: prefer_const_constructors
Text(
'Home',
// ignore: prefer_const_constructors
style: TextStyle(color: Colors.white),
),
],
Expand All @@ -284,14 +277,18 @@ class Home extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
IconButton(
// ignore: prefer_const_constructors
icon: Icon(
Icons.favorite,
color: Colors.white, // Set the icon color to white
),
onPressed: () {},
onPressed: () {
Navigator.pushNamed(context, favouritePage);
},
),
// ignore: prefer_const_constructors
Text(
'Favorite',
'Favorites',
style: TextStyle(color: Colors.white),
),
],
Expand All @@ -304,10 +301,12 @@ class Home extends StatelessWidget {
Icons.add,
color: Colors.white, // Set the icon color to white
),
onPressed: () {},
onPressed: () {
Navigator.pushNamed(context, addAccount);
},
),
Text(
'Add account',
'Add Account',
style: TextStyle(color: Colors.white),
),
],
Expand All @@ -323,15 +322,13 @@ class Home extends StatelessWidget {
onPressed: () {},
),
Text(
'My Account',
'My Accounts',
style: TextStyle(color: Colors.white),
),
],
),
],
),
padding:
EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
),
);
}
Expand Down

0 comments on commit 13a2884

Please sign in to comment.