87 lines
3.0 KiB
Dart
87 lines
3.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../core/theme/tokens.dart';
|
|
import '../home_data.dart';
|
|
import '../home_screen.dart' show formatPop;
|
|
import '../../../core/i18n/app_locale.dart';
|
|
|
|
/// 인기 K-INSIDE 한 건 — Figma 「아미보이 / 10분 전 / 500 P / 제목 / 본문 / 3」.
|
|
///
|
|
/// 현상금(POP 바운티)이 붙은 Q&A 다. 정책 설계서 §P-11 — 자기 답변 채택은 막고
|
|
/// (`E-QNA-01`), 기한 만료 시 현상금은 자동 환불한다(`E-QNA-02`).
|
|
class InsideCard extends StatelessWidget {
|
|
const InsideCard({super.key, required this.digest, this.onTap});
|
|
|
|
final InsideDigest digest;
|
|
final VoidCallback? onTap;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final t = Theme.of(context).textTheme;
|
|
return Material(
|
|
color: AppColors.cosmicSurfaceContainer,
|
|
borderRadius: BorderRadius.circular(AppRadius.md),
|
|
child: InkWell(
|
|
onTap: onTap,
|
|
borderRadius: BorderRadius.circular(AppRadius.md),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(AppSpace.s4),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Text(digest.authorName, style: t.bodySmall),
|
|
const SizedBox(width: AppSpace.s2),
|
|
Text(digest.timeAgo, style: t.labelSmall),
|
|
const Spacer(),
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: AppSpace.s2,
|
|
vertical: 2,
|
|
),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(color: AppColors.cosmicAccent),
|
|
borderRadius: BorderRadius.circular(AppRadius.full),
|
|
),
|
|
child: Text(
|
|
'${formatPop(digest.bountyPop)} P',
|
|
style: t.labelSmall?.copyWith(
|
|
color: AppColors.cosmicAccent,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: AppSpace.s3),
|
|
Text(digest.title, style: t.bodyMedium),
|
|
const SizedBox(height: AppSpace.s1),
|
|
Text(
|
|
digest.body,
|
|
style: t.bodySmall,
|
|
maxLines: 2,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
const SizedBox(height: AppSpace.s3),
|
|
Row(
|
|
children: [
|
|
const Icon(
|
|
Icons.mode_comment_outlined,
|
|
size: 14,
|
|
color: AppColors.onCosmicVariant,
|
|
),
|
|
const SizedBox(width: AppSpace.s1),
|
|
Text(
|
|
context.l10n.insideAnswers('${digest.answers}'),
|
|
style: t.labelSmall,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|