@@ -426,24 +426,37 @@ class DetailsPage extends StatelessWidget with Scroll2TopPageMixin {
426
426
427
427
Widget _buildLanguage (double iconSize, double space, BuildContext context) {
428
428
return GetBuilder <DetailsPageLogic >(
429
- id: DetailsPageLogic .galleryId ,
429
+ id: DetailsPageLogic .languageId ,
430
430
global: false ,
431
431
init: logic,
432
- builder: (_) => Row (
433
- mainAxisSize: MainAxisSize .min,
434
- children: [
435
- Icon (Icons .language, size: iconSize, color: UIConfig .detailsPageIconColor (context)),
436
- SizedBox (width: space),
437
- AnimatedSwitcher (
438
- duration: const Duration (milliseconds: UIConfig .detailsPageAnimationDuration),
439
- child: Text (
440
- state.gallery == null ? '...' : state.gallery! .language? .capitalizeFirst ?? 'Japanese' ,
441
- key: ValueKey (state.gallery == null ? '...' : state.gallery! .language? .capitalizeFirst ?? 'Japanese' ),
442
- style: const TextStyle (fontSize: UIConfig .detailsPageInfoTextSize),
432
+ builder: (_) {
433
+ String language;
434
+ if (state.galleryDetails != null ) {
435
+ language = state.galleryDetails! .language.capitalizeFirst! ;
436
+ } else if (state.gallery? .language != null ) {
437
+ language = state.gallery! .language! .capitalizeFirst! ;
438
+ } else if (state.gallery? .tags.isNotEmpty ?? false ) {
439
+ language = 'Japanese' ;
440
+ } else {
441
+ language = '...' ;
442
+ }
443
+
444
+ return Row (
445
+ mainAxisSize: MainAxisSize .min,
446
+ children: [
447
+ Icon (Icons .language, size: iconSize, color: UIConfig .detailsPageIconColor (context)),
448
+ SizedBox (width: space),
449
+ AnimatedSwitcher (
450
+ duration: const Duration (milliseconds: UIConfig .detailsPageAnimationDuration),
451
+ child: Text (
452
+ language,
453
+ key: ValueKey (language),
454
+ style: const TextStyle (fontSize: UIConfig .detailsPageInfoTextSize),
455
+ ),
443
456
),
444
- ) ,
445
- ],
446
- ) ,
457
+ ] ,
458
+ );
459
+ } ,
447
460
);
448
461
}
449
462
0 commit comments