mirror of
				https://github.com/esiur/esiur-dart.git
				synced 2025-10-30 23:31:36 +00:00 
			
		
		
		
	first
This commit is contained in:
		| @@ -73,6 +73,12 @@ class AutoList<T, ST> extends IDestructible with IterableMixin<T> { | ||||
|     emitArgs("add", [_state, value]); | ||||
|   } | ||||
|  | ||||
|   | ||||
|   T? first(bool Function(T element) selector) { | ||||
|     final res = _list.where(selector); | ||||
|     return res.isEmpty ? null : res.first; | ||||
|   } | ||||
|  | ||||
|   /// <summary> | ||||
|   /// Add an array of items to the list | ||||
|   /// </summary> | ||||
|   | ||||
| @@ -78,6 +78,11 @@ class KeyList<KT, T> extends IEventHandler with MapMixin<KT, T> { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   T? first(bool Function(T element) selector) { | ||||
|     final res = _map.where(selector); | ||||
|     return res.isEmpty ? null : res.first; | ||||
|   } | ||||
|  | ||||
|   _itemDestroyed(T sender) { | ||||
|     removeValue(sender); | ||||
|   } | ||||
|   | ||||
| @@ -570,6 +570,7 @@ class Warehouse { | ||||
|   /// <param name="type">.Net type.</param> | ||||
|   /// <returns>Resource template.</returns> | ||||
|   static TypeTemplate? getTemplateByType(Type type) { | ||||
|      | ||||
|     // loaded ? | ||||
|     for (var tmps in _templates.values) | ||||
|       for (var tmp in tmps.values) if (tmp.definedType == type) return tmp; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user