Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit a4f4af1

Browse files
committed
Update readme and refactor
1 parent 6504be6 commit a4f4af1

File tree

72 files changed

+143
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+143
-197
lines changed

.github/scripts/update_changelog.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

.github/workflows/prepare.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
##
44
## 🇽🇾🇿 & Dev
55
##
6-
## Copyright Ⓒ Robert Mollentze, xyzand.dev
7-
##
6+
## Copyright Ⓒ Robert Mollentze
7+
##
88
## Licensing details can be found in the LICENSE file in the root directory.
9-
##
9+
##
1010
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
1111
##.title~
1212

@@ -27,7 +27,7 @@ jobs:
2727
steps:
2828
- name: Checkout code
2929
uses: actions/checkout@v3
30-
30+
3131
- name: Set up Dart
3232
uses: dart-lang/setup-dart@v1.2
3333

@@ -43,19 +43,19 @@ jobs:
4343
VERSION=$(grep "version:" pubspec.yaml | sed 's/version: //')
4444
echo "Extracted version: $VERSION"
4545
echo "::set-output name=extracted_version::$VERSION"
46-
46+
4747
- name: Get commit messages
4848
id: get_commits
4949
run: |
5050
COMMIT_MESSAGES=$(git log --format=%B -n 1 HEAD)
5151
echo "::set-output name=messages::${COMMIT_MESSAGES}"
52-
52+
5353
- name: Update CHANGELOG.md
5454
run: |
5555
RELEASE_NOTES="${{ steps.get_commits.outputs.messages }}"
5656
dart run .github/scripts/update_changelog.dart "${{ steps.get_version.outputs.extracted_version }}" "$RELEASE_NOTES"
5757
shell: bash
58-
58+
5959
- name: Commit and push changes
6060
run: |
6161
git config user.name github-actions

.github/workflows/publish.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
##
44
## 🇽🇾🇿 & Dev
55
##
6-
## Copyright Ⓒ Robert Mollentze, xyzand.dev
7-
##
6+
## Copyright Ⓒ Robert Mollentze
7+
##
88
## Licensing details can be found in the LICENSE file in the root directory.
9-
##
9+
##
1010
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
1111
##.title~
1212

@@ -17,7 +17,7 @@ name: Publish to pub.dev
1717
on:
1818
push:
1919
tags:
20-
- 'v[0-9]+.[0-9]+.[0-9]+*'
20+
- "v[0-9]+.[0-9]+.[0-9]+*"
2121

2222
## -----------------------------------------------------------------------------
2323

@@ -27,4 +27,4 @@ jobs:
2727
id-token: write # Required for authentication using OIDC
2828
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
2929
# with:
30-
# working-directory: path/to/package/within/repository
30+
# working-directory: path/to/package/within/repository

