Refactor ShareFileDialog: reduce maxLines for share URL input and streamline button layout for link creation

This commit is contained in:
Leon Bösche
2026-01-24 23:51:29 +01:00
parent ea5c297641
commit e4931d4e03

View File

@@ -225,7 +225,7 @@ class _ShareFileDialogState extends State<ShareFileDialog> {
child: TextField(
controller: TextEditingController(text: _shareUrl),
readOnly: true,
maxLines: 2,
maxLines: 1,
style: TextStyle(color: AppTheme.primaryText),
decoration: InputDecoration(
border: OutlineInputBorder(
@@ -265,52 +265,27 @@ class _ShareFileDialogState extends State<ShareFileDialog> {
],
),
const SizedBox(height: 16),
Row(
children: [
ModernGlassButton(
onPressed: _revokeShareLink,
child: Text(
'Revoke Link',
style: TextStyle(color: AppTheme.errorColor),
),
),
const Spacer(),
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('Close'),
),
],
),
] else ...[
Text(
'No share link yet. Create a public, read-only link for this file.',
style: TextStyle(color: AppTheme.secondaryText),
),
const SizedBox(height: 16),
Row(
children: [
ModernGlassButton(
onPressed: _createShareLink,
isLoading: _isLoading,
child: _isLoading
? const SizedBox(
height: 16,
width: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
AppTheme.accentColor,
),
),
)
: const Text('Create link'),
),
const Spacer(),
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: const Text('Close'),
),
],
ModernGlassButton(
onPressed: _createShareLink,
isLoading: _isLoading,
child: _isLoading
? const SizedBox(
height: 16,
width: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
AppTheme.accentColor,
),
),
)
: const Text('Create link'),
),
],
],