[ui] UI theme should match repertory blue #61
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
@@ -416,10 +416,11 @@ Future<String?> editMountLocation(
|
|||||||
onChanged: (value) => setState(() => currentLocation = value),
|
onChanged: (value) => setState(() => currentLocation = value),
|
||||||
)
|
)
|
||||||
: AppDropdownFormField<String>(
|
: AppDropdownFormField<String>(
|
||||||
labelText: "Select drive",
|
|
||||||
labelOf: (s) => s,
|
labelOf: (s) => s,
|
||||||
value: currentLocation,
|
labelText: "Select drive",
|
||||||
onChanged: (value) => setState(() => currentLocation = value),
|
onChanged: (value) => setState(() => currentLocation = value),
|
||||||
|
prefixIcon: Icons.computer,
|
||||||
|
value: currentLocation,
|
||||||
values: available.toList(),
|
values: available.toList(),
|
||||||
),
|
),
|
||||||
title: const Text('Mount Location', textAlign: TextAlign.center),
|
title: const Text('Mount Location', textAlign: TextAlign.center),
|
||||||
|
@@ -130,20 +130,20 @@ class _AddMountScreenState extends State<AddMountScreen> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: constants.padding),
|
const SizedBox(height: constants.padding),
|
||||||
AppDropdownFormField<String>(
|
AppDropdownFormField<String>(
|
||||||
labelText: 'Provider Type',
|
constrainToIntrinsic: true,
|
||||||
prefixIcon: Icons.extension,
|
isExpanded: false,
|
||||||
values: constants.providerTypeList,
|
|
||||||
value: _mountType.isEmpty ? null : _mountType,
|
|
||||||
labelOf: (s) => s,
|
labelOf: (s) => s,
|
||||||
|
labelText: 'Provider Type',
|
||||||
onChanged: (mountType) {
|
onChanged: (mountType) {
|
||||||
_handleChange(
|
_handleChange(
|
||||||
Provider.of<Auth>(context, listen: false),
|
Provider.of<Auth>(context, listen: false),
|
||||||
mountType ?? '',
|
mountType ?? '',
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
constrainToIntrinsic: true,
|
prefixIcon: Icons.miscellaneous_services,
|
||||||
|
value: _mountType.isEmpty ? null : _mountType,
|
||||||
|
values: constants.providerTypeList,
|
||||||
widthMultiplier: 2.0,
|
widthMultiplier: 2.0,
|
||||||
isExpanded: false,
|
|
||||||
),
|
),
|
||||||
if (_mountType.isNotEmpty && _mountType != 'Remote') ...[
|
if (_mountType.isNotEmpty && _mountType != 'Remote') ...[
|
||||||
const SizedBox(height: constants.padding),
|
const SizedBox(height: constants.padding),
|
||||||
|
@@ -6,6 +6,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:repertory/constants.dart' as constants;
|
import 'package:repertory/constants.dart' as constants;
|
||||||
import 'package:repertory/helpers.dart'
|
import 'package:repertory/helpers.dart'
|
||||||
show Validator, displayErrorMessage, doShowDialog;
|
show Validator, displayErrorMessage, doShowDialog;
|
||||||
|
import 'package:repertory/widgets/app_dropdown.dart';
|
||||||
import 'package:settings_ui/settings_ui.dart';
|
import 'package:settings_ui/settings_ui.dart';
|
||||||
|
|
||||||
void createBooleanSetting(
|
void createBooleanSetting(
|
||||||
@@ -56,8 +57,8 @@ void createIntListSetting(
|
|||||||
SettingsTile.navigation(
|
SettingsTile.navigation(
|
||||||
title: createSettingTitle(context, key, description),
|
title: createSettingTitle(context, key, description),
|
||||||
leading: Icon(icon),
|
leading: Icon(icon),
|
||||||
value: DropdownButton<String>(
|
value: AppDropdownFormField<String>(
|
||||||
value: value.toString(),
|
labelOf: (s) => s,
|
||||||
onChanged: (newValue) {
|
onChanged: (newValue) {
|
||||||
setState(
|
setState(
|
||||||
() => settings[key] = int.parse(
|
() => settings[key] = int.parse(
|
||||||
@@ -65,9 +66,8 @@ void createIntListSetting(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
items: valueList.map<DropdownMenuItem<String>>((item) {
|
value: value.toString(),
|
||||||
return DropdownMenuItem<String>(value: item, child: Text(item));
|
values: valueList,
|
||||||
}).toList(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -305,12 +305,12 @@ void createStringListSetting(
|
|||||||
SettingsTile.navigation(
|
SettingsTile.navigation(
|
||||||
title: createSettingTitle(context, key, description),
|
title: createSettingTitle(context, key, description),
|
||||||
leading: Icon(icon),
|
leading: Icon(icon),
|
||||||
value: DropdownButton<String>(
|
value: AppDropdownFormField<String>(
|
||||||
value: value,
|
constrainToIntrinsic: true,
|
||||||
|
labelOf: (s) => s,
|
||||||
onChanged: (newValue) => setState(() => settings[key] = newValue),
|
onChanged: (newValue) => setState(() => settings[key] = newValue),
|
||||||
items: valueList.map<DropdownMenuItem<String>>((item) {
|
value: value,
|
||||||
return DropdownMenuItem<String>(value: item, child: Text(item));
|
values: valueList,
|
||||||
}).toList(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@@ -5,22 +5,22 @@ import 'package:repertory/helpers.dart';
|
|||||||
class AppDropdownFormField<T> extends StatelessWidget {
|
class AppDropdownFormField<T> extends StatelessWidget {
|
||||||
const AppDropdownFormField({
|
const AppDropdownFormField({
|
||||||
super.key,
|
super.key,
|
||||||
required this.values,
|
|
||||||
required this.labelOf,
|
required this.labelOf,
|
||||||
this.value,
|
required this.values,
|
||||||
this.onChanged,
|
|
||||||
this.validator,
|
|
||||||
this.labelText,
|
|
||||||
this.prefixIcon,
|
|
||||||
this.enabled = true,
|
|
||||||
this.constrainToIntrinsic = false,
|
this.constrainToIntrinsic = false,
|
||||||
this.widthMultiplier = 1.0,
|
|
||||||
this.maxWidth,
|
|
||||||
this.isExpanded = false,
|
|
||||||
this.dropdownColor,
|
|
||||||
this.textStyle,
|
|
||||||
this.contentPadding,
|
this.contentPadding,
|
||||||
|
this.dropdownColor,
|
||||||
|
this.enabled = true,
|
||||||
this.fillColor,
|
this.fillColor,
|
||||||
|
this.isExpanded = false,
|
||||||
|
this.labelText,
|
||||||
|
this.maxWidth,
|
||||||
|
this.onChanged,
|
||||||
|
this.prefixIcon,
|
||||||
|
this.textStyle,
|
||||||
|
this.validator,
|
||||||
|
this.value,
|
||||||
|
this.widthMultiplier = 1.0,
|
||||||
});
|
});
|
||||||
|
|
||||||
final List<T> values;
|
final List<T> values;
|
||||||
@@ -113,7 +113,11 @@ class AppDropdownFormField<T> extends StatelessWidget {
|
|||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
final field = DropdownButtonFormField<T>(
|
final field = DropdownButtonFormField<T>(
|
||||||
decoration: createCommonDecoration(scheme, labelText ?? ""),
|
decoration: createCommonDecoration(
|
||||||
|
scheme,
|
||||||
|
labelText ?? "",
|
||||||
|
icon: prefixIcon,
|
||||||
|
),
|
||||||
dropdownColor: dropdownColor ?? effectiveFill,
|
dropdownColor: dropdownColor ?? effectiveFill,
|
||||||
iconEnabledColor: scheme.onSurface.withValues(alpha: 0.90),
|
iconEnabledColor: scheme.onSurface.withValues(alpha: 0.90),
|
||||||
initialValue: value,
|
initialValue: value,
|
||||||
|
Reference in New Issue
Block a user