Skip to content

Commit 8b930c2

Browse files
committed
v6.38.0
1 parent b4d4d82 commit 8b930c2

File tree

6 files changed

+293
-134
lines changed

6 files changed

+293
-134
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [6.38.0] - 2025-11-15
2+
3+
* Fix `NyLanguageSwitcher` AssetManifest.json
4+
* Added `NyRichText.template` to construct rich text from a template string
5+
* Update pubspec.yaml
6+
17
## [6.37.0] - 2025-10-28
28

39
* Added `MetroService.createFile` method to create a file in your project

example/pubspec.lock

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ packages:
9393
dependency: transitive
9494
description:
9595
name: crypto
96-
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
96+
sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf
9797
url: "https://pub.dev"
9898
source: hosted
99-
version: "3.0.6"
99+
version: "3.0.7"
100100
date_field:
101101
dependency: transitive
102102
description:
@@ -308,10 +308,10 @@ packages:
308308
dependency: transitive
309309
description:
310310
name: flutter_timezone
311-
sha256: ccad42fbb5d01d51d3eb281cc4428fca556cc4063c52bd9fa40f80cd93b8e649
311+
sha256: "978192f2f9ea6d019a4de4f0211d76a9af955ca24865828fa98ca4e20cf0cb3c"
312312
url: "https://pub.dev"
313313
source: hosted
314-
version: "5.0.0"
314+
version: "5.0.1"
315315
flutter_web_plugins:
316316
dependency: transitive
317317
description: flutter
@@ -329,10 +329,10 @@ packages:
329329
dependency: transitive
330330
description:
331331
name: http
332-
sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007
332+
sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412"
333333
url: "https://pub.dev"
334334
source: hosted
335-
version: "1.5.0"
335+
version: "1.6.0"
336336
http_parser:
337337
dependency: transitive
338338
description:
@@ -409,10 +409,10 @@ packages:
409409
dependency: transitive
410410
description:
411411
name: meta
412-
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
412+
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
413413
url: "https://pub.dev"
414414
source: hosted
415-
version: "1.16.0"
415+
version: "1.17.0"
416416
mime:
417417
dependency: transitive
418418
description:
@@ -427,7 +427,7 @@ packages:
427427
path: ".."
428428
relative: true
429429
source: path
430-
version: "6.37.0"
430+
version: "6.38.0"
431431
path:
432432
dependency: transitive
433433
description:
@@ -448,18 +448,18 @@ packages:
448448
dependency: transitive
449449
description:
450450
name: path_provider_android
451-
sha256: "993381400e94d18469750e5b9dcb8206f15bc09f9da86b9e44a9b0092a0066db"
451+
sha256: e122c5ea805bb6773bb12ce667611265980940145be920cd09a4b0ec0285cb16
452452
url: "https://pub.dev"
453453
source: hosted
454-
version: "2.2.18"
454+
version: "2.2.20"
455455
path_provider_foundation:
456456
dependency: transitive
457457
description:
458458
name: path_provider_foundation
459-
sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd"
459+
sha256: efaec349ddfc181528345c56f8eda9d6cccd71c177511b132c6a0ddaefaa2738
460460
url: "https://pub.dev"
461461
source: hosted
462-
version: "2.4.2"
462+
version: "2.4.3"
463463
path_provider_linux:
464464
dependency: transitive
465465
description:
@@ -552,18 +552,18 @@ packages:
552552
dependency: transitive
553553
description:
554554
name: shared_preferences_android
555-
sha256: a2608114b1ffdcbc9c120eb71a0e207c71da56202852d4aab8a5e30a82269e74
555+
sha256: "34266009473bf71d748912da4bf62d439185226c03e01e2d9687bc65bbfcb713"
556556
url: "https://pub.dev"
557557
source: hosted
558-
version: "2.4.12"
558+
version: "2.4.15"
559559
shared_preferences_foundation:
560560
dependency: transitive
561561
description:
562562
name: shared_preferences_foundation
563-
sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03"
563+
sha256: "1c33a907142607c40a7542768ec9badfd16293bac51da3a4482623d15845f88b"
564564
url: "https://pub.dev"
565565
source: hosted
566-
version: "2.5.4"
566+
version: "2.5.5"
567567
shared_preferences_linux:
568568
dependency: transitive
569569
description:
@@ -617,14 +617,6 @@ packages:
617617
url: "https://pub.dev"
618618
source: hosted
619619
version: "1.10.1"
620-
sprintf:
621-
dependency: transitive
622-
description:
623-
name: sprintf
624-
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
625-
url: "https://pub.dev"
626-
source: hosted
627-
version: "7.0.0"
628620
stack_trace:
629621
dependency: transitive
630622
description:
@@ -661,10 +653,10 @@ packages:
661653
dependency: transitive
662654
description:
663655
name: test_api
664-
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
656+
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
665657
url: "https://pub.dev"
666658
source: hosted
667-
version: "0.7.6"
659+
version: "0.7.7"
668660
theme_provider:
669661
dependency: transitive
670662
description:
@@ -701,18 +693,18 @@ packages:
701693
dependency: transitive
702694
description:
703695
name: url_launcher_android
704-
sha256: "199bc33e746088546a39cc5f36bac5a278c5e53b40cb3196f99e7345fdcfae6b"
696+
sha256: "5c8b6c2d89a78f5a1cca70a73d9d5f86c701b36b42f9c9dac7bad592113c28e9"
705697
url: "https://pub.dev"
706698
source: hosted
707-
version: "6.3.22"
699+
version: "6.3.24"
708700
url_launcher_ios:
709701
dependency: transitive
710702
description:
711703
name: url_launcher_ios
712-
sha256: d80b3f567a617cb923546034cc94bfe44eb15f989fe670b37f26abdb9d939cb7
704+
sha256: "6b63f1441e4f653ae799166a72b50b1767321ecc263a57aadf825a7a2a5477d9"
713705
url: "https://pub.dev"
714706
source: hosted
715-
version: "6.3.4"
707+
version: "6.3.5"
716708
url_launcher_linux:
717709
dependency: transitive
718710
description:
@@ -725,10 +717,10 @@ packages:
725717
dependency: transitive
726718
description:
727719
name: url_launcher_macos
728-
sha256: c043a77d6600ac9c38300567f33ef12b0ef4f4783a2c1f00231d2b1941fea13f
720+
sha256: "8262208506252a3ed4ff5c0dc1e973d2c0e0ef337d0a074d35634da5d44397c9"
729721
url: "https://pub.dev"
730722
source: hosted
731-
version: "3.2.3"
723+
version: "3.2.4"
732724
url_launcher_platform_interface:
733725
dependency: transitive
734726
description:
@@ -757,10 +749,10 @@ packages:
757749
dependency: transitive
758750
description:
759751
name: uuid
760-
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
752+
sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8
761753
url: "https://pub.dev"
762754
source: hosted
763-
version: "4.5.1"
755+
version: "4.5.2"
764756
validated:
765757
dependency: transitive
766758
description:

