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