-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
9fffa39
commit 42b9f15
Showing
5 changed files
with
186 additions
and
0 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
126 changes: 126 additions & 0 deletions
126
lib/app/modules/notice/presentation/pages/search_page.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,126 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
import 'package:ziggle/app/modules/common/presentation/widgets/ziggle_button.dart'; | ||
import 'package:ziggle/app/modules/common/presentation/widgets/ziggle_pressable.dart'; | ||
import 'package:ziggle/app/values/palette.dart'; | ||
import 'package:ziggle/gen/assets.gen.dart'; | ||
import 'package:ziggle/gen/strings.g.dart'; | ||
|
||
class SearchPage extends StatefulWidget { | ||
const SearchPage({super.key}); | ||
|
||
@override | ||
State<SearchPage> createState() => _SearchPageState(); | ||
} | ||
|
||
class _SearchPageState extends State<SearchPage> { | ||
String _keyword = ''; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
const count = 10; | ||
return Scaffold( | ||
appBar: PreferredSize( | ||
preferredSize: const Size.fromHeight(60), | ||
child: SafeArea( | ||
bottom: false, | ||
child: Padding( | ||
padding: const EdgeInsets.all(10), | ||
child: Row( | ||
children: [ | ||
Expanded( | ||
child: CupertinoSearchTextField( | ||
prefixIcon: Assets.icons.search.svg(width: 20), | ||
placeholder: t.notice.search.hint, | ||
suffixIcon: const Icon(Icons.cancel), | ||
onChanged: (v) => setState(() => _keyword = v), | ||
), | ||
), | ||
const SizedBox(width: 10), | ||
ZiggleButton.text( | ||
onPressed: () => context.pop(), | ||
child: Text( | ||
t.common.cancel, | ||
style: const TextStyle(color: Palette.grayText), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
body: _keyword.isEmpty | ||
? Center( | ||
child: Column( | ||
children: [ | ||
const SizedBox(height: 50), | ||
Assets.icons.search.svg( | ||
width: 65, | ||
height: 65, | ||
colorFilter: const ColorFilter.mode( | ||
Palette.gray, | ||
BlendMode.srcIn, | ||
), | ||
), | ||
const SizedBox(height: 9), | ||
Text( | ||
t.notice.search.description, | ||
style: const TextStyle( | ||
color: Palette.grayText, | ||
fontSize: 16, | ||
fontWeight: FontWeight.w400, | ||
), | ||
) | ||
], | ||
), | ||
) | ||
: ListView.builder( | ||
itemCount: count, | ||
itemBuilder: (context, index) => Container( | ||
padding: const EdgeInsets.only(left: 16), | ||
decoration: index != count - 1 | ||
? null | ||
: const BoxDecoration( | ||
border: Border( | ||
bottom: | ||
BorderSide(color: Color(0x5B3C3C43), width: 0.33), | ||
), | ||
), | ||
child: Container( | ||
padding: const EdgeInsets.symmetric(vertical: 9), | ||
decoration: const BoxDecoration( | ||
border: Border( | ||
top: BorderSide(color: Color(0x5B3C3C43), width: 0.33), | ||
), | ||
), | ||
child: ZigglePressable( | ||
onPressed: () {}, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: [ | ||
Text( | ||
'title', | ||
style: const TextStyle( | ||
fontSize: 17, | ||
fontWeight: FontWeight.w400, | ||
color: Palette.black, | ||
), | ||
), | ||
Text( | ||
'인포팀, 하루전', | ||
style: const TextStyle( | ||
fontSize: 15, | ||
fontWeight: FontWeight.w400, | ||
color: Palette.grayText, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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