File tree Expand file tree Collapse file tree 5 files changed +24
-2
lines changed Expand file tree Collapse file tree 5 files changed +24
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.1.2
2
+
3
+ * Added ` refreshWithLang(String) ` method language change.
4
+ * Added ` refreshWithLocale(Locale) ` method language change.
5
+
1
6
## 0.1.0
2
7
3
8
* Added ` string() ` method for getting resources.
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ class MyAppPage extends StatefulWidget {
50
50
MyAppPageState createState () => MyAppPageState ();
51
51
}
52
52
53
- class MyAppPageState extends State <MyAppPage > {
53
+ class MyAppPageState extends ScState <MyAppPage > {
54
54
String _platformVersion = 'Unknown' ;
55
55
String asyncValue = "" ;
56
56
Original file line number Diff line number Diff line change
1
+ import 'package:flutter/widgets.dart' ;
2
+ import 'package:global_refresh/global_refresh.dart' ;
3
+
4
+ abstract class ScState <T extends StatefulWidget > extends GRState <T > {}
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:flutter/services.dart' ;
3
3
import 'package:flutter_localizations/flutter_localizations.dart' ;
4
+ import 'package:global_refresh/global_refresh.dart' ;
4
5
import 'package:go_router/go_router.dart' ;
5
6
import 'package:stringcare/src/web/stringcare_impl.dart'
6
7
if (dart.library.io) 'package:stringcare/src/native/stringcare_impl.dart' ;
@@ -14,6 +15,7 @@ export 'src/i18n/remote_languages.dart';
14
15
export 'src/widget/sc_asset_image_provider.dart' ;
15
16
export 'src/widget/sc_image_asset.dart' ;
16
17
export 'src/widget/sc_svg.dart' ;
18
+ export 'src/widget/sc_state.dart' ;
17
19
18
20
class Stringcare {
19
21
static Stringcare ? _instance;
@@ -187,4 +189,14 @@ class Stringcare {
187
189
if (context == null ) return false ;
188
190
return AppLocalizations .of (context)? .load () ?? Future .value (false );
189
191
}
192
+
193
+ void refreshWithLang (String ? lang) {
194
+ withLang = () => lang;
195
+ GlobalRefresh ().refresh ();
196
+ }
197
+
198
+ void refreshWithLocale (Locale ? locale) {
199
+ withLocale = () => locale;
200
+ GlobalRefresh ().refresh ();
201
+ }
190
202
}
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.1
3
+ version : 0.1.2
4
4
homepage : https://github.com/StringCare/stringcare
5
5
repository : https://github.com/StringCare/stringcare
6
6
@@ -18,6 +18,7 @@ dependencies:
18
18
crypto : ^3.0.3
19
19
flutter_svg : ^2.0.9 # android ios linux macos windows
20
20
ffi : ^2.1.0
21
+ global_refresh : ^1.0.0 # android ios linux macos web windows
21
22
go_router : ^13.0.1 # android ios linux macos web windows
22
23
path : ^1.8.3
23
24
yaml : ^3.1.2
You can’t perform that action at this time.
0 commit comments