Skip to content

Commit

Permalink
Merge pull request #49 from OpenPecha/develop
Browse files Browse the repository at this point in the history
updated db
  • Loading branch information
CodingWithTashi authored Nov 29, 2024
2 parents 7a5da61 + 0b665e1 commit 505248a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 20 deletions.
Binary file modified assets/db/gonpa.db
Binary file not shown.
19 changes: 13 additions & 6 deletions lib/models/deity_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ class Deity {
final String? callNumber;
final String? slug;
final String? pic;
final String? sound;
final String? tbsound;
final String? ensound;

final DateTime created;
final DateTime updated;

Expand All @@ -24,7 +26,8 @@ class Deity {
this.callNumber,
this.slug,
this.pic,
this.sound,
this.tbsound,
this.ensound,
required this.created,
required this.updated,
});
Expand All @@ -41,7 +44,8 @@ class Deity {
callNumber: map['callnumber'] as String?,
slug: map['slug'] as String?,
pic: map['pic'] as String?,
sound: map['sound'] as String?,
tbsound: map['tbsound'] as String?,
ensound: map['ensound'] as String?,
created: DateTime.parse(map['created'] as String),
updated: DateTime.parse(map['updated'] as String),
);
Expand All @@ -59,7 +63,8 @@ class Deity {
'callnumber': callNumber,
'slug': slug,
'pic': pic,
'sound': sound,
'tbsound': tbsound,
'ensound': ensound,
'created': created.toIso8601String(),
'updated': updated.toIso8601String(),
};
Expand All @@ -76,7 +81,8 @@ class Deity {
String? callNumber,
String? slug,
String? pic,
String? sound,
String? tbsound,
String? ensound,
DateTime? created,
DateTime? updated,
}) {
Expand All @@ -91,7 +97,8 @@ class Deity {
callNumber: callNumber ?? this.callNumber,
slug: slug ?? this.slug,
pic: pic ?? this.pic,
sound: sound ?? this.sound,
tbsound: tbsound ?? this.tbsound,
ensound: ensound ?? this.ensound,
created: created ?? this.created,
updated: updated ?? this.updated,
);
Expand Down
18 changes: 12 additions & 6 deletions lib/models/organization_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class Organization {
final String callNumber;
final String slug;
final String pic;
final String? sound;
final String? tbsound;
final String? ensound;
final DateTime created;
final DateTime updated;

Expand All @@ -46,7 +47,8 @@ class Organization {
required this.callNumber,
required this.slug,
required this.pic,
this.sound,
this.tbsound,
this.ensound,
required this.created,
required this.updated,
});
Expand Down Expand Up @@ -74,7 +76,8 @@ class Organization {
callNumber: map['callnumber'] as String,
slug: map['slug'] as String,
pic: map['pic'] as String,
sound: map['sound'] as String?,
tbsound: map['tbsound'] as String?,
ensound: map['ensound'] as String?,
created: DateTime.parse(map['created'] as String),
updated: DateTime.parse(map['updated'] as String),
);
Expand Down Expand Up @@ -102,7 +105,8 @@ class Organization {
'callnumber': callNumber,
'slug': slug,
'pic': pic,
'sound': sound,
'tbsound': tbsound,
'ensound': ensound,
'created': created.toIso8601String(),
'updated': updated.toIso8601String(),
};
Expand Down Expand Up @@ -131,7 +135,8 @@ class Organization {
String? callNumber,
String? slug,
String? pic,
String? sound,
String? tbsound,
String? ensound,
DateTime? created,
DateTime? updated,
}) {
Expand All @@ -157,7 +162,8 @@ class Organization {
callNumber: callNumber ?? this.callNumber,
slug: slug ?? this.slug,
pic: pic ?? this.pic,
sound: sound ?? this.sound,
tbsound: tbsound ?? this.tbsound,
ensound: ensound ?? this.ensound,
created: created ?? this.created,
updated: updated ?? this.updated,
);
Expand Down
6 changes: 4 additions & 2 deletions lib/ui/screen/deities_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ class DeityDetailScreen extends ConsumerWidget {
),
),
const SizedBox(height: 16),
if (selectedDeity.sound != null)
if (selectedDeity.tbsound != null)
SpeakerWidget(
audioUrl: selectedDeity.sound!,
audioUrl: context.localizedText(
enText: selectedDeity.ensound ?? '',
boText: selectedDeity.tbsound ?? ''),
description: selectedDeity.enContent),
const SizedBox(height: 16),
Text(
Expand Down
6 changes: 4 additions & 2 deletions lib/ui/screen/organization_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ class OrganizationDetailScreen extends ConsumerWidget {
),
),
const SizedBox(height: 16),
if (selectedOrganization.sound != null)
if (selectedOrganization.tbsound != null)
SpeakerWidget(
audioUrl: selectedOrganization.sound!,
audioUrl: context.localizedText(
enText: selectedOrganization.ensound ?? '',
boText: selectedOrganization.tbsound ?? ''),
description: context.localizedText(
enText: selectedOrganization.enContent,
boText: selectedOrganization.tbContent)),
Expand Down
12 changes: 8 additions & 4 deletions lib/ui/widget/speaker_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ class SpeakerWidget extends ConsumerWidget {
final LanguageState currentLanguage = ref.watch(languageProvider);

return currentLanguage.currentLanguage == "en"
? FlutterTtsSpeaker(
text: description,
)
: AudioPlayerWidget(audioUrl: audioUrl);
? (audioUrl.isEmpty
? FlutterTtsSpeaker(
text: description,
)
: AudioPlayerWidget(audioUrl: audioUrl))
: audioUrl.isEmpty
? SizedBox()
: AudioPlayerWidget(audioUrl: audioUrl);
}
}

0 comments on commit 505248a

Please sign in to comment.