-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Da-gather/default
Feat: bottom navigation bar 구현
- Loading branch information
Showing
13 changed files
with
265 additions
and
102 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import 'package:dagather_frontend/screens/account/screens/account_screen.dart'; | ||
import 'package:dagather_frontend/screens/chat/screens/chats_screen.dart'; | ||
import 'package:dagather_frontend/screens/home/screens/home_screen.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
|
||
import '../utilities/colors.dart'; | ||
|
||
class BaseScaffold extends StatefulWidget { | ||
const BaseScaffold({super.key}); | ||
|
||
@override | ||
State<BaseScaffold> createState() => _BaseScaffoldState(); | ||
} | ||
|
||
class _BaseScaffoldState extends State<BaseScaffold> { | ||
int _selectedIdx = 0; | ||
|
||
final List<Widget> _screenList = [ | ||
const HomeScreen(), | ||
const ChatsScreen(), | ||
const AccountScreen(), | ||
]; | ||
|
||
void _onItemTapped(int index) { | ||
setState(() { | ||
_selectedIdx = index; | ||
}); | ||
} | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: SafeArea( | ||
child: _screenList.elementAt(_selectedIdx), | ||
), | ||
bottomNavigationBar: BottomNavigationBar( | ||
currentIndex: _selectedIdx, | ||
backgroundColor: Colors.white, | ||
unselectedItemColor: AppColor.g400, | ||
onTap: _onItemTapped, | ||
showSelectedLabels: false, | ||
showUnselectedLabels: false, | ||
type: BottomNavigationBarType.fixed, | ||
items: [ | ||
BottomNavigationBarItem( | ||
icon: SvgPicture.asset( | ||
width: 24.w, | ||
'assets/icons/navigation/ic_home.svg', | ||
), | ||
activeIcon: SvgPicture.asset( | ||
width: 24.w, | ||
'assets/icons/navigation/ic_home_filled.svg', | ||
), | ||
label: 'home'), | ||
BottomNavigationBarItem( | ||
icon: SvgPicture.asset( | ||
width: 24.w, | ||
'assets/icons/navigation/ic_chat.svg', | ||
), | ||
activeIcon: SvgPicture.asset( | ||
width: 24.w, | ||
'assets/icons/navigation/ic_chat_filled.svg', | ||
), | ||
label: 'chat'), | ||
BottomNavigationBarItem( | ||
icon: SvgPicture.asset( | ||
width: 24.w, | ||
'assets/icons/navigation/ic_person.svg', | ||
), | ||
activeIcon: SvgPicture.asset( | ||
width: 24.w, | ||
'assets/icons/navigation/ic_person_filled.svg', | ||
), | ||
label: 'account'), | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AccountScreen extends StatelessWidget { | ||
const AccountScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Center( | ||
child: Text("account"), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class ChatsScreen extends StatelessWidget { | ||
const ChatsScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Center( | ||
child: Text("chats"), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class HomeScreen extends StatelessWidget { | ||
const HomeScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Center( | ||
child: Text("home"), | ||
); | ||
} | ||
} |
Oops, something went wrong.