[ui] UI theme should match repertory blue #61

This commit is contained in:
2025-09-04 11:20:47 -05:00
parent d1183c00af
commit 36ef520cf2
2 changed files with 47 additions and 26 deletions

View File

@@ -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;
}
}

View File

@@ -50,7 +50,6 @@ class _AddMountScreenState extends State<AddMountScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// Header
Row(
children: [
Material(
@@ -129,29 +128,41 @@ class _AddMountScreenState extends State<AddMountScreen> {
],
),
const SizedBox(height: constants.padding),
DropdownButtonFormField<String>(
IntrinsicWidth(
child: DropdownButtonFormField<String>(
initialValue: _mountType.isEmpty ? null : _mountType,
isExpanded: false,
decoration: createCommonDecoration(
scheme,
'Provider Type',
Icons.cloud_outlined,
"Provider Type",
Icons.storage,
filled: false,
),
isExpanded: true,
items: constants.providerTypeList
.map<DropdownMenuItem<String>>(
(item) => DropdownMenuItem<String>(
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<String>(
value: item,
child: Text(item),
child: Text(
item,
style: textTheme.bodyMedium?.copyWith(
color: scheme.onSurface.withValues(alpha: 0.96),
),
)
.toList(),
onChanged: (mountType) => _handleChange(
),
);
}).toList(),
onChanged: (mountType) {
_handleChange(
Provider.of<Auth>(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<AddMountScreen> {
).copyWith(hintText: 'Enter a unique name'),
),
],
// Settings + Actions
if (_mount != null) ...[
const SizedBox(height: constants.padding),
Expanded(