forked from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
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
62 changes: 62 additions & 0 deletions
62
front/capstone_front/lib/screens/question/question_screen.dart
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,62 @@ | ||
import 'package:capstone_front/screens/faq/faq_screen.dart'; | ||
import 'package:capstone_front/screens/qna/qna_list_screen/qna_list_screen.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class QuestionScreen extends StatefulWidget { | ||
const QuestionScreen({super.key}); | ||
|
||
@override | ||
State<QuestionScreen> createState() => _QuestionScreenState(); | ||
} | ||
|
||
class _QuestionScreenState extends State<QuestionScreen> { | ||
int _selectedPageIndex = 0; | ||
final _qnaScreenList = [ | ||
const QnaListScreen(), | ||
const FaqScreen(), | ||
]; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
centerTitle: false, | ||
scrolledUnderElevation: 0, | ||
title: Row( | ||
children: [ | ||
GestureDetector( | ||
onTap: () { | ||
setState(() { | ||
_selectedPageIndex = 0; | ||
}); | ||
}, | ||
child: Text( | ||
"QnA", | ||
style: TextStyle( | ||
color: _selectedPageIndex == 0 ? Colors.black : Colors.grey, | ||
), | ||
), | ||
), | ||
const Text(' '), | ||
GestureDetector( | ||
onTap: () { | ||
setState(() { | ||
_selectedPageIndex = 1; | ||
}); | ||
}, | ||
child: Text( | ||
"FAQ", | ||
style: TextStyle( | ||
color: _selectedPageIndex == 1 ? Colors.black : Colors.grey, | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
body: SafeArea( | ||
child: _qnaScreenList.elementAt(_selectedPageIndex), | ||
), | ||
); | ||
} | ||
} |