[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(
|
InputDecoration createCommonDecoration(
|
||||||
ColorScheme colorScheme,
|
ColorScheme colorScheme,
|
||||||
String label,
|
String label,
|
||||||
IconData icon,
|
IconData icon, {
|
||||||
) => InputDecoration(
|
bool filled = true,
|
||||||
|
}) => InputDecoration(
|
||||||
labelText: label,
|
labelText: label,
|
||||||
prefixIcon: Icon(icon),
|
prefixIcon: Icon(icon),
|
||||||
filled: true,
|
filled: filled,
|
||||||
fillColor: colorScheme.primary.withValues(alpha: constants.primaryAlpha),
|
fillColor: colorScheme.primary.withValues(alpha: constants.primaryAlpha),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(constants.borderRadiusSmall),
|
borderRadius: BorderRadius.circular(constants.borderRadiusSmall),
|
||||||
@@ -484,3 +485,14 @@ InputDecoration createCommonDecoration(
|
|||||||
),
|
),
|
||||||
contentPadding: const EdgeInsets.all(constants.paddingSmall),
|
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(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// Header
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Material(
|
Material(
|
||||||
@@ -129,29 +128,41 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: constants.padding),
|
const SizedBox(height: constants.padding),
|
||||||
DropdownButtonFormField<String>(
|
IntrinsicWidth(
|
||||||
initialValue: _mountType.isEmpty ? null : _mountType,
|
child: DropdownButtonFormField<String>(
|
||||||
decoration: createCommonDecoration(
|
initialValue: _mountType.isEmpty ? null : _mountType,
|
||||||
scheme,
|
isExpanded: false,
|
||||||
'Provider Type',
|
decoration: createCommonDecoration(
|
||||||
Icons.cloud_outlined,
|
scheme,
|
||||||
),
|
"Provider Type",
|
||||||
isExpanded: true,
|
Icons.storage,
|
||||||
items: constants.providerTypeList
|
filled: false,
|
||||||
.map<DropdownMenuItem<String>>(
|
),
|
||||||
(item) => DropdownMenuItem<String>(
|
dropdownColor: scheme.primary.withValues(
|
||||||
value: item,
|
alpha: constants.primaryAlpha,
|
||||||
child: Text(item),
|
),
|
||||||
|
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(),
|
}).toList(),
|
||||||
onChanged: (mountType) => _handleChange(
|
onChanged: (mountType) {
|
||||||
Provider.of<Auth>(context, listen: false),
|
_handleChange(
|
||||||
mountType ?? '',
|
Provider.of<Auth>(context, listen: false),
|
||||||
|
mountType ?? '',
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Configuration name (only when not Remote)
|
|
||||||
if (_mountType.isNotEmpty && _mountType != 'Remote') ...[
|
if (_mountType.isNotEmpty && _mountType != 'Remote') ...[
|
||||||
const SizedBox(height: constants.padding),
|
const SizedBox(height: constants.padding),
|
||||||
TextField(
|
TextField(
|
||||||
@@ -172,8 +183,6 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
).copyWith(hintText: 'Enter a unique name'),
|
).copyWith(hintText: 'Enter a unique name'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
||||||
// Settings + Actions
|
|
||||||
if (_mount != null) ...[
|
if (_mount != null) ...[
|
||||||
const SizedBox(height: constants.padding),
|
const SizedBox(height: constants.padding),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
Reference in New Issue
Block a user