- Update documentation and examples

Signed-off-by: Hans Kokx <hans.kokx@hackberry.se>
This commit is contained in:
Hans Kokx
2024-11-04 17:10:31 +01:00
parent e73e49d0de
commit 055b68bff6
4 changed files with 62 additions and 8 deletions
+11
View File
@@ -35,4 +35,15 @@ void main() {
const String lowercase = "hello";
final String capitalized = lowercase.capitalize;
print(capitalized); // "Hello"
final list = [1, 2, 2, 3, 4, 4];
final uniqueList = list.unique();
print(uniqueList); // Output: [1, 2, 3, 4]
final people = [
Person(id: 1, name: "Alice"),
Person(id: 2, name: "Bob"),
Person(id: 1, name: "Alice Duplicate"),
];
final uniquePeople = people.unique((person) => person.id);
print(uniquePeople.map((p) => p.name)); // Output: ['Alice', 'Bob']
}