Skip to content

Commit f513527

Browse files
committed
remove unneeded reset function, run unit tests in CI
1 parent 82e1c45 commit f513527

File tree

8 files changed

+54
-37
lines changed

8 files changed

+54
-37
lines changed

.github/workflows/unit_tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Flutter Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: subosito/flutter-action@v2
17+
with:
18+
channel: stable
19+
20+
- name: Install dependencies
21+
run: flutter pub get
22+
23+
- name: Run tests
24+
run: flutter test

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
## 0.0.1
2-
3-
* TODO: Describe initial release.
4-
52
## 0.0.1+1
63
## 0.0.1+2
74

8-
* edited and clarified the documentation
5+
* edited and clarified the documentation
6+
7+
## 0.0.2
8+
* remove the reset function

LICENSE

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
MIT based License
2-
31
Copyright (c) 2025 Nathan Taal
42

53
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to use,
7-
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8-
derivative works of the Software, subject to the following conditions:
9-
10-
- The Software itself, or modified versions of it, may not be sold, licensed, or otherwise distributed for a fee as a standalone product.
11-
- It may be used freely within commercial and non-commercial projects, including closed-source applications.
4+
of this software and associated documentation files (the “Software”), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
129

13-
Credit to the original author is appreciated but not required.
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
1412

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1614
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1715
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1816
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1917
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is not because of the package itself, but because I'm a Signals enthusiast.
77
This package currently fits all my needs, but it might not fit yours.
88

99
## License
10-
Licensed under a modified MIT License (with a no-reselling clause).
10+
Licensed under a modified MIT License.
1111

1212
## (Non) features
1313
* Supports singular only, does not support pluralization
@@ -70,7 +70,7 @@ SignalTranslator().setLanguage('en');
7070

7171
5. To view the currently set language:
7272
```dart
73-
SignalTranslator().setLanguage('en');
73+
SignalTranslator().currentLocale;
7474
```
7575
This is done automatically when the app starts, but if you want to build in a language selector, you can use this method to highlight the currently selected language.
7676

@@ -84,3 +84,6 @@ More features could be implemented. As my time is limited, feel free to open an
8484

8585
## Credits
8686
All this is possible because of the best state management package out there: [Signals](https://pub.dev/packages/signals). Credits should go there :)
87+
88+
## Development
89+
Publish extension using dart pub publish --dry-run

example/pubspec.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ packages:
55
dependency: transitive
66
description:
77
name: async
8-
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
8+
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "2.12.0"
11+
version: "2.13.0"
1212
boolean_selector:
1313
dependency: transitive
1414
description:
@@ -53,10 +53,10 @@ packages:
5353
dependency: transitive
5454
description:
5555
name: fake_async
56-
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
56+
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
5757
url: "https://pub.dev"
5858
source: hosted
59-
version: "1.3.2"
59+
version: "1.3.3"
6060
ffi:
6161
dependency: transitive
6262
description:
@@ -100,10 +100,10 @@ packages:
100100
dependency: transitive
101101
description:
102102
name: leak_tracker
103-
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
103+
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
104104
url: "https://pub.dev"
105105
source: hosted
106-
version: "10.0.8"
106+
version: "10.0.9"
107107
leak_tracker_flutter_testing:
108108
dependency: transitive
109109
description:
@@ -294,7 +294,7 @@ packages:
294294
path: ".."
295295
relative: true
296296
source: path
297-
version: "0.0.1"
297+
version: "0.0.2"
298298
sky_engine:
299299
dependency: transitive
300300
description: flutter
@@ -360,10 +360,10 @@ packages:
360360
dependency: transitive
361361
description:
362362
name: vm_service
363-
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
363+
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
364364
url: "https://pub.dev"
365365
source: hosted
366-
version: "14.3.1"
366+
version: "15.0.0"
367367
web:
368368
dependency: transitive
369369
description:

lib/signals_translator.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@ class SignalTranslator {
9898
}
9999
return translation;
100100
}
101-
102-
//Needed for resetting the tests :(
103-
//TODO find another way
104-
reset() {
105-
SignalTranslator()._translations.value = {};
106-
SignalTranslator()._chosenLocale.value = 'sys';
107-
}
108101
}
109102

110103
String tl(String key) {

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: signals_translator
22
description: "Translate your project 100% using signals"
3-
version: 0.0.1+2
3+
version: 0.0.2
44
homepage: https://github.com/nathantaal/flutter-signals-translator
55
repository: https://github.com/nathantaal/flutter-signals-translator
66

@@ -17,5 +17,5 @@ dependencies:
1717
dev_dependencies:
1818
flutter_test:
1919
sdk: flutter
20-
flutter_lints: ^5.0.0
20+
flutter_lints: ^6.0.0
2121
mockito: ^5.4.0

test/signals_translator_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ void main() {
9696
final prefs = await SharedPreferences.getInstance();
9797
await prefs.clear();
9898
mockBundle = null;
99-
signalTranslator!.reset();
10099
signalTranslator = null;
101100
});
102101

0 commit comments

Comments
 (0)