README.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
[![pub package](https://img.shields.io/pub/v/xyz_utils.svg)](https://pub.dev/packages/xyz_utils)
44

5-
This package provides a set of utilities that are commonly used in Dart apps. It is also the foundation for other packages in the 🇽🇾🇿 ecosystem.
5+
This package provides a set of utilities to facilitate the development of Dart apps. It also includes many utilities used by other packages in the 🇽🇾🇿 ecosystem.
66

7-
It includes utilities for working with collections and and more, as well as the following notable features:
7+
## Notable Utilities
8+
9+
Here are some notable utilities included in this package, with many more available and continually added with each update:
810

911
- The [Debouncer](https://pub.dev/documentation/xyz_utils/0.44.4/xyz_utils/Debouncer-class.html) can be used to debounce user input.
1012
- The [Here](https://pub.dev/documentation/xyz_utils/0.44.4/xyz_utils/Here-class.html) can be used to log messages to the console at the given position in the code.
@@ -15,27 +17,24 @@ Please refer to the [API reference](https://pub.dev/documentation/xyz_utils/0.44
1517

1618
## Installation
1719

18-
#### Add this to your `pubspec.yaml` file:
20+
Use this package as a dependency by adding it to your `pubspec.yaml` file (see [here](https://pub.dev/packages/xyz_utils/install)), or copy the needed source code directly into your project.
1921

20-
```yaml
21-
dependencies:
22-
xyz_utils: any # or the latest version
23-
```
2422
## Contributing
2523

26-
Contributions are welcome. Here are a few ways you can help:
24+
This is an open-source project, and contributions are welcome from everyone, regardless of experience level. Contributing to projects is a great way to learn, share knowledge, and showcase your skills to the community. Join the discussions to report bugs, suggest features, share ideas, or find out how you can contribute.
2725

28-
- Report bugs and make feature requests.
29-
- Add new features.
30-
- Improve the existing code.
31-
- Help with documentation and tutorials.
26+
### Join GitHub Discussion:
3227

33-
## License
28+
💬 https://github.com/robmllze/xyz_utils/discussions/1
3429

35-
This project is released under the MIT License. See [LICENSE](https://raw.githubusercontent.com/robmllze/xyz_utils/main/LICENSE) for more information.
30+
### Join Reddit Discussion:
31+
32+
💬 https://www.reddit.com/user/robmllze/m/xyz_utils_package/
3633

37-
## Contact
34+
### Contact Chief Contributor:
3835

39-
**Author:** Robert Mollentze
36+
📧 Email _Robert Mollentze_ at robmllze@gmail.com
4037

41-
**Email:** robmllze@gmail.com
38+
## License
39+
40+
This project is released under the MIT License. See [LICENSE](https://raw.githubusercontent.com/robmllze/xyz_utils/main/LICENSE) for more information.

analysis_options.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
##
44
## 🇽🇾🇿 & Dev
55
##
6-
## Copyright Ⓒ Robert Mollentze, xyzand.dev
7-
##
6+
## Copyright Ⓒ Robert Mollentze
7+
##
88
## Licensing details can be found in the LICENSE file in the root directory.
9-
##
9+
##
1010
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
1111
##.title~
1212

@@ -31,10 +31,10 @@ linter:
3131
camel_case_types: false
3232

3333
analyzer:
34-
exclude:
34+
exclude:
3535
- build/**
3636
#- '**/*.g.dart'
3737
errors:
3838
prefer_final_in_for_each: error
3939
unnecessary_new: error
40-
unrelated_type_equality_checks: error
40+
unrelated_type_equality_checks: error

example/example.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//
@@ -20,5 +20,5 @@ import 'package:xyz_utils/xyz_utils.dart';
2020

2121
void main() async {
2222
// Print the current file name.
23-
print(Here().fileName);
23+
print(Here().fileName); // prints 'example.dart'
2424
}
File renamed without changes.

lib/src/collections/src/csv.dart

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//
@@ -28,16 +28,13 @@ String mapToCsv(Map input) {
2828

2929
/// Converts a CSV string to a map.
3030
Map<int, List<String>> csvToMap(String input) {
31-
final processedInput =
32-
input.replaceAll(r'\,', '\u{F0001}').replaceAll(r'\"', '\u{F0002}');
31+
final processedInput = input.replaceAll(r'\,', '\u{F0001}').replaceAll(r'\"', '\u{F0002}');
3332
final lines = processedInput.split('\n');
3433
final res = <int, List<String>>{};
3534
for (var i = 0; i < lines.length; i++) {
3635
final line = lines[i];
37-
var parts = line
38-
.split(RegExp(r',(?=(?:[^"]*"[^"]*")*[^"]*$)'))
39-
.map((part) => part.trim())
40-
.toList();
36+
var parts =
37+
line.split(RegExp(r',(?=(?:[^"]*"[^"]*")*[^"]*$)')).map((part) => part.trim()).toList();
4138
parts = parts.map((e) {
4239
return e.replaceAll('\u{F0001}', ',').replaceAll('\u{F0002}', r'\"');
4340
}).toList();

lib/src/collections/src/etc.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/expand_flattened_json.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/expand_json.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/first_where_or_null.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/flatten_json.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/generic_type_extension.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/join_with_last_separator_on_iterable_extension.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/map_filter_extension.dart

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//
@@ -15,9 +15,7 @@ extension MapWithDefaultOnMapExtension<K, V> on Map<K, V> {
1515
/// [defaultValue] for all values that are null. If [defaultValue] is null,
1616
/// it simply returns a copy of the original map.
1717
Map<K, dynamic> mapWithDefault(dynamic defaultValue) {
18-
return defaultValue != null
19-
? this.map((k, v) => MapEntry(k, v ?? defaultValue))
20-
: Map.of(this);
18+
return defaultValue != null ? this.map((k, v) => MapEntry(k, v ?? defaultValue)) : Map.of(this);
2119
}
2220

2321
/// Filters the map's entries based on a list of included values.

lib/src/collections/src/map_keys_and_values_on_map_extension.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/map_to_json.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/mapi.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/maybe_add_to.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/merge.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/non_nulls_on_map_extension.dart

+3-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//
@@ -26,10 +26,7 @@ extension NonNullKeysOnMapExtension<K, V> on Map<K?, V> {
2626
/// Returns a new map with all non-null keys and values.
2727
Map<K, V> get nonNullKeys {
2828
return Map<K, V>.fromEntries(
29-
this
30-
.entries
31-
.where((e) => e.key != null)
32-
.map((e) => MapEntry(e.key as K, e.value)),
29+
this.entries.where((e) => e.key != null).map((e) => MapEntry(e.key as K, e.value)),
3330
);
3431
}
3532
}
@@ -38,10 +35,7 @@ extension NonNullValuesOnMapExtension<K, V> on Map<K, V?> {
3835
/// Returns a new map with all non-null keys and values.
3936
Map<K, V> get nonNullValues {
4037
return Map<K, V>.fromEntries(
41-
this
42-
.entries
43-
.where((e) => e.value != null)
44-
.map((e) => MapEntry(e.key, e.value as V)),
38+
this.entries.where((e) => e.value != null).map((e) => MapEntry(e.key, e.value as V)),
4539
);
4640
}
4741
}

lib/src/collections/src/null_filtered.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

lib/src/collections/src/null_if_empty_extensions.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// 🇽🇾🇿 & Dev
55
//
6-
// Copyright Ⓒ Robert Mollentze, xyzand.dev
6+
// Copyright Ⓒ Robert Mollentze
77
//
88
// Licensing details can be found in the LICENSE file in the root directory.
99
//

0 commit comments

Comments
 (0)