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