-
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.
- Loading branch information
Showing
9 changed files
with
119 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:palink_v2/data/models/chat/conversation_response.dart'; | ||
import 'package:palink_v2/domain/model/chat/conversation.dart'; | ||
|
||
extension ConversationMapper on ConversationResponse { | ||
Conversation toDomain() { | ||
return Conversation( | ||
conversationId: conversationId, | ||
day: DateTime.parse(day), | ||
userId: userId, | ||
characterId: characterId, | ||
); | ||
} | ||
} |
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
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
46 changes: 43 additions & 3 deletions
46
lib/presentation/screens/mypage/view/myfeedbacks_view.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 |
---|---|---|
@@ -1,20 +1,60 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:palink_v2/core/theme/app_fonts.dart'; | ||
import '../../common/appbar_perferred_size.dart'; | ||
import 'package:palink_v2/domain/model/character/character.dart'; | ||
import 'package:palink_v2/presentation/screens/common/appbar_perferred_size.dart'; | ||
import 'package:palink_v2/presentation/screens/mypage/controller/myfeedbacks_viewmodel.dart'; | ||
|
||
class MyfeedbacksView extends StatelessWidget { | ||
final MyfeedbacksViewmodel viewModel = Get.put(MyfeedbacksViewmodel()); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: const Color(0xfff5f5f5), | ||
appBar: AppBar( | ||
backgroundColor: Colors.white, | ||
title: Text('PALINK', style: textTheme().titleLarge), | ||
title: Text('내 피드백 기록', style: textTheme().titleMedium), | ||
centerTitle: false, | ||
bottom: appBarBottomLine(), | ||
), | ||
body: Text('피드백들'), | ||
body: GetBuilder<MyfeedbacksViewmodel>( | ||
builder: (viewModel) { | ||
if (viewModel.chatrooms.isEmpty) { | ||
return const Center(child: Text('피드백이 없습니다.')); | ||
} | ||
|
||
return ListView.builder( | ||
itemCount: viewModel.chatrooms.length, | ||
itemBuilder: (context, index) { | ||
var chatroom = viewModel.chatrooms[index]; | ||
var character = viewModel.characters[chatroom.characterId]; | ||
return Column( | ||
children: [ | ||
ListTile( | ||
contentPadding: const EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0), | ||
tileColor: Colors.white, // 배경을 하얀색으로 설정 | ||
leading: ClipRRect( | ||
borderRadius: BorderRadius.circular(10), | ||
child: Image.asset(character!.image) | ||
), | ||
title: Text(character != null ? character.name : '익명', style: textTheme().titleMedium), | ||
subtitle: Text(_formatDate(chatroom.day)), | ||
horizontalTitleGap: 30.0, | ||
), | ||
const Divider(), | ||
], | ||
); | ||
}, | ||
); | ||
}, | ||
), | ||
); | ||
} | ||
|
||
|
||
// 날짜 포맷팅 함수 | ||
String _formatDate(DateTime date) { | ||
return '${date.year}년 ${date.month}월 ${date.day}일 ${date.hour}시 ${date.minute}분'; | ||
} | ||
} |
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