From 3ffe3173926b997e2d89c22e9635435ae1f7e9f2 Mon Sep 17 00:00:00 2001 From: AhsanAli13503 Date: Fri, 31 May 2024 11:30:30 +0500 Subject: [PATCH] fix: some issue while testing --- evently/i18n/de.json | 3 ++- evently/i18n/en-US.json | 3 ++- evently/i18n/es.json | 3 ++- evently/i18n/ru-RU.json | 3 ++- evently/lib/generated/locale_keys.g.dart | 1 + evently/lib/models/denom.dart | 2 +- evently/lib/viewmodels/create_event_viewmodel.dart | 1 + wallet/lib/model/event.dart | 7 +++++-- wallet/lib/pages/events/event_purchase_view.dart | 1 + 9 files changed, 17 insertions(+), 7 deletions(-) diff --git a/evently/i18n/de.json b/evently/i18n/de.json index c1082e519e..ecf3116545 100644 --- a/evently/i18n/de.json +++ b/evently/i18n/de.json @@ -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" } \ No newline at end of file diff --git a/evently/i18n/en-US.json b/evently/i18n/en-US.json index 777c9749cf..0c91f363d6 100644 --- a/evently/i18n/en-US.json +++ b/evently/i18n/en-US.json @@ -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" } \ No newline at end of file diff --git a/evently/i18n/es.json b/evently/i18n/es.json index ecbd2db646..0ccaa01230 100644 --- a/evently/i18n/es.json +++ b/evently/i18n/es.json @@ -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" } \ No newline at end of file diff --git a/evently/i18n/ru-RU.json b/evently/i18n/ru-RU.json index 1c347bb983..0a9945448a 100644 --- a/evently/i18n/ru-RU.json +++ b/evently/i18n/ru-RU.json @@ -71,5 +71,6 @@ "event_name" : "Event Name", "are_you_sure_you_want_to_delete": "Вы уверены, что хотите удалить этот черновик?", "published": "изданный", - "delete": "удалять" + "delete": "удалять", + "event_preview" : "event_preview" } \ No newline at end of file diff --git a/evently/lib/generated/locale_keys.g.dart b/evently/lib/generated/locale_keys.g.dart index 48bceccb94..06eb4dd784 100644 --- a/evently/lib/generated/locale_keys.g.dart +++ b/evently/lib/generated/locale_keys.g.dart @@ -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'; } diff --git a/evently/lib/models/denom.dart b/evently/lib/models/denom.dart index 1f4cb66b36..b08ababff7 100644 --- a/evently/lib/models/denom.dart +++ b/evently/lib/models/denom.dart @@ -91,7 +91,7 @@ class Denom { return map; } - factory Denom.fromJson(Map json) => Denom( + factory Denom.fromJson(Map json) => Denom( name: json['name']!, symbol: json['symbol']!, icon: json['icon']!, diff --git a/evently/lib/viewmodels/create_event_viewmodel.dart b/evently/lib/viewmodels/create_event_viewmodel.dart index b898ed55f3..c39aa4fb7b 100644 --- a/evently/lib/viewmodels/create_event_viewmodel.dart +++ b/evently/lib/viewmodels/create_event_viewmodel.dart @@ -23,6 +23,7 @@ class CreateEventViewModel extends ChangeNotifier { LocaleKeys.detail.tr(), LocaleKeys.perks.tr(), LocaleKeys.price.tr(), + LocaleKeys.event_preview.trim(), ]; Events? events; diff --git a/wallet/lib/model/event.dart b/wallet/lib/model/event.dart index aa4ce6dbd4..86dbdf7a45 100644 --- a/wallet/lib/model/event.dart +++ b/wallet/lib/model/event.dart @@ -138,7 +138,7 @@ class Events extends Equatable { factory Events.fromRecipe(Recipe recipe) { final Map 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 listOfPerks = []; jsonDecode(map[kPerks]!).map((jsonMap) { @@ -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(), ); } @@ -194,6 +194,9 @@ class Events extends Equatable { } static Map _extractCoinValue(List coins) { + if (coins.isEmpty) { + return {}; + } return {kDenom: coins[0].denom, kPrice: coins[0].amount}; } diff --git a/wallet/lib/pages/events/event_purchase_view.dart b/wallet/lib/pages/events/event_purchase_view.dart index 3623944b72..29beec63bb 100644 --- a/wallet/lib/pages/events/event_purchase_view.dart +++ b/wallet/lib/pages/events/event_purchase_view.dart @@ -333,6 +333,7 @@ class _EventPassViewContentState extends State { Container( margin: EdgeInsets.symmetric(horizontal: 20.w), child: CachedNetworkImage( + height: 160.h, width: double.infinity, fit: BoxFit.fill, imageUrl: widget.events.thumbnail,