feat(ui): 更新品牌启动页与选集交互
This commit is contained in:
1 parent
4778ce2c75
commit
c1cb7d1c11
87 files changed
+919
-552
No files matched your search
@@ -19,9 +19,10 @@ import '../../../l10n/app_localizations.dart';
|
||||
import '../../interaction/widgets/report_dialog.dart';
|
||||
import 'comment_tile.dart';
|
||||
|
||||
const double _minSheetHeight = 240;
|
||||
const double _maxSheetHeight = 460;
|
||||
const double _minSheetHeight = 280;
|
||||
const double _maxSheetHeight = 520;
|
||||
const int _maxCommentLength = 300;
|
||||
const double _composerRadius = 22;
|
||||
|
||||
/// 服务端评论底部弹窗:匿名列表、游标翻页、回复、点赞和本人删除。
|
||||
class DramaCommentsSheet extends StatefulWidget {
|
||||
@@ -164,7 +165,7 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 8),
|
||||
padding: const EdgeInsets.fromLTRB(20, 4, 20, 12),
|
||||
child: ListenableBuilder(
|
||||
listenable: _controller,
|
||||
builder: (context, _) => _content(context),
|
||||
@@ -182,9 +183,13 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
children: [
|
||||
Text(
|
||||
l10n.comments,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w700),
|
||||
style: const TextStyle(
|
||||
color: AppColors.cream,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 12),
|
||||
Expanded(child: _list(l10n)),
|
||||
if (_replyTo != null) _replyBanner(l10n, _replyTo!),
|
||||
_composer(l10n),
|
||||
@@ -199,24 +204,14 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
);
|
||||
}
|
||||
if (_controller.error != null && _controller.comments.isEmpty) {
|
||||
return Center(
|
||||
return EmptyState(
|
||||
key: const Key('comment-list-error'),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
errorText(l10n, _controller.error, l10n.commentsLoadFailed),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: AppColors.muted),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
TextButton(
|
||||
key: const Key('comment-list-retry'),
|
||||
onPressed: _controller.load,
|
||||
child: Text(l10n.retry),
|
||||
),
|
||||
],
|
||||
),
|
||||
icon: Icons.cloud_off_rounded,
|
||||
title: errorText(l10n, _controller.error, l10n.commentsLoadFailed),
|
||||
actionLabel: l10n.retry,
|
||||
actionKey: const Key('comment-list-retry'),
|
||||
onAction: _controller.load,
|
||||
compact: true,
|
||||
);
|
||||
}
|
||||
if (_controller.comments.isEmpty) {
|
||||
@@ -272,7 +267,7 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
l10n.replyingTo(
|
||||
replyTo.nickname.isEmpty ? l10n.anonymousUser : replyTo.nickname,
|
||||
),
|
||||
style: const TextStyle(color: AppColors.blueSoft, fontSize: 12),
|
||||
style: const TextStyle(color: AppColors.muted, fontSize: 12),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
@@ -286,6 +281,25 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
),
|
||||
);
|
||||
|
||||
InputDecoration _composerDecoration(String hint) {
|
||||
const radius = BorderRadius.all(Radius.circular(_composerRadius));
|
||||
const clear = OutlineInputBorder(
|
||||
borderRadius: radius,
|
||||
borderSide: BorderSide.none,
|
||||
);
|
||||
return InputDecoration(
|
||||
hintText: hint,
|
||||
hintStyle: const TextStyle(color: AppColors.muted, fontSize: 14),
|
||||
counterText: '',
|
||||
filled: true,
|
||||
fillColor: AppColors.raised,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
border: clear,
|
||||
enabledBorder: clear,
|
||||
focusedBorder: clear,
|
||||
);
|
||||
}
|
||||
|
||||
Widget _composer(AppLocalizations l10n) => Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -295,16 +309,9 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
focusNode: _inputFocus,
|
||||
maxLength: _maxCommentLength,
|
||||
maxLines: 1,
|
||||
decoration: InputDecoration(
|
||||
hintText: l10n.writeComment,
|
||||
counterText: '',
|
||||
filled: true,
|
||||
fillColor: const Color(0xFF35353A),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
),
|
||||
style: const TextStyle(color: AppColors.cream, fontSize: 14),
|
||||
cursorColor: AppColors.gold,
|
||||
decoration: _composerDecoration(l10n.writeComment),
|
||||
onSubmitted: (_) => _post(),
|
||||
),
|
||||
),
|
||||
@@ -387,7 +394,7 @@ class _CommentThread extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user