-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat/#17 검색 페이지 UI
- Loading branch information
Showing
6 changed files
with
192 additions
and
14 deletions.
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
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,52 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class RecentSearchWord extends StatelessWidget { | ||
const RecentSearchWord({super.key}); | ||
|
||
// final String text; | ||
// final VoidCallback onDelete; | ||
|
||
// const RecentSearchWord({ | ||
// Key? key, | ||
// required this.text, | ||
// required this.onDelete, | ||
// }) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
width: 100, | ||
margin: const EdgeInsets.symmetric(horizontal: 4.0), | ||
decoration: BoxDecoration( | ||
color: Colors.lightBlueAccent.shade100, | ||
borderRadius: BorderRadius.circular(15.0), | ||
), | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), | ||
child: Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
const Flexible( | ||
child: Text( | ||
"안녕안녕안녕안녕안녕", | ||
overflow: TextOverflow.fade, | ||
maxLines: 1, | ||
softWrap: false, | ||
style: TextStyle(color: Colors.black), | ||
), | ||
), | ||
const SizedBox(width: 4.0), | ||
GestureDetector( | ||
// onTap: , | ||
child: const Icon( | ||
Icons.cancel, | ||
size: 16.0, | ||
color: Colors.grey, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
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,47 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class SelectMovieDramaTab extends StatefulWidget { | ||
const SelectMovieDramaTab({super.key}); | ||
|
||
@override | ||
_SelectMovieDramaTabState createState() => _SelectMovieDramaTabState(); | ||
} | ||
|
||
class _SelectMovieDramaTabState extends State<SelectMovieDramaTab> | ||
with SingleTickerProviderStateMixin { | ||
late TabController tabController; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
tabController = TabController(length: 2, vsync: this); | ||
} | ||
|
||
@override | ||
void dispose() { | ||
tabController.dispose(); | ||
super.dispose(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return TabBar( | ||
controller: tabController, | ||
tabs: const [ | ||
Tab(text: '영화'), | ||
Tab(text: '드라마'), | ||
], | ||
indicator: const BoxDecoration( | ||
border: Border( | ||
bottom: BorderSide( | ||
color: Colors.orange, | ||
width: 4.0, | ||
), | ||
), | ||
), | ||
indicatorSize: TabBarIndicatorSize.tab, // 이 속성으로 인디케이터 크기를 탭 크기에 맞춤 | ||
labelColor: Colors.black, | ||
unselectedLabelColor: Colors.grey, | ||
); | ||
} | ||
} |
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,79 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class SelectableCircle extends StatefulWidget { | ||
// final String label; | ||
|
||
const SelectableCircle({ | ||
Key? key, | ||
}) : super(key: key); | ||
|
||
@override | ||
_SelectableCircleState createState() => _SelectableCircleState(); | ||
} | ||
|
||
class _SelectableCircleState extends State<SelectableCircle> { | ||
bool isSelected = false; | ||
|
||
void _toggleSelection() { | ||
setState(() { | ||
isSelected = !isSelected; | ||
}); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return GestureDetector( | ||
onTap: _toggleSelection, | ||
child: Column( | ||
children: [ | ||
Stack( | ||
alignment: Alignment.center, | ||
children: [ | ||
// 회색 원 | ||
CircleAvatar( | ||
radius: 35, | ||
backgroundColor: Colors.grey.shade300, | ||
), | ||
// 주황색 테두리가 그려진 원 | ||
if (isSelected) | ||
CircleAvatar( | ||
radius: 37, | ||
backgroundColor: Colors.transparent, | ||
child: Container( | ||
decoration: BoxDecoration( | ||
shape: BoxShape.circle, | ||
border: Border.all(color: Colors.orange, width: 3.0), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
const SizedBox(height: 8), | ||
Text("영화", | ||
style: TextStyle(color: isSelected ? Colors.black : Colors.grey)), | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
class CircleGrid extends StatelessWidget { | ||
const CircleGrid({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return GridView.builder( | ||
padding: const EdgeInsets.all(16.0), | ||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( | ||
crossAxisCount: 3, // 한 줄에 3개의 항목 | ||
crossAxisSpacing: 10.0, | ||
mainAxisSpacing: 10.0, | ||
childAspectRatio: 1, // 정사각형 비율 | ||
), | ||
itemCount: 9, // 예시를 위해 9개의 아이템을 표시 | ||
itemBuilder: (context, index) { | ||
return const SelectableCircle(); | ||
}, | ||
); | ||
} | ||
} |