[ui] UI theme should match repertory blue #61
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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>(
|
||||
initialValue: _mountType.isEmpty ? null : _mountType,
|
||||
decoration: createCommonDecoration(
|
||||
scheme,
|
||||
'Provider Type',
|
||||
Icons.cloud_outlined,
|
||||
),
|
||||
isExpanded: true,
|
||||
items: constants.providerTypeList
|
||||
.map<DropdownMenuItem<String>>(
|
||||
(item) => DropdownMenuItem<String>(
|
||||
value: item,
|
||||
child: Text(item),
|
||||
IntrinsicWidth(
|
||||
child: DropdownButtonFormField<String>(
|
||||
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<String>(
|
||||
value: item,
|
||||
child: Text(
|
||||
item,
|
||||
style: textTheme.bodyMedium?.copyWith(
|
||||
color: scheme.onSurface.withValues(alpha: 0.96),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
onChanged: (mountType) => _handleChange(
|
||||
Provider.of<Auth>(context, listen: false),
|
||||
mountType ?? '',
|
||||
);
|
||||
}).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(
|
||||
|
Reference in New Issue
Block a user