친구/그룹 스터디/백품타 랭킹 화면 폭 제한 (양옆으로 길게 늘어지던 것 수정)
백품타 랭킹, 그룹 스터디 목록은 최대 560px로(기존 대비 절반 느낌), 친구 목록은 최대 400px로(더 좁게, 1/3 느낌) 가운데 정렬되게 제한. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+121
-111
@@ -163,123 +163,133 @@ class _FriendsScreenState extends State<FriendsScreen> {
|
||||
),
|
||||
body: _controller.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: RefreshIndicator(
|
||||
onRefresh: _controller.refresh,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 90),
|
||||
children: [
|
||||
const Center(child: TitlePill('친구')),
|
||||
const SizedBox(height: 20),
|
||||
if (_controller.requests.isNotEmpty) ...[
|
||||
_sectionHeader(
|
||||
'받은 친구 신청',
|
||||
count: _controller.requests.length,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
for (final r in _controller.requests)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 400),
|
||||
child: RefreshIndicator(
|
||||
onRefresh: _controller.refresh,
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 90),
|
||||
children: [
|
||||
const Center(child: TitlePill('친구')),
|
||||
const SizedBox(height: 20),
|
||||
if (_controller.requests.isNotEmpty) ...[
|
||||
_sectionHeader(
|
||||
'받은 친구 신청',
|
||||
count: _controller.requests.length,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${r['name']} (${r['studentId']})',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
const SizedBox(height: 10),
|
||||
for (final r in _controller.requests)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${r['name']} (${r['studentId']})',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () =>
|
||||
_respond(r['requestId'] as int, false),
|
||||
child: const Text(
|
||||
'거절',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
),
|
||||
onPressed: () =>
|
||||
_respond(r['requestId'] as int, true),
|
||||
child: const Text('수락'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
_sectionHeader('내 친구', count: _controller.friends.length),
|
||||
const SizedBox(height: 10),
|
||||
if (_controller.friends.isEmpty)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
child: Text(
|
||||
'아직 친구가 없어요. 학번으로 친구를 추가해보세요.',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
)
|
||||
else
|
||||
for (final f in _controller.friends)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.ink.withValues(
|
||||
alpha: 0.06,
|
||||
TextButton(
|
||||
onPressed: () => _respond(
|
||||
r['requestId'] as int,
|
||||
false,
|
||||
),
|
||||
child: const Text(
|
||||
'거절',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.person_rounded,
|
||||
size: 16,
|
||||
color: AppPalette.ink,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${f['name']} (${f['studentId']})',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppPalette.ink,
|
||||
foregroundColor: AppPalette.paper,
|
||||
),
|
||||
onPressed: () =>
|
||||
_respond(r['requestId'] as int, true),
|
||||
child: const Text('수락'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.person_remove_outlined,
|
||||
color: Colors.grey,
|
||||
),
|
||||
onPressed: () =>
|
||||
_remove(f['studentId'] as String),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
_sectionHeader(
|
||||
'내 친구',
|
||||
count: _controller.friends.length,
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 10),
|
||||
if (_controller.friends.isEmpty)
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
child: Text(
|
||||
'아직 친구가 없어요. 학번으로 친구를 추가해보세요.',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
)
|
||||
else
|
||||
for (final f in _controller.friends)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.paper,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppPalette.sage),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppPalette.ink.withValues(
|
||||
alpha: 0.06,
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.person_rounded,
|
||||
size: 16,
|
||||
color: AppPalette.ink,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${f['name']} (${f['studentId']})',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.person_remove_outlined,
|
||||
color: Colors.grey,
|
||||
),
|
||||
onPressed: () =>
|
||||
_remove(f['studentId'] as String),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user