File tree Expand file tree Collapse file tree 3 files changed +37
-7
lines changed Expand file tree Collapse file tree 3 files changed +37
-7
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.1.3
2
+
3
+ * Fixed refresh languages method.
4
+ * Added ` refreshWithLangWithContext(BuildContext, String) ` method for language change.
5
+ * Added ` refreshWithLocaleWithContext(BuildContext, Locale) ` method for language change.
6
+
1
7
## 0.1.2
2
8
3
- * Added ` refreshWithLang(String) ` method language change.
4
- * Added ` refreshWithLocale(Locale) ` method language change.
9
+ * Added ` refreshWithLang(String) ` method language for change.
10
+ * Added ` refreshWithLocale(Locale) ` method language for change.
5
11
6
12
## 0.1.0
7
13
Original file line number Diff line number Diff line change @@ -190,13 +190,37 @@ class Stringcare {
190
190
return AppLocalizations .of (context)? .load () ?? Future .value (false );
191
191
}
192
192
193
- void refreshWithLang (String ? lang) {
193
+ Future < void > refreshWithLang (String ? lang) async {
194
194
withLang = () => lang;
195
- GlobalRefresh ().refresh ();
195
+ if (await Stringcare ().load ()) {
196
+ GlobalRefresh ().refresh ();
197
+ }
198
+ }
199
+
200
+ Future <void > refreshWithLocale (Locale ? locale) async {
201
+ withLocale = () => locale;
202
+ if (await Stringcare ().load ()) {
203
+ GlobalRefresh ().refresh ();
204
+ }
196
205
}
197
206
198
- void refreshWithLocale (Locale ? locale) {
207
+ Future <void > refreshWithLangWithContext (
208
+ BuildContext ? context,
209
+ String ? lang,
210
+ ) async {
211
+ withLang = () => lang;
212
+ if (await Stringcare ().loadWithContext (context)) {
213
+ GlobalRefresh ().refresh ();
214
+ }
215
+ }
216
+
217
+ Future <void > refreshWithLocaleWithContext (
218
+ BuildContext ? context,
219
+ Locale ? locale,
220
+ ) async {
199
221
withLocale = () => locale;
200
- GlobalRefresh ().refresh ();
222
+ if (await Stringcare ().loadWithContext (context)) {
223
+ GlobalRefresh ().refresh ();
224
+ }
201
225
}
202
226
}
Original file line number Diff line number Diff line change 1
1
name : stringcare
2
2
description : Flutter plugin for obfuscate and reveal strings and any other data.
3
- version : 0.1.2
3
+ version : 0.1.3
4
4
homepage : https://github.com/StringCare/stringcare
5
5
repository : https://github.com/StringCare/stringcare
6
6
You can’t perform that action at this time.
0 commit comments