Merge pull request #4086 from NicKoehler/sort-fix
fix sort inconsistency
This commit is contained in:
		
						commit
						9da6da6bd1
					
				| @ -455,12 +455,12 @@ class _PeerSortDropdownState extends State<PeerSortDropdown> { | |||||||
|       borderRadius: BorderRadius.circular(5), |       borderRadius: BorderRadius.circular(5), | ||||||
|     ); |     ); | ||||||
| 
 | 
 | ||||||
|     final translated_text = |     final translated_text = { | ||||||
|         PeerSortType.values.map((e) => translate(e)).toList(); |       for (var e in PeerSortType.values) e: translate(e) | ||||||
|  |     }; | ||||||
| 
 | 
 | ||||||
|     final double max_width = |     final double max_width = | ||||||
|         50 + translated_text.map((e) => e.length).reduce(max) * 10; |         50 + translated_text.values.map((e) => e.length).reduce(max) * 10; | ||||||
| 
 |  | ||||||
|     return Container( |     return Container( | ||||||
|       padding: EdgeInsets.all(4.0), |       padding: EdgeInsets.all(4.0), | ||||||
|       decoration: deco, |       decoration: deco, | ||||||
| @ -496,20 +496,20 @@ class _PeerSortDropdownState extends State<PeerSortDropdown> { | |||||||
|                 ), |                 ), | ||||||
|                 enabled: false, |                 enabled: false, | ||||||
|               ), |               ), | ||||||
|               ...translated_text |               ...translated_text.entries | ||||||
|                   .map<DropdownMenuItem<String>>( |                   .map<DropdownMenuItem<String>>( | ||||||
|                     (String value) => DropdownMenuItem<String>( |                     (MapEntry entry) => DropdownMenuItem<String>( | ||||||
|                       value: value, |                       value: entry.key, | ||||||
|                       child: Row( |                       child: Row( | ||||||
|                         children: [ |                         children: [ | ||||||
|                           Icon( |                           Icon( | ||||||
|                             value == peerSort.value |                             entry.key == peerSort.value | ||||||
|                                 ? Icons.radio_button_checked_rounded |                                 ? Icons.radio_button_checked_rounded | ||||||
|                                 : Icons.radio_button_off_rounded, |                                 : Icons.radio_button_off_rounded, | ||||||
|                             size: 18, |                             size: 18, | ||||||
|                           ).paddingOnly(right: 12), |                           ).paddingOnly(right: 12), | ||||||
|                           Text( |                           Text( | ||||||
|                             value, |                             entry.value, | ||||||
|                             overflow: TextOverflow.ellipsis, |                             overflow: TextOverflow.ellipsis, | ||||||
|                           ), |                           ), | ||||||
|                         ], |                         ], | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user