-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/#14-letterBox' into main
- Loading branch information
Showing
8 changed files
with
329 additions
and
68 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
106 changes: 106 additions & 0 deletions
106
unibond/lib/view/screens/letter/letter_list_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,106 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:unibond/domain/letter/letter.dart'; | ||
import 'package:unibond/view/screens/letter/letter_read_screen.dart'; | ||
|
||
class LetterList extends StatelessWidget { | ||
final Color backgroundColor1; | ||
final Color backgroundColor2; | ||
final String sender; | ||
final String date; | ||
|
||
const LetterList({ | ||
required this.backgroundColor1, | ||
required this.backgroundColor2, | ||
required this.sender, | ||
required this.date, | ||
Key? key, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
centerTitle: true, | ||
title: const Text('편지 내용'), | ||
leading: IconButton( | ||
icon: const Icon(Icons.arrow_back_ios), | ||
onPressed: () { | ||
Get.back(); | ||
}, | ||
), | ||
), | ||
body: Center( | ||
child: Stack( | ||
alignment: Alignment.center, | ||
children: List.generate( | ||
10, | ||
(index) { | ||
double topPosition = index * 50.0; | ||
|
||
Color backgroundColor = | ||
index.isEven ? backgroundColor1 : backgroundColor2; | ||
|
||
return Positioned( | ||
top: topPosition, | ||
child: GestureDetector( | ||
onTap: () { | ||
Get.to(LetterReadScreen( | ||
letter: Letter( | ||
id: 1, | ||
receiverId: 2, | ||
title: "저는 오늘 행복한 하루를 보냈어요.", | ||
content: "마음이 잘 통하는 친구를 만난 것 같거든요.", | ||
isliked: true, | ||
), | ||
)); | ||
}, | ||
child: Card( | ||
elevation: 4.0, // 카드 그림자 깊이 | ||
child: Container( | ||
padding: const EdgeInsets.all(16.0), | ||
width: 300, | ||
height: 200, | ||
decoration: BoxDecoration( | ||
color: backgroundColor, | ||
), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text( | ||
"2023-11-27", | ||
style: TextStyle( | ||
fontSize: 14, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
Center( | ||
child: Text( | ||
"저는 오늘 행복한 하루를 보냈어요", | ||
style: TextStyle( | ||
fontSize: 18, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
), | ||
Align( | ||
alignment: Alignment.bottomRight, | ||
child: Text( | ||
"From. $sender", | ||
style: TextStyle(fontSize: 12), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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
Oops, something went wrong.