Jeet Bhalujeetbhalu.hashnode.dev·17 minutes agoDart Iterable singlewhere().singlewhere() void main() { List<int> numList = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; int result = numList.singleWhere((element) => element > 2 && element < 4); print(result); } output 3 Exited.DiscussDart
Jeet Bhalujeetbhalu.hashnode.dev·39 minutes agoDart Iterable Shuffle().Shuffle() A shuffle is a randomly set in program in list shuffling and modify list . Example void main() { var nums = [1, 2, 3, 4, 5, 6, 6]; print('nums : $nums'); nums.shuffle(); print(nums); } Output nums : [1, 2, 3, 4, 5, 6, 6] [1, 6, 2...DiscussDart
Jeet Bhalujeetbhalu.hashnode.dev·an hour agoDart Iterale Sort().Sort() A sort() method is used to sort the elements of an iterable in ascending order. Example void main() { var numbers = [1, 2, 3, 4, 1, 4, 2, 5, 6, 1, 3, 5, 3]; numbers.sort(); print(numbers); } Output [1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5,...DiscussDart
Jeet Bhalujeetbhalu.hashnode.dev·an hour agoDart Iterable Take() & TakeWhile().Take() This method returns an Iterable containing the first count elements from the original Iterable. TakeWhile() This method returns an Iterable containing the initial elements of the original Iterable as long as the specified condition (test) i...DiscussDart
Jeet Bhalujeetbhalu.hashnode.dev·2 hours agoDart Iterable Skip() & SkipWhile()Skip() This method skips the first elements from the iterable and returns a new iterable that starts after those elements. SkipWhile() This method skips elements while a condition is true, and once the condition becomes false for an element, it st...DiscussDart
Jeet Bhalujeetbhalu.hashnode.dev·2 hours agoDart Iterable Contains().Contains() Whether the collection contains an element equal to element. This operation will check each element in order for being equal to element, unless it has a more efficient way to find an element equal to element. Stops iterating on the first...DiscussDart
Jeet Bhalujeetbhalu.hashnode.dev·2 hours agoDart Iterable subList().subList() A sublist method is used to return a new list containing a portion of an existing list. The portion of the list is defined by two arguments: the starting index and the ending index. List<T> sublist<T>(List<T> list, int start, [int? end]) ...DiscussDart
Jeet Bhalujeetbhalu.hashnode.dev·2 hours agoDart Iterable Where()Where() A Where() method is an extension provided by the Iterable class. The where() method takes a callback function as an argument. void main() { Iterable<int> number = [1, 2, 3, 4]; Iterable even = number.where((number) => number.isEven);...DiscussDart
Samrat Kumar Dascolddsam.hashnode.dev·6 hours agoUnveiling Hidden Gems: Exploring the Vast World of ProjectsUnveiling Hidden Gems: Exploring the Vast World of Projects Introduction: Delving into the Abyss of Projects The realm of software development is a vast and ever-evolving ocean, teeming with countless projects of varying sizes, complexities, and purp...Discussprojects
Jeet Bhalujeetbhalu.hashnode.dev·a day agoLists, Sets, Maps or IterablesIterable : Set & List Both List and Set are Iterable, so they have the same methods and properties as the Iterable class. A Map uses a different data structure internally, depending on its implementation. For example, HashMap uses a hash table in w...Discuss#dart language