lib/widgets/ny_language_switcher.dart

Lines changed: 52 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'dart:core';
2-
import 'dart:convert';
32
import '/helpers/ny_color.dart';
43

54
import '/helpers/ny_logger.dart';
@@ -729,13 +728,13 @@ class NyLanguageSwitcher extends StatefulWidget {
729728
{String langPath = 'lang'}) async {
730729
List<Map<String, String>> list = [];
731730
try {
732-
String assetManifest = await rootBundle.loadString('AssetManifest.json');
733-
List<String> langFiles = jsonDecode(assetManifest)
734-
.keys
735-
.where((String key) => key.contains("lang"))
736-
.toList();
731+
final assetManifest = await AssetManifest.loadFromAssetBundle(rootBundle);
732+
final assets = assetManifest.listAssets();
733+
List<String> langFiles =
734+
assets.where((String key) => key.startsWith("lang/")).toList();
737735

738736
for (var langFile in langFiles) {
737+
if (".DS_Store" == langFile) continue;
739738
RegExp regex = RegExp(langPath + r'/(.*).json');
740739
Match? match = regex.firstMatch(langFile);
741740

@@ -776,46 +775,53 @@ class _NyLanguageSwitcherState extends NyState<NyLanguageSwitcher> {
776775
@override
777776
Widget build(BuildContext context) {
778777
String? selectedLang = selectedLanguage?.entries.first.key ?? "en";
779-
return DropdownButton<String>(
780-
value: selectedLang,
781-
iconSize: widget.iconSize,
782-
hint: widget.hint,
783-
elevation: widget.elevation,
784-
itemHeight: widget.itemHeight,
785-
style: widget.textStyle ??
786-
TextStyle(
787-
color: NyColor(light: Colors.black, dark: Colors.white)
788-
.toColor(context),
789-
),
790-
onChanged: _onChange,
791-
icon: widget.icon,
792-
borderRadius: widget.borderRadius,
793-
onTap: widget.onTap,
794-
dropdownColor: widget.dropdownBgColor,
795-
padding: widget.padding,
796-
items:
797-
languages.map<DropdownMenuItem<String>>((Map<String, dynamic> value) {
798-
MapEntry<String, dynamic> item = value.entries.first;
799-
Widget child = Text(
800-
item.value,
801-
style: TextStyle(
802-
color: NyColor(light: Colors.black, dark: Colors.white)
803-
.toColor(context),
804-
),
805-
);
806-
if (widget.dropdownBuilder != null) {
807-
child = widget.dropdownBuilder!({
808-
"locale": item.key,
809-
"name": item.value,
810-
});
811-
}
812-
return DropdownMenuItem<String>(
813-
value: item.key,
814-
onTap: widget.dropdownOnTap,
815-
alignment: widget.dropdownAlignment,
816-
child: child,
817-
);
818-
}).toList(),
778+
return Theme(
779+
data: Theme.of(context).copyWith(
780+
highlightColor: Colors.grey[300],
781+
focusColor: Colors.grey[300],
782+
hoverColor: Colors.grey[300],
783+
),
784+
child: DropdownButton<String>(
785+
value: selectedLang,
786+
iconSize: widget.iconSize,
787+
hint: widget.hint,
788+
elevation: widget.elevation,
789+
itemHeight: widget.itemHeight,
790+
style: widget.textStyle ??
791+
TextStyle(
792+
color: NyColor(light: Colors.black, dark: Colors.white)
793+
.toColor(context),
794+
),
795+
onChanged: _onChange,
796+
icon: widget.icon,
797+
borderRadius: widget.borderRadius,
798+
onTap: widget.onTap,
799+
dropdownColor: widget.dropdownBgColor,
800+
padding: widget.padding,
801+
items: languages
802+
.map<DropdownMenuItem<String>>((Map<String, dynamic> value) {
803+
MapEntry<String, dynamic> item = value.entries.first;
804+
Widget child = Text(
805+
item.value,
806+
style: TextStyle(
807+
color: NyColor(light: Colors.black, dark: Colors.white)
808+
.toColor(context),
809+
),
810+
);
811+
if (widget.dropdownBuilder != null) {
812+
child = widget.dropdownBuilder!({
813+
"locale": item.key,
814+
"name": item.value,
815+
});
816+
}
817+
return DropdownMenuItem<String>(
818+
value: item.key,
819+
onTap: widget.dropdownOnTap,
820+
alignment: widget.dropdownAlignment,
821+
child: child,
822+
);
823+
}).toList(),
824+
),
819825
);
820826
}
821827

0 commit comments

Comments
 (0)