💄 Post editor content max width

This commit is contained in:
LittleSheep 2025-01-15 15:19:46 +08:00
parent 9d0e19c56f
commit 32c1effcb5

View File

@ -303,19 +303,22 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
], ],
), ),
// Content Input Area // Content Input Area
TextField( Container(
controller: _writeController.contentController, constraints: const BoxConstraints(maxWidth: 640),
maxLines: null, child: TextField(
decoration: InputDecoration( controller: _writeController.contentController,
hintText: 'fieldPostContent'.tr(), maxLines: null,
hintStyle: TextStyle(fontSize: 14), decoration: InputDecoration(
isCollapsed: true, hintText: 'fieldPostContent'.tr(),
contentPadding: const EdgeInsets.symmetric( hintStyle: TextStyle(fontSize: 14),
horizontal: 16, isCollapsed: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 16,
),
border: InputBorder.none,
), ),
border: InputBorder.none, onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
), ),
onTapOutside: (_) => FocusManager.instance.primaryFocus?.unfocus(),
), ),
] ]
.expandIndexed( .expandIndexed(
@ -366,6 +369,15 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LoadingIndicator(isActive: _isLoading),
if (_writeController.isBusy && _writeController.progress != null)
TweenAnimationBuilder<double>(
tween: Tween(begin: 0, end: _writeController.progress),
duration: Duration(milliseconds: 300),
builder: (context, value, _) => LinearProgressIndicator(value: value, minHeight: 2),
)
else if (_writeController.isBusy)
const LinearProgressIndicator(value: null, minHeight: 2),
Container( Container(
child: _writeController.temporaryRestored child: _writeController.temporaryRestored
? Container( ? Container(
@ -396,15 +408,6 @@ class _PostEditorScreenState extends State<PostEditorScreen> {
) )
.height(_writeController.temporaryRestored ? 32 : 0, animate: true) .height(_writeController.temporaryRestored ? 32 : 0, animate: true)
.animate(const Duration(milliseconds: 300), Curves.fastLinearToSlowEaseIn), .animate(const Duration(milliseconds: 300), Curves.fastLinearToSlowEaseIn),
LoadingIndicator(isActive: _isLoading),
if (_writeController.isBusy && _writeController.progress != null)
TweenAnimationBuilder<double>(
tween: Tween(begin: 0, end: _writeController.progress),
duration: Duration(milliseconds: 300),
builder: (context, value, _) => LinearProgressIndicator(value: value, minHeight: 2),
)
else if (_writeController.isBusy)
const LinearProgressIndicator(value: null, minHeight: 2),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [