Skip to content

Commit

Permalink
fix: some issue while testing
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanRns committed May 31, 2024
1 parent 93dc8a0 commit 3ffe317
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion evently/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@
"event_name" : "Event Name",
"are_you_sure_you_want_to_delete": "Möchten Sie diesen Entwurf wirklich löschen?",
"published": "Veröffentlicht",
"delete": "Löschen"
"delete": "Löschen",
"event_preview" : "event_preview"
}
3 changes: 2 additions & 1 deletion evently/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,6 @@
"event_name" : "Event Name",
"are_you_sure_you_want_to_delete": "Are you sure you want to delete this draft?",
"published": "Published",
"delete": "Delete"
"delete": "Delete",
"event_preview" : "event_preview"
}
3 changes: 2 additions & 1 deletion evently/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@
"event_name" : "Event Name",
"are_you_sure_you_want_to_delete": "¿Seguro que quieres eliminar este Plan Preliminar?",
"published": "Publicado",
"delete": "Borrar"
"delete": "Borrar",
"event_preview" : "event_preview"
}
3 changes: 2 additions & 1 deletion evently/i18n/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@
"event_name" : "Event Name",
"are_you_sure_you_want_to_delete": "Вы уверены, что хотите удалить этот черновик?",
"published": "изданный",
"delete": "удалять"
"delete": "удалять",
"event_preview" : "event_preview"
}
1 change: 1 addition & 0 deletions evently/lib/generated/locale_keys.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ abstract class LocaleKeys {
static const are_you_sure_you_want_to_delete = 'are_you_sure_you_want_to_delete';
static const published = 'published';
static const delete = 'delete';
static const event_preview = 'event_preview';

}
2 changes: 1 addition & 1 deletion evently/lib/models/denom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Denom {
return map;
}

factory Denom.fromJson(Map<String, String> json) => Denom(
factory Denom.fromJson(Map<String, dynamic> json) => Denom(
name: json['name']!,
symbol: json['symbol']!,
icon: json['icon']!,
Expand Down
1 change: 1 addition & 0 deletions evently/lib/viewmodels/create_event_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class CreateEventViewModel extends ChangeNotifier {
LocaleKeys.detail.tr(),
LocaleKeys.perks.tr(),
LocaleKeys.price.tr(),
LocaleKeys.event_preview.trim(),
];

Events? events;
Expand Down
7 changes: 5 additions & 2 deletions wallet/lib/model/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Events extends Equatable {
factory Events.fromRecipe(Recipe recipe) {
final Map<String, String> map = _extractAttributeValues(recipe.entries.itemOutputs[0].strings);

final denom = recipe.coinInputs.isEmpty ? "" : _extractCoinValue(recipe.coinInputs[0].coins)[kDenom];
final denom = _extractCoinValue(recipe.coinInputs[0].coins)[kDenom] ?? "";

final List<PerksModel> listOfPerks = [];
jsonDecode(map[kPerks]!).map((jsonMap) {
Expand All @@ -160,7 +160,7 @@ class Events extends Equatable {
listOfPerks: listOfPerks,
cookbookID: map[kCookBookId]!,
recipeID: map[kRecipeId]!,
denom: denom!.toIBCCoinsEnum(),
denom: denom.isEmpty ? IBCCoins.upylon : denom.toIBCCoinsEnum(),
);
}

Expand Down Expand Up @@ -194,6 +194,9 @@ class Events extends Equatable {
}

static Map<String, String> _extractCoinValue(List<Coin> coins) {
if (coins.isEmpty) {
return {};
}
return {kDenom: coins[0].denom, kPrice: coins[0].amount};
}

Expand Down
1 change: 1 addition & 0 deletions wallet/lib/pages/events/event_purchase_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ class _EventPassViewContentState extends State<EventPassViewContent> {
Container(
margin: EdgeInsets.symmetric(horizontal: 20.w),
child: CachedNetworkImage(
height: 160.h,
width: double.infinity,
fit: BoxFit.fill,
imageUrl: widget.events.thumbnail,
Expand Down

0 comments on commit 3ffe317

Please sign in to comment.