diff --git a/web/repertory/lib/helpers.dart b/web/repertory/lib/helpers.dart index 81edb7e6..a7d919f0 100644 --- a/web/repertory/lib/helpers.dart +++ b/web/repertory/lib/helpers.dart @@ -468,11 +468,12 @@ Scaffold createCommonScaffold(Widget child, {Widget? floatingActionButton}) => InputDecoration createCommonDecoration( ColorScheme colorScheme, String label, - IconData icon, -) => InputDecoration( + IconData icon, { + bool filled = true, +}) => InputDecoration( labelText: label, prefixIcon: Icon(icon), - filled: true, + filled: filled, fillColor: colorScheme.primary.withValues(alpha: constants.primaryAlpha), border: OutlineInputBorder( borderRadius: BorderRadius.circular(constants.borderRadiusSmall), @@ -484,3 +485,14 @@ InputDecoration createCommonDecoration( ), contentPadding: const EdgeInsets.all(constants.paddingSmall), ); + +IconData getProviderTypeIcon(String mountType) { + switch (mountType.toLowerCase()) { + case "encrypt": + return Icons.key_outlined; + case "remote": + return Icons.network_ping_outlined; + default: + return Icons.cloud_outlined; + } +} diff --git a/web/repertory/lib/screens/add_mount_screen.dart b/web/repertory/lib/screens/add_mount_screen.dart index 309f96c9..8a0e304e 100644 --- a/web/repertory/lib/screens/add_mount_screen.dart +++ b/web/repertory/lib/screens/add_mount_screen.dart @@ -50,7 +50,6 @@ class _AddMountScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - // Header Row( children: [ Material( @@ -129,29 +128,41 @@ class _AddMountScreenState extends State { ], ), const SizedBox(height: constants.padding), - DropdownButtonFormField( - initialValue: _mountType.isEmpty ? null : _mountType, - decoration: createCommonDecoration( - scheme, - 'Provider Type', - Icons.cloud_outlined, - ), - isExpanded: true, - items: constants.providerTypeList - .map>( - (item) => DropdownMenuItem( - value: item, - child: Text(item), + IntrinsicWidth( + child: DropdownButtonFormField( + initialValue: _mountType.isEmpty ? null : _mountType, + isExpanded: false, + decoration: createCommonDecoration( + scheme, + "Provider Type", + Icons.storage, + filled: false, + ), + dropdownColor: scheme.primary.withValues( + alpha: constants.primaryAlpha, + ), + style: textTheme.bodyMedium?.copyWith( + color: scheme.onSurface.withValues(alpha: 0.96), + ), + items: constants.providerTypeList.map((item) { + return DropdownMenuItem( + value: item, + child: Text( + item, + style: textTheme.bodyMedium?.copyWith( + color: scheme.onSurface.withValues(alpha: 0.96), + ), ), - ) - .toList(), - onChanged: (mountType) => _handleChange( - Provider.of(context, listen: false), - mountType ?? '', + ); + }).toList(), + onChanged: (mountType) { + _handleChange( + Provider.of(context, listen: false), + mountType ?? '', + ); + }, ), ), - - // Configuration name (only when not Remote) if (_mountType.isNotEmpty && _mountType != 'Remote') ...[ const SizedBox(height: constants.padding), TextField( @@ -172,8 +183,6 @@ class _AddMountScreenState extends State { ).copyWith(hintText: 'Enter a unique name'), ), ], - - // Settings + Actions if (_mount != null) ...[ const SizedBox(height: constants.padding), Expanded(