Skip to content

Commit

Permalink
feat : SearchBox 제작 완료
Browse files Browse the repository at this point in the history
lib/widgets/search_box.dart

issues : #13
  • Loading branch information
huchujj committed Aug 13, 2024
1 parent 2c9aa25 commit 29bd6a6
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:frontend/widgets/custom_app_bar.dart';
import 'package:frontend/colors/app_colors.dart';
import 'package:frontend/widgets/custom_bottom_navigation_bar.dart';
import 'package:frontend/widgets/home_recommend_list.dart';
import 'package:frontend/widgets/search_box.dart';

class HomePage extends StatefulWidget {
const HomePage({super.key});
Expand All @@ -27,6 +28,7 @@ class _HomePageState extends State<HomePage> {
height: 200,
child: HomeRecommendList(),
),
SearchBox(),
],
),
),
Expand Down
39 changes: 39 additions & 0 deletions frontend/lib/pages/search_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:frontend/widgets/custom_app_bar.dart';
import 'package:frontend/colors/app_colors.dart';
import 'package:frontend/widgets/custom_bottom_navigation_bar.dart';
import 'package:frontend/widgets/home_recommend_list.dart';
import 'package:frontend/widgets/search_box.dart';

class SearchPage extends StatefulWidget {
const SearchPage({super.key});

@override
_SearchPageState createState() => _SearchPageState();
}

class _SearchPageState extends State<SearchPage> {
@override
Widget build(BuildContext context) {
return const Scaffold(
appBar: CustomAppBar(),
backgroundColor: AppColors.backgroundColor,
body: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(10.0),
child: Column(
children: [
Text('data'),
SizedBox(
height: 200,
child: HomeRecommendList(),
),
SearchBox(),
],
),
),
),
bottomNavigationBar: CustomBottomNavigationBar(),
);
}
}
36 changes: 36 additions & 0 deletions frontend/lib/widgets/search_box.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';

class SearchBox extends StatefulWidget {
const SearchBox({super.key});

@override
_SearchBoxState createState() => _SearchBoxState();
}

class _SearchBoxState extends State<SearchBox> {
@override
Widget build(BuildContext context) {
return Container(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
TextField(
decoration: const InputDecoration(
hintText: '다양한 컨텐츠들을 검색해보아요.',
suffixIcon: Icon(Icons.search),
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
),
),
onChanged: (text) {
// 검색어가 입력될 때 수행할 동작
},
),
// 다른 위젯 추가 가능
],
),
),
);
}
}

0 comments on commit 29bd6a6

Please sign in to comment.