diff --git a/assets/translations/de.json b/assets/translations/de.json
new file mode 100644
index 00000000..1c782d72
--- /dev/null
+++ b/assets/translations/de.json
@@ -0,0 +1,343 @@
+{
+ "appTitle": "3DPass",
+ "@compare_page":{
+ },
+ "Rank": "Rank",
+ "Hash": "Hash",
+ "compare_page_appbar": "Top-Hashes vergleichen",
+
+ "@global":{
+ },
+ "Share": "Teilen",
+ "Delete": "Löschen",
+ "Remove": "Entfernen",
+ "Save": "Speichern",
+ "Cancel": "Abbrechen",
+ "Saved": "Gespeichert",
+ "Next": "Weiter",
+ "Coming soon": "Demnächst verfügbar",
+ "Reset": "Zurücksetzen",
+ "Copied": "Kopiert",
+ "Apply": "Anwenden",
+ "Invalid": "Ungültig",
+ "Clear": "Leeren",
+ "Copy": "Kopieren",
+ "OK": "OK",
+
+ "@home_page":{
+ },
+ "calc_hashes_loader_text":"Berechnung der Hashes...",
+
+ "recognize_your_objects":"Erkenne deine Objekte",
+ "open_web_wallet_button_label": "Web-Wallet öffnen",
+ "get_from_file_button_label": "Von Datei abrufen",
+ "no_saved_objects_placeholder": "Keine gespeicherten Objekte verfügbar",
+
+ "error_hash_list_bloc": "Die Hashes-Liste ist nicht initialisiert :(",
+ "error_file_picker": "Fehler bei der Dateiauswahl",
+ "error_trans_bytes_unavaliable": "Fehler: Sowohl die Benutzereingabe, als auch der letzte Block sind nicht verfügbar. Objekt kann nicht gescannt werden.",
+
+ "@preview_page":{
+ },
+ "MATCHES_number_plural":{
+ "zero": "Keine Treffer ",
+ "one": "{} Treffer ",
+ "two": "{} Treffer ",
+ "few": "{} Treffer ",
+ "many": "{} Treffer ",
+ "other": "{} Treffer "
+ },
+ "matches_FOUND": "Gefunden",
+ "WHY_not_found": "Warum?",
+ "save_this_object_button_label":"Objekt speichern",
+ "save_this_snapshot_button_label":"Schnappschuss speichern",
+ "rename_this_snapshot_button_label":"Diesen Schnappschuss umbenennen",
+
+ "stable_hashes_list_title": "Stabile Hashes",
+ "no_stable_hash_placeholder": "Kein stabiler Hash gefunden",
+ "no_stable_hash_help": "Um einen stabilen Hashwert zu erhalten, versuchen Sie, das Objekt mehrmals mit denselben Scaneinstellungen zu scannen.",
+
+ "@rename_snap_dialog":{
+ },
+ "rename_snapshot_title" : "Schnappschuss umbenennen",
+ "rename_action": "Umbenennen",
+
+ "@save_snap_dialog":{
+ },
+ "save_snapshot_title" : "Schnappschuss speichern",
+
+ "@create_object_dialog":{
+ },
+ "create_object_title" : "Neues Objekt erstellen",
+ "create_object_input_label":"Objektname",
+ "create_object_input_hint":"Objektname eingeben",
+ "create_object_snap_input_label":"Schnappschussname",
+ "create_object_snap_input_hint":"Schnappschussname eingeben",
+ "create_action": "Erstellen",
+
+ "@settings_page":{
+ },
+ "settings_title": "Einstellungen",
+ "choose_algorithm_label": "Algorithmus wählen",
+ "algorithm_button_label": "Scan-Algorithmus",
+ "grid_size_label": "Rastergröße",
+ "n_sections_label": "N Abschnitte",
+ "n_sections_help": "Tipp. Verwenden Sie für Grid2d die Abschnitte 66-68 und für Grid2d_v2, sowie Grid2d_v3 12-16.",
+ "trans_bytes_input_label": "Rotationsbytes",
+ "trans_bytes_empty_input": "Zufällig",
+ "error_n_sections_validator": "N Abschnitte müssen eine Zahl sein",
+ "hash_settings_title": "Scan-Einstellungen",
+ "lib_version_label": "Lib-Version:",
+ "wallet_settings_title": "Wallet Einstellungen",
+ "preview_settings_title": "Previeweinstellungen",
+ "app_settings_title": "Appeinstellungen",
+ "stable_requirement_label": "Stabiler Hash",
+ "stable_requirement_button_text": "Stabile Hash-Anforderung",
+ "stable_requirement_help": "Wie oft muss ein Hash wiederholt werden, um als stabil zu gelten?",
+ "error_stable_is_invalid": "Die Stabilitätsanforderung muss eine positive ganze Zahl sein",
+ "preview_settings_pixel_ratio_label": "Pixelratio",
+ "wallet_settings_istestnet_switch": "Ist Testnet",
+ "node_url_label": "Node URL",
+ "error_hex": "Ungültige Eingabe. Muss 8 Ziffern sein",
+
+ "pixel_ratio_help_text": "Eine Verringerung des Wertes verringert die Qualität der Vorschau, erhöht aber die Leistung.",
+
+ "settings_text_span_title": "Eigenschaften scannen",
+ "algorithm_span": "Algorithmus",
+ "grid_span":"Raster",
+ "n_sections_span": "nAbschnitte",
+ "lib_version_span": "Hash lib Version",
+ "trans_bytes_span": "Rotationsbytes",
+
+ "node_url_button_label": "Node url",
+ "node_url_subpage_label": "Node url",
+
+ "antialias_button_label": "Antialias",
+
+ "dark_theme_switch_label": "Dunkles Theme",
+ "show_zero_assets_label": "Zeige Assets mit Nullbetrag an",
+ "set_pin_button_label": "Pincode festlegen",
+ "remove_pin_button_label": "Pincode entfernen",
+
+
+ "@wallet_base":{
+ },
+ "wallet_header_title": "Wallet",
+ "create_account_button_label": "Zufälliger Account",
+ "import_account_button_label": "Account importieren",
+
+ "init_status_sdk": "Initialisierung...",
+ "init_status_connecting_to_node": "Verbindet mit der Node...",
+ "init_status_completed": "Erfolgreich verbunden",
+ "init_status_connecting_to_node_failed": "Verbindung zur Node fehlgeschlagen",
+
+ "address_copied_to_clipboard": "Adresse kopiert",
+ "choose_account_assets_page_drawer": "Account wählen",
+
+ "@navigation":{
+ },
+ "bottom_label_scan": "Scannen",
+ "bottom_label_wallet": "Wallet",
+ "bottom_label_settings": "Einstellungen",
+
+ "@create_account_page":{
+ },
+ "create_account_title": "Account generieren",
+ "import_account_title": "Account importieren",
+
+ "create_warn1_header": "Bitte beachten",
+ "create_warn1_text": "Wir kopieren oder speichern Ihre Konto-Mnemonik niemals außerhalb Ihres Telefonspeichers. Es liegt in Ihrer Verantwortung, sie sicher aufzubewahren.",
+ "create_warn2_header": "Backup Mnemonik",
+ "create_warn2_text":
+ "Bitte notieren Sie sich Ihren mnemonischen Seed und bewahren Sie ihn an einem sicheren Ort auf.",
+ "create_warn2_text2":"Mit der Mnemonik können Sie Ihr Wallet wiederherstellen.",
+ "create_warn3_header": "Teilen Sie Ihre Mnemonik nicht",
+ "create_warn3_text": "Bewahren Sie Ihre Mnemonik sorgfältig auf, um Ihr Vermögen nicht zu verlieren.",
+ "create_warn3_text2":
+ "Jeder, der Ihre Mnemonik hat, hat vollen Zugriff auf Ihr Konto.",
+ "create_warn4_header": "Mache keine Screenshots",
+ "create_warn4_text":
+ "Machen Sie keine Screenshots, da diese von Malware von Drittanbietern gesammelt werden können, was zum Verlust von Daten führen kann.",
+
+ "create_warn5_header": "Vorsichtig sein",
+ "create_warn5_text": "Geben Sie niemals die Scan-Einstellungen des gewählten Objekts weiter. Dies kann zum Verlust von Assets führen.",
+ "create_warn6_header": "Backup Raw-Seed",
+ "create_warn6_text":
+ "Bitte notieren Sie den ausgewählten Raw-Seed und bewahren Sie ihn an einem sicheren Ort auf.",
+ "create_warn6_text2":"Es kann zur Wiederherstellung ihres Wallets verwendet werden.",
+
+ "backup_warn1_header": "Backup Mnemonik",
+ "backup_warn1_text": "Bitte notieren Sie sich Ihren mnemonischen Seed und bewahren Sie ihn an einem sicheren Ort auf.",
+
+ "backup_confirm_header": "Bestätigen Sie die Mnemonik",
+ "backup_confirm_text": "Bitte klicken Sie auf die Mnemonik in der richtigen Reihenfolge, um zu bestätigen, dass die Sicherung korrekt ist",
+
+ "create_credentials_name": "Name",
+ "create_credentials_name_error": "Name darf nicht leer sein",
+ "create_credentials_password": "Passwort",
+ "create_credentials_password_error": "6 bis 18 Ziffern und enthält Zahlen und Buchstaben",
+ "create_credentials_password2": "Passwort bestätigen",
+ "create_credentials_password2_error": "Inkonsistente Passwörter",
+
+ "error_create_account": "Fehler. Account wurde NICHT erstellt.",
+ "create_account_loading": "Account erstellen...",
+ "import_account_loading": "Account importieren...",
+ "error_import_duplicate": "Fehler: Dieser Account wurde bereits importiert",
+ "error_import_invalid": "Fehler: Dieser Account ist ungültig",
+
+ "import_account_type_title": "Account importieren aus...",
+ "create_type_mnemonic": "Mnemonik",
+ "create_type_object": "3D Objekt",
+ "create_type_rawseed": "Raw Seed",
+ "create_account_from_object": "Account aus 3D-Objekt erstellen",
+
+ "create_from_object_text1": "Objekt auswählen",
+ "create_from_object_text2": "Stabilen Hash wählen",
+ "create_from_object_text2_hint": "Er wird als Raw-Seed für Ihren Account verwendet.",
+
+ "create_from_object_error_no_stable_hashes": "FEHLER. Keine Objekte mit stabilen Hashes gefunden.",
+
+ "import_type_mnemonic": "Mnemonic",
+ "import_type_rawseed": "Raw Seed",
+
+ "import_mnemonic_hint": "Mnemonic eingeben",
+ "import_mnemonic_preview_placeholder": "Mnemonik eingeben, um Adresse zu sehen",
+
+ "import_rawseed_hint": "Raw Seed eingeben",
+ "import_rawseed_preview_placeholder": "Raw Seed eingeben, um Adresse zu sehen",
+
+ "invalid_input": "Ungültige Eingabe",
+ "error_mnemonic_not_found": "Fehler: Mnemonik nicht gefunden",
+ "error_rawseed_not_found": "Error: Raw Seed nicht gefunden",
+ "error_empty_account_address": "Adresse darf nicht leer sein",
+
+ "no_stable_hash_dialog_title": "Kein stabiler Hash",
+ "no_stable_hash_dialog_text": "Sie können keinen Account aus einem 3D-Objekt erstellen, weil Sie keinen stabilen Hash haben. Um einen zu erstellen, scannen Sie das Objekt mehrmals oder ändern Sie die Hash-Anforderung.",
+
+ "@assets_page":{
+ },
+ "balance_avaliable_title": "Verfügbar",
+ "balance_locked_title": "Abgeschlossen",
+ "balance_reserved_title": "Reserviert",
+ "transfer_coins_button_label": "Senden",
+ "recieve_coins_button_label": "Empfangen",
+ "remove_account_button_label": "Account löschen",
+
+ "remove_accout_dialog_title": "Account löschen {}",
+ "remove_accout_dialog_text": "Sind Sie sicher, dass Sie diesen Account löschen möchten?",
+ "assets_title": "Assets",
+
+ "@non_native_token":{
+ },
+ "non_native_token_token": "Asset {}",
+ "no_asset_history": "Keine Extrinsics gefunden",
+ "mint_asset_history_label": "Mint {} {}",
+ "mint_asset_history_prefix": "Für:",
+ "set_metadata_asset_history_label": "Metadaten für assetID festlegen: {}",
+ "set_metadata_asset_history_name": "Name: {}",
+ "set_metadata_asset_history_symbol": "Symbol: {}",
+ "set_metadata_asset_history_decimals": "Dezimalen: {}",
+ "non_native_history_title_label": "Geschichte",
+ "create_token_widget": "Token erstellen",
+ "nnt_transfer_button_label": "Assets übertragen",
+
+ "@recieve_page":{
+ },
+ "recieve_page_title": "Empfangen",
+
+ "@transfer_page":{
+ },
+ "transfer_page_title": "Transaktion",
+ "from_address_label": "Von",
+ "to_address_label": "An Adresse",
+ "to_address_hint": "Adresse eingeben",
+ "amount_label": "Menge (Kontostand: {})",
+ "amount_hint": "Menge eingeben",
+ "enter_password_hint": "Passwort eingeben",
+ "enter_password_label": "Passwort",
+ "existential_deposit_label": "existenzielle Einlage",
+ "existential_deposit_text": "Der Mindestbetrag, den ein Account haben sollte, um als aktiv zu gelten.",
+ "estimated_transfer_fee": "Geschätzte Transaktionsgebühr",
+ "keep_alive_label": "am Leben erhalten",
+ "keep_alive_text": "Mit der Option \"Am Leben erhalten\" ist der Account vor der Löschung aufgrund eines niedrigen Kontostands geschützt.",
+ "make_transfer_label": "Transaktion vornehmen",
+ "error_wrong_amount": "Erwartet wurde eine reale Zahl, die kleiner ist als der verfügbare Kontostand.",
+ "could_not_check_address": "Adresse konnte nicht überprüft werden",
+ "wrong_address": "Ungültige Adresse angegeben",
+ "transfer_loader_text": "Übertragen...",
+ "transfer_success_text": "Mittel werden gesendet",
+
+ "error_empty": "Sollte nicht leer sein",
+
+ "@transactions_history":{
+ },
+ "transactions_to": "An",
+ "transactions_from": "Von",
+ "transactions_title": "Transaktionshistorie",
+ "show_transfers": "Transaktionen anzeigen",
+ "no_transfers": "Keine Transaktionen gefunden",
+ "first_page_error_title": "Etwas ist schief gelaufen",
+ "first_page_error_message": "Die Anwendung ist auf einen unbekannten Fehler gestoßen.\\nBitte versuchen Sie es später noch einmal.",
+ "first_page_error_button": "Erneut versuchen",
+
+ "@Screen_lock":{
+ },
+ "screen_lock_title": "PIN-Code eingeben",
+ "screen_lock_title_set": "Legen Sie Ihren PIN-Code fest",
+ "screen_lock_title_confirm": "Bestätigen Sie Ihren PIN-Code",
+
+ "@2.7.2":{
+ },
+ "choose_transfer_keep_alive": "Absender am Leben erhalten",
+ "transfer_keep_alive_help": "Bei aktivierter \"Am Leben erhalten\"-Option ist der Account vor einer Löschung aufgrund eines niedrigen Kontostands geschützt.",
+
+ "@2.8.0":{
+ },
+ "notifications_title": "Transaktionen",
+ "transfer_status": "Status der Übertragung:",
+ "status_pending": "Ausstehend",
+ "status_success": "Erfolgreich",
+ "status_failed": "Fehlgeschlagen",
+ "status_error": "Fehler",
+ "error_wrong_amount_int": "Eine positive ganze Zahl erwartet",
+
+ "@2.9.0":{
+ },
+ "from_select_account_title": "Account auswählen",
+ "add_account_from_label": "Account hinzufügen zum Senden VON",
+ "add_account_to_label": "Account hinzufügen zum Senden AN",
+ "password_hint_1": "Drücken Sie ",
+ "password_hint_2": " um das Passwort des obigen Accounts zu kopieren",
+
+ "@3.0.0":{
+ },
+ "top_hashes_title": "Top-Hashes",
+ "copy_hash_button_text": "Kopieren",
+ "HASHES_number_plural":{
+ "zero": "0 Hashes",
+ "one": "{} Hash",
+ "two": "{} Hashes",
+ "few": "{} Hashes",
+ "many": "{} Hashes",
+ "other": "{} Hashes"
+ },
+ "stable_hashes_copied_toast": "Stabile Hashes kopiert",
+ "scan_properties_copied_toast": "Scan-Eigenschaften kopiert",
+ "top_hashes_copied_toast": "Top-Hashes kopiert",
+ "trans_bytes_copied_toast": "Rotationsbytes kopiert",
+ "file_hash_copied": "Dateihashwert kopiert",
+ "unsaved_object_appbar": "Unbenanntes Objekt",
+ "delete_new_snapshot": "Schnappschuss nicht speichern",
+ "delete_extisting_snapshot": "Schnappschuss löschen",
+ "delete_snapshot_confirm_title": "Möchten Sie {} löschen?",
+ "explore_hashes_button_title": "Hashes erforschen",
+ "upload_to_3d_rpc_title": "3DRPC-2",
+ "3d_rpc_button_label": "Objekt ablegen",
+ "no_top_hashes_found": "Keine Hashes gefunden",
+ "top_hashes_empty_text": "Das ist ein interessantes Verhalten. Vielleicht findet das Scannen mit anderen Einstellungen echte Hashes.",
+ "chosen_file_to_upload_to_3drpc": "Datei: {}",
+ "file_hash_title": "Datei Hash",
+ "x_hashes_chosen": "{} ausgewählt",
+ "n_approvals_hint": "Gewünschte Anzahl von Genehmigungen eingeben",
+ "from_address_dropdown_hint": "Konto wählen"
+}
\ No newline at end of file
diff --git a/assets/translations/en.json b/assets/translations/en.json
index cd03e34d..50aaa4d2 100644
--- a/assets/translations/en.json
+++ b/assets/translations/en.json
@@ -27,11 +27,6 @@
"@home_page":{
},
"calc_hashes_loader_text":"Calculating hashes...",
- "snap_card_name": "Name: ",
- "snap_card_stamp": "Stamp: ",
- "saved_objects_header": "Saved objects",
- "object_title_prefix": "Object -",
- "snapshots_subtitle": "snapshots:",
"recognize_your_objects":"Recognize your objects",
"open_web_wallet_button_label": "Open web wallet",
@@ -54,16 +49,12 @@
},
"matches_FOUND": "found",
"WHY_not_found": "Why?",
- "save_this_object_button_label":"Save this object",
- "save_this_snapshot_button_label":"Save this snapshot",
+ "save_this_object_button_label":"Save object",
+ "save_this_snapshot_button_label":"Save snapshot",
"rename_this_snapshot_button_label":"Rename this snapshot",
- "top_10_hashes": "Hash ID",
- "get_new_object_appbar": "Get a new one",
- "show_and_share_dialog_button": "Show and share",
- "delete_snapshot_button": "Remove & clear the cache",
- "stable_hashes_list_title": "Stable hashes:",
- "no_stable_hash_placeholder": "No stable hash found.",
+ "stable_hashes_list_title": "Stable hashes",
+ "no_stable_hash_placeholder": "No stable hash found",
"no_stable_hash_help": "To get a stable hash, try to scan the object several times with the same scan settings.",
"@rename_snap_dialog":{
@@ -91,7 +82,7 @@
"algorithm_button_label": "Scan algorithm",
"grid_size_label": "Grid size",
"n_sections_label": "N Sections",
- "n_sections_help": "Tip. Use 66-68 sections for Grid2d and 15-16 for Grid2d_v2, Grid2d_v3.",
+ "n_sections_help": "Tip. Use 66-68 sections for Grid2d and 12-16 for Grid2d_v2, Grid2d_v3.",
"trans_bytes_input_label": "Rotation bytes",
"trans_bytes_empty_input": "Random",
"error_n_sections_validator": "N Sections must be a number",
@@ -111,7 +102,7 @@
"pixel_ratio_help_text": "Decreasing the value reduces preview quality, but increases performance.",
- "settings_text_span_title": "Scan properties:",
+ "settings_text_span_title": "Scan properties",
"algorithm_span": "Algorithm",
"grid_span":"Grid",
"n_sections_span": "nSections",
@@ -197,6 +188,7 @@
"import_account_type_title": "Import account from...",
"create_type_mnemonic": "Mnemonic",
+ "create_type_rawseed": "Raw Seed",
"create_type_object": "3D Object",
"create_account_from_object": "Create account from 3D Object",
@@ -207,12 +199,17 @@
"create_from_object_error_no_stable_hashes": "ERROR. No objects with stable hashes found.",
"import_type_mnemonic": "Mnemonic",
+ "import_type_rawseed": "Raw Seed",
"import_mnemonic_hint": "Enter mnemonic",
"import_mnemonic_preview_placeholder": "Enter mnemonic to see address",
+ "import_rawseed_hint": "Enter raw seed",
+ "import_rawseed_preview_placeholder": "Enter raw seed to see address",
+
"invalid_input": "Invalid input",
"error_mnemonic_not_found": "Error: mnemonic not found",
+ "error_rawseed_not_found": "Error: raw seed not found",
"error_empty_account_address": "Address can't be empty",
"no_stable_hash_dialog_title": "No stable hash",
@@ -223,7 +220,7 @@
"balance_avaliable_title": "Available",
"balance_locked_title": "Locked",
"balance_reserved_title": "Reserved",
- "transfer_coins_button_label": "Transfer",
+ "transfer_coins_button_label": "Send",
"recieve_coins_button_label": "Recieve",
"remove_account_button_label": "Delete account",
@@ -297,8 +294,6 @@
"@2.8.0":{
},
- "notifications_titile": "Transactions",
- "transfer_status": "Transfer status:",
"status_pending": "Pending",
"status_success": "Success",
"status_failed": "Failed",
@@ -311,5 +306,59 @@
"add_account_from_label": "Add accout to send FROM",
"add_account_to_label": "Add accout to send TO",
"password_hint_1": "Press ",
- "password_hint_2": " to copy the password of the account above"
+ "password_hint_2": " to copy the password of the account above",
+
+ "@3.0.0":{
+ },
+ "top_hashes_title": "Top hashes",
+ "copy_hash_button_text": "Copy",
+ "HASHES_number_plural":{
+ "zero": "0 hashes",
+ "one": "{} hash",
+ "two": "{} hashes",
+ "few": "{} hashes",
+ "many": "{} hashes",
+ "other": "{} hashes"
+ },
+ "stable_hashes_copied_toast": "Stable hashes copied",
+ "scan_properties_copied_toast": "Scan properties copied",
+ "top_hashes_copied_toast": "Top hashes copied",
+ "trans_bytes_copied_toast": "Rotation bytes copied",
+ "file_hash_copied": "File hash copied",
+ "unsaved_object_appbar": "Unnamed object",
+ "delete_new_snapshot": "Don't save snapshot",
+ "delete_extisting_snapshot": "Delete snapshot",
+ "delete_snapshot_confirm_title": "Do you want to delete {}?",
+ "explore_hashes_button_title": "Compare hashes",
+ "upload_to_3d_rpc_title": "Put object",
+ "3d_rpc_button_label": "Put object",
+ "no_top_hashes_found": "No hashes found",
+ "top_hashes_empty_text": "This is interesting behavior. Perhaps scanning with other settings will find real hashes.",
+ "chosen_file_to_upload_to_3drpc": "File: {}",
+ "file_hash_title": "Local file hash",
+ "x_hashes_chosen": "{} chosen",
+ "n_approvals_hint": "Enter desired number of approvals",
+ "from_address_dropdown_hint": "Choose account",
+ "poscan_putobject_choose_account": "Account",
+ "poscan_putobject_choose_napprovals": "nApprovals",
+ "poscan_putobject_choose_hashes": "Hashes",
+ "poscan_putobject_fees_warning": "This transaction takes fees",
+ "Submit": "Submit",
+ "poscan_putobject_choose_properties": "Properties (optional)",
+ "PROPERTIES_number_plural": {
+ "zero": "0 properties chosen",
+ "one": "{} property chosen",
+ "two": "{} properties chosen",
+ "few": "{} properties chosen",
+ "many": "{} properties chosen",
+ "other": "{} properties chosen"
+ },
+ "poscan_putobject_choose_category": "Category",
+ "account_never_null": "Please choose an account",
+ "notifications_title": "Transactions",
+ "extrinsic_status": "Extrinsic:",
+ "objects_list_header": "Objects list",
+ "uploaded_object_title": "Uploaded object",
+ "local_snapshots_with_same_hashes": "Local snapshots with same hashes",
+ "file_hash_subtitle_scan_list": "Local file hash: "
}
\ No newline at end of file
diff --git a/assets/translations/es.json b/assets/translations/es.json
index 844b1f09..c932fdba 100644
--- a/assets/translations/es.json
+++ b/assets/translations/es.json
@@ -53,7 +53,7 @@
"show_and_share_dialog_button": "Mostrar y compartir",
"delete_snapshot_button": "Eliminar y borrar la caché",
"stable_hashes_list_title": "Hashes estables:",
- "no_stable_hash_placeholder": "No se encontró ningún hash estable.",
+ "no_stable_hash_placeholder": "No se encontró ningún hash estable",
"no_stable_hash_help": "Para obtener un hash estable, intenta escanear el objeto varias veces con la misma configuración de escaneo.",
"@rename_snap_dialog": {},
"rename_snapshot_title": "Renombrar instantánea",
@@ -73,7 +73,7 @@
"algorithm_button_label": "Algoritmo de escaneo",
"grid_size_label": "Tamaño de la cuadrícula",
"n_sections_label": "Secciones N",
- "n_sections_help": "Consejo. Usa 66-68 secciones para Grid2d y 15-16 para Grid2d_v2, Grid2d_v3.",
+ "n_sections_help": "Consejo. Usa 66-68 secciones para Grid2d y 12-16 para Grid2d_v2, Grid2d_v3.",
"trans_bytes_input_label": "Bytes de rotación",
"trans_bytes_empty_input": "Aleatorio",
"error_n_sections_validator": "Las secciones N deben ser un número",
@@ -91,7 +91,7 @@
"node_url_label": "URL del nodo",
"error_hex": "Entrada no válida. Debe tener 8 dígitos",
"pixel_ratio_help_text": "Reducir el valor reduce la calidad de la vista previa, pero aumenta el rendimiento.",
- "settings_text_span_title": "Propiedades de escaneo:",
+ "settings_text_span_title": "Propiedades de escaneo",
"algorithm_span": "Algoritmo",
"grid_span": "Cuadrícula",
"n_sections_span": "nSecciones",
diff --git a/build.yaml b/build.yaml
index 53559550..6daaf0e6 100644
--- a/build.yaml
+++ b/build.yaml
@@ -8,4 +8,4 @@ targets:
ferry_generator|serializer_builder:
enabled: true
options:
- schema: threedpass|lib/core/graphql/threedpass.schema.graphql
\ No newline at end of file
+ schema: threedpass|lib/core/graphql/threedpass.schema.graphql
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index f95a01a6..f60edb69 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -19,6 +19,7 @@
en
es
sr
+ de
CFBundleName
threedpass
diff --git a/lib/core/errors/parse_failure.dart b/lib/core/errors/parse_failure.dart
new file mode 100644
index 00000000..360ed4c8
--- /dev/null
+++ b/lib/core/errors/parse_failure.dart
@@ -0,0 +1,5 @@
+import 'package:super_core/super_core.dart';
+
+class ParseFailure extends Failure {
+ const ParseFailure(super.cause);
+}
diff --git a/lib/core/errors/type_mismatch.dart b/lib/core/errors/type_mismatch.dart
new file mode 100644
index 00000000..edbb00cb
--- /dev/null
+++ b/lib/core/errors/type_mismatch.dart
@@ -0,0 +1,9 @@
+import 'package:super_core/super_core.dart';
+
+class TypeMismatch extends Failure {
+ const TypeMismatch({
+ required final String expected,
+ required final String actual,
+ required final String varName,
+ }) : super('$varName expected type $expected, but got $actual');
+}
diff --git a/lib/core/polkawallet/app_service.dart b/lib/core/polkawallet/app_service.dart
index 2f7e33d0..7299b24e 100644
--- a/lib/core/polkawallet/app_service.dart
+++ b/lib/core/polkawallet/app_service.dart
@@ -63,9 +63,9 @@ class AppService {
chosenAccountBalance.value = data;
}
- tokensAreLoading.value = true;
- await _setTokensData(address);
- tokensAreLoading.value = false;
+ // tokensAreLoading.value = true;
+ // await _setTokensData(address);
+ // tokensAreLoading.value = false;
},
),
);
diff --git a/lib/core/polkawallet/bloc/app_service_cubit.dart b/lib/core/polkawallet/bloc/app_service_cubit.dart
index f2ad66bc..57156dc8 100644
--- a/lib/core/polkawallet/bloc/app_service_cubit.dart
+++ b/lib/core/polkawallet/bloc/app_service_cubit.dart
@@ -13,15 +13,17 @@ import 'package:threedpass/core/polkawallet/plugins/d3p_live_net_plugin.dart';
import 'package:threedpass/core/polkawallet/plugins/d3p_test_net_plugin.dart';
import 'package:threedpass/core/polkawallet/utils/tx_update_event_logs_handler.dart';
import 'package:threedpass/features/accounts/domain/account_info.dart';
+import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cubit.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
import 'package:threedpass/features/settings_page/domain/entities/wallet_settings.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/bloc/transfers_from_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/bloc/transfers_to_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/usecases/get_transfers.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/bloc/transfers_from_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/bloc/transfers_to_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart';
import 'package:threedpass/setup.dart';
part 'init_app_service_extension.dart';
+part 'dirty_after_init.dart';
///
/// BE CAREFUL when you write [buildWhen] for this cubit.
@@ -201,8 +203,13 @@ class AppServiceLoaderCubit extends Cubit {
final String msgId,
final TransactionsCallback setTransactionResult,
) {
+ // TODO Remove handler after get result
state.plugin.sdk.webView!.addGlobalHandler(
- TxUpdateEventLogsHandler(msgId, setTransactionResult),
+ TxUpdateEventLogsHandler(
+ msgId: msgId,
+ setTransactionResult: setTransactionResult,
+ webViewRunner: state.plugin.sdk.webView!,
+ ),
);
}
}
diff --git a/lib/core/polkawallet/bloc/dirty_after_init.dart b/lib/core/polkawallet/bloc/dirty_after_init.dart
new file mode 100644
index 00000000..e5b63e90
--- /dev/null
+++ b/lib/core/polkawallet/bloc/dirty_after_init.dart
@@ -0,0 +1,7 @@
+part of './app_service_cubit.dart';
+
+extension DirtyArchitectureTrick on AppServiceLoaderCubit {
+ Future _afterInit() async {
+ unawaited(getIt().loadAll());
+ }
+}
diff --git a/lib/core/polkawallet/bloc/init_app_service_extension.dart b/lib/core/polkawallet/bloc/init_app_service_extension.dart
index 9ebf8293..3b525540 100644
--- a/lib/core/polkawallet/bloc/init_app_service_extension.dart
+++ b/lib/core/polkawallet/bloc/init_app_service_extension.dart
@@ -20,7 +20,9 @@ extension _ on AppServiceLoaderCubit {
);
emit(appService);
- unawaited(_startPlugin(appService));
+ await _startPlugin(appService);
+
+ unawaited(_afterInit());
}
static D3pCorePlugin _buildPlugin(final WalletSettings walletSettings) {
diff --git a/lib/core/polkawallet/failures.dart b/lib/core/polkawallet/failures.dart
new file mode 100644
index 00000000..e033571b
--- /dev/null
+++ b/lib/core/polkawallet/failures.dart
@@ -0,0 +1,5 @@
+import 'package:super_core/super_core.dart';
+
+class AppServiceIsNotInitialized extends Failure {
+ const AppServiceIsNotInitialized([final String? cause]) : super(cause);
+}
diff --git a/lib/core/polkawallet/non_native_tokens_api.dart b/lib/core/polkawallet/non_native_tokens_api.dart
index 5057f124..0dd38ff1 100644
--- a/lib/core/polkawallet/non_native_tokens_api.dart
+++ b/lib/core/polkawallet/non_native_tokens_api.dart
@@ -1,7 +1,7 @@
import 'package:polkawallet_sdk/plugin/store/balances.dart';
import 'package:threedpass/core/polkawallet/app_service.dart';
-/// Load balances for assets
+/// Load balances for assets // TODO REMOVE ASSETS
class NonNativeTokensApi {
final AppService service;
final String address;
diff --git a/lib/core/polkawallet/utils/basic_event_logs_handler.dart b/lib/core/polkawallet/utils/basic_event_logs_handler.dart
new file mode 100644
index 00000000..35f63f89
--- /dev/null
+++ b/lib/core/polkawallet/utils/basic_event_logs_handler.dart
@@ -0,0 +1,75 @@
+import 'dart:convert';
+
+import 'package:logger/logger.dart';
+import 'package:polkawallet_sdk/service/webViewRunner.dart';
+import 'package:polkawallet_sdk/utils/web_logs_handler.dart';
+import 'package:threedpass/setup.dart';
+
+abstract class BasicEventLogsHandler extends WebLogsHandler {
+ const BasicEventLogsHandler({
+ required this.msgId,
+ required this.webViewRunner,
+ });
+
+ final String msgId;
+ final WebViewRunner webViewRunner;
+
+ static const String extrinsicSuccess = 'ok';
+
+ void onExtrinsicSuccess();
+ void onExtrinsicFailed(final String msg);
+
+ void onError(final String msg);
+
+ void dispose() {
+ webViewRunner.removeGlobalHandler(this);
+ }
+
+ @override
+ void handle(final String data) {
+ final dynamic rawData = jsonDecode(data);
+
+ if (!(rawData is Map &&
+ rawData.keys.contains('path') &&
+ rawData.keys.contains('data'))) {
+ return;
+ }
+
+ final dynamic path = rawData['path'];
+
+ if (!(path is String && path.contains('|msgId=$msgId'))) {
+ return;
+ }
+
+ final dynamic dataSection = rawData['data'];
+
+ if (!(dataSection is Map &&
+ dataSection.keys.contains('title') &&
+ dataSection.keys.contains('message'))) {
+ return;
+ }
+
+ final String title = dataSection['title'] as String;
+ final String message = dataSection['message'] as String;
+ getIt().v('Found log $title $message');
+
+ switch (title) {
+ case 'system.ExtrinsicSuccess':
+ getIt().v('Found ExtrinsicSuccess for $msgId');
+ onExtrinsicSuccess();
+ dispose();
+ break;
+ case 'system.ExtrinsicFailed':
+ getIt().v('Found ExtrinsicFailed for $msgId');
+ onExtrinsicFailed(message);
+ dispose();
+ break;
+ default:
+ if (title.contains('error')) {
+ onError(message);
+ dispose();
+ }
+ break;
+ }
+ }
+}
diff --git a/lib/core/polkawallet/utils/extrinsic_status.dart b/lib/core/polkawallet/utils/extrinsic_status.dart
new file mode 100644
index 00000000..06a97e9f
--- /dev/null
+++ b/lib/core/polkawallet/utils/extrinsic_status.dart
@@ -0,0 +1 @@
+enum ExtrinsicStatus { error, loading, success, failed }
diff --git a/lib/core/polkawallet/utils/tx_update_event_logs_handler.dart b/lib/core/polkawallet/utils/tx_update_event_logs_handler.dart
index dc366835..39c9f77f 100644
--- a/lib/core/polkawallet/utils/tx_update_event_logs_handler.dart
+++ b/lib/core/polkawallet/utils/tx_update_event_logs_handler.dart
@@ -1,79 +1,97 @@
-import 'dart:convert';
-
-import 'package:flutter/material.dart';
-import 'package:logger/logger.dart';
-import 'package:polkawallet_sdk/utils/web_logs_handler.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/setup.dart';
+import 'package:threedpass/core/polkawallet/utils/basic_event_logs_handler.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
typedef TransactionsCallback = void Function({
- required ExtrisincStatus status,
+ required ExtrinsicStatus status,
required String? message,
});
-class TxUpdateEventLogsHandler extends WebLogsHandler {
- const TxUpdateEventLogsHandler(
- this.msgId,
- this.setTransactionResult,
- );
-
- final String msgId;
+class TxUpdateEventLogsHandler extends BasicEventLogsHandler {
+ const TxUpdateEventLogsHandler({
+ required super.msgId,
+ required super.webViewRunner,
+ required this.setTransactionResult,
+ });
final TransactionsCallback setTransactionResult;
- static const String extrinsicSuccess = 'ok';
+ // static const String extrinsicSuccess = 'ok';
+
+ // @override
+ // void handle(final String data) {
+ // final dynamic rawData = jsonDecode(data);
+
+ // if (!(rawData is Map &&
+ // rawData.keys.contains('path') &&
+ // rawData.keys.contains('data'))) {
+ // return;
+ // }
+
+ // final dynamic path = rawData['path'];
+
+ // if (!(path is String && path.contains('txUpdateEvent|msgId=$msgId'))) {
+ // return;
+ // }
+
+ // final dynamic dataSection = rawData['data'];
+
+ // if (!(dataSection is Map &&
+ // dataSection.keys.contains('title') &&
+ // dataSection.keys.contains('message'))) {
+ // return;
+ // }
+
+ // final String title = dataSection['title'] as String;
+ // final String message = dataSection['message'] as String;
+ // debugPrint('$title $message');
+
+ // if (title == "system.ExtrinsicSuccess") {
+ // getIt().d('Found ExtrinsicSuccess for $msgId');
+ // setTransactionResult(status: ExtrinsicStatus.success, message: null);
+ // } else if (title == 'system.ExtrinsicFailed') {
+ // getIt().d('Found ExtrinsicFailed for $msgId');
+ // setTransactionResult(
+ // status: ExtrinsicStatus.failed,
+ // message: message,
+ // );
+ // }
+
+ // if (title.contains('error')) {
+ // if (message.contains('password check failed')) {
+ // setTransactionResult(
+ // status: ExtrinsicStatus.error,
+ // message: message,
+ // );
+ // } else {
+ // setTransactionResult(
+ // status: ExtrinsicStatus.failed,
+ // message: message,
+ // );
+ // }
+ // }
+ // }
+
+ @override
+ void onError(final String msg) {
+ setTransactionResult(
+ status: ExtrinsicStatus.error,
+ message: msg,
+ );
+ }
+
+ @override
+ void onExtrinsicFailed(final String msg) {
+ setTransactionResult(
+ status: ExtrinsicStatus.failed,
+ message: msg,
+ );
+ }
@override
- void handle(final String data) {
- final dynamic rawData = jsonDecode(data);
-
- if (!(rawData is Map &&
- rawData.keys.contains('path') &&
- rawData.keys.contains('data'))) {
- return;
- }
-
- final dynamic path = rawData['path'];
-
- if (!(path is String && path.contains('txUpdateEvent|msgId=$msgId'))) {
- return;
- }
-
- final dynamic dataSection = rawData['data'];
-
- if (!(dataSection is Map &&
- dataSection.keys.contains('title') &&
- dataSection.keys.contains('message'))) {
- return;
- }
-
- final String title = dataSection['title'] as String;
- final String message = dataSection['message'] as String;
- debugPrint('$title $message');
-
- if (title == "system.ExtrinsicSuccess") {
- getIt().d('Found ExtrinsicSuccess for $msgId');
- setTransactionResult(status: ExtrisincStatus.success, message: null);
- } else if (title == 'system.ExtrinsicFailed') {
- getIt().d('Found ExtrinsicFailed for $msgId');
- setTransactionResult(
- status: ExtrisincStatus.failed,
- message: message,
- );
- }
-
- if (title.contains('error')) {
- if (message.contains('password check failed')) {
- setTransactionResult(
- status: ExtrisincStatus.error,
- message: message,
- );
- } else {
- setTransactionResult(
- status: ExtrisincStatus.failed,
- message: message,
- );
- }
- }
+ void onExtrinsicSuccess() {
+ setTransactionResult(
+ status: ExtrinsicStatus.success,
+ message: null,
+ );
}
}
diff --git a/lib/core/polkawallet/widgets/account_choose_tile_text.dart b/lib/core/polkawallet/widgets/account_choose_tile_text.dart
new file mode 100644
index 00000000..d5dbaeaf
--- /dev/null
+++ b/lib/core/polkawallet/widgets/account_choose_tile_text.dart
@@ -0,0 +1,45 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/utils/formatters.dart';
+
+class AccountChooseTileText extends StatelessWidget {
+ const AccountChooseTileText({
+ required this.address,
+ required this.name,
+ super.key,
+ });
+
+ final String? name;
+ final String? address;
+
+ String fixedName() {
+ if (name != null) {
+ return name! + ' ';
+ } else {
+ return '';
+ }
+ }
+
+ String shortAddress() {
+ return Fmt.shorterAddress(address);
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ final textStyles = Theme.of(context).customTextStyles;
+ return Text.rich(
+ TextSpan(
+ text: fixedName(),
+ style: textStyles.d3pBodyMedium,
+ children: [
+ TextSpan(
+ text: shortAddress(),
+ style: textStyles.d3pBodyMedium.copyWith(color: D3pColors.disabled),
+ ),
+ ],
+ ),
+ );
+ // return '${fixedName()}${shortAddress()}';
+ }
+}
diff --git a/lib/core/theme/d3p_bottom_sheet_theme.dart b/lib/core/theme/d3p_bottom_sheet_theme.dart
new file mode 100644
index 00000000..71222251
--- /dev/null
+++ b/lib/core/theme/d3p_bottom_sheet_theme.dart
@@ -0,0 +1,14 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
+
+class D3pBottonSheetTheme {
+ static MaterialModalSheetData get materialTheme => MaterialModalSheetData(
+ shape: const RoundedRectangleBorder(
+ side: BorderSide.none,
+ borderRadius: BorderRadius.only(
+ topLeft: Radius.circular(16),
+ topRight: Radius.circular(16),
+ ),
+ ),
+ );
+}
diff --git a/lib/core/theme/d3p_card_theme.dart b/lib/core/theme/d3p_card_theme.dart
new file mode 100644
index 00000000..b8c69716
--- /dev/null
+++ b/lib/core/theme/d3p_card_theme.dart
@@ -0,0 +1,5 @@
+import 'package:flutter/material.dart';
+
+class D3pCardTheme {
+ static Radius get radius => const Radius.circular(4.0);
+}
diff --git a/lib/core/theme/d3p_dropdown_theme.dart b/lib/core/theme/d3p_dropdown_theme.dart
new file mode 100644
index 00000000..e1aaec34
--- /dev/null
+++ b/lib/core/theme/d3p_dropdown_theme.dart
@@ -0,0 +1,19 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_theme.dart';
+
+class D3pDropdownTheme {
+ static InputBorder get border => const OutlineInputBorder(
+ borderSide: BorderSide.none,
+ borderRadius: BorderRadius.all(
+ Radius.circular(4),
+ ),
+ );
+
+ static InputBorder get focusedBorder => OutlineInputBorder(
+ borderSide: BorderSide(color: D3pThemeData.mainColor),
+ borderRadius: const BorderRadius.all(
+ Radius.circular(4),
+ ),
+ gapPadding: 4,
+ );
+}
diff --git a/lib/core/theme/d3p_special_styles.dart b/lib/core/theme/d3p_special_styles.dart
index 188f2282..00ab4c06 100644
--- a/lib/core/theme/d3p_special_styles.dart
+++ b/lib/core/theme/d3p_special_styles.dart
@@ -81,6 +81,7 @@ extension TitleCustomText on CustomTextStyles {
}
extension BodyCustomText on CustomTextStyles {
+ TextStyle get d3pReallyLarge => d3pBodyLarge.copyWith(fontSize: 18);
TextStyle get d3pBodyLarge =>
themeData.textTheme.bodyLarge!.copyWith(color: _themeOpposite);
TextStyle get d3pBodyMedium =>
@@ -107,3 +108,8 @@ extension Buttons on CustomTextStyles {
TextStyle get hintStyle => d3pBodySmall.copyWith(color: D3pColors.disabled);
}
+
+extension TextInput on CustomTextStyles {
+ TextStyle get textInputHintStyle =>
+ d3pBodyMedium.copyWith(color: D3pColors.disabled);
+}
diff --git a/lib/core/theme/d3p_text_input_theme.dart b/lib/core/theme/d3p_text_input_theme.dart
new file mode 100644
index 00000000..baa94b87
--- /dev/null
+++ b/lib/core/theme/d3p_text_input_theme.dart
@@ -0,0 +1,19 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_theme.dart';
+
+class D3pTextInputTheme {
+ static InputBorder get border => const OutlineInputBorder(
+ borderSide: BorderSide.none,
+ borderRadius: BorderRadius.all(
+ Radius.circular(16),
+ ),
+ );
+
+ static InputBorder get focusedBorder => OutlineInputBorder(
+ borderSide: BorderSide(color: D3pThemeData.mainColor),
+ borderRadius: const BorderRadius.all(
+ Radius.circular(16),
+ ),
+ gapPadding: 4,
+ );
+}
diff --git a/lib/core/theme/d3p_theme.dart b/lib/core/theme/d3p_theme.dart
index e5472797..c600df9b 100644
--- a/lib/core/theme/d3p_theme.dart
+++ b/lib/core/theme/d3p_theme.dart
@@ -10,6 +10,7 @@ import 'd3p_elevated_button_theme.dart';
class D3pThemeData {
static MaterialColor mainColor = Colors.green;
+ static Color accentColor = const Color(0xFFC3F8C5);
static ThemeData get lightTheme {
final t = ThemeData(
diff --git a/lib/core/utils/formatters.dart b/lib/core/utils/formatters.dart
index 6ab13403..0b4638a8 100644
--- a/lib/core/utils/formatters.dart
+++ b/lib/core/utils/formatters.dart
@@ -1,7 +1,7 @@
import 'package:easy_localization/easy_localization.dart';
class Fmt {
- static DateFormat basicDateFormat = DateFormat('yyyy-MM-dd H:m:s');
+ static DateFormat basicDateFormat = DateFormat('yyyy-MM-dd HH:mm:ss');
static String shorterAddress(final String? addr, {final int pad = 6}) {
if (addr == null || addr.isEmpty) {
diff --git a/lib/core/widgets/buttons/clickable_card.dart b/lib/core/widgets/buttons/clickable_card.dart
new file mode 100644
index 00000000..675c62d0
--- /dev/null
+++ b/lib/core/widgets/buttons/clickable_card.dart
@@ -0,0 +1,29 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
+
+class ClickableCard extends StatelessWidget {
+ const ClickableCard({
+ required this.child,
+ required this.onTap,
+ super.key,
+ });
+
+ final void Function()? onTap;
+ final Widget child;
+
+ @override
+ Widget build(final BuildContext context) {
+ return D3pCard(
+ child: InkWell(
+ onTap: onTap,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 16),
+ child: SizedBox(
+ width: double.infinity,
+ child: child,
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/core/widgets/buttons/dropdown_button.dart b/lib/core/widgets/buttons/dropdown_button.dart
index 061d944a..ef8e604c 100644
--- a/lib/core/widgets/buttons/dropdown_button.dart
+++ b/lib/core/widgets/buttons/dropdown_button.dart
@@ -1,47 +1,32 @@
-import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_dropdown_theme.dart';
import 'package:threedpass/core/theme/d3p_special_colors.dart';
import 'package:threedpass/core/theme/d3p_special_styles.dart';
-import 'package:threedpass/core/theme/d3p_theme.dart';
-
-class D3pDropdownButton extends DropdownButton {
- D3pDropdownButton({
- required final BuildContext context,
- required super.items,
- required super.onChanged,
- required super.value,
- super.isExpanded,
- super.key,
- super.selectedItemBuilder,
- }) : super(
- dropdownColor: Theme.of(context).customColors.scaffoldBackground,
- style: Theme.of(context).customTextStyles.d3pBodyLarge,
- );
-}
// ignore: prefer-single-widget-per-file
-class D3pDropdownButtonFormField extends DropdownButtonFormField {
- D3pDropdownButtonFormField({
+class D3pDropdownButton extends DropdownButtonFormField {
+ D3pDropdownButton({
required final BuildContext context,
required super.items,
required super.onChanged,
required super.value,
- required final String label,
+ // required final String label,
super.isExpanded,
super.key,
super.selectedItemBuilder,
+ super.validator,
+ final String? hint,
}) : super(
dropdownColor: Theme.of(context).customColors.scaffoldBackground,
- style: Theme.of(context).customTextStyles.d3pBodyLarge,
+ hint: Text(
+ hint ?? '',
+ style: Theme.of(context).customTextStyles.textInputHintStyle,
+ ),
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(horizontal: 8),
- label: Text(
- label.tr(),
- style: Theme.of(context).customTextStyles.d3pBodyMedium,
- ),
- focusedBorder: UnderlineInputBorder(
- borderSide: BorderSide(color: D3pThemeData.mainColor),
- ),
+ filled: true,
+ border: D3pDropdownTheme.border,
+ focusedBorder: D3pDropdownTheme.focusedBorder,
),
);
}
diff --git a/lib/core/widgets/buttons/elevated_button.dart b/lib/core/widgets/buttons/elevated_button.dart
index 400fb1d1..59e79375 100644
--- a/lib/core/widgets/buttons/elevated_button.dart
+++ b/lib/core/widgets/buttons/elevated_button.dart
@@ -54,6 +54,9 @@ class D3pElevatedButton extends StatelessWidget {
material: (final context, final platform) =>
MaterialElevatedButtonData(
style: ButtonStyle(
+ foregroundColor: foregroundColor != null
+ ? MaterialStateProperty.all(foregroundColor)
+ : null,
backgroundColor: backgroundColor != null
? MaterialStateProperty.all(backgroundColor)
: null,
@@ -97,12 +100,12 @@ class _ElevatedButtonChild extends StatelessWidget {
return Row(
mainAxisAlignment: childAlignment ?? MainAxisAlignment.center,
children: [
- (icon != null || iconData != null)
- ? _Icon(
- icon: icon,
- iconData: iconData,
- )
- : const SizedBox(),
+ if (icon != null || iconData != null)
+ _Icon(
+ icon: icon,
+ iconData: iconData,
+ isTextEmpty: text.isEmpty,
+ ),
Text(
text,
),
@@ -115,11 +118,15 @@ class _Icon extends StatelessWidget {
const _Icon({
required this.iconData,
required this.icon,
+ required this.isTextEmpty,
final Key? key,
}) : super(key: key);
final IconData? iconData;
final Widget? icon;
+ final bool isTextEmpty;
+
+ double get padding => isTextEmpty ? 0 : 8;
@override
Widget build(final BuildContext context) {
@@ -130,12 +137,12 @@ class _Icon extends StatelessWidget {
if (iconData != null) {
return Padding(
- padding: const EdgeInsets.only(right: 8),
+ padding: EdgeInsets.only(right: padding),
child: Icon(iconData),
);
} else if (icon != null) {
return Padding(
- padding: const EdgeInsets.only(right: 8),
+ padding: EdgeInsets.only(right: padding),
child: icon,
);
} else {
diff --git a/lib/core/widgets/buttons/enum_button.dart b/lib/core/widgets/buttons/enum_button.dart
index 3001bf60..b29ced48 100644
--- a/lib/core/widgets/buttons/enum_button.dart
+++ b/lib/core/widgets/buttons/enum_button.dart
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:threedpass/core/theme/d3p_special_colors.dart';
import 'package:threedpass/core/theme/d3p_theme.dart';
-import 'package:threedpass/core/utils/empty_function.dart';
class EnumButton extends StatelessWidget {
const EnumButton({
@@ -40,7 +39,7 @@ class EnumButton extends StatelessWidget {
padding: padding ?? EdgeInsets.zero,
child: SizedBox(
child: PlatformTextButton(
- onPressed: isChosen ? emptyFunction : onPressed,
+ onPressed: onPressed,
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
diff --git a/lib/core/widgets/buttons/icon_button.dart b/lib/core/widgets/buttons/icon_button.dart
index addbea38..50fe49f9 100644
--- a/lib/core/widgets/buttons/icon_button.dart
+++ b/lib/core/widgets/buttons/icon_button.dart
@@ -47,6 +47,7 @@ class D3pIconButton extends StatelessWidget {
padding: EdgeInsets.zero,
constraints: emptyContraints ? const BoxConstraints() : null,
splashRadius: splashRadius,
+ iconSize: size,
),
),
if (text != null) Text(text!),
diff --git a/lib/core/widgets/d3p_card.dart b/lib/core/widgets/d3p_card.dart
index 273f88ae..902c2d50 100644
--- a/lib/core/widgets/d3p_card.dart
+++ b/lib/core/widgets/d3p_card.dart
@@ -1,11 +1,14 @@
import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_card_theme.dart';
import 'package:threedpass/core/theme/d3p_special_colors.dart';
class D3pCard extends StatelessWidget {
final Widget child;
+ final CardShape cardShape;
const D3pCard({
required this.child,
+ this.cardShape = CardShape.all,
super.key,
});
@@ -14,8 +17,39 @@ class D3pCard extends StatelessWidget {
final bgColor = Theme.of(context).customColors.cardBackground;
return Card(
margin: EdgeInsets.zero,
+ shape: MapperCardShapeToBorder(cardShape).border(),
color: bgColor,
child: child,
);
}
}
+
+enum CardShape { top, middle, bottom, all }
+
+class MapperCardShapeToBorder {
+ final CardShape cardShape;
+
+ const MapperCardShapeToBorder(this.cardShape);
+
+ ShapeBorder border() {
+ final radius = D3pCardTheme.radius;
+
+ switch (cardShape) {
+ case CardShape.top:
+ return RoundedRectangleBorder(
+ borderRadius: BorderRadius.only(topLeft: radius, topRight: radius),
+ );
+ case CardShape.bottom:
+ return RoundedRectangleBorder(
+ borderRadius:
+ BorderRadius.only(bottomLeft: radius, bottomRight: radius),
+ );
+ case CardShape.middle:
+ return const RoundedRectangleBorder(borderRadius: BorderRadius.zero);
+ case CardShape.all:
+ return RoundedRectangleBorder(
+ borderRadius: BorderRadius.all(radius),
+ );
+ }
+ }
+}
diff --git a/lib/core/widgets/d3p_scaffold.dart b/lib/core/widgets/d3p_scaffold.dart
index 01e597f5..2a7f001c 100644
--- a/lib/core/widgets/d3p_scaffold.dart
+++ b/lib/core/widgets/d3p_scaffold.dart
@@ -10,8 +10,8 @@ class D3pScaffold extends StatelessWidget {
final bool translateAppbar;
const D3pScaffold({
- required this.body,
required this.appbarTitle,
+ required this.body,
this.removeBackButton,
this.translateAppbar = true,
super.key,
diff --git a/lib/core/widgets/input/textformfield/suffix_button.dart b/lib/core/widgets/input/textformfield/suffix_button.dart
index 7dcfcd77..d390a988 100644
--- a/lib/core/widgets/input/textformfield/suffix_button.dart
+++ b/lib/core/widgets/input/textformfield/suffix_button.dart
@@ -8,43 +8,39 @@ class _SuffixButton {
required this.onSuffixButtonPressed,
});
- final Widget? labelButton;
- final Widget? suffixButton;
+ final IconData? labelButton;
+ final IconData? suffixButton;
final void Function()? onLabelButtonPressed;
final void Function()? onSuffixButtonPressed;
Widget? build(final BuildContext context) {
+ final colors = Theme.of(context).customColors;
return labelButton != null || suffixButton != null
? Row(
mainAxisSize: MainAxisSize.min,
+ mainAxisAlignment: MainAxisAlignment.end,
children: [
- labelButton != null
- ? SizedBox(
- height: 40,
- width: 50,
- child: PlatformTextButton(
- padding: EdgeInsets.zero,
- onPressed: onLabelButtonPressed ?? emptyFunction,
- child: labelButton,
- ),
- )
- : const SizedBox(),
+ if (labelButton != null)
+ D3pIconButton(
+ emptyContraints: true,
+ iconData: labelButton!,
+ size: 20,
+ onPressed: onLabelButtonPressed,
+ iconColor: colors.themeOpposite,
+ ),
SizedBox(
- width: labelButton != null && suffixButton != null ? 8 : 0,
+ width: labelButton != null && suffixButton != null ? 16 : 0,
),
- suffixButton != null
- ? SizedBox(
- height: 40,
- width: 50,
- child: PlatformTextButton(
- padding: EdgeInsets.zero,
- onPressed: onSuffixButtonPressed ?? emptyFunction,
- child: suffixButton,
- ),
- )
- : const SizedBox(),
- const SizedBox(width: 4),
+ if (suffixButton != null)
+ D3pIconButton(
+ emptyContraints: true,
+ iconData: suffixButton!,
+ size: 20,
+ onPressed: onSuffixButtonPressed,
+ iconColor: colors.themeOpposite,
+ ),
+ const SizedBox(width: 8),
],
)
: null;
diff --git a/lib/core/widgets/input/textformfield/textformfield.dart b/lib/core/widgets/input/textformfield/textformfield.dart
index b7867dfb..90018434 100644
--- a/lib/core/widgets/input/textformfield/textformfield.dart
+++ b/lib/core/widgets/input/textformfield/textformfield.dart
@@ -1,10 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
-import 'package:threedpass/core/theme/d3p_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_colors.dart';
import 'package:threedpass/core/theme/d3p_special_styles.dart';
-import 'package:threedpass/core/theme/d3p_theme.dart';
-import 'package:threedpass/core/utils/empty_function.dart';
+import 'package:threedpass/core/theme/d3p_text_input_theme.dart';
+import 'package:threedpass/core/widgets/buttons/icon_button.dart';
import 'package:threedpass/core/widgets/paddings.dart';
part 'suffix_button.dart';
@@ -34,8 +33,8 @@ class D3pTextFormField extends StatelessWidget {
this.makeLabelOutside = false,
this.contentPadding =
const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
- this.focusedBorder,
- this.border,
+ // this.focusedBorder,
+ // this.border,
this.bottomWidget,
super.key,
}) : controller = controller ?? TextEditingController();
@@ -54,29 +53,23 @@ class D3pTextFormField extends StatelessWidget {
final String? hintText;
final List? inputFormatters;
final TextInputType? keyboardType;
- final Widget? labelButton;
+ final IconData? labelButton;
final String? labelText;
final int? maxLen;
final int? maxLines;
- final Widget? suffixButton;
+ final IconData? suffixButton;
final bool obscureText;
final bool isCollapsed;
final bool autofocus;
final EdgeInsetsGeometry contentPadding;
- final InputBorder? border;
- final InputBorder? focusedBorder;
final bool makeLabelOutside;
- TextStyle hintStyle(final CustomTextStyles textStyles) {
- return textStyles.d3pBodyMedium.copyWith(color: D3pColors.disabled);
- }
-
int? get mMaxLines => obscureText ? 1 : maxLines ?? 1;
// double? get mHeight => labelText == null ? 44 : null;
- InputBorder get defaultFocusedBorder => UnderlineInputBorder(
- borderSide: BorderSide(color: D3pThemeData.mainColor),
- );
+ // InputBorder get defaultFocusedBorder => OutlineInputBorder(
+ // borderSide: BorderSide(color: D3pThemeData.mainColor, width: 1),
+ // );
@override
Widget build(final BuildContext context) {
@@ -96,14 +89,14 @@ class D3pTextFormField extends StatelessWidget {
],
),
SizedBox(
- // height: 55,
+ // height: 48,
child: TextFormField(
style: textStyle.d3pBodyLarge,
decoration: InputDecoration(
- isDense: true,
+ isDense: false,
filled: true,
- border: border,
- focusedBorder: focusedBorder ?? defaultFocusedBorder,
+ border: D3pTextInputTheme.border,
+ focusedBorder: D3pTextInputTheme.focusedBorder,
contentPadding: contentPadding,
label: makeLabelOutside ? null : _Label(labelText).build(context),
suffixIcon: _SuffixButton(
@@ -113,7 +106,7 @@ class D3pTextFormField extends StatelessWidget {
onSuffixButtonPressed: onSuffixButtonPressed,
).build(context),
hintText: hintText,
- hintStyle: hintStyle(textStyle),
+ hintStyle: textStyle.textInputHintStyle,
isCollapsed: isCollapsed,
),
autofocus: autofocus,
diff --git a/lib/core/widgets/other/fast_rich_text.dart b/lib/core/widgets/other/fast_rich_text.dart
new file mode 100644
index 00000000..0a5d4a90
--- /dev/null
+++ b/lib/core/widgets/other/fast_rich_text.dart
@@ -0,0 +1,32 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+
+class FastRichText extends StatelessWidget {
+ const FastRichText({
+ required this.mainText,
+ required this.secondaryText,
+ super.key,
+ });
+
+ final String secondaryText;
+ final String mainText;
+
+ @override
+ Widget build(final BuildContext context) {
+ final medium = Theme.of(context).customTextStyles.d3pBodyMedium;
+
+ return Text.rich(
+ TextSpan(
+ text: secondaryText,
+ style: medium.copyWith(color: D3pColors.disabled),
+ children: [
+ TextSpan(
+ text: mainText,
+ style: medium,
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/core/widgets/other/padding_16.dart b/lib/core/widgets/other/padding_16.dart
new file mode 100644
index 00000000..2f9b44a3
--- /dev/null
+++ b/lib/core/widgets/other/padding_16.dart
@@ -0,0 +1,13 @@
+import 'package:flutter/material.dart';
+
+class Padding16 extends StatelessWidget {
+ final Widget child;
+
+ const Padding16({required this.child, super.key});
+
+ @override
+ Widget build(final BuildContext context) => Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: child,
+ );
+}
diff --git a/lib/core/widgets/other/right_chevron.dart b/lib/core/widgets/other/right_chevron.dart
index 9375da35..b4bc87d3 100644
--- a/lib/core/widgets/other/right_chevron.dart
+++ b/lib/core/widgets/other/right_chevron.dart
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
-import 'package:threedpass/core/theme/d3p_special_colors.dart';
class RightChevron extends StatelessWidget {
const RightChevron({
@@ -11,12 +10,10 @@ class RightChevron extends StatelessWidget {
@override
Widget build(final BuildContext context) {
- final colors = Theme.of(context).customColors;
- final iconColor = colors.moreFadedGrey;
return Icon(
Icons.arrow_forward_ios_outlined,
size: 16,
- color: color ?? iconColor,
+ color: color,
);
}
}
diff --git a/lib/core/widgets/screen_lock/d3p_screen_lock_theme.dart b/lib/core/widgets/screen_lock/d3p_screen_lock_theme.dart
index c49de214..f1fa4c93 100644
--- a/lib/core/widgets/screen_lock/d3p_screen_lock_theme.dart
+++ b/lib/core/widgets/screen_lock/d3p_screen_lock_theme.dart
@@ -1,6 +1,7 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screen_lock/flutter_screen_lock.dart';
+import 'package:threedpass/core/theme/d3p_card_theme.dart';
import 'package:threedpass/core/theme/d3p_special_colors.dart';
import 'package:threedpass/core/theme/d3p_special_styles.dart';
@@ -29,7 +30,11 @@ class D3pScreenLockTheme {
buttonStyle: OutlinedButton.styleFrom(
foregroundColor: colors.themeOpposite,
backgroundColor: colors.pinButtonBGColor,
- shape: const CircleBorder(),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.all(
+ D3pCardTheme.radius,
+ ),
+ ),
padding: const EdgeInsets.all(0),
side: BorderSide.none,
),
diff --git a/lib/core/widgets/text/d3p_body_medium_text.dart b/lib/core/widgets/text/d3p_body_medium_text.dart
index 547e9804..a43fe46e 100644
--- a/lib/core/widgets/text/d3p_body_medium_text.dart
+++ b/lib/core/widgets/text/d3p_body_medium_text.dart
@@ -6,12 +6,14 @@ class D3pBodyMediumText extends StatelessWidget {
final String text;
final bool translate;
final Color? color;
+ final TextAlign? textAlign;
const D3pBodyMediumText(
this.text, {
super.key,
this.translate = true,
this.color,
+ this.textAlign,
});
@override
@@ -23,6 +25,7 @@ class D3pBodyMediumText extends StatelessWidget {
.d3pBodyMedium
.copyWith(color: color),
translate: translate,
+ textAlign: textAlign,
);
}
}
diff --git a/lib/features/accounts/bloc/account_store_bloc/account_store_bloc.dart b/lib/features/accounts/bloc/account_store_bloc/account_store_bloc.dart
index 61def68d..e8461579 100644
--- a/lib/features/accounts/bloc/account_store_bloc/account_store_bloc.dart
+++ b/lib/features/accounts/bloc/account_store_bloc/account_store_bloc.dart
@@ -6,6 +6,7 @@ import 'package:polkawallet_sdk/api/types/recoveryInfo.dart';
import 'package:threedpass/core/polkawallet/app_service.dart';
import 'package:threedpass/features/accounts/domain/account_advanced_options.dart';
import 'package:threedpass/features/accounts/domain/account_info.dart';
+import 'package:threedpass/features/accounts/domain/rawseed_text.dart';
import 'package:threedpass/router/router.gr.dart';
part 'account_store_event.dart';
@@ -15,11 +16,11 @@ part 'account_store_bloc.g.dart';
class AccountStoreBloc extends Bloc {
AccountStoreBloc(this.outerContext) : super(_AccountStoreStateInitial()) {
on(_setCredentials);
- on(_setAccountSeed);
on(_generateMnemonicKey);
on(_popToRoout);
on(_changeAdvancedOptions);
on(_setMnemonic);
+ on(_setRawseed);
}
final BuildContext outerContext;
@@ -64,6 +65,21 @@ class AccountStoreBloc extends Bloc {
);
}
+ Future _setRawseed(
+ final SetRawseed event,
+ final Emitter emit,
+ ) async {
+ emit(
+ state.copyWith(
+ newAccount: AccountCreateSeed(
+ seed: event.rawseed.fixedSeed,
+ name: '',
+ password: '',
+ ),
+ ),
+ );
+ }
+
Future _generateMnemonicKey(
final GenerateMnemonicKey event,
final Emitter emit,
@@ -86,19 +102,4 @@ class AccountStoreBloc extends Bloc {
addError('Mnemonic was not generated');
}
}
-
- Future _setAccountSeed(
- final SetAccountSeed event,
- final Emitter emit,
- ) async {
- emit(
- state.copyWith(
- newAccount: AccountCreateSeed(
- seed: event.seed,
- name: '',
- password: '',
- ),
- ),
- );
- }
}
diff --git a/lib/features/accounts/bloc/account_store_bloc/account_store_event.dart b/lib/features/accounts/bloc/account_store_bloc/account_store_event.dart
index 65c685b8..f4537cca 100644
--- a/lib/features/accounts/bloc/account_store_bloc/account_store_event.dart
+++ b/lib/features/accounts/bloc/account_store_bloc/account_store_event.dart
@@ -14,14 +14,6 @@ class SetCredentials extends AccountStoreEvent {
final String password;
}
-class SetAccountSeed extends AccountStoreEvent {
- const SetAccountSeed({
- required this.seed,
- });
-
- final String seed;
-}
-
class GenerateMnemonicKey extends AccountStoreEvent {
const GenerateMnemonicKey(this.service, [this.key = '']);
@@ -35,6 +27,12 @@ class SetMnemonic extends AccountStoreEvent {
final String mnemonic;
}
+class SetRawseed extends AccountStoreEvent {
+ const SetRawseed(this.rawseed);
+
+ final RawseedText rawseed;
+}
+
class ResetAccount extends AccountStoreEvent {
const ResetAccount();
}
diff --git a/lib/features/accounts/bloc/address_icon_data_preview_cubit.dart b/lib/features/accounts/bloc/address_icon_data_preview_cubit.dart
index 12c2f4e8..21afde42 100644
--- a/lib/features/accounts/bloc/address_icon_data_preview_cubit.dart
+++ b/lib/features/accounts/bloc/address_icon_data_preview_cubit.dart
@@ -3,6 +3,7 @@ import 'package:polkawallet_sdk/api/apiKeyring.dart';
import 'package:polkawallet_sdk/api/types/addressIconData.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
import 'package:threedpass/core/polkawallet/constants.dart';
+import 'package:threedpass/features/accounts/domain/rawseed_text.dart';
class AddressIconDataPreviewCubit extends Cubit {
AddressIconDataPreviewCubit(this.appServiceCubit) : super(null);
@@ -25,6 +26,22 @@ class AddressIconDataPreviewCubit extends Cubit {
emit(addressInfo);
}
+ Future updateInfoFromRawseed(
+ final RawseedText inputRawseed, {
+ final CryptoType cryptoType = defaultCryptoType,
+ final String derivePath = '',
+ }) async {
+ final addressInfo =
+ await appServiceCubit.state.plugin.sdk.api.keyring.addressFromRawSeed(
+ appServiceCubit.state.networkStateData.ss58Format!,
+ cryptoType: cryptoType,
+ derivePath: derivePath,
+ rawSeed: inputRawseed.fixedSeed,
+ );
+
+ emit(addressInfo);
+ }
+
void dropInfo() {
emit(null);
}
diff --git a/lib/features/accounts/domain/rawseed_text.dart b/lib/features/accounts/domain/rawseed_text.dart
new file mode 100644
index 00000000..0960cc2a
--- /dev/null
+++ b/lib/features/accounts/domain/rawseed_text.dart
@@ -0,0 +1,9 @@
+class RawseedText {
+ final String rawInput;
+
+ const RawseedText(
+ this.rawInput,
+ );
+
+ String get fixedSeed => '0x$rawInput';
+}
diff --git a/lib/features/accounts/presentation/pages/create_account/create_account_from_object/create_account_from_object.dart b/lib/features/accounts/presentation/pages/create_account/create_account_from_object/create_account_from_object.dart
index 5141554f..c6cada93 100644
--- a/lib/features/accounts/presentation/pages/create_account/create_account_from_object/create_account_from_object.dart
+++ b/lib/features/accounts/presentation/pages/create_account/create_account_from_object/create_account_from_object.dart
@@ -10,6 +10,7 @@ import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
import 'package:threedpass/core/widgets/d3p_scaffold.dart';
import 'package:threedpass/core/widgets/paddings.dart';
import 'package:threedpass/features/accounts/bloc/account_store_bloc/account_store_bloc.dart';
+import 'package:threedpass/features/accounts/domain/rawseed_text.dart';
import 'package:threedpass/features/accounts/presentation/pages/account_page_template.dart';
import 'package:threedpass/features/accounts/presentation/widgets/header_info.dart';
import 'package:threedpass/features/accounts/presentation/widgets/text_info.dart';
diff --git a/lib/features/accounts/presentation/pages/create_account/create_account_from_object/widgets/submit_button.dart b/lib/features/accounts/presentation/pages/create_account/create_account_from_object/widgets/submit_button.dart
index baa33a66..14b9470e 100644
--- a/lib/features/accounts/presentation/pages/create_account/create_account_from_object/widgets/submit_button.dart
+++ b/lib/features/accounts/presentation/pages/create_account/create_account_from_object/widgets/submit_button.dart
@@ -7,7 +7,7 @@ class _SubmitButton extends StatelessWidget {
void onSubmit(final BuildContext context) {
BlocProvider.of(context).add(
- SetAccountSeed(seed: '0x' + chosenHash.value),
+ SetRawseed(RawseedText(chosenHash.value)),
);
context.router.push(
diff --git a/lib/features/accounts/presentation/pages/create_account/create_account_type.dart b/lib/features/accounts/presentation/pages/create_account/create_account_type.dart
index d759ae9d..eb7b5459 100644
--- a/lib/features/accounts/presentation/pages/create_account/create_account_type.dart
+++ b/lib/features/accounts/presentation/pages/create_account/create_account_type.dart
@@ -30,6 +30,7 @@ class CreateAccountTypePage extends StatelessWidget {
const SizedBoxH8(),
const _Item(CreateType.mnemonic),
const _D3ObjectItem(),
+ const _Item(CreateType.rawseed),
],
),
],
@@ -51,6 +52,9 @@ class _Item extends StatelessWidget {
case CreateType.mnemonic:
context.router.push(ImportMnemonicFormRoute());
break;
+ case CreateType.rawseed:
+ context.router.push(ImportRawseedFormRoute());
+ break;
}
}
@@ -58,6 +62,8 @@ class _Item extends StatelessWidget {
switch (createType) {
case CreateType.mnemonic:
return 'create_type_mnemonic'.tr();
+ case CreateType.rawseed:
+ return 'create_type_rawseed'.tr();
}
}
@@ -112,4 +118,4 @@ class _D3ObjectItem extends StatelessWidget {
}
}
-enum CreateType { mnemonic }
+enum CreateType { mnemonic, rawseed }
diff --git a/lib/features/accounts/presentation/pages/create_account/import_mnemonic_form.dart b/lib/features/accounts/presentation/pages/create_account/import_mnemonic_form.dart
index aa2c117b..57f23f08 100644
--- a/lib/features/accounts/presentation/pages/create_account/import_mnemonic_form.dart
+++ b/lib/features/accounts/presentation/pages/create_account/import_mnemonic_form.dart
@@ -77,7 +77,9 @@ class ImportMnemonicFormPage extends StatelessWidget {
),
needHorizontalPadding: false,
children: [
- const AddressIconPreview(),
+ const AddressIconPreview(
+ placeholderText: 'import_mnemonic_preview_placeholder',
+ ),
const SizedBox(height: 16),
Column(
children: [
diff --git a/lib/features/accounts/presentation/pages/create_account/import_rawseed_form.dart b/lib/features/accounts/presentation/pages/create_account/import_rawseed_form.dart
new file mode 100644
index 00000000..091ed746
--- /dev/null
+++ b/lib/features/accounts/presentation/pages/create_account/import_rawseed_form.dart
@@ -0,0 +1,82 @@
+import 'dart:async';
+
+import 'package:auto_route/auto_route.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/polkawallet/app_service.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/features/accounts/bloc/account_store_bloc/account_store_bloc.dart';
+import 'package:threedpass/features/accounts/domain/rawseed_text.dart';
+import 'package:threedpass/features/accounts/presentation/pages/account_page_template.dart';
+import 'package:threedpass/features/accounts/presentation/widgets/import_mnemonic_form/address_icon_preview.dart';
+import 'package:threedpass/features/accounts/presentation/widgets/import_mnemonic_form/address_icon_preview_cubit_provider.dart';
+import 'package:threedpass/features/accounts/presentation/widgets/import_rawseed_form/import_rawseed_textfield.dart';
+import 'package:threedpass/router/router.gr.dart';
+
+@RoutePage()
+class ImportRawseedFormPage extends StatelessWidget {
+ ImportRawseedFormPage({final Key? key}) : super(key: key);
+
+ final _formKey = GlobalKey();
+ final TextEditingController controller = TextEditingController();
+
+ Future onSubmitPressed({
+ required final BuildContext innerContext,
+ required final BuildContext outerContext,
+ required final AppService appService,
+ required final String rawseedInput,
+ }) async {
+ // Check user input
+ if (_formKey.currentState != null && _formKey.currentState!.validate()) {
+ final input = rawseedInput.trim().toLowerCase();
+ final accountStoreBloc = BlocProvider.of(innerContext);
+ final rawseedObj = RawseedText(input);
+ accountStoreBloc.add(SetRawseed(rawseedObj));
+ unawaited(
+ innerContext.router.push(
+ CreateAccountCredentialsRoute(
+ appbarText: AccountAppbarTitle.import,
+ ),
+ ),
+ );
+ }
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ final AppService appService =
+ BlocProvider.of(context).state;
+
+ return AddressIconPreviewCubitProvider(
+ child: AccountPageTemplate.import(
+ onSubmitPressed: (final inner) => onSubmitPressed(
+ innerContext: inner,
+ outerContext: context,
+ appService: appService,
+ rawseedInput: controller.text,
+ ),
+ needHorizontalPadding: false,
+ children: [
+ const AddressIconPreview(
+ placeholderText: 'import_rawseed_preview_placeholder',
+ ),
+ const SizedBoxH16(),
+ Column(
+ children: [
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Form(
+ key: _formKey,
+ child: ImportRawseedTextfield(
+ textEditingController: controller,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/features/accounts/presentation/widgets/create_account_form.dart b/lib/features/accounts/presentation/widgets/create_account_form.dart
index e47fbc8c..95cb7bc7 100644
--- a/lib/features/accounts/presentation/widgets/create_account_form.dart
+++ b/lib/features/accounts/presentation/widgets/create_account_form.dart
@@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:threedpass/core/utils/validators.dart';
import 'package:threedpass/core/widgets/input/textformfield/textformfield.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
import 'package:threedpass/features/accounts/presentation/pages/account_page_template.dart';
class CreateAccountForm extends StatelessWidget {
@@ -53,20 +54,20 @@ class CreateAccountForm extends StatelessWidget {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
- const SizedBox(height: 16),
+ const SizedBoxH16(),
D3pTextFormField(
labelText: 'create_credentials_name'.tr(),
controller: _nameCtrl,
validator: _nameValidator,
),
- const SizedBox(height: 16),
+ const SizedBoxH16(),
D3pTextFormField(
labelText: 'create_credentials_password'.tr(),
controller: _passCtrl,
obscureText: true,
validator: _passValidator,
),
- const SizedBox(height: 16),
+ const SizedBoxH16(),
D3pTextFormField(
labelText: 'create_credentials_password2'.tr(),
controller: _pass2Ctrl,
diff --git a/lib/features/accounts/presentation/widgets/import_mnemonic_form/address_icon_preview.dart b/lib/features/accounts/presentation/widgets/import_mnemonic_form/address_icon_preview.dart
index 25860f36..11e780ef 100644
--- a/lib/features/accounts/presentation/widgets/import_mnemonic_form/address_icon_preview.dart
+++ b/lib/features/accounts/presentation/widgets/import_mnemonic_form/address_icon_preview.dart
@@ -6,7 +6,17 @@ import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
import 'package:threedpass/features/accounts/bloc/address_icon_data_preview_cubit.dart';
class AddressIconPreview extends StatelessWidget {
- const AddressIconPreview({final Key? key}) : super(key: key);
+ // final bool isRawseed;
+ // final Function(bool)? callBackAddressNull;
+
+ final String placeholderText;
+
+ const AddressIconPreview({
+ required this.placeholderText,
+ final Key? key,
+ // this.isRawseed = false,
+ // this.callBackAddressNull,
+ }) : super(key: key);
@override
Widget build(final BuildContext context) {
@@ -15,11 +25,10 @@ class AddressIconPreview extends StatelessWidget {
child: BlocBuilder(
builder: (final context, final state) {
if (state == null || state.address == null) {
- return const Center(
- child: D3pBodyMediumText('import_mnemonic_preview_placeholder'),
+ return Center(
+ child: D3pBodyMediumText(placeholderText),
);
}
-
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.symmetric(horizontal: 16),
diff --git a/lib/features/accounts/presentation/widgets/import_rawseed_form/import_rawseed_textfield.dart b/lib/features/accounts/presentation/widgets/import_rawseed_form/import_rawseed_textfield.dart
new file mode 100644
index 00000000..cab4f659
--- /dev/null
+++ b/lib/features/accounts/presentation/widgets/import_rawseed_form/import_rawseed_textfield.dart
@@ -0,0 +1,58 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/input/textformfield/textformfield.dart';
+import 'package:threedpass/features/accounts/bloc/address_icon_data_preview_cubit.dart';
+import 'package:threedpass/features/accounts/domain/rawseed_text.dart';
+
+class ImportRawseedTextfield extends StatelessWidget {
+ const ImportRawseedTextfield({
+ required this.textEditingController,
+ final Key? key,
+ }) : super(key: key);
+
+ final TextEditingController textEditingController;
+
+ /// https://github.com/polkawallet-io/app/blob/48821c58b19b2e6df17200bc0c5d10bf5577ac41/lib/pages/account/import/importAccountFromRawSeed.dart
+ static String? _validateInput(final String? v) {
+ bool passed = false;
+ if (v != null) {
+ final String input = v.trim().toLowerCase();
+ //if (input.isNotEmpty && (input.length <= 32 || input.length == 66)) {
+ //TODO 3dPass uses Sha-256, so always 64?
+ if (input.isNotEmpty && input.length == 64) {
+ passed = true;
+ }
+ }
+ return passed ? null : 'Invalid'.tr() + ' ' + 'import_type_rawseed'.tr();
+ }
+
+ void changeAddressIconPreview(final String? s, final BuildContext context) {
+ if (s != null) {
+ final String rawseed = s.trim().toLowerCase();
+ //if (input.isNotEmpty && (input.length <= 32 || input.length == 66)) {
+ //TODO 3dPass uses Sha-256, so always 64?
+ if (rawseed.length == 64) {
+ final rawseedObj = RawseedText(rawseed);
+
+ BlocProvider.of(context)
+ .updateInfoFromRawseed(rawseedObj);
+ } else {
+ BlocProvider.of(context).dropInfo();
+ }
+ } else {
+ BlocProvider.of(context).dropInfo();
+ }
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ return D3pTextFormField(
+ labelText: 'import_type_rawseed'.tr(),
+ hintText: 'import_rawseed_hint'.tr(),
+ controller: textEditingController,
+ validator: _validateInput,
+ onChanged: (final value) => changeAddressIconPreview(value, context),
+ );
+ }
+}
diff --git a/lib/features/accounts/router/create_account_page_route.dart b/lib/features/accounts/router/create_account_page_route.dart
index bafa4e60..5707cd51 100644
--- a/lib/features/accounts/router/create_account_page_route.dart
+++ b/lib/features/accounts/router/create_account_page_route.dart
@@ -40,5 +40,8 @@ AutoRoute createAccountPageRoute = AutoRoute(
AutoRoute(
page: ImportMnemonicFormRoute.page,
),
+ AutoRoute(
+ page: ImportRawseedFormRoute.page,
+ ),
],
);
diff --git a/lib/features/app/presentation/global_states_provider.dart b/lib/features/app/presentation/global_states_provider.dart
index f3eeba6d..feb5343c 100644
--- a/lib/features/app/presentation/global_states_provider.dart
+++ b/lib/features/app/presentation/global_states_provider.dart
@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart';
+import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cubit.dart';
import 'package:threedpass/features/scan_page/bloc/scan_isolate_cubit.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/setup.dart' as di_setup;
@@ -34,6 +35,10 @@ class GlobalStatesProvider extends StatelessWidget {
BlocProvider(
create: (final _) => ScanIsolateCubit(),
),
+ BlocProvider(
+ create: (final _) => di_setup.getIt(),
+ lazy: false,
+ ),
],
child: PlatformProvider(
settings: PlatformSettingsData(
diff --git a/lib/features/compare_page/presentation/pages/compare_page.dart b/lib/features/compare_page/presentation/pages/compare_page.dart
index e685b350..04fed668 100644
--- a/lib/features/compare_page/presentation/pages/compare_page.dart
+++ b/lib/features/compare_page/presentation/pages/compare_page.dart
@@ -14,18 +14,18 @@ class ComparePage extends StatelessWidget {
appbarTitle: 'compare_page_appbar',
body: Column(
children: [
- Flexible(
- child: Padding(
- padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
- child: CompareRow(),
- ),
+ Padding(
+ padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+ child: CompareRow(),
),
Divider(
- height: 15,
- thickness: 3,
- color: Colors.black,
+ height: 16,
+ thickness: 2,
+ // color: Colors.black,
+ ),
+ Flexible(
+ child: CompareTable(),
),
- CompareTable(),
],
),
);
diff --git a/lib/features/compare_page/presentation/widgets/compare_table/app_table_row.dart b/lib/features/compare_page/presentation/widgets/compare_table/app_table_row.dart
index 47b57190..9c95bfef 100644
--- a/lib/features/compare_page/presentation/widgets/compare_table/app_table_row.dart
+++ b/lib/features/compare_page/presentation/widgets/compare_table/app_table_row.dart
@@ -17,12 +17,12 @@ class AppTableRow extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Row(
children: [
- D3pBodyMediumText(
- rowData.rank1,
- translate: false,
- ),
- const SizedBox(
+ SizedBox(
width: 48,
+ child: D3pBodyMediumText(
+ rowData.rank1,
+ translate: false,
+ ),
),
Flexible(
child: Text(
@@ -32,12 +32,13 @@ class AppTableRow extends StatelessWidget {
),
),
),
- const SizedBox(
+ SizedBox(
width: 48,
- ),
- D3pBodyMediumText(
- rowData.rank2,
- translate: false,
+ child: D3pBodyMediumText(
+ rowData.rank2,
+ translate: false,
+ textAlign: TextAlign.end,
+ ),
),
],
),
diff --git a/lib/features/compare_page/presentation/widgets/compare_table/compare_table.dart b/lib/features/compare_page/presentation/widgets/compare_table/compare_table.dart
index 5ef0a26c..347de622 100644
--- a/lib/features/compare_page/presentation/widgets/compare_table/compare_table.dart
+++ b/lib/features/compare_page/presentation/widgets/compare_table/compare_table.dart
@@ -37,6 +37,7 @@ class CompareTable extends StatelessWidget {
const SizedBoxH16(),
Flexible(
child: ListView.separated(
+ padding: const EdgeInsets.only(bottom: 24),
shrinkWrap: true,
itemBuilder: (final context, final index) =>
AppTableRow(rowData: rowsData[index]),
@@ -67,17 +68,52 @@ class RowsData {
List build() {
final rowsData = [];
- for (final mainHash in mainObject.hashes) {
- if (objectToCompare.hashes.contains(mainHash)) {
- rowsData.add(
- RowData(
- rank1: (mainObject.hashes.indexOf(mainHash) + 1).toString(),
- hash: mainHash,
- rank2: (objectToCompare.hashes.indexOf(mainHash) + 1).toString(),
- isStableHash: stableHashes.contains(mainHash),
- ),
- );
+ final setOfAdded = {};
+
+ final allMainHashes = mainObject.hashes;
+
+ int j = 0; // second object counter
+
+ for (int i = 0; i < allMainHashes.length; i++) {
+ final hash = allMainHashes[i];
+ if (hash.isEmpty) continue;
+
+ setOfAdded.add(hash);
+
+ final sndObjHasHash = objectToCompare.hashes.contains(hash);
+
+ if (sndObjHasHash) {
+ j++;
}
+
+ rowsData.add(
+ RowData(
+ rank1: (i + 1).toString(),
+ hash: hash,
+ rank2: sndObjHasHash ? '$j' : '',
+ isStableHash: stableHashes.contains(hash),
+ ),
+ );
+ }
+
+ final sndHashes = objectToCompare.hashes;
+
+ for (int i = 0; i < sndHashes.length; i++) {
+ final hash = sndHashes[i];
+ if (hash.isEmpty) continue;
+
+ if (setOfAdded.contains(hash)) continue;
+
+ j++;
+
+ rowsData.add(
+ RowData(
+ rank1: '',
+ hash: hash,
+ rank2: '$j',
+ isStableHash: stableHashes.contains(hash),
+ ),
+ );
}
return rowsData;
diff --git a/lib/features/hashes_list/domain/entities/matches_count.dart b/lib/features/hashes_list/domain/entities/matches_count.dart
index 91a0310b..198da084 100644
--- a/lib/features/hashes_list/domain/entities/matches_count.dart
+++ b/lib/features/hashes_list/domain/entities/matches_count.dart
@@ -3,6 +3,7 @@ import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart';
/// Calc how many snapshots include same hashes as the given snapshot
class MatchesCount {
+ // TODO Use it somewhere
final HashObject? object;
final Snapshot snapshot;
diff --git a/lib/features/hashes_list/domain/entities/snapshot.dart b/lib/features/hashes_list/domain/entities/snapshot.dart
index 7fa15dea..ed5408f8 100644
--- a/lib/features/hashes_list/domain/entities/snapshot.dart
+++ b/lib/features/hashes_list/domain/entities/snapshot.dart
@@ -72,6 +72,7 @@ class Snapshot {
for (final snap in hashObject.snapshots) {
setOfHashes.addAll(snap.hashes);
}
+ setOfHashes.remove('');
// find at least one common hash
bool hasCommonHash = false;
@@ -83,4 +84,8 @@ class Snapshot {
return hasCommonHash;
}
+
+ bool get withEmptyHashes {
+ return hashes.isEmpty || (hashes.first.isEmpty && hashes.length == 1);
+ }
}
diff --git a/lib/features/hashes_list/presentation/widgets/hashes_primitive_list.dart b/lib/features/hashes_list/presentation/widgets/hashes_primitive_list.dart
index 785c69b6..da013fc7 100644
--- a/lib/features/hashes_list/presentation/widgets/hashes_primitive_list.dart
+++ b/lib/features/hashes_list/presentation/widgets/hashes_primitive_list.dart
@@ -1,29 +1,23 @@
import 'package:flutter/material.dart';
-import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart';
import 'package:threedpass/features/hashes_list/presentation/widgets/hash_primitive_item.dart';
class HashesPrimitiveList extends StatelessWidget {
const HashesPrimitiveList({
- required this.hashesModel,
+ required this.hashes,
final Key? key,
}) : super(key: key);
- final Snapshot hashesModel;
+ final List hashes;
@override
Widget build(final BuildContext context) {
- final int len = hashesModel.hashes.length;
- return Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: List.generate(
- len,
- (final int index) => Padding(
- padding: const EdgeInsets.symmetric(vertical: 8),
- child: HashPrimitiveItem(
- hash: hashesModel.hashes[index],
- ),
- ),
+ return ListView.builder(
+ physics: const NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ // padding: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
+ itemCount: hashes.length,
+ itemBuilder: (final context, final index) => HashPrimitiveItem(
+ hash: '${index + 1}. ${hashes[index]}',
),
);
}
diff --git a/lib/features/home_page/router/home_page_route.dart b/lib/features/home_page/router/home_page_route.dart
index bb41a6c2..0323c9c4 100644
--- a/lib/features/home_page/router/home_page_route.dart
+++ b/lib/features/home_page/router/home_page_route.dart
@@ -2,7 +2,7 @@ import 'package:auto_route/auto_route.dart';
import 'package:threedpass/features/home_page/router/pin_code_guard.dart';
import 'package:threedpass/features/scan_page/router/scan_page_route.dart';
import 'package:threedpass/features/settings_page/router/settings_page_route.dart';
-import 'package:threedpass/features/wallet_screen/router/wallet_page_route.dart';
+import 'package:threedpass/features/wallet_screen/wallet_page_route.dart';
import 'package:threedpass/router/router.gr.dart';
AutoRoute initialAutoRoute = AutoRoute(
diff --git a/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.dart b/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.dart
new file mode 100644
index 00000000..48aca1a9
--- /dev/null
+++ b/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.dart
@@ -0,0 +1,74 @@
+import 'package:copy_with_extension/copy_with_extension.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:logger/logger.dart';
+import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart';
+import 'package:threedpass/features/poscan_objects_query/domain/usecase/get_obj_count_usecase.dart';
+import 'package:threedpass/features/poscan_objects_query/domain/usecase/get_uploaded_object.dart';
+import 'package:threedpass/setup.dart';
+
+part 'poscan_objects_cubit.g.dart';
+
+@CopyWith()
+class PoscanObjectsState {
+ final List objects;
+ final PoscanObjectStateStatus status;
+
+ const PoscanObjectsState({
+ required this.objects,
+ required this.status,
+ });
+
+ const PoscanObjectsState.initial()
+ : objects = const [],
+ status = PoscanObjectStateStatus.loaded;
+}
+
+enum PoscanObjectStateStatus {
+ loading,
+ loaded,
+}
+
+class PoscanObjectsCubit extends Cubit {
+ PoscanObjectsCubit({
+ required this.getObjCount,
+ required this.getUploadedObject,
+ }) : super(const PoscanObjectsState.initial());
+
+ final GetObjCount getObjCount;
+ final GetUploadedObject getUploadedObject;
+
+ // int get lastLoadedId => state.objects.isEmpty ? 0 : state.objects.last.id;
+ // bool get isLoadedFull => state.length == ;
+
+ Future loadAll() async {
+ emit(state.copyWith(status: PoscanObjectStateStatus.loading));
+
+ final countEither = await getObjCount.call(null);
+ await countEither.when(
+ left: (final e) {
+ getIt().e("Could not load objects count from poscan. $e");
+ },
+ right: (final objLen) async {
+ final indicies = List.generate(objLen, (final index) => index);
+ await Future.forEach(indicies, (final i) async {
+ final objEither = await getUploadedObject.call(i);
+ objEither.when(
+ left: (final e) => getIt()
+ .e("Could not load object id=$i from poscan. $e"),
+ right: (final obj) => emit(
+ state.copyWith(
+ objects: state.objects + [obj],
+ ),
+ ),
+ );
+ });
+ },
+ );
+
+ emit(state.copyWith(status: PoscanObjectStateStatus.loaded));
+ }
+
+ void clear() {
+ emit(const PoscanObjectsState.initial());
+ }
+}
diff --git a/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.g.dart b/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.g.dart
new file mode 100644
index 00000000..3a2992a4
--- /dev/null
+++ b/lib/features/poscan_objects_query/bloc/poscan_objects_cubit.g.dart
@@ -0,0 +1,70 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'poscan_objects_cubit.dart';
+
+// **************************************************************************
+// CopyWithGenerator
+// **************************************************************************
+
+abstract class _$PoscanObjectsStateCWProxy {
+ PoscanObjectsState objects(List objects);
+
+ PoscanObjectsState status(PoscanObjectStateStatus status);
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PoscanObjectsState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// PoscanObjectsState(...).copyWith(id: 12, name: "My name")
+ /// ````
+ PoscanObjectsState call({
+ List? objects,
+ PoscanObjectStateStatus? status,
+ });
+}
+
+/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPoscanObjectsState.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPoscanObjectsState.copyWith.fieldName(...)`
+class _$PoscanObjectsStateCWProxyImpl implements _$PoscanObjectsStateCWProxy {
+ const _$PoscanObjectsStateCWProxyImpl(this._value);
+
+ final PoscanObjectsState _value;
+
+ @override
+ PoscanObjectsState objects(List objects) =>
+ this(objects: objects);
+
+ @override
+ PoscanObjectsState status(PoscanObjectStateStatus status) =>
+ this(status: status);
+
+ @override
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PoscanObjectsState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// PoscanObjectsState(...).copyWith(id: 12, name: "My name")
+ /// ````
+ PoscanObjectsState call({
+ Object? objects = const $CopyWithPlaceholder(),
+ Object? status = const $CopyWithPlaceholder(),
+ }) {
+ return PoscanObjectsState(
+ objects: objects == const $CopyWithPlaceholder() || objects == null
+ ? _value.objects
+ // ignore: cast_nullable_to_non_nullable
+ : objects as List,
+ status: status == const $CopyWithPlaceholder() || status == null
+ ? _value.status
+ // ignore: cast_nullable_to_non_nullable
+ : status as PoscanObjectStateStatus,
+ );
+ }
+}
+
+extension $PoscanObjectsStateCopyWith on PoscanObjectsState {
+ /// Returns a callable class that can be used as follows: `instanceOfPoscanObjectsState.copyWith(...)` or like so:`instanceOfPoscanObjectsState.copyWith.fieldName(...)`.
+ // ignore: library_private_types_in_public_api
+ _$PoscanObjectsStateCWProxy get copyWith =>
+ _$PoscanObjectsStateCWProxyImpl(this);
+}
diff --git a/lib/features/poscan_objects_query/data/storage_poscan_repo.dart b/lib/features/poscan_objects_query/data/storage_poscan_repo.dart
new file mode 100644
index 00000000..d498ced8
--- /dev/null
+++ b/lib/features/poscan_objects_query/data/storage_poscan_repo.dart
@@ -0,0 +1,72 @@
+import 'package:super_core/super_core.dart';
+import 'package:threedpass/core/errors/parse_failure.dart';
+import 'package:threedpass/core/errors/type_mismatch.dart';
+import 'package:threedpass/core/polkawallet/app_service.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/core/polkawallet/failures.dart';
+import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart';
+
+class StoragePoscanRepository {
+ final AppServiceLoaderCubit appServiceLoaderCubit;
+
+ StoragePoscanRepository({
+ required this.appServiceLoaderCubit,
+ });
+
+ Future> objCount() async {
+ if (appServiceLoaderCubit.state.status != AppServiceInitStatus.connected) {
+ return const Either.left(AppServiceIsNotInitialized());
+ }
+
+ final dynamic res =
+ await appServiceLoaderCubit.state.plugin.sdk.api.universal.callNoSign(
+ second: 'poScan',
+ third: 'objCount',
+ args: null,
+ );
+
+ final resStr = res.toString();
+ final maybeInt = int.tryParse(resStr);
+ if (maybeInt != null) {
+ return Either.right(maybeInt);
+ } else {
+ return Either.left(NoDataFailure(resStr));
+ }
+ }
+
+ Future> objects(
+ final int id,
+ ) async {
+ if (appServiceLoaderCubit.state.status != AppServiceInitStatus.connected) {
+ return const Either.left(AppServiceIsNotInitialized());
+ }
+
+ final dynamic res =
+ await appServiceLoaderCubit.state.plugin.sdk.api.universal.callNoSign(
+ second: 'poScan',
+ third: 'objects',
+ args: ['$id'],
+ );
+ if (res is Map) {
+ try {
+ return Either.right(
+ UploadedObjectFabric(id: id, raw: res).object(),
+ );
+ } on Object catch (e) {
+ return Either.left(
+ ParseFailure(
+ 'Could not parse UploadedObject ' + e.toString(),
+ ),
+ );
+ }
+ } else {
+ return Either.left(
+ TypeMismatch(
+ varName: 'res',
+ expected: 'Map',
+ actual: res.runtimeType.toString(),
+ ),
+ );
+ }
+ }
+}
diff --git a/lib/features/poscan_objects_query/di_polkadot_query.dart b/lib/features/poscan_objects_query/di_polkadot_query.dart
new file mode 100644
index 00000000..499a1f6c
--- /dev/null
+++ b/lib/features/poscan_objects_query/di_polkadot_query.dart
@@ -0,0 +1,37 @@
+import 'package:get_it/get_it.dart';
+import 'package:super_core/super_core.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cubit.dart';
+import 'package:threedpass/features/poscan_objects_query/data/storage_poscan_repo.dart';
+import 'package:threedpass/features/poscan_objects_query/domain/usecase/get_obj_count_usecase.dart';
+import 'package:threedpass/features/poscan_objects_query/domain/usecase/get_uploaded_object.dart';
+
+class DIPoscanQuery extends DIModule {
+ @override
+ Future setup(final GetIt getIt) async {
+ getIt.registerSingleton(
+ StoragePoscanRepository(
+ appServiceLoaderCubit: getIt(),
+ ),
+ );
+
+ getIt.registerSingleton(
+ GetObjCount(
+ repository: getIt(),
+ ),
+ );
+
+ getIt.registerSingleton(
+ GetUploadedObject(
+ repository: getIt(),
+ ),
+ );
+
+ getIt.registerSingleton(
+ PoscanObjectsCubit(
+ getObjCount: getIt(),
+ getUploadedObject: getIt(),
+ ),
+ );
+ }
+}
diff --git a/lib/features/poscan_objects_query/domain/entities/uploaded_object.dart b/lib/features/poscan_objects_query/domain/entities/uploaded_object.dart
new file mode 100644
index 00000000..ad1a6649
--- /dev/null
+++ b/lib/features/poscan_objects_query/domain/entities/uploaded_object.dart
@@ -0,0 +1,49 @@
+class UploadedObject {
+ final Map raw;
+ final int id;
+ final String owner;
+ final List hashes;
+ final String status;
+
+ const UploadedObject({
+ required this.id,
+ required this.raw,
+ required this.owner,
+ required this.hashes,
+ required this.status,
+ });
+}
+
+class UploadedObjectFabric {
+ final int id;
+ final Map raw;
+
+ const UploadedObjectFabric({
+ required this.id,
+ required this.raw,
+ });
+
+ String owner() {
+ return raw['owner'] as String;
+ }
+
+ List hashes() {
+ return (raw['hashes'] as List)
+ .map((final dynamic e) => e.toString().substring(2))
+ .toList();
+ }
+
+ String status() {
+ return (raw['state'] as Map).keys.first.toString();
+ }
+
+ UploadedObject object() {
+ return UploadedObject(
+ id: id,
+ raw: raw,
+ owner: owner(),
+ hashes: hashes(),
+ status: status(),
+ );
+ }
+}
diff --git a/lib/features/poscan_objects_query/domain/usecase/get_obj_count_usecase.dart b/lib/features/poscan_objects_query/domain/usecase/get_obj_count_usecase.dart
new file mode 100644
index 00000000..bb6a5c3e
--- /dev/null
+++ b/lib/features/poscan_objects_query/domain/usecase/get_obj_count_usecase.dart
@@ -0,0 +1,19 @@
+import 'package:super_core/super_core.dart';
+import 'package:threedpass/core/utils/usecase.dart';
+import 'package:threedpass/features/poscan_objects_query/data/storage_poscan_repo.dart';
+
+class GetObjCount extends UseCase {
+ final StoragePoscanRepository repository;
+
+ const GetObjCount({
+ required this.repository,
+ });
+
+ @override
+ Future> call(
+ final void params,
+ ) async {
+ final res = await repository.objCount();
+ return res;
+ }
+}
diff --git a/lib/features/poscan_objects_query/domain/usecase/get_uploaded_object.dart b/lib/features/poscan_objects_query/domain/usecase/get_uploaded_object.dart
new file mode 100644
index 00000000..47bd2e06
--- /dev/null
+++ b/lib/features/poscan_objects_query/domain/usecase/get_uploaded_object.dart
@@ -0,0 +1,24 @@
+import 'package:super_core/super_core.dart';
+import 'package:threedpass/core/utils/usecase.dart';
+import 'package:threedpass/features/poscan_objects_query/data/storage_poscan_repo.dart';
+import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart';
+
+class GetUploadedObject extends UseCase {
+ final StoragePoscanRepository repository;
+
+ const GetUploadedObject({
+ required this.repository,
+ });
+
+ @override
+ Future> call(
+ final int id,
+ ) async {
+ final res = await repository.objects(id);
+
+ return res.when(
+ left: (final e) => Either.left(e),
+ right: (final obj) => Either.right(obj),
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/bloc/poscan_putobject_cubit.dart b/lib/features/poscan_putobject/bloc/poscan_putobject_cubit.dart
new file mode 100644
index 00000000..a2b9910e
--- /dev/null
+++ b/lib/features/poscan_putobject/bloc/poscan_putobject_cubit.dart
@@ -0,0 +1,146 @@
+import 'dart:async';
+
+import 'package:auto_route/auto_route.dart';
+import 'package:copy_with_extension/copy_with_extension.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:fluttertoast/fluttertoast.dart';
+import 'package:polkawallet_sdk/storage/types/keyPairData.dart';
+import 'package:threedpass/core/widgets/default_loading_dialog.dart';
+import 'package:threedpass/features/poscan_putobject/domain/entities/poscan_categories.dart';
+import 'package:threedpass/features/poscan_putobject/domain/entities/poscan_property.dart';
+import 'package:threedpass/features/poscan_putobject/domain/usecases/put_object_usecase.dart';
+import 'package:threedpass/features/preview_page/bloc/outer_context_cubit.dart';
+
+part 'poscan_putobject_cubit.g.dart';
+
+@CopyWith()
+class D3PRPCCubitState {
+ final KeyPairData account;
+ final List chosenHashes;
+ final List properties;
+ final MapPoscanCategory chosenCategory;
+
+ const D3PRPCCubitState({
+ required this.account,
+ required this.chosenHashes,
+ required this.properties,
+ required this.chosenCategory,
+ });
+}
+
+class PoscanPutObjectCubit extends Cubit {
+ PoscanPutObjectCubit({
+ required this.fileHash,
+ required this.filePath,
+ required this.putObjectUseCase,
+ required this.localSnapshotName,
+ required final List initialHashes,
+ required final KeyPairData initialAccount,
+ }) : super(
+ D3PRPCCubitState(
+ account: initialAccount,
+ chosenHashes: initialHashes,
+ properties: [],
+ chosenCategory: PoscanCategories.first,
+ ),
+ );
+
+ final PutObject putObjectUseCase;
+
+ final TextEditingController nApprovalsController =
+ TextEditingController(text: '10');
+ final TextEditingController accountPassword = TextEditingController();
+ final int fileHash;
+ final String filePath;
+ final String localSnapshotName;
+
+ bool fastCheckPassed = false;
+
+ void toggleHash(final String hash) {
+ if (state.chosenHashes.contains(hash)) {
+ removeHash(hash);
+ } else {
+ addHash(hash);
+ }
+ }
+
+ void addHash(final String hash) {
+ final newList = List.from(state.chosenHashes);
+ newList.add(hash);
+
+ emit(state.copyWith(chosenHashes: newList));
+ }
+
+ void removeHash(final String hash) {
+ final newList = List.from(state.chosenHashes);
+ newList.remove(hash);
+
+ emit(state.copyWith(chosenHashes: newList));
+ }
+
+ void toggleProp(final PoscanProperty prop) {
+ if (state.properties.contains(prop)) {
+ removeProp(prop);
+ } else {
+ addProp(prop);
+ }
+ }
+
+ void addProp(final PoscanProperty prop) {
+ final newList = List.from(state.properties);
+ newList.add(prop);
+
+ emit(state.copyWith(properties: newList));
+ }
+
+ void removeProp(final PoscanProperty prop) {
+ final newList = List.from(state.properties);
+ newList.remove(prop);
+
+ emit(state.copyWith(properties: newList));
+ }
+
+ void changeCategory(final MapPoscanCategory cat) {
+ emit(state.copyWith(chosenCategory: cat));
+ }
+
+ void setAcc(final KeyPairData acc) {
+ emit(state.copyWith(account: acc));
+ }
+
+ Future submit(BuildContext context) async {
+ DefaultLoadingDialog.show(context);
+
+ fastCheckPassed = false;
+
+ final params = PutObjectParams(
+ localSnapshotName: localSnapshotName,
+ account: state.account,
+ password: accountPassword.text,
+ nApprovals: int.parse(nApprovalsController.text),
+ pathToFile: filePath,
+ categoryFabric: state.chosenCategory,
+ hashes: state.chosenHashes,
+ propValues: state.properties.map((final e) => e.propValue).toList(),
+ updateStatus: () {
+ fastCheckPassed = true;
+ DefaultLoadingDialog.hide(context);
+ BlocProvider.of(context).state.router.pop();
+ },
+ );
+ final res = await putObjectUseCase.call(params);
+
+ if (!fastCheckPassed) {
+ String message = '';
+ res.when(
+ left: (final f) {
+ message = f.cause ?? '';
+ },
+ right: (final _) {},
+ );
+ DefaultLoadingDialog.hide(context);
+ unawaited(Fluttertoast.showToast(msg: message));
+ }
+ }
+}
diff --git a/lib/features/poscan_putobject/bloc/poscan_putobject_cubit.g.dart b/lib/features/poscan_putobject/bloc/poscan_putobject_cubit.g.dart
new file mode 100644
index 00000000..e1f21977
--- /dev/null
+++ b/lib/features/poscan_putobject/bloc/poscan_putobject_cubit.g.dart
@@ -0,0 +1,95 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'poscan_putobject_cubit.dart';
+
+// **************************************************************************
+// CopyWithGenerator
+// **************************************************************************
+
+abstract class _$D3PRPCCubitStateCWProxy {
+ D3PRPCCubitState account(KeyPairData account);
+
+ D3PRPCCubitState chosenHashes(List chosenHashes);
+
+ D3PRPCCubitState properties(List properties);
+
+ D3PRPCCubitState chosenCategory(MapPoscanCategory chosenCategory);
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `D3PRPCCubitState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// D3PRPCCubitState(...).copyWith(id: 12, name: "My name")
+ /// ````
+ D3PRPCCubitState call({
+ KeyPairData? account,
+ List? chosenHashes,
+ List? properties,
+ MapPoscanCategory? chosenCategory,
+ });
+}
+
+/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfD3PRPCCubitState.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfD3PRPCCubitState.copyWith.fieldName(...)`
+class _$D3PRPCCubitStateCWProxyImpl implements _$D3PRPCCubitStateCWProxy {
+ const _$D3PRPCCubitStateCWProxyImpl(this._value);
+
+ final D3PRPCCubitState _value;
+
+ @override
+ D3PRPCCubitState account(KeyPairData account) => this(account: account);
+
+ @override
+ D3PRPCCubitState chosenHashes(List chosenHashes) =>
+ this(chosenHashes: chosenHashes);
+
+ @override
+ D3PRPCCubitState properties(List properties) =>
+ this(properties: properties);
+
+ @override
+ D3PRPCCubitState chosenCategory(MapPoscanCategory chosenCategory) =>
+ this(chosenCategory: chosenCategory);
+
+ @override
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `D3PRPCCubitState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// D3PRPCCubitState(...).copyWith(id: 12, name: "My name")
+ /// ````
+ D3PRPCCubitState call({
+ Object? account = const $CopyWithPlaceholder(),
+ Object? chosenHashes = const $CopyWithPlaceholder(),
+ Object? properties = const $CopyWithPlaceholder(),
+ Object? chosenCategory = const $CopyWithPlaceholder(),
+ }) {
+ return D3PRPCCubitState(
+ account: account == const $CopyWithPlaceholder() || account == null
+ ? _value.account
+ // ignore: cast_nullable_to_non_nullable
+ : account as KeyPairData,
+ chosenHashes:
+ chosenHashes == const $CopyWithPlaceholder() || chosenHashes == null
+ ? _value.chosenHashes
+ // ignore: cast_nullable_to_non_nullable
+ : chosenHashes as List,
+ properties:
+ properties == const $CopyWithPlaceholder() || properties == null
+ ? _value.properties
+ // ignore: cast_nullable_to_non_nullable
+ : properties as List,
+ chosenCategory: chosenCategory == const $CopyWithPlaceholder() ||
+ chosenCategory == null
+ ? _value.chosenCategory
+ // ignore: cast_nullable_to_non_nullable
+ : chosenCategory as MapPoscanCategory,
+ );
+ }
+}
+
+extension $D3PRPCCubitStateCopyWith on D3PRPCCubitState {
+ /// Returns a callable class that can be used as follows: `instanceOfD3PRPCCubitState.copyWith(...)` or like so:`instanceOfD3PRPCCubitState.copyWith.fieldName(...)`.
+ // ignore: library_private_types_in_public_api
+ _$D3PRPCCubitStateCWProxy get copyWith => _$D3PRPCCubitStateCWProxyImpl(this);
+}
diff --git a/lib/features/poscan_putobject/data/poscan_repository.dart b/lib/features/poscan_putobject/data/poscan_repository.dart
new file mode 100644
index 00000000..4428d266
--- /dev/null
+++ b/lib/features/poscan_putobject/data/poscan_repository.dart
@@ -0,0 +1,70 @@
+import 'dart:io';
+
+import 'package:logger/logger.dart';
+import 'package:super_core/super_core.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/features/poscan_putobject/domain/usecases/put_object_usecase.dart';
+import 'package:threedpass/setup.dart';
+
+class PoScanRepository {
+ const PoScanRepository({
+ required this.appServiceLoaderCubit,
+ });
+
+ final AppServiceLoaderCubit appServiceLoaderCubit;
+
+ Future> putObject({
+ required final PutObjectParams params,
+ required final void Function() updateStatus,
+ required final void Function(String) msgIdCallback,
+ }) async {
+ final poscanApi = appServiceLoaderCubit.state.plugin.sdk.api.poscan;
+
+ try {
+ final file = File(params.pathToFile);
+ final bytes = file.readAsBytesSync();
+ // print(params.pathToFile);
+ // print(file.readAsBytesSync());
+ // print(file.readAsBytesSync().length);
+ // print('0x${bytes.toList().map((e) => e.toRadixString(16)).join('')}');
+
+ // return const Either.left(NoDataFailure('res is not a Map'));
+
+ bool flag = true;
+
+ final dynamic res = await poscanApi.putObject(
+ pubKey: params.account.pubKey!,
+ password: params.password,
+ category: params.categoryFabric.build(),
+ file: bytes,
+ nApprovals: params.nApprovals,
+ hashes: params.hashes,
+ propValue: params.propValues,
+ onStatusChange: (final p0) {
+ // print('$p0');
+ if (flag) {
+ updateStatus();
+ flag = false;
+ }
+ },
+ msgIdCallback: msgIdCallback,
+ );
+ getIt().d(res);
+ if (res is Map) {
+ final String key = res.keys.first as String;
+ if (key == 'error') {
+ return Either.left(NoDataFailure(res[key].toString()));
+ } else {
+ return Either.right(res.values.join(''));
+ }
+ } else {
+ return const Either.left(NoDataFailure('res is not a Map'));
+ }
+ } on Object catch (e) {
+ getIt().e(e);
+ return Either.left(NoDataFailure(e.toString()));
+ }
+ }
+}
+
+enum D3pRPCError { a, b }
diff --git a/lib/features/poscan_putobject/di_preview_page.dart b/lib/features/poscan_putobject/di_preview_page.dart
new file mode 100644
index 00000000..01bc76ee
--- /dev/null
+++ b/lib/features/poscan_putobject/di_preview_page.dart
@@ -0,0 +1,25 @@
+import 'package:get_it/get_it.dart';
+import 'package:super_core/super_core.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/features/poscan_putobject/data/poscan_repository.dart';
+import 'package:threedpass/features/poscan_putobject/domain/usecases/put_object_usecase.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+
+class DIPreviewPage extends DIModule {
+ @override
+ Future setup(final GetIt getIt) async {
+ getIt.registerSingleton(
+ PoScanRepository(
+ appServiceLoaderCubit: getIt(),
+ ),
+ );
+
+ getIt.registerLazySingleton(
+ () => PutObject(
+ repository: getIt(),
+ notificationsBloc: getIt(),
+ appServiceLoaderCubit: getIt(),
+ ),
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/domain/entities/poscan_categories.dart b/lib/features/poscan_putobject/domain/entities/poscan_categories.dart
new file mode 100644
index 00000000..24e317ea
--- /dev/null
+++ b/lib/features/poscan_putobject/domain/entities/poscan_categories.dart
@@ -0,0 +1,44 @@
+class PoscanCategories {
+ final String catName;
+ final List subCats;
+
+ const PoscanCategories._(this.catName, this.subCats);
+
+ static MapPoscanCategory first = MapPoscanCategory(
+ cat: allCats.first.catName,
+ subCat: allCats.first.subCats.first,
+ );
+
+ static List allCats = [
+ objects3d,
+ // drawings2d,
+ // music,
+ // biometrics,
+ // movements,
+ ];
+
+ static PoscanCategories objects3d = const PoscanCategories._(
+ 'objects3d',
+ ['grid2dLow'], // 'grid2dHigh'
+ );
+ static PoscanCategories drawings2d =
+ const PoscanCategories._('drawings2d', []);
+ static PoscanCategories music = const PoscanCategories._('music', []);
+ static PoscanCategories biometrics =
+ const PoscanCategories._('biometrics', []);
+ static PoscanCategories movements = const PoscanCategories._('movements', []);
+}
+
+class MapPoscanCategory {
+ const MapPoscanCategory({
+ required this.cat,
+ required this.subCat,
+ });
+
+ final String cat;
+ final String subCat;
+
+ Map build() {
+ return {cat: subCat};
+ }
+}
diff --git a/lib/features/poscan_putobject/domain/entities/poscan_property.dart b/lib/features/poscan_putobject/domain/entities/poscan_property.dart
new file mode 100644
index 00000000..3001b3d1
--- /dev/null
+++ b/lib/features/poscan_putobject/domain/entities/poscan_property.dart
@@ -0,0 +1,11 @@
+import 'package:polkawallet_sdk/p3d/prop_value.dart';
+
+class PoscanProperty {
+ final String name;
+ final PropValue propValue;
+
+ const PoscanProperty({
+ required this.name,
+ required this.propValue,
+ });
+}
diff --git a/lib/features/poscan_putobject/domain/entities/put_object_global_handler.dart b/lib/features/poscan_putobject/domain/entities/put_object_global_handler.dart
new file mode 100644
index 00000000..11f4ef10
--- /dev/null
+++ b/lib/features/poscan_putobject/domain/entities/put_object_global_handler.dart
@@ -0,0 +1,40 @@
+import 'package:threedpass/core/polkawallet/utils/basic_event_logs_handler.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+
+class PutObjectGlobalHandler extends BasicEventLogsHandler {
+ final NotificationsBloc notificationsBloc;
+ final NotificationPutObject initialN;
+
+ const PutObjectGlobalHandler({
+ required super.msgId,
+ required this.notificationsBloc,
+ required this.initialN,
+ required super.webViewRunner,
+ });
+
+ void updateNotification(final ExtrinsicStatus status, final String? message) {
+ final notificationNew = initialN.copyWith(
+ status: status,
+ message: message,
+ );
+ notificationsBloc.add(
+ UpdateNotification(
+ newN: notificationNew,
+ oldN: initialN,
+ ),
+ );
+ }
+
+ @override
+ void onError(final String msg) =>
+ updateNotification(ExtrinsicStatus.error, msg);
+
+ @override
+ void onExtrinsicFailed(final String msg) =>
+ updateNotification(ExtrinsicStatus.failed, msg);
+
+ @override
+ void onExtrinsicSuccess() =>
+ updateNotification(ExtrinsicStatus.success, null);
+}
diff --git a/lib/features/poscan_putobject/domain/usecases/put_object_usecase.dart b/lib/features/poscan_putobject/domain/usecases/put_object_usecase.dart
new file mode 100644
index 00000000..7f4afc3a
--- /dev/null
+++ b/lib/features/poscan_putobject/domain/usecases/put_object_usecase.dart
@@ -0,0 +1,112 @@
+import 'package:polkawallet_sdk/p3d/prop_value.dart';
+import 'package:polkawallet_sdk/storage/types/keyPairData.dart';
+import 'package:super_core/super_core.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/core/utils/usecase.dart';
+import 'package:threedpass/features/poscan_putobject/data/poscan_repository.dart';
+import 'package:threedpass/features/poscan_putobject/domain/entities/poscan_categories.dart';
+import 'package:threedpass/features/poscan_putobject/domain/entities/put_object_global_handler.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+
+class PutObject extends UseCase {
+ final PoScanRepository repository;
+ final NotificationsBloc notificationsBloc;
+ final AppServiceLoaderCubit appServiceLoaderCubit;
+
+ const PutObject({
+ required this.repository,
+ required this.notificationsBloc,
+ required this.appServiceLoaderCubit,
+ });
+
+ @override
+ Future> call(
+ final PutObjectParams params,
+ ) async {
+ final notificationLoading = NotificationPutObject(
+ account: params.account,
+ localSnapshotName: params.localSnapshotName,
+ status: ExtrinsicStatus.loading,
+ message: null,
+ );
+
+ notificationsBloc.add(
+ AddNotification(notificationLoading),
+ );
+
+ final res = await repository.putObject(
+ params: params,
+ updateStatus: () {
+ params.updateStatus();
+ },
+ msgIdCallback: (final msgId) {
+ appServiceLoaderCubit.state.plugin.sdk.api.service.webView!
+ .addGlobalHandler(
+ PutObjectGlobalHandler(
+ msgId: msgId,
+ notificationsBloc: notificationsBloc,
+ initialN: notificationLoading,
+ webViewRunner:
+ appServiceLoaderCubit.state.plugin.sdk.api.service.webView!,
+ ),
+ );
+ },
+ );
+
+ // updateNotification(notificationLoading, res, innerFastCheckPassed);
+
+ return res;
+ }
+
+ /// Set the result of extrinsic
+ // void updateNotification(
+ // final NotificationPutObject initialN,
+ // final Either res,
+ // final bool innerFastCheckPassed,
+ // ) {
+ // res.when(
+ // left: (final e) {
+ // final notificationError = initialN.copyWith(
+ // status: innerFastCheckPassed
+ // ? ExtrinsicStatus.failed
+ // : ExtrinsicStatus.error,
+ // message: e.cause,
+ // );
+ // notificationsBloc.add(
+ // UpdateNotification(
+ // newN: notificationError,
+ // oldN: initialN,
+ // ),
+ // );
+ // },
+ // right: (final res) {
+ // // Just close loading dialog and exit from putobject screnn
+ // },
+ // );
+ // }
+}
+
+class PutObjectParams {
+ const PutObjectParams({
+ required this.account,
+ required this.password,
+ required this.nApprovals,
+ required this.pathToFile,
+ required this.categoryFabric,
+ required this.hashes,
+ required this.propValues,
+ required this.updateStatus,
+ required this.localSnapshotName,
+ });
+
+ final KeyPairData account;
+ final String password;
+ final int nApprovals;
+ final String pathToFile;
+ final MapPoscanCategory categoryFabric;
+ final List hashes;
+ final List? propValues;
+ final void Function() updateStatus;
+ final String localSnapshotName;
+}
diff --git a/lib/features/poscan_putobject/presentation/d3prpc_page.dart b/lib/features/poscan_putobject/presentation/d3prpc_page.dart
new file mode 100644
index 00000000..63159e96
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/d3prpc_page.dart
@@ -0,0 +1,40 @@
+import 'package:auto_route/auto_route.dart';
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/widgets/d3p_scaffold.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/choose_account.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/choose_approvals.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/choose_category.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/choose_file.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/choose_hashes.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/choose_properties.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/putobject_submit_button.dart';
+
+@RoutePage()
+class D3PRPCPage extends StatelessWidget {
+ const D3PRPCPage({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ return const D3pScaffold(
+ appbarTitle: 'upload_to_3d_rpc_title',
+ body: SingleChildScrollView(
+ child: Padding16(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ ChooseFile(),
+ ChooseAccount(),
+ ChooseCategory(),
+ ChooseApprovals(),
+ ChooseHashes(),
+ ChooseProperties(),
+ PutObjectSubmitButton(),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/d3rpc_page_wrapper.dart b/lib/features/poscan_putobject/presentation/d3rpc_page_wrapper.dart
new file mode 100644
index 00000000..ee14e892
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/d3rpc_page_wrapper.dart
@@ -0,0 +1,39 @@
+import 'package:auto_route/auto_route.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/features/poscan_putobject/bloc/poscan_putobject_cubit.dart';
+import 'package:threedpass/features/poscan_putobject/domain/usecases/put_object_usecase.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:threedpass/setup.dart';
+
+@RoutePage()
+class D3PRPCPageWrapper extends StatelessWidget implements AutoRouteWrapper {
+ const D3PRPCPageWrapper({super.key});
+
+ @override
+ Widget wrappedRoute(final BuildContext context) {
+ final state = BlocProvider.of(context).state;
+ final fileHash = state.snapshot.fileHash;
+
+ final appService = BlocProvider.of(context).state;
+ final initialAccount = appService.keyring.current;
+
+ return BlocProvider(
+ create: (final context) => PoscanPutObjectCubit(
+ fileHash: fileHash,
+ filePath: state.snapshot.realPath,
+ initialAccount: initialAccount,
+ initialHashes: state.snapshot.hashes,
+ localSnapshotName: state.snapshot.name,
+ putObjectUseCase: getIt(),
+ ),
+ child: this,
+ );
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ return const AutoRouter();
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/widgets/choose_account.dart b/lib/features/poscan_putobject/presentation/widgets/choose_account.dart
new file mode 100644
index 00000000..38d591d2
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/widgets/choose_account.dart
@@ -0,0 +1,61 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:polkawallet_sdk/storage/types/keyPairData.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/core/polkawallet/widgets/account_choose_tile_text.dart';
+import 'package:threedpass/core/utils/empty_function.dart';
+import 'package:threedpass/core/widgets/buttons/dropdown_button.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
+import 'package:threedpass/features/poscan_putobject/bloc/poscan_putobject_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transfer_page/widgets/basic_password_text_field.dart';
+
+class ChooseAccount extends StatelessWidget {
+ const ChooseAccount({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final cubit = BlocProvider.of(context);
+
+ final appService = BlocProvider.of(context).state;
+ final accounts = appService.keyring.allAccounts;
+
+ return Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const SizedBoxH16(),
+ const D3pBodyMediumText('poscan_putobject_choose_account'),
+ const SizedBoxH4(),
+ D3pDropdownButton(
+ context: context,
+ isExpanded: true,
+ items: accounts
+ .map>(
+ (final e) => DropdownMenuItem(
+ value: e,
+ child: AccountChooseTileText(
+ name: e.name,
+ address: e.address,
+ ),
+ ),
+ )
+ .toList(),
+ onChanged: (final obj) =>
+ obj != null ? cubit.setAcc(obj) : emptyFunction(),
+ value: accounts.firstWhere(
+ (final element) => cubit.state.account.pubKey == element.pubKey,
+ ),
+ validator: (final value) =>
+ value == null ? 'account_never_null'.tr() : null,
+ ),
+ const SizedBoxH4(),
+ BasicPasswordTextField(
+ passwordController: cubit.accountPassword,
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/widgets/choose_approvals.dart b/lib/features/poscan_putobject/presentation/widgets/choose_approvals.dart
new file mode 100644
index 00000000..7e873f30
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/widgets/choose_approvals.dart
@@ -0,0 +1,39 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/input/textformfield/textformfield.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
+import 'package:threedpass/features/poscan_putobject/bloc/poscan_putobject_cubit.dart';
+
+class ChooseApprovals extends StatelessWidget {
+ const ChooseApprovals({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final cubit = BlocProvider.of(context);
+
+ return Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const SizedBoxH16(),
+ const D3pBodyMediumText('poscan_putobject_choose_napprovals'),
+ const SizedBoxH4(),
+ D3pTextFormField(
+ controller: cubit.nApprovalsController,
+ hintText: 'n_approvals_hint'.tr(),
+ validator: validate,
+ keyboardType: TextInputType.number,
+ ),
+ ],
+ );
+ }
+
+ String? validate(final String? p0) {
+ final res = int.tryParse(p0 ?? '');
+
+ return res != null && res > 0 ? null : 'error_wrong_amount_int'.tr();
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/widgets/choose_category.dart b/lib/features/poscan_putobject/presentation/widgets/choose_category.dart
new file mode 100644
index 00000000..9f05736b
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/widgets/choose_category.dart
@@ -0,0 +1,76 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/widgets/buttons/enum_button.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
+import 'package:threedpass/features/poscan_putobject/bloc/poscan_putobject_cubit.dart';
+import 'package:threedpass/features/poscan_putobject/domain/entities/poscan_categories.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/open_bottom_sheet.dart';
+import 'package:threedpass/features/poscan_putobject/utils/capitalize_first.dart';
+
+class ChooseCategory extends StatelessWidget {
+ const ChooseCategory({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final textStyles = Theme.of(context).customTextStyles;
+
+ return OpenBottomSheet(
+ unlocalizedSubtitle: 'poscan_putobject_choose_category',
+ buttonIconData: Icons.check_box_outline_blank_outlined,
+ buttonTextChild: BlocBuilder(
+ buildWhen: (final previous, final current) =>
+ previous.chosenCategory != current.chosenCategory,
+ builder: (final context, final state) => D3pBodyMediumText(
+ '${state.chosenCategory.cat.capitalizeFirst()} -> ${state.chosenCategory.subCat.capitalizeFirst()}',
+ translate: false,
+ ),
+ ),
+ bottomSheetPlatform: BlocBuilder(
+ buildWhen: (final previous, final current) =>
+ previous.chosenCategory != current.chosenCategory,
+ builder: (final context, final state) => ListView.builder(
+ shrinkWrap: true,
+ itemCount: PoscanCategories.allCats.length,
+ itemBuilder: (final context, final index) {
+ final cat = PoscanCategories.allCats[index];
+ return Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Padding16(
+ child: Text(
+ cat.catName.capitalizeFirst(),
+ style: textStyles.secondaryText,
+ ),
+ ),
+ cat.subCats.isEmpty
+ ? const SizedBoxH16()
+ : ListView.builder(
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ itemCount: cat.subCats.length,
+ itemBuilder: (final context, final index) => EnumButton(
+ text: cat.subCats[index].capitalizeFirst(),
+ onPressed: () =>
+ BlocProvider.of(context)
+ .changeCategory(
+ MapPoscanCategory(
+ cat: cat.catName,
+ subCat: cat.subCats[index],
+ ),
+ ),
+ isChosen: state.chosenCategory.cat == cat.catName &&
+ state.chosenCategory.subCat == cat.subCats[index],
+ ),
+ ),
+ ],
+ );
+ },
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/widgets/choose_file.dart b/lib/features/poscan_putobject/presentation/widgets/choose_file.dart
new file mode 100644
index 00000000..f5c12b31
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/widgets/choose_file.dart
@@ -0,0 +1,27 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_large_text.dart';
+import 'package:threedpass/features/poscan_putobject/bloc/poscan_putobject_cubit.dart';
+
+class ChooseFile extends StatelessWidget {
+ const ChooseFile({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final cubit = BlocProvider.of(context);
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const SizedBoxH16(),
+ D3pBodyLargeText(
+ 'chosen_file_to_upload_to_3drpc'
+ .tr(args: [cubit.fileHash.toString()]),
+ translate: false,
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/widgets/choose_hashes.dart b/lib/features/poscan_putobject/presentation/widgets/choose_hashes.dart
new file mode 100644
index 00000000..a1373cda
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/widgets/choose_hashes.dart
@@ -0,0 +1,28 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+
+class ChooseHashes extends StatelessWidget {
+ const ChooseHashes({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final state = BlocProvider.of(context).state;
+
+ return Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const SizedBoxH16(),
+ const D3pBodyMediumText('poscan_putobject_choose_hashes'),
+ const SizedBoxH4(),
+ D3pBodyMediumText(
+ state.snapshot.hashes.join('\n'),
+ translate: false,
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/widgets/choose_properties.dart b/lib/features/poscan_putobject/presentation/widgets/choose_properties.dart
new file mode 100644
index 00000000..882f6c76
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/widgets/choose_properties.dart
@@ -0,0 +1,64 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:polkawallet_sdk/p3d/prop_value.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/widgets/buttons/enum_button.dart';
+import 'package:threedpass/features/poscan_putobject/bloc/poscan_putobject_cubit.dart';
+import 'package:threedpass/features/poscan_putobject/domain/entities/poscan_property.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/open_bottom_sheet.dart';
+import 'package:threedpass/features/poscan_putobject/presentation/widgets/property_tile_text.dart';
+
+class ChooseProperties extends StatelessWidget {
+ const ChooseProperties({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final textStyle = Theme.of(context).customTextStyles;
+
+ // Non-fungible - 0, Share - 1
+ final List properties = [
+ PoscanProperty(
+ name: 'Non-fungible',
+ propValue: PropValue(maxValue: BigInt.one, propIdx: 0),
+ ),
+ PoscanProperty(
+ name: 'Share',
+ propValue: PropValue(maxValue: BigInt.from(100000000), propIdx: 1),
+ ),
+ ];
+ return OpenBottomSheet(
+ unlocalizedSubtitle: 'poscan_putobject_choose_properties',
+ bottomSheetPlatform: BlocBuilder(
+ builder: (final context, final state) => ListView.builder(
+ shrinkWrap: true,
+ itemCount: properties.length,
+ itemBuilder: (final context, final index) {
+ final prop = properties.elementAt(index);
+ return EnumButton(
+ text: null,
+ isChosen: state.properties.contains(prop),
+ onPressed: () => BlocProvider.of(context)
+ .toggleProp(prop),
+ child: PropertyTileText(
+ prop: prop,
+ isChosen: state.properties.contains(prop),
+ ),
+ );
+ },
+ ),
+ ),
+ buttonIconData: Icons.add,
+ buttonTextChild: BlocBuilder(
+ buildWhen: (final previous, final current) =>
+ previous.properties != current.properties,
+ builder: (final context, final state) => Text(
+ 'PROPERTIES_number_plural'.plural(
+ state.properties.length,
+ ),
+ style: textStyle.d3pBodyMedium,
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/widgets/open_bottom_sheet.dart b/lib/features/poscan_putobject/presentation/widgets/open_bottom_sheet.dart
new file mode 100644
index 00000000..88155043
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/widgets/open_bottom_sheet.dart
@@ -0,0 +1,75 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
+import 'package:threedpass/core/theme/d3p_bottom_sheet_theme.dart';
+import 'package:threedpass/core/theme/d3p_special_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
+
+class OpenBottomSheet extends StatelessWidget {
+ const OpenBottomSheet({
+ required this.bottomSheetPlatform,
+ required this.buttonIconData,
+ required this.buttonTextChild,
+ required this.unlocalizedSubtitle,
+ super.key,
+ });
+
+ final Widget bottomSheetPlatform;
+ final String unlocalizedSubtitle;
+ final Widget buttonTextChild;
+ final IconData buttonIconData;
+
+ Future openDialog(
+ final BuildContext context,
+ ) {
+ return showPlatformModalSheet(
+ context: context,
+ material: D3pBottonSheetTheme.materialTheme,
+ builder: (final _) => Column(
+ children: [
+ const SizedBoxH24(),
+ Flexible(
+ child: bottomSheetPlatform,
+ ),
+ ],
+ ),
+ );
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ final textStyle = Theme.of(context).customTextStyles;
+ final colors = Theme.of(context).customColors;
+
+ return Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const SizedBoxH16(),
+ D3pBodyMediumText(unlocalizedSubtitle),
+ const SizedBoxH4(),
+ D3pElevatedButton(
+ text: null,
+ onPressed: () => openDialog(context),
+ backgroundColor: colors.cardBackground,
+ elevation: 1,
+ childAlignment: MainAxisAlignment.start,
+ textStyle: textStyle.d3pBodyMedium,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ buttonTextChild,
+ Icon(
+ buttonIconData,
+ color: colors.themeOpposite,
+ ),
+ ],
+ ),
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/widgets/property_tile_text.dart b/lib/features/poscan_putobject/presentation/widgets/property_tile_text.dart
new file mode 100644
index 00000000..24ab4521
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/widgets/property_tile_text.dart
@@ -0,0 +1,115 @@
+import 'dart:ui';
+
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/theme/d3p_theme.dart';
+import 'package:threedpass/features/poscan_putobject/domain/entities/poscan_property.dart';
+
+class PropertyTileText extends StatelessWidget {
+ const PropertyTileText({
+ required this.prop,
+ required this.isChosen,
+ super.key,
+ });
+
+ final PoscanProperty prop;
+ final bool isChosen;
+
+ TextSpan formattedMaxValue(
+ final BigInt maxValue,
+ final TextStyle enabledStyle,
+ ) {
+ if (maxValue == BigInt.from(1) || maxValue == BigInt.from(10)) {
+ return TextSpan(
+ text: maxValue.toString(),
+ style: enabledStyle,
+ );
+ }
+ final str = maxValue.toString();
+ final correctNumPattern = RegExp(r'^1[0]*');
+ final matches = correctNumPattern.allMatches(str);
+
+ if (matches.length == 1 && matches.first.group(0) == str) {
+ int res = 1;
+ final big10 = BigInt.from(10);
+ BigInt tmp = maxValue;
+ while (tmp > big10) {
+ tmp = tmp ~/ big10;
+ res++;
+ }
+ return TextSpan(
+ text: '10^',
+ style: enabledStyle,
+ children: [
+ TextSpan(
+ text: res.toString(),
+ style: enabledStyle.copyWith(
+ fontFeatures: [
+ const FontFeature.superscripts(),
+ ],
+ ),
+ ),
+ ],
+ );
+ } else {
+ return TextSpan(
+ text: maxValue.toString(),
+ style: enabledStyle,
+ );
+ }
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ final theme = Theme.of(context);
+ final textStyles = theme.customTextStyles;
+ final enabledStyle = textStyles.d3pBodyMedium.copyWith(
+ color:
+ isChosen ? D3pThemeData.mainColor : theme.customColors.themeOpposite,
+ );
+ final disabledStyle =
+ textStyles.d3pBodyMedium.copyWith(color: D3pColors.disabled);
+ return Row(
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Expanded(
+ flex: 4,
+ child: Text(
+ prop.name,
+ style: enabledStyle,
+ ),
+ ),
+ Expanded(
+ flex: 1,
+ child: Text.rich(
+ TextSpan(
+ text: ' id: ',
+ style: disabledStyle,
+ children: [
+ TextSpan(
+ text: prop.propValue.propIdx.toString(),
+ style: enabledStyle,
+ ),
+ ],
+ ),
+ ),
+ ),
+ Expanded(
+ flex: 4,
+ child: Text.rich(
+ TextSpan(
+ text: ' max_value: ',
+ style: disabledStyle,
+ children: [
+ formattedMaxValue(prop.propValue.maxValue, enabledStyle),
+ ],
+ ),
+ ),
+ ),
+ ],
+ );
+ // return '${fixedName()}${shortAddress()}';
+ }
+}
diff --git a/lib/features/poscan_putobject/presentation/widgets/putobject_submit_button.dart b/lib/features/poscan_putobject/presentation/widgets/putobject_submit_button.dart
new file mode 100644
index 00000000..202c5718
--- /dev/null
+++ b/lib/features/poscan_putobject/presentation/widgets/putobject_submit_button.dart
@@ -0,0 +1,36 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/features/poscan_putobject/bloc/poscan_putobject_cubit.dart';
+
+class PutObjectSubmitButton extends StatelessWidget {
+ const PutObjectSubmitButton({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final textStyle = Theme.of(context).customTextStyles;
+
+ return Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const SizedBoxH24(),
+ Text(
+ 'poscan_putobject_fees_warning'.tr(),
+ style: textStyle.secondaryText,
+ ),
+ const SizedBox(height: 2),
+ D3pElevatedButton(
+ text: 'Submit'.tr(),
+ onPressed: () =>
+ BlocProvider.of(context).submit(context),
+ ),
+ const SizedBoxH24(),
+ ],
+ );
+ }
+}
diff --git a/lib/features/poscan_putobject/utils/capitalize_first.dart b/lib/features/poscan_putobject/utils/capitalize_first.dart
new file mode 100644
index 00000000..60b1aac3
--- /dev/null
+++ b/lib/features/poscan_putobject/utils/capitalize_first.dart
@@ -0,0 +1,5 @@
+extension CapFirst on String {
+ String capitalizeFirst() {
+ return '${this[0].toUpperCase()}${substring(1)}';
+ }
+}
diff --git a/lib/features/preview_page/bloc/preview_page_cubit.dart b/lib/features/preview_page/bloc/preview_page_cubit.dart
index 2d1a9207..79334761 100644
--- a/lib/features/preview_page/bloc/preview_page_cubit.dart
+++ b/lib/features/preview_page/bloc/preview_page_cubit.dart
@@ -13,8 +13,13 @@ abstract class PreviewPageCubitState {
});
HashObject? get hashObject;
+ PreviewSnapshotType get psType;
final Snapshot snapshot;
+
+ bool get isNew =>
+ psType == PreviewSnapshotType.newObject ||
+ psType == PreviewSnapshotType.newSnapshot;
}
class PreviewNewObject extends PreviewPageCubitState {
@@ -24,6 +29,9 @@ class PreviewNewObject extends PreviewPageCubitState {
@override
HashObject? get hashObject => null;
+
+ @override
+ PreviewSnapshotType get psType => PreviewSnapshotType.newObject;
}
class PreviewNewSnapshot extends PreviewPageCubitState {
@@ -34,6 +42,9 @@ class PreviewNewSnapshot extends PreviewPageCubitState {
@override
final HashObject hashObject;
+
+ @override
+ PreviewSnapshotType get psType => PreviewSnapshotType.newSnapshot;
}
class PreviewExistingSnapshot extends PreviewPageCubitState {
@@ -44,4 +55,9 @@ class PreviewExistingSnapshot extends PreviewPageCubitState {
@override
final HashObject hashObject;
+
+ @override
+ PreviewSnapshotType get psType => PreviewSnapshotType.existingSnapshot;
}
+
+enum PreviewSnapshotType { newObject, newSnapshot, existingSnapshot }
diff --git a/lib/features/preview_page/presentation/preview_page.dart b/lib/features/preview_page/presentation/preview_page.dart
index dbae1998..d9693862 100644
--- a/lib/features/preview_page/presentation/preview_page.dart
+++ b/lib/features/preview_page/presentation/preview_page.dart
@@ -2,19 +2,9 @@ import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
-import 'package:threedpass/core/widgets/paddings.dart';
import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
import 'package:threedpass/features/preview_page/presentation/widgets/appbar/preview_appbar.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/delete_snapshot_button.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/hash_properties.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/matches_found/matches_found.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/more_info.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/object_preview/object_preview.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/preview_save_button.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/snapshot_info.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/stable_hash_text.dart';
-
-part 'widgets/preview_page_body.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/preview_page_body.dart';
@RoutePage()
class PreviewPage extends StatelessWidget {
@@ -30,12 +20,10 @@ class PreviewPage extends StatelessWidget {
return PlatformScaffold(
appBar: PreviewAppBar(
hashObject: previewPageCubitState.hashObject,
- snapshot: previewPageCubitState.snapshot,
themeData: Theme.of(context),
context: context,
),
body: SingleChildScrollView(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: PreviewPageBody(
previewPageCubitState: previewPageCubitState,
),
diff --git a/lib/features/preview_page/presentation/widgets/appbar/preview_appbar.dart b/lib/features/preview_page/presentation/widgets/appbar/preview_appbar.dart
index 2b2d2ffb..cbce9cbd 100644
--- a/lib/features/preview_page/presentation/widgets/appbar/preview_appbar.dart
+++ b/lib/features/preview_page/presentation/widgets/appbar/preview_appbar.dart
@@ -1,18 +1,18 @@
import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
-import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
-import 'package:share_plus/share_plus.dart';
import 'package:threedpass/core/theme/d3p_appbar_theme.dart';
import 'package:threedpass/core/theme/d3p_special_colors.dart';
import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/widgets/buttons/icon_button.dart';
import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart';
-import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:unicons/unicons.dart';
class PreviewAppBar extends PlatformAppBar {
PreviewAppBar({
- required final Snapshot snapshot,
+ // required final Snapshot snapshot,
required final ThemeData themeData,
required final BuildContext context,
final Key? key,
@@ -30,40 +30,22 @@ class PreviewAppBar extends PlatformAppBar {
PlatformIconButton(
padding: EdgeInsets.zero,
icon: Icon(
- _getIconData(),
+ _getIconData(context),
color: themeData.customColors.appBarButton,
),
onPressed: () => context.router.pop(),
),
- hashObject != null
- ? Flexible(
- child: Padding(
- padding: const EdgeInsets.only(right: 16),
- child: Text(
- hashObject.name,
- overflow: TextOverflow.ellipsis,
- style: themeData.customTextStyles.appBarTextBright,
- ),
- ),
- )
- : Text(
- 'get_new_object_appbar'.tr(),
- style: themeData.customTextStyles.appBarTextBright,
- ),
- PlatformIconButton(
- padding: EdgeInsets.zero,
- icon: Icon(
- Icons.share,
- color: themeData.customColors.appBarButton,
- ),
- onPressed: () => Share.share(snapshot.shareText),
+ _PreviewAppbarTitle(
+ hashObject: hashObject,
),
+ // _PseudoButtonSavedIndicator(psType),
+ const D3pIconButton.fake(),
],
),
);
- static IconData _getIconData() {
- final platform = defaultTargetPlatform;
+ static IconData _getIconData(final BuildContext context) {
+ final platform = Theme.of(context).platform;
switch (platform) {
case TargetPlatform.android:
case TargetPlatform.fuchsia:
@@ -76,3 +58,44 @@ class PreviewAppBar extends PlatformAppBar {
}
}
}
+
+class _PreviewAppbarTitle extends StatelessWidget {
+ const _PreviewAppbarTitle({
+ required this.hashObject,
+ // required this.psType,
+ });
+
+ final HashObject? hashObject;
+
+ @override
+ Widget build(final BuildContext context) {
+ final themeData = Theme.of(context);
+ return hashObject != null
+ ? Flexible(
+ child: Text(
+ hashObject!.name,
+ overflow: TextOverflow.ellipsis,
+ style: themeData.customTextStyles.appBarTextBright,
+ ),
+ )
+ : Text(
+ 'unsaved_object_appbar'.tr(),
+ style: themeData.customTextStyles.appBarTextBright,
+ );
+ }
+}
+
+class _PseudoButtonSavedIndicator extends StatelessWidget {
+ final PreviewSnapshotType psType;
+
+ const _PseudoButtonSavedIndicator(this.psType);
+
+ @override
+ Widget build(final BuildContext context) {
+ return D3pIconButton(
+ iconData: psType == PreviewSnapshotType.existingSnapshot
+ ? UniconsLine.file_check
+ : UniconsLine.file_exclamation,
+ );
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/copy_text_card.dart b/lib/features/preview_page/presentation/widgets/copy_text_card.dart
new file mode 100644
index 00000000..4e26a178
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/copy_text_card.dart
@@ -0,0 +1,27 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/utils/copy_and_notify.dart';
+import 'package:threedpass/core/widgets/buttons/clickable_card.dart';
+
+class CopyTextCard extends StatelessWidget {
+ final Widget child;
+ final String textToCopy;
+ final String textToShow;
+
+ const CopyTextCard({
+ required this.textToShow,
+ required this.textToCopy,
+ required this.child,
+ super.key,
+ });
+
+ @override
+ Widget build(final BuildContext context) {
+ return ClickableCard(
+ onTap: () => copyAndNotify(
+ textToCopy: textToCopy,
+ textToShow: textToShow,
+ ),
+ child: child,
+ );
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/delete_snapshot_button.dart b/lib/features/preview_page/presentation/widgets/delete_snapshot_button.dart
index 311de058..1753be58 100644
--- a/lib/features/preview_page/presentation/widgets/delete_snapshot_button.dart
+++ b/lib/features/preview_page/presentation/widgets/delete_snapshot_button.dart
@@ -1,39 +1,35 @@
import 'package:auto_route/auto_route.dart';
-import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
-import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
-import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart';
-import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart';
-import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:threedpass/features/settings_page/presentation/widgets/default_settings_button.dart';
+import 'package:threedpass/router/router.gr.dart';
class DeleteSnapshotButton extends StatelessWidget {
const DeleteSnapshotButton({
- required this.snapshot,
- required this.hashObject,
+ required this.state,
final Key? key,
}) : super(key: key);
- final HashObject? hashObject;
- final Snapshot snapshot;
-
- void deleteSnapshot(final BuildContext context) {
- if (hashObject != null) {
- BlocProvider.of(context).add(
- DeleteHash(
- hash: snapshot,
- object: hashObject!,
- ),
- );
- }
- context.router.pop();
- }
+ final PreviewPageCubitState state;
@override
Widget build(final BuildContext context) {
- return D3pElevatedButton(
- text: 'delete_snapshot_button'.tr(),
- onPressed: () => deleteSnapshot(context),
+ final cardShape = !state.isNew ? CardShape.bottom : CardShape.all;
+
+ final text =
+ state.isNew ? 'delete_new_snapshot' : 'delete_extisting_snapshot';
+
+ return DefaultSettingsButton.openButton(
+ iconData: Icons.delete_outline_rounded,
+ iconColor: Colors.red,
+ textValue: '',
+ onPressed: state.isNew
+ ? () => context.router.pop()
+ : () => context.router.push(const DeleteSnapshotRoute()),
+ text: text,
+ cardShape: cardShape,
+ isChevronGrey: false,
);
}
}
diff --git a/lib/features/preview_page/presentation/widgets/delete_snapshot_dialog.dart b/lib/features/preview_page/presentation/widgets/delete_snapshot_dialog.dart
new file mode 100644
index 00000000..5fe87003
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/delete_snapshot_dialog.dart
@@ -0,0 +1,57 @@
+import 'dart:async';
+
+import 'package:auto_route/auto_route.dart';
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/buttons/text_button.dart';
+import 'package:threedpass/core/widgets/dialog/d3p_platform_dialog.dart';
+import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart';
+import 'package:threedpass/features/preview_page/bloc/outer_context_cubit.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+
+@RoutePage()
+class DeleteSnapshotDialog extends StatelessWidget {
+ const DeleteSnapshotDialog({super.key});
+
+ Future deleteSnapshot(
+ final BuildContext context,
+ final PreviewPageCubitState state,
+ ) async {
+ if (state.hashObject != null) {
+ BlocProvider.of(context).add(
+ DeleteHash(
+ hash: state.snapshot,
+ object: state.hashObject!,
+ ),
+ );
+ }
+
+ final outerContext = BlocProvider.of(context).state;
+ unawaited(outerContext.router.pop());
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ final state = BlocProvider.of(context).state;
+
+ return D3pPlatformDialog(
+ title: 'delete_snapshot_confirm_title'.tr(args: [state.snapshot.name]),
+ content: const SingleChildScrollView(
+ child: Column(
+ children: [],
+ ),
+ ),
+ actions: [
+ D3pTextButton(
+ text: 'Cancel'.tr(),
+ onPressed: () => context.router.pop(),
+ ),
+ D3pTextButton(
+ text: 'Delete'.tr(),
+ onPressed: () => deleteSnapshot(context, state),
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/deprecation_warning.dart b/lib/features/preview_page/presentation/widgets/deprecation_warning.dart
new file mode 100644
index 00000000..7707c88f
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/deprecation_warning.dart
@@ -0,0 +1,25 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+
+class DeprecationWarning extends StatelessWidget {
+ const DeprecationWarning({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final snap = BlocProvider.of(context).state.snapshot;
+
+ if (snap.externalPathToObj != null) {
+ return Flexible(
+ child: Padding(
+ padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
+ child: Text(
+ 'WARNING: this snapshot was made in a deprecated way. It depends on external file. Modifying or loss of a file may result in undefined behavior. Please rescan the file with the same settings. Path:\n${snap.externalPathToObj}',
+ ),
+ ),
+ );
+ } else {
+ return const SizedBox();
+ }
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/explore_hashes_button.dart b/lib/features/preview_page/presentation/widgets/explore_hashes_button.dart
new file mode 100644
index 00000000..b62114a9
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/explore_hashes_button.dart
@@ -0,0 +1,40 @@
+import 'package:auto_route/auto_route.dart';
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/theme/d3p_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_colors.dart';
+import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:threedpass/router/router.gr.dart';
+
+class ExploreHashesButton extends StatelessWidget {
+ const ExploreHashesButton({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final state = BlocProvider.of(context).state;
+ final colors = Theme.of(context).customColors;
+ final bgColor = colors.cardBackground;
+ final fgColorBright = colors.themeOpposite;
+ const fgColorDim = D3pColors.disabled;
+
+ return Padding16(
+ child: D3pElevatedButton(
+ backgroundColor: bgColor,
+ text: 'explore_hashes_button_title'.tr(),
+ foregroundColor: state.hashObject != null ? fgColorBright : fgColorDim,
+ iconData: Icons.compare_arrows_rounded,
+ onPressed: state.hashObject != null
+ ? () => context.router.push(
+ CompareRouteWrapper(
+ origObj: state.snapshot,
+ hashObject: state.hashObject!,
+ ),
+ )
+ : null, // PUSH to compare page
+ ),
+ );
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/file_hash_card.dart b/lib/features/preview_page/presentation/widgets/file_hash_card.dart
new file mode 100644
index 00000000..54c6f551
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/file_hash_card.dart
@@ -0,0 +1,36 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/copy_text_card.dart';
+
+class FileHashBlock extends StatelessWidget {
+ const FileHashBlock({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final snap = BlocProvider.of(context).state.snapshot;
+
+ final fileHashText = snap.fileHash.toString();
+
+ return Padding16(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ Text(
+ 'file_hash_title'.tr(),
+ style: Theme.of(context).customTextStyles.d3plabelLarge,
+ ),
+ CopyTextCard(
+ textToCopy: fileHashText,
+ textToShow: 'file_hash_copied'.tr(),
+ child: Text(fileHashText),
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/hash_properties.dart b/lib/features/preview_page/presentation/widgets/hash_properties.dart
index 622808ae..fd5b33eb 100644
--- a/lib/features/preview_page/presentation/widgets/hash_properties.dart
+++ b/lib/features/preview_page/presentation/widgets/hash_properties.dart
@@ -1,9 +1,12 @@
+import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/copy_text_card.dart';
import 'package:threedpass/features/settings_page/presentation/widgets/settings_text.dart';
-class HashProperties extends StatelessWidget {
- const HashProperties({
+class ScanProperties extends StatelessWidget {
+ const ScanProperties({
required this.snapshot,
final Key? key,
}) : super(key: key);
@@ -12,11 +15,11 @@ class HashProperties extends StatelessWidget {
@override
Widget build(final BuildContext context) {
- return SingleChildScrollView(
- child: ListBody(
- children: [
- Text.rich(snapshot.settingsConfig.toText(context)),
- ],
+ return Padding16(
+ child: CopyTextCard(
+ textToCopy: snapshot.settingsConfig.toRawString(),
+ textToShow: 'scan_properties_copied_toast'.tr(),
+ child: Text.rich(snapshot.settingsConfig.toText(context)),
),
);
}
diff --git a/lib/features/preview_page/presentation/widgets/matches_found/match_hyperlink.dart b/lib/features/preview_page/presentation/widgets/matches_found/match_hyperlink.dart
deleted file mode 100644
index d0be0b48..00000000
--- a/lib/features/preview_page/presentation/widgets/matches_found/match_hyperlink.dart
+++ /dev/null
@@ -1,37 +0,0 @@
-import 'package:flutter/gestures.dart';
-import 'package:flutter/material.dart';
-import 'package:threedpass/core/theme/d3p_special_styles.dart';
-
-class MatchHyperlink extends StatelessWidget {
- const MatchHyperlink({
- required this.clickable,
- required this.mainText,
- required this.onTap,
- final Key? key,
- }) : super(key: key);
-
- final String clickable;
- final String mainText;
- final void Function() onTap;
-
- @override
- Widget build(final BuildContext context) {
- final textStyles = Theme.of(context).customTextStyles;
-
- return RichText(
- text: TextSpan(
- children: [
- TextSpan(
- text: mainText,
- style: textStyles.d3pBodyMedium,
- ),
- TextSpan(
- text: clickable,
- style: textStyles.matchesHyperlink,
- recognizer: TapGestureRecognizer()..onTap = onTap,
- ),
- ],
- ),
- );
- }
-}
diff --git a/lib/features/preview_page/presentation/widgets/matches_found/matches_found.dart b/lib/features/preview_page/presentation/widgets/matches_found/matches_found.dart
deleted file mode 100644
index ad4acef8..00000000
--- a/lib/features/preview_page/presentation/widgets/matches_found/matches_found.dart
+++ /dev/null
@@ -1,45 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:threedpass/core/widgets/error_page.dart';
-import 'package:threedpass/features/hashes_list/domain/entities/matches_count.dart';
-import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/matches_found/matches_found_text.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/matches_found/no_matches_found_text.dart';
-
-class MatchesFound extends StatelessWidget {
- const MatchesFound({
- required this.state,
- final Key? key,
- }) : super(key: key);
-
- final PreviewPageCubitState state;
-
- @override
- Widget build(final BuildContext context) {
- switch (state.runtimeType) {
- case PreviewNewObject:
- return const NoMatchesFoundText();
- case PreviewNewSnapshot:
- case PreviewExistingSnapshot:
- final mc =
- MatchesCount(object: state.hashObject, snapshot: state.snapshot);
-
- if (mc.matchesCount == 0) {
- return const NoMatchesFoundText();
- } else {
- return MatchesFoundText(
- state: state,
- number: mc.matchesCount,
- );
- }
-
- // return MatchesFoundText(
- // state: state,
- // number: state.hashObject!.snapshots.length - 1,
- // );
- default:
- return const ErrorPage(
- error: '[MatchesFound] Unknown state for PreviewPageCubitState',
- );
- }
- }
-}
diff --git a/lib/features/preview_page/presentation/widgets/matches_found/matches_found_text.dart b/lib/features/preview_page/presentation/widgets/matches_found/matches_found_text.dart
deleted file mode 100644
index fdcecadf..00000000
--- a/lib/features/preview_page/presentation/widgets/matches_found/matches_found_text.dart
+++ /dev/null
@@ -1,34 +0,0 @@
-import 'package:auto_route/auto_route.dart';
-import 'package:easy_localization/easy_localization.dart';
-import 'package:flutter/material.dart';
-import 'package:threedpass/core/utils/empty_function.dart';
-import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/matches_found/match_hyperlink.dart';
-import 'package:threedpass/router/router.gr.dart';
-
-class MatchesFoundText extends StatelessWidget {
- const MatchesFoundText({
- required this.state,
- required this.number,
- final Key? key,
- }) : super(key: key);
-
- final int number;
- final PreviewPageCubitState state;
-
- @override
- Widget build(final BuildContext context) {
- return MatchHyperlink(
- mainText: plural('MATCHES_number_plural', number),
- clickable: 'matches_FOUND'.tr(),
- onTap: number > 0
- ? () => context.router.push(
- CompareRouteWrapper(
- origObj: state.snapshot,
- hashObject: state.hashObject!,
- ),
- )
- : emptyFunction,
- );
- }
-}
diff --git a/lib/features/preview_page/presentation/widgets/matches_found/no_matches_found_text.dart b/lib/features/preview_page/presentation/widgets/matches_found/no_matches_found_text.dart
deleted file mode 100644
index 430c844f..00000000
--- a/lib/features/preview_page/presentation/widgets/matches_found/no_matches_found_text.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-import 'package:easy_localization/easy_localization.dart';
-import 'package:flutter/material.dart';
-import 'package:threedpass/features/preview_page/presentation/widgets/matches_found/match_hyperlink.dart';
-import 'package:url_launcher/url_launcher_string.dart';
-
-class NoMatchesFoundText extends StatelessWidget {
- const NoMatchesFoundText({final Key? key}) : super(key: key);
-
- @override
- Widget build(final BuildContext context) {
- return MatchHyperlink(
- mainText: plural('MATCHES_number_plural', 0),
- clickable: 'WHY_not_found'.tr(),
- onTap: () => launchUrlString(
- 'https://3dpass.org/features#3drecognition',
- ),
- );
- }
-}
diff --git a/lib/features/preview_page/presentation/widgets/more_info.dart b/lib/features/preview_page/presentation/widgets/more_info.dart
deleted file mode 100644
index 9a94c985..00000000
--- a/lib/features/preview_page/presentation/widgets/more_info.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-import 'package:auto_route/auto_route.dart';
-import 'package:easy_localization/easy_localization.dart';
-import 'package:flutter/gestures.dart';
-import 'package:flutter/material.dart';
-import 'package:qr_flutter/qr_flutter.dart';
-import 'package:threedpass/core/theme/d3p_special_colors.dart';
-import 'package:threedpass/core/theme/d3p_special_styles.dart';
-import 'package:threedpass/core/widgets/text/d3p_body_large_text.dart';
-import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
-import 'package:threedpass/router/router.gr.dart';
-
-class MoreInfo extends StatelessWidget {
- const MoreInfo({
- required this.state,
- final Key? key,
- }) : super(key: key);
-
- final PreviewPageCubitState state;
-
- void onTap(final BuildContext context) {
- context.router.push(
- SaveTopHashesRoute(
- pageCubitState: state,
- ),
- );
- }
-
- @override
- Widget build(final BuildContext context) {
- final textStyles = Theme.of(context).customTextStyles;
-
- return Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- const D3pBodyLargeText('top_10_hashes'),
- Text.rich(
- TextSpan(
- text: 'show_and_share_dialog_button'.tr(),
- style: textStyles.matchesHyperlink,
- recognizer: TapGestureRecognizer()
- ..onTap = () => onTap(context),
- ),
- ),
- ],
- ),
- Container(
- alignment: Alignment.center,
- child: QrImageView(
- padding: EdgeInsets.zero,
- data: state.snapshot.hashes.join('\n'),
- version: QrVersions.auto,
- size: 120.0,
- foregroundColor: Theme.of(context).customColors.themeOpposite,
- ),
- ),
- ],
- );
- }
-}
diff --git a/lib/features/preview_page/presentation/widgets/object_preview/object_preview.dart b/lib/features/preview_page/presentation/widgets/object_preview/object_preview.dart
index 3870d792..008ea0c9 100644
--- a/lib/features/preview_page/presentation/widgets/object_preview/object_preview.dart
+++ b/lib/features/preview_page/presentation/widgets/object_preview/object_preview.dart
@@ -89,7 +89,7 @@ class _State extends State {
double get height => 250;
- double get width => screenSize.width - 16 * 2;
+ double get width => screenSize.width;
SnackBar errorSnackBar() => SnackBar(
content: Text(
diff --git a/lib/features/preview_page/presentation/widgets/poscan_result.dart b/lib/features/preview_page/presentation/widgets/poscan_result.dart
new file mode 100644
index 00000000..2ca3b75c
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/poscan_result.dart
@@ -0,0 +1,27 @@
+import 'package:auto_route/auto_route.dart';
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/polkawallet/app_service.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
+import 'package:threedpass/router/router.gr.dart';
+
+class PoscanResult extends StatelessWidget {
+ const PoscanResult({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ return BlocBuilder(
+ builder: (final context, final state) => Padding16(
+ child: D3pElevatedButton(
+ text: '3d_rpc_button_label'.tr(),
+ onPressed: state.status == AppServiceInitStatus.connected
+ ? () => context.router.push(const D3PRPCRouteWrapper())
+ : null,
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/preview_page_body.dart b/lib/features/preview_page/presentation/widgets/preview_page_body.dart
index 02b18106..b6153973 100644
--- a/lib/features/preview_page/presentation/widgets/preview_page_body.dart
+++ b/lib/features/preview_page/presentation/widgets/preview_page_body.dart
@@ -1,4 +1,20 @@
-part of '../preview_page.dart';
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/delete_snapshot_button.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/deprecation_warning.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/explore_hashes_button.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/file_hash_card.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/hash_properties.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/object_preview/object_preview.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/poscan_result.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/preview_save_button.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/rename_snapshot_button.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/section_title.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/snapshot_info.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/stable_hashes_section.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/top_hashes_card.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/top_hashes_title.dart';
class PreviewPageBody extends StatelessWidget {
const PreviewPageBody({
@@ -14,40 +30,35 @@ class PreviewPageBody extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Flexible(
- child: SnapshotInfo(
- state: previewPageCubitState,
- ),
- ),
- const SizedBoxH8(),
- MatchesFound(
+ const SizedBoxH16(),
+ DeprecationWarning(),
+ SnapshotInfo(
state: previewPageCubitState,
),
- const SizedBoxH8(),
ObjectPreview(
snapshot: previewPageCubitState.snapshot,
),
- const SizedBoxH16(),
- StableHashText(
+ PreviewSaveButton(
state: previewPageCubitState,
),
+ const StableHashesSection(),
+ const SizedBox(height: 2),
+ const ExploreHashesButton(),
const SizedBoxH16(),
- HashProperties(
+ const SectionTitle(titleUnlocalized: 'settings_text_span_title'),
+ ScanProperties(
snapshot: previewPageCubitState.snapshot,
),
const SizedBoxH16(),
- PreviewSaveButton(
- state: previewPageCubitState,
- ),
- const SizedBox(height: 4),
- DeleteSnapshotButton(
- snapshot: previewPageCubitState.snapshot,
- hashObject: previewPageCubitState.hashObject,
- ),
+ const FileHashBlock(),
+ // const SizedBoxH16(),
+ // const PoscanResult(),
const SizedBoxH16(),
- MoreInfo(
- state: previewPageCubitState,
- ),
+ const TopHashesTitle(),
+ TopHashesCard(hashes: previewPageCubitState.snapshot.hashes),
+ const SizedBoxH16(),
+ RenameSnapshotButton(state: previewPageCubitState),
+ DeleteSnapshotButton(state: previewPageCubitState),
const SizedBoxH16(),
],
);
diff --git a/lib/features/preview_page/presentation/widgets/preview_save_button.dart b/lib/features/preview_page/presentation/widgets/preview_save_button.dart
index 9de6fbe4..77db159f 100644
--- a/lib/features/preview_page/presentation/widgets/preview_save_button.dart
+++ b/lib/features/preview_page/presentation/widgets/preview_save_button.dart
@@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
import 'package:threedpass/router/router.gr.dart';
@@ -20,7 +21,6 @@ class PreviewSaveButton extends StatelessWidget {
case PreviewNewSnapshot:
return 'save_this_snapshot_button_label'.tr();
case PreviewExistingSnapshot:
- return 'rename_this_snapshot_button_label'.tr();
default:
return 'Error';
}
@@ -38,10 +38,6 @@ class PreviewSaveButton extends StatelessWidget {
snapshot: state.snapshot,
);
case PreviewExistingSnapshot:
- return RenameSnapshotRoute(
- hashObject: state.hashObject!,
- snapshot: state.snapshot,
- );
default:
throw Exception('Unknown state type');
}
@@ -49,10 +45,20 @@ class PreviewSaveButton extends StatelessWidget {
@override
Widget build(final BuildContext context) {
- return D3pElevatedButton(
- minimumSize: const Size.fromHeight(46),
- text: title,
- onPressed: () => routeToPush.push(context),
- );
+ if (state.psType == PreviewSnapshotType.newObject ||
+ state.psType == PreviewSnapshotType.newSnapshot) {
+ return Padding(
+ padding: const EdgeInsets.only(bottom: 16),
+ child: Padding16(
+ child: D3pElevatedButton(
+ iconData: Icons.save,
+ text: title,
+ onPressed: () => routeToPush.push(context),
+ ),
+ ),
+ );
+ } else {
+ return const SizedBox();
+ }
}
}
diff --git a/lib/features/preview_page/presentation/widgets/rename_snapshot_button.dart b/lib/features/preview_page/presentation/widgets/rename_snapshot_button.dart
new file mode 100644
index 00000000..bf59eeac
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/rename_snapshot_button.dart
@@ -0,0 +1,37 @@
+import 'package:auto_route/auto_route.dart';
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_special_colors.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:threedpass/features/settings_page/presentation/widgets/default_settings_button.dart';
+import 'package:threedpass/router/router.gr.dart';
+
+class RenameSnapshotButton extends StatelessWidget {
+ const RenameSnapshotButton({required this.state, super.key});
+
+ final PreviewPageCubitState state;
+
+ @override
+ Widget build(final BuildContext context) {
+ final colors = Theme.of(context).customColors;
+
+ if (state.psType == PreviewSnapshotType.existingSnapshot) {
+ return DefaultSettingsButton.openButton(
+ iconData: Icons.abc_rounded,
+ iconColor: colors.themeOpposite,
+ textValue: '',
+ onPressed: () => context.router.push(
+ RenameSnapshotRoute(
+ snapshot: state.snapshot,
+ hashObject: state.hashObject!,
+ ),
+ ),
+ text: 'rename_this_snapshot_button_label',
+ cardShape: CardShape.top,
+ isChevronGrey: false,
+ );
+ } else {
+ return const SizedBox();
+ }
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/rename_snapshot_dialog.dart b/lib/features/preview_page/presentation/widgets/rename_snapshot_dialog.dart
index 7da53ef7..8b2c29b7 100644
--- a/lib/features/preview_page/presentation/widgets/rename_snapshot_dialog.dart
+++ b/lib/features/preview_page/presentation/widgets/rename_snapshot_dialog.dart
@@ -38,7 +38,7 @@ class RenameSnapshotDialog extends StatelessWidget {
final outerContext = BlocProvider.of(context).state;
// TODO When rename object do bloc_builder instead of re-push
- outerContext.router.popUntilRouteWithName(InitialWrapperRoute.name);
+ await outerContext.router.pop();
unawaited(
outerContext.router.push(
diff --git a/lib/features/preview_page/presentation/widgets/save_hash_dialog.dart b/lib/features/preview_page/presentation/widgets/save_hash_dialog.dart
index 48acc7a8..5a1dc1e1 100644
--- a/lib/features/preview_page/presentation/widgets/save_hash_dialog.dart
+++ b/lib/features/preview_page/presentation/widgets/save_hash_dialog.dart
@@ -1,3 +1,5 @@
+import 'dart:async';
+
import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
@@ -7,7 +9,6 @@ import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart
import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart';
import 'package:threedpass/features/preview_page/bloc/outer_context_cubit.dart';
import 'package:threedpass/features/preview_page/presentation/widgets/dialogs/common_dialog.dart';
-import 'package:threedpass/router/router.gr.dart';
@RoutePage()
class SaveHashDialog extends StatelessWidget {
@@ -34,7 +35,7 @@ class SaveHashDialog extends StatelessWidget {
);
final outerContext = BlocProvider.of(context).state;
- outerContext.router.popUntilRouteWithName(InitialWrapperRoute.name);
+ unawaited(outerContext.router.pop());
}
@override
diff --git a/lib/features/preview_page/presentation/widgets/save_top_hashes_dialog/save_top_hashes_dialog.dart b/lib/features/preview_page/presentation/widgets/save_top_hashes_dialog/save_top_hashes_dialog.dart
deleted file mode 100644
index bfefc3cd..00000000
--- a/lib/features/preview_page/presentation/widgets/save_top_hashes_dialog/save_top_hashes_dialog.dart
+++ /dev/null
@@ -1,46 +0,0 @@
-import 'package:auto_route/auto_route.dart';
-import 'package:easy_localization/easy_localization.dart';
-import 'package:flutter/material.dart';
-import 'package:share_plus/share_plus.dart';
-import 'package:threedpass/core/widgets/buttons/text_button.dart';
-import 'package:threedpass/core/widgets/dialog/d3p_platform_dialog.dart';
-import 'package:threedpass/features/hashes_list/presentation/widgets/hashes_primitive_list.dart';
-import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
-
-@RoutePage()
-class SaveTopHashesDialog extends StatelessWidget {
- const SaveTopHashesDialog({
- required this.pageCubitState,
- final Key? key,
- }) : super(key: key);
-
- final PreviewPageCubitState pageCubitState;
-
- void shareSnapshots(final BuildContext context) {
- context.router.pop();
- Share.share(pageCubitState.snapshot.shareText);
- }
-
- @override
- Widget build(final BuildContext context) {
- return D3pPlatformDialog(
- title: 'top_10_hashes'.tr(),
- content: SingleChildScrollView(
- child: HashesPrimitiveList(
- hashesModel: pageCubitState.snapshot,
- ),
- ),
- actions: [
- D3pTextButton(
- text: 'Cancel'.tr(),
- onPressed: () => context.router.pop(),
- ),
- D3pTextButton(
- text: 'Share'.tr(),
- onPressed: () => shareSnapshots(context),
- ),
- // _SaveTopHashesButton(pageCubitState),
- ],
- );
- }
-}
diff --git a/lib/features/preview_page/presentation/widgets/section_title.dart b/lib/features/preview_page/presentation/widgets/section_title.dart
new file mode 100644
index 00000000..5c030a58
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/section_title.dart
@@ -0,0 +1,23 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+
+class SectionTitle extends StatelessWidget {
+ const SectionTitle({
+ required this.titleUnlocalized,
+ super.key,
+ });
+
+ final String titleUnlocalized;
+
+ @override
+ Widget build(final BuildContext context) {
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: Text(
+ titleUnlocalized.tr(),
+ style: Theme.of(context).customTextStyles.d3plabelLarge,
+ ),
+ );
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/snapshot_info.dart b/lib/features/preview_page/presentation/widgets/snapshot_info.dart
index ca076647..d387efd8 100644
--- a/lib/features/preview_page/presentation/widgets/snapshot_info.dart
+++ b/lib/features/preview_page/presentation/widgets/snapshot_info.dart
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
class SnapshotInfo extends StatelessWidget {
@@ -13,20 +14,10 @@ class SnapshotInfo extends StatelessWidget {
@override
Widget build(final BuildContext context) {
final textTheme = Theme.of(context).customTextStyles.d3pBodyLarge;
- return Text.rich(
- TextSpan(
- text: 'Snapshot: ',
- children: [
- TextSpan(
- text: state.snapshot.name,
- style: textTheme.copyWith(
- fontStyle: FontStyle.normal,
- ),
- ),
- ],
- ),
- style: textTheme.copyWith(
- fontStyle: FontStyle.italic,
+ return Padding16(
+ child: Text(
+ state.snapshot.name,
+ style: textTheme,
),
);
}
diff --git a/lib/features/preview_page/presentation/widgets/stable_hash_text.dart b/lib/features/preview_page/presentation/widgets/stable_hash_text.dart
index 41668257..8b2cc7ed 100644
--- a/lib/features/preview_page/presentation/widgets/stable_hash_text.dart
+++ b/lib/features/preview_page/presentation/widgets/stable_hash_text.dart
@@ -1,71 +1,58 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:threedpass/core/theme/d3p_special_styles.dart';
-import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/copy_text_card.dart';
class StableHashText extends StatelessWidget {
const StableHashText({
- required this.state,
+ required this.hashes,
final Key? key,
}) : super(key: key);
- final PreviewPageCubitState state;
-
- List stableHashes() {
- switch (state.runtimeType) {
- case PreviewNewSnapshot:
- final stateT = state as PreviewNewSnapshot;
- return stateT.hashObject.stableHashesPlusNew(stateT.snapshot);
- case PreviewExistingSnapshot:
- final stateT = state as PreviewExistingSnapshot;
- return stateT.hashObject.stableHashes;
- case PreviewNewObject:
- default:
- return [];
- }
- }
+ final List hashes;
@override
Widget build(final BuildContext context) {
- final hashes = stableHashes();
-
- if (hashes.isEmpty) {
- return const _Placeholder();
+ final hashesStr = [];
+ // Build pattern "1. hash\n2. hash\n3. hash"
+ for (int i = 0; i < hashes.length; i++) {
+ String str = (i + 1).toString() + '. ' + hashes[i];
+ if (i < hashes.length - 1) {
+ str += '\n';
+ }
+ hashesStr.add(str);
}
final children = [];
- for (int i = 0; i < hashes.length; i++) {
+ for (final str in hashesStr) {
children.add(
TextSpan(
- text: (i + 1).toString() + '. ' + hashes[i] + '\n',
+ text: str,
),
);
}
- return Text.rich(
- TextSpan(
- text: 'stable_hashes_list_title'.tr() + '\n',
- children: children,
- ),
- style: Theme.of(context).customTextStyles.d3pBodyLarge,
- );
- }
-}
-
-class _Placeholder extends StatelessWidget {
- const _Placeholder({final Key? key}) : super(key: key);
+ final textTheme = Theme.of(context).customTextStyles.d3pBodyMedium;
- @override
- Widget build(final BuildContext context) => Text.rich(
- TextSpan(
- text: 'no_stable_hash_placeholder'.tr() + '\n',
- style: Theme.of(context).customTextStyles.d3pBodyLarge,
+ return Padding16(
+ child: CopyTextCard(
+ textToCopy: hashesStr.join('\n'),
+ textToShow: 'stable_hashes_copied_toast'.tr(),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
children: [
- TextSpan(
- text: 'no_stable_hash_help'.tr(),
- style: Theme.of(context).customTextStyles.d3pBodyMedium,
+ Text.rich(
+ TextSpan(
+ text: '',
+ children: children,
+ ),
+ style: textTheme,
),
],
),
- );
+ ),
+ );
+ }
}
diff --git a/lib/features/preview_page/presentation/widgets/stable_hashes_section.dart b/lib/features/preview_page/presentation/widgets/stable_hashes_section.dart
new file mode 100644
index 00000000..8018865d
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/stable_hashes_section.dart
@@ -0,0 +1,76 @@
+import 'package:flutter/widgets.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/section_title.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/stable_hash_text.dart';
+
+class StableHashesSection extends StatelessWidget {
+ const StableHashesSection({super.key});
+
+ List stableHashes(final PreviewPageCubitState state) {
+ switch (state.runtimeType) {
+ case PreviewNewSnapshot:
+ final stateT = state as PreviewNewSnapshot;
+ return stateT.hashObject.stableHashesPlusNew(stateT.snapshot);
+ case PreviewExistingSnapshot:
+ final stateT = state as PreviewExistingSnapshot;
+ return stateT.hashObject.stableHashes;
+ case PreviewNewObject:
+ default:
+ return [];
+ }
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ final state = BlocProvider.of(context).state;
+
+ final hashes = stableHashes(state);
+
+ if (hashes.isEmpty) {
+ return const _NoStableHashes();
+ } else {
+ return _HasStableHashes(hashes: hashes);
+ }
+ }
+}
+
+class _NoStableHashes extends StatelessWidget {
+ const _NoStableHashes({final Key? key}) : super(key: key);
+
+ @override
+ Widget build(final BuildContext context) {
+ return const Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ SectionTitle(titleUnlocalized: 'no_stable_hash_placeholder'),
+ Padding16(
+ child: D3pBodyMediumText('no_stable_hash_help'),
+ ),
+ ],
+ );
+ }
+}
+
+class _HasStableHashes extends StatelessWidget {
+ const _HasStableHashes({required this.hashes});
+
+ final List hashes;
+
+ @override
+ Widget build(final BuildContext context) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ const SectionTitle(titleUnlocalized: 'stable_hashes_list_title'),
+ StableHashText(
+ hashes: hashes,
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/top_hashes_card.dart b/lib/features/preview_page/presentation/widgets/top_hashes_card.dart
new file mode 100644
index 00000000..79564a22
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/top_hashes_card.dart
@@ -0,0 +1,46 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/widgets/other/padding_16.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
+import 'package:threedpass/features/hashes_list/presentation/widgets/hashes_primitive_list.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/copy_text_card.dart';
+
+class TopHashesCard extends StatelessWidget {
+ const TopHashesCard({required this.hashes, super.key});
+
+ final List hashes;
+
+ @override
+ Widget build(final BuildContext context) {
+ if (hashes.isEmpty || (hashes.first.isEmpty && hashes.length == 1)) {
+ return const _NoHashesPlaceHolder();
+ }
+
+ return Padding16(
+ child: CopyTextCard(
+ textToShow: 'top_hashes_copied_toast'.tr(),
+ textToCopy: hashes.join('\n'),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ HashesPrimitiveList(
+ hashes: hashes,
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+}
+
+class _NoHashesPlaceHolder extends StatelessWidget {
+ const _NoHashesPlaceHolder();
+
+ @override
+ Widget build(final BuildContext context) {
+ return const Padding16(
+ child: D3pBodyMediumText('top_hashes_empty_text'),
+ );
+ }
+}
diff --git a/lib/features/preview_page/presentation/widgets/top_hashes_title.dart b/lib/features/preview_page/presentation/widgets/top_hashes_title.dart
new file mode 100644
index 00000000..6d08b3e9
--- /dev/null
+++ b/lib/features/preview_page/presentation/widgets/top_hashes_title.dart
@@ -0,0 +1,18 @@
+import 'package:flutter/widgets.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/features/preview_page/bloc/preview_page_cubit.dart';
+import 'package:threedpass/features/preview_page/presentation/widgets/section_title.dart';
+
+class TopHashesTitle extends StatelessWidget {
+ const TopHashesTitle({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ final state = BlocProvider.of(context).state;
+ final title_str = state.snapshot.withEmptyHashes
+ ? 'no_top_hashes_found'
+ : 'top_hashes_title';
+
+ return SectionTitle(titleUnlocalized: title_str);
+ }
+}
diff --git a/lib/features/preview_page/router/preview_page_route.dart b/lib/features/preview_page/router/preview_page_route.dart
index 0792f110..001254cd 100644
--- a/lib/features/preview_page/router/preview_page_route.dart
+++ b/lib/features/preview_page/router/preview_page_route.dart
@@ -12,10 +12,6 @@ AutoRoute previewPageRoute = AutoRoute(
AutoRoute(
page: CompareRouteWrapper.page,
),
- CustomRoute(
- page: SaveTopHashesRoute.page,
- customRouteBuilder: dialogBuilder,
- ),
CustomRoute(
page: SaveObjectRoute.page,
customRouteBuilder: dialogBuilder,
@@ -28,5 +24,18 @@ AutoRoute previewPageRoute = AutoRoute(
page: RenameSnapshotRoute.page,
customRouteBuilder: dialogBuilder,
),
+ CustomRoute(
+ page: DeleteSnapshotRoute.page,
+ customRouteBuilder: dialogBuilder,
+ ),
+ AutoRoute(
+ page: D3PRPCRouteWrapper.page,
+ children: [
+ AutoRoute(
+ page: D3PRPCRoute.page,
+ path: '',
+ ),
+ ],
+ ),
],
);
diff --git a/lib/features/scan_page/presentation/pages/scan_page.dart b/lib/features/scan_page/presentation/pages/scan_page.dart
index 48ff0b83..39550bb1 100644
--- a/lib/features/scan_page/presentation/pages/scan_page.dart
+++ b/lib/features/scan_page/presentation/pages/scan_page.dart
@@ -19,7 +19,7 @@ class ScanPage extends StatelessWidget {
Align(
alignment: Alignment.bottomRight,
child: Padding(
- padding: EdgeInsets.all(16),
+ padding: EdgeInsets.all(24),
child: GetObjectFromFileFloatingButton(),
),
),
diff --git a/lib/features/scan_page/presentation/widgets/file_hash_header.dart b/lib/features/scan_page/presentation/widgets/file_hash_header.dart
new file mode 100644
index 00000000..128816c3
--- /dev/null
+++ b/lib/features/scan_page/presentation/widgets/file_hash_header.dart
@@ -0,0 +1,31 @@
+import 'package:easy_localization/easy_localization.dart';
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+
+class FileHashHeader extends StatelessWidget {
+ const FileHashHeader({
+ required this.fileHash,
+ super.key,
+ });
+
+ final int fileHash;
+
+ @override
+ Widget build(final BuildContext context) {
+ final medium = Theme.of(context).customTextStyles.d3pBodyMedium;
+
+ return Text.rich(
+ TextSpan(
+ text: 'file_hash_subtitle_scan_list'.tr(),
+ style: medium.copyWith(color: D3pColors.disabled),
+ children: [
+ TextSpan(
+ text: fileHash.toString(),
+ style: medium,
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart b/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart
index eab281da..0ab26002 100644
--- a/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart
+++ b/lib/features/scan_page/presentation/widgets/get_object_from_file_button.dart
@@ -1,12 +1,10 @@
import 'dart:async';
import 'package:auto_route/auto_route.dart';
-import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:logger/logger.dart';
-import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart';
import 'package:threedpass/features/hashes_list/domain/entities/objects_directory.dart';
import 'package:threedpass/features/hashes_list/domain/entities/snapshot_create_from_file/file_copy.dart';
@@ -58,7 +56,7 @@ class GetObjectFromFileFloatingButton extends StatelessWidget {
scanIsolateCubit: BlocProvider.of(context),
// recievePort: recievePort,
);
-
+ // TODO Do return with enum of possible situations instead of random try-catches
try {
final objectsDirectory = getIt();
final pickedFilePath = await FilePickerShortCut().pickFile();
@@ -101,19 +99,16 @@ class GetObjectFromFileFloatingButton extends StatelessWidget {
@override
Widget build(final BuildContext context) {
- return Row(
- children: [
- const Spacer(),
- Flexible(
- child: D3pElevatedButton(
- iconData: Icons.folder_open,
- text: 'get_from_file_button_label'.tr(),
- onPressed: () => createHashFromFile(
- context,
- ),
- ),
- ),
- ],
+ return FloatingActionButton(
+ // shape: const RoundedRectangleBorder(
+ // borderRadius: BorderRadius.all(
+ // Radius.circular(4),
+ // ),
+ // ),
+ child: const Icon(Icons.folder_open_rounded),
+ onPressed: () => createHashFromFile(
+ context,
+ ),
);
}
}
diff --git a/lib/features/scan_page/presentation/widgets/object_list/hash_card.dart b/lib/features/scan_page/presentation/widgets/object_list/hash_card.dart
index 540aad91..f9899eff 100644
--- a/lib/features/scan_page/presentation/widgets/object_list/hash_card.dart
+++ b/lib/features/scan_page/presentation/widgets/object_list/hash_card.dart
@@ -1,8 +1,11 @@
import 'package:auto_route/auto_route.dart';
-import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
-import 'package:threedpass/core/widgets/d3p_card.dart';
-import 'package:threedpass/core/widgets/text/d3p_body_large_text.dart';
+import 'package:threedpass/core/theme/d3p_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/utils/formatters.dart';
+import 'package:threedpass/core/widgets/buttons/clickable_card.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart';
import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart';
import 'package:threedpass/features/scan_page/presentation/widgets/object_list/hash_card_popup_menu.dart';
@@ -10,58 +13,55 @@ import 'package:threedpass/features/settings_page/presentation/widgets/settings_
import 'package:threedpass/router/router.gr.dart';
class SnapshotCard extends StatelessWidget {
- SnapshotCard({
+ const SnapshotCard({
required this.snapshot,
required this.hashObject,
final Key? key,
}) : super(key: key);
- final DateFormat formatter = DateFormat('yyyy-MM-dd H:m:s');
final Snapshot snapshot;
final HashObject hashObject;
@override
Widget build(final BuildContext context) {
- return D3pCard(
- child: InkWell(
- onTap: () => context.router.push(
- PreviewRouteWrapper(
- hashObject: hashObject,
- snapshot: snapshot,
- ),
+ final theme = Theme.of(context).customTextStyles;
+ return ClickableCard(
+ onTap: () => context.router.push(
+ PreviewRouteWrapper(
+ hashObject: hashObject,
+ snapshot: snapshot,
),
- child: Padding(
- padding: const EdgeInsets.all(16.0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Flexible(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Flexible(
- child: D3pBodyLargeText(
- 'snap_card_name'.tr() + snapshot.name,
- translate: false,
- ),
- ),
- D3pBodyLargeText(
- 'snap_card_stamp'.tr() + formatter.format(snapshot.stamp),
- translate: false,
- ),
- const SizedBox(height: 8),
- Text.rich(snapshot.settingsConfig.toText(context)),
- ],
+ ),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Flexible(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ snapshot.name,
+ style: theme.d3pBodyLarge,
+ ),
+ const SizedBoxH8(),
+ Text.rich(
+ snapshot.settingsConfig.toShort(context),
),
- ),
- HashCardPopUpMenuButton(
- hashObject: hashObject,
- snapshot: snapshot,
- ),
- ],
+ const SizedBoxH8(),
+ D3pBodyMediumText(
+ Fmt.basicDateFormat.format(snapshot.stamp),
+ translate: false,
+ color: D3pColors.disabled,
+ ),
+ ],
+ ),
),
- ),
+ HashCardPopUpMenuButton(
+ hashObject: hashObject,
+ snapshot: snapshot,
+ ),
+ ],
),
);
}
diff --git a/lib/features/scan_page/presentation/widgets/objects_list.dart b/lib/features/scan_page/presentation/widgets/objects_list.dart
index 1ca74510..f1a91864 100644
--- a/lib/features/scan_page/presentation/widgets/objects_list.dart
+++ b/lib/features/scan_page/presentation/widgets/objects_list.dart
@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart';
+import 'package:threedpass/features/scan_page/presentation/widgets/file_hash_header.dart';
import 'package:threedpass/features/scan_page/presentation/widgets/snapshots_list.dart';
class ObjectsList extends StatelessWidget {
@@ -14,23 +16,46 @@ class ObjectsList extends StatelessWidget {
@override
Widget build(final BuildContext context) {
if (state is HashesListLoaded) {
+ final realState = state as HashesListLoaded;
+ final objects = realState.objects;
+
return ListView.builder(
- padding: const EdgeInsets.only(bottom: 46 * 2),
+ padding: const EdgeInsets.only(bottom: 16, left: 16, right: 16),
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
- itemCount: (state as HashesListLoaded).objects.length,
+ itemCount: objects.length,
itemBuilder: (final context, final objIndex) {
- final currentObject = (state as HashesListLoaded).objects[objIndex];
+ final currentObject = objects[objIndex];
+ final fileHashes = currentObject.fileHashes.toList();
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
_ObjectTitle(currentObject.name),
- Flexible(
- child: SnapshotsList(
- currentObject: currentObject,
- ),
+ const SizedBoxH4(),
+ ListView.builder(
+ shrinkWrap: true,
+ physics: const NeverScrollableScrollPhysics(),
+ padding: EdgeInsets.zero,
+ itemCount: fileHashes.length,
+ itemBuilder: (final _, final index) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ FileHashHeader(
+ fileHash: fileHashes[index],
+ ),
+ Flexible(
+ child: SnapshotsList(
+ currentObject: currentObject,
+ allowedFileHash: fileHashes[index],
+ ),
+ ),
+ ],
+ );
+ },
),
],
);
@@ -48,7 +73,7 @@ class _ObjectTitle extends StatelessWidget {
@override
Widget build(final BuildContext context) => Padding(
- padding: const EdgeInsets.only(top: 16, left: 16, right: 16),
+ padding: const EdgeInsets.only(top: 16, right: 16),
child: Text(
title,
style: Theme.of(context).customTextStyles.d3ptitleLarge,
diff --git a/lib/features/scan_page/presentation/widgets/objects_list_header.dart b/lib/features/scan_page/presentation/widgets/objects_list_header.dart
deleted file mode 100644
index de5b4754..00000000
--- a/lib/features/scan_page/presentation/widgets/objects_list_header.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-part of './scan_page_content.dart';
-
-class _ObjectsListHeader extends StatelessWidget {
- const _ObjectsListHeader({
- final Key? key,
- }) : super(key: key);
-
- @override
- Widget build(final BuildContext context) {
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
- child: Text(
- 'saved_objects_header'.tr(),
- style: Theme.of(context).customTextStyles.d3pheadlineMedium,
- ),
- );
- }
-}
diff --git a/lib/features/scan_page/presentation/widgets/scan_page_content.dart b/lib/features/scan_page/presentation/widgets/scan_page_content.dart
index f1956d74..0b361f64 100644
--- a/lib/features/scan_page/presentation/widgets/scan_page_content.dart
+++ b/lib/features/scan_page/presentation/widgets/scan_page_content.dart
@@ -1,14 +1,10 @@
-import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
-import 'package:threedpass/core/theme/d3p_special_styles.dart';
import 'package:threedpass/features/hashes_list/bloc/hashes_list_bloc.dart';
import 'package:threedpass/features/scan_page/presentation/widgets/no_saved_objects_placeholder.dart';
import 'package:threedpass/features/scan_page/presentation/widgets/objects_list.dart';
-part './objects_list_header.dart';
-
class ScanPageContent extends StatelessWidget {
const ScanPageContent({final Key? key}) : super(key: key);
@@ -25,8 +21,6 @@ class ScanPageContent extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- const _ObjectsListHeader(),
- const SizedBox(height: 4),
Flexible(
child: ObjectsList(
state: state,
diff --git a/lib/features/scan_page/presentation/widgets/snapshots_list.dart b/lib/features/scan_page/presentation/widgets/snapshots_list.dart
index 85107758..948ae2f0 100644
--- a/lib/features/scan_page/presentation/widgets/snapshots_list.dart
+++ b/lib/features/scan_page/presentation/widgets/snapshots_list.dart
@@ -1,26 +1,39 @@
import 'package:flutter/material.dart';
import 'package:threedpass/features/hashes_list/domain/entities/hash_object.dart';
+import 'package:threedpass/features/hashes_list/domain/entities/snapshot.dart';
import 'package:threedpass/features/scan_page/presentation/widgets/object_list/hash_card.dart';
class SnapshotsList extends StatelessWidget {
const SnapshotsList({
required this.currentObject,
+ required this.allowedFileHash,
final Key? key,
}) : super(key: key);
final HashObject currentObject;
+ final int allowedFileHash;
@override
- Widget build(final BuildContext context) => ListView.builder(
- physics: const NeverScrollableScrollPhysics(),
- shrinkWrap: true,
- itemCount: currentObject.snapshots.length,
- itemBuilder: (final context, final hashIndex) => Padding(
- padding: const EdgeInsets.symmetric(vertical: 4),
- child: SnapshotCard(
- snapshot: currentObject.snapshots[hashIndex],
- hashObject: currentObject,
- ),
+ Widget build(final BuildContext context) {
+ final listToShow = [];
+
+ for (final snap in currentObject.snapshots) {
+ if (snap.fileHash == allowedFileHash) {
+ listToShow.add(snap);
+ }
+ }
+
+ return ListView.builder(
+ physics: const NeverScrollableScrollPhysics(),
+ shrinkWrap: true,
+ itemCount: listToShow.length,
+ itemBuilder: (final context, final index) => Padding(
+ padding: const EdgeInsets.symmetric(vertical: 4),
+ child: SnapshotCard(
+ snapshot: listToShow[index],
+ hashObject: currentObject,
),
- );
+ ),
+ );
+ }
}
diff --git a/lib/features/settings_page/domain/entities/algorithm.dart b/lib/features/settings_page/domain/entities/algorithm.dart
index fa7a94d5..c1963248 100644
--- a/lib/features/settings_page/domain/entities/algorithm.dart
+++ b/lib/features/settings_page/domain/entities/algorithm.dart
@@ -1,25 +1,28 @@
class AlgorithmMaster {
// Algo names
- static const grid2d_0_3_3_v1 = 'Grid2d. P3D 0.3.3';
- static const grid2d_0_3_3_v2 = 'Grid2d_v2. P3D 0.3.3';
- static const grid2d_0_3_3_v3 = 'Grid2d_v3. P3D 0.3.3';
+ static const grid2d_0_3_4_v1 = 'Grid2d. P3D 0.3.4';
+ static const grid2d_0_3_4_v2 = 'Grid2d_v2. P3D 0.3.4';
+ static const grid2d_0_3_4_v3 = 'Grid2d_v3. P3D 0.3.4';
+ static const grid2d_0_3_4_v3a = 'Grid2d_v3a. P3D 0.3.4';
/// Update this list when a new algorithm is added
static const list = [
- grid2d_0_3_3_v1,
- grid2d_0_3_3_v2,
- grid2d_0_3_3_v3,
+ grid2d_0_3_4_v1,
+ grid2d_0_3_4_v2,
+ grid2d_0_3_4_v3,
+ grid2d_0_3_4_v3a,
];
/// Default value for settings
- static const defaultAlgo = grid2d_0_3_3_v3;
+ static const defaultAlgo = grid2d_0_3_4_v3a;
/// Map to rust lib
/// Must be the same strings as in packages/hash_lib_interface/ffi_interface ...
/// Lengths should be the same as declared in ffi_interface
static const mapToRust = {
- grid2d_0_3_3_v1: '0.3.3_Grid2d_v1',
- grid2d_0_3_3_v2: '0.3.3_Grid2d_v2',
- grid2d_0_3_3_v3: '0.3.3_Grid2d_v3',
+ grid2d_0_3_4_v1: 'Grid2d',
+ grid2d_0_3_4_v2: 'Grid2dV2',
+ grid2d_0_3_4_v3: 'Grid2dV3',
+ grid2d_0_3_4_v3a: 'Grid2dV3a',
};
}
diff --git a/lib/features/settings_page/domain/entities/scan_settings.dart b/lib/features/settings_page/domain/entities/scan_settings.dart
index 3da8b53e..1f9587f8 100644
--- a/lib/features/settings_page/domain/entities/scan_settings.dart
+++ b/lib/features/settings_page/domain/entities/scan_settings.dart
@@ -30,7 +30,7 @@ class ScanSettings extends Equatable {
const ScanSettings.defaultValues()
: gridSize = 8,
algorithm = AlgorithmMaster.defaultAlgo,
- nSections = 15,
+ nSections = 12,
libVersion = 'unknown',
transBytes = '';
@@ -46,7 +46,7 @@ class ScanSettings extends Equatable {
String algorithm = this.algorithm;
if (!AlgorithmMaster.list.contains(algorithm)) {
// If algo is deprecated, migrate slowly
- algorithm = AlgorithmMaster.grid2d_0_3_3_v1;
+ algorithm = AlgorithmMaster.defaultAlgo;
}
return this.copyWith(
diff --git a/lib/features/settings_page/presentation/settings_sub_page/trans_bytes_subpage.dart b/lib/features/settings_page/presentation/settings_sub_page/trans_bytes_subpage.dart
index ce5b1131..dc742eae 100644
--- a/lib/features/settings_page/presentation/settings_sub_page/trans_bytes_subpage.dart
+++ b/lib/features/settings_page/presentation/settings_sub_page/trans_bytes_subpage.dart
@@ -45,7 +45,7 @@ class TransBytesSubPage extends SettingSubPage {
void changeSettings(final String rawInput, final BuildContext context) {
final smartInput = TransBytesInput(rawInput);
if (smartInput.isValid == null) {
- final realInput = smartInput.unmasked;
+ final realInput = smartInput.unmasked.toLowerCase();
final cubit = BlocProvider.of(context);
final newScanConfig =
cubit.state.scanSettings.copyWith(transBytes: realInput);
diff --git a/lib/features/settings_page/presentation/widgets/app_settings/app_settings.dart b/lib/features/settings_page/presentation/widgets/app_settings/app_settings.dart
index 9314d2df..3bc6c838 100644
--- a/lib/features/settings_page/presentation/widgets/app_settings/app_settings.dart
+++ b/lib/features/settings_page/presentation/widgets/app_settings/app_settings.dart
@@ -19,7 +19,7 @@ class AppSettingsBlock extends StatelessWidget {
// const _RequirementsTextField(),
RequirementsButton(),
DarkThemeSwitch(),
- ShowZeroAssets(),
+ // ShowZeroAssets(), // TODO Adapt to new types of assets or delete
PinCodeSettings(),
],
);
diff --git a/lib/features/settings_page/presentation/widgets/app_settings/dark_theme_switch.dart b/lib/features/settings_page/presentation/widgets/app_settings/dark_theme_switch.dart
index cb745179..d6fea4d3 100644
--- a/lib/features/settings_page/presentation/widgets/app_settings/dark_theme_switch.dart
+++ b/lib/features/settings_page/presentation/widgets/app_settings/dark_theme_switch.dart
@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_phoenix/flutter_phoenix.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/app_settings.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
@@ -27,6 +28,7 @@ class DarkThemeSwitch extends StatelessWidget {
Widget build(final BuildContext context) {
return BlocBuilder(
builder: (final context, final state) => DefaultSettingsButton.boolean(
+ cardShape: CardShape.middle,
text: 'dark_theme_switch_label',
iconData: Icons.wb_sunny_outlined,
iconColor: Colors.green,
diff --git a/lib/features/settings_page/presentation/widgets/app_settings/pin_code_settings.dart b/lib/features/settings_page/presentation/widgets/app_settings/pin_code_settings.dart
index cb53a3d2..bf2f283f 100644
--- a/lib/features/settings_page/presentation/widgets/app_settings/pin_code_settings.dart
+++ b/lib/features/settings_page/presentation/widgets/app_settings/pin_code_settings.dart
@@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:logger/logger.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/core/widgets/screen_lock/d3p_screen_lock_create_dialog.dart';
import 'package:threedpass/features/home_page/bloc/home_context_cubit.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
@@ -52,6 +53,7 @@ class _NoPasswordSet extends StatelessWidget {
@override
Widget build(final BuildContext context) {
return DefaultSettingsButton.openButton(
+ cardShape: CardShape.bottom,
iconData: Icons.key,
iconColor: Colors.amber,
textValue: '',
@@ -93,6 +95,7 @@ class _PasswordWasSet extends StatelessWidget {
@override
Widget build(final BuildContext context) {
return DefaultSettingsButton.openButton(
+ cardShape: CardShape.bottom,
iconData: Icons.key_off,
iconColor: Colors.amber,
textValue: '',
diff --git a/lib/features/settings_page/presentation/widgets/app_settings/requirements_button.dart b/lib/features/settings_page/presentation/widgets/app_settings/requirements_button.dart
index 046b6cf7..be5b485f 100644
--- a/lib/features/settings_page/presentation/widgets/app_settings/requirements_button.dart
+++ b/lib/features/settings_page/presentation/widgets/app_settings/requirements_button.dart
@@ -1,6 +1,7 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
import 'package:threedpass/features/settings_page/presentation/widgets/default_settings_button.dart';
@@ -27,6 +28,7 @@ class RequirementsButton extends StatelessWidget {
textValue: state.appSettings.stableRequirement.toString(),
onPressed: () => onPressed(context),
text: 'stable_requirement_button_text',
+ cardShape: CardShape.top,
);
},
);
diff --git a/lib/features/settings_page/presentation/widgets/app_settings/show_zero_assets.dart b/lib/features/settings_page/presentation/widgets/app_settings/show_zero_assets.dart
index aa61873d..ac35086c 100644
--- a/lib/features/settings_page/presentation/widgets/app_settings/show_zero_assets.dart
+++ b/lib/features/settings_page/presentation/widgets/app_settings/show_zero_assets.dart
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/app_settings.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
@@ -29,6 +30,7 @@ class ShowZeroAssets extends StatelessWidget {
iconColor: Colors.green,
initialValue: state.appSettings.showZeroAssets,
onPressedBool: (final bool p0) => onChanged(p0, context),
+ cardShape: CardShape.middle,
),
);
}
diff --git a/lib/features/settings_page/presentation/widgets/default_settings_button.dart b/lib/features/settings_page/presentation/widgets/default_settings_button.dart
index a30606ba..98c93362 100644
--- a/lib/features/settings_page/presentation/widgets/default_settings_button.dart
+++ b/lib/features/settings_page/presentation/widgets/default_settings_button.dart
@@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:threedpass/core/theme/d3p_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_colors.dart';
import 'package:threedpass/core/theme/d3p_special_styles.dart';
import 'package:threedpass/core/utils/empty_function.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/core/widgets/other/right_chevron.dart';
import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
@@ -17,6 +19,8 @@ class DefaultSettingsButton extends StatelessWidget {
required this.onPressedBool,
required this.textValue,
required this.initialValue,
+ required this.cardShape,
+ required this.isChevronGrey,
});
const DefaultSettingsButton.openButton({
@@ -24,7 +28,9 @@ class DefaultSettingsButton extends StatelessWidget {
required this.iconData,
required this.text,
required this.onPressed,
+ required this.cardShape,
this.textValue,
+ this.isChevronGrey = true,
super.key,
}) : isBoolean = false,
initialValue = null,
@@ -36,6 +42,8 @@ class DefaultSettingsButton extends StatelessWidget {
required this.text,
required this.initialValue,
required this.onPressedBool,
+ required this.cardShape,
+ this.isChevronGrey = true,
super.key,
}) : isBoolean = true,
onPressed = emptyFunction,
@@ -49,6 +57,8 @@ class DefaultSettingsButton extends StatelessWidget {
final bool isBoolean;
final bool? initialValue;
final void Function(bool) onPressedBool;
+ final CardShape cardShape;
+ final bool isChevronGrey;
@override
Widget build(final BuildContext context) {
@@ -62,6 +72,8 @@ class DefaultSettingsButton extends StatelessWidget {
textValue: textValue,
initialValue: initialValue,
onPressed: onPressed,
+ cardShape: cardShape,
+ isChevronGrey: isChevronGrey,
),
);
}
@@ -77,6 +89,8 @@ class _ArgumentsDTO {
required this.textValue,
required this.initialValue,
required this.onPressed,
+ required this.cardShape,
+ required this.isChevronGrey,
});
final IconData iconData;
@@ -87,6 +101,8 @@ class _ArgumentsDTO {
final bool? initialValue;
final void Function(bool) onPressedBool;
final void Function()? onPressed;
+ final CardShape cardShape;
+ final bool isChevronGrey;
}
class _WrapCard extends StatelessWidget {
@@ -124,12 +140,18 @@ class _WrappedInkWellBase extends StatelessWidget {
Widget build(final BuildContext context) {
final child = _ButtonBase(args);
- return args.isBoolean
- ? child
- : InkWell(
- onTap: args.onPressed != null ? () => args.onPressed!() : null,
- child: child,
- );
+ return Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: D3pCard(
+ cardShape: args.cardShape,
+ child: args.isBoolean
+ ? child
+ : InkWell(
+ onTap: args.onPressed != null ? () => args.onPressed!() : null,
+ child: child,
+ ),
+ ),
+ );
}
}
@@ -140,6 +162,8 @@ class _ButtonBase extends StatelessWidget {
@override
Widget build(final BuildContext context) {
+ final colors = Theme.of(context).customColors;
+
return Padding(
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: _SettingsButtonContent(
@@ -150,6 +174,7 @@ class _ButtonBase extends StatelessWidget {
boolValue: args.initialValue,
isBoolean: args.isBoolean,
onPressedBool: args.onPressedBool,
+ chevronColor: args.isChevronGrey ? colors.moreFadedGrey : null,
),
);
}
@@ -165,6 +190,7 @@ class _SettingsButtonContent extends StatelessWidget {
required this.boolValue,
required this.isBoolean,
required this.onPressedBool,
+ required this.chevronColor,
});
final IconData iconData;
@@ -174,6 +200,7 @@ class _SettingsButtonContent extends StatelessWidget {
final bool isBoolean;
final bool? boolValue;
final void Function(bool) onPressedBool;
+ final Color? chevronColor;
// final void Function() onPressed;
@override
@@ -194,7 +221,10 @@ class _SettingsButtonContent extends StatelessWidget {
isBoolean
? _BoolSwitch(value: boolValue!, onChanged: onPressedBool)
: Flexible(
- child: _Value(value: value),
+ child: _Value(
+ value: value,
+ chevronColor: chevronColor,
+ ),
),
],
),
@@ -236,8 +266,10 @@ class _BoolSwitch extends StatelessWidget {
class _Value extends StatelessWidget {
const _Value({
required this.value,
+ required this.chevronColor,
});
final String? value;
+ final Color? chevronColor;
@override
Widget build(final BuildContext context) {
@@ -249,7 +281,7 @@ class _Value extends StatelessWidget {
Flexible(
child: _ValueText(value: value),
),
- const RightChevron(),
+ RightChevron(color: chevronColor),
],
);
}
diff --git a/lib/features/settings_page/presentation/widgets/hash_settings/algorithm_button.dart b/lib/features/settings_page/presentation/widgets/hash_settings/algorithm_button.dart
index 075d86c5..2cd9f6a1 100644
--- a/lib/features/settings_page/presentation/widgets/hash_settings/algorithm_button.dart
+++ b/lib/features/settings_page/presentation/widgets/hash_settings/algorithm_button.dart
@@ -1,6 +1,7 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
import 'package:threedpass/features/settings_page/presentation/widgets/default_settings_button.dart';
@@ -27,6 +28,7 @@ class AlgorithmButton extends StatelessWidget {
textValue: value,
onPressed: () => onPressed(context),
text: 'algorithm_button_label',
+ cardShape: CardShape.top,
);
},
);
diff --git a/lib/features/settings_page/presentation/widgets/hash_settings/grid_size_button.dart b/lib/features/settings_page/presentation/widgets/hash_settings/grid_size_button.dart
index deed6ab2..b11322d1 100644
--- a/lib/features/settings_page/presentation/widgets/hash_settings/grid_size_button.dart
+++ b/lib/features/settings_page/presentation/widgets/hash_settings/grid_size_button.dart
@@ -1,6 +1,7 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
import 'package:threedpass/features/settings_page/presentation/widgets/default_settings_button.dart';
@@ -28,6 +29,7 @@ class GridSizeButton extends StatelessWidget {
textValue: stringValue,
onPressed: () => onPressed(context),
text: 'grid_size_label',
+ cardShape: CardShape.middle,
);
},
);
diff --git a/lib/features/settings_page/presentation/widgets/hash_settings/sections_button.dart b/lib/features/settings_page/presentation/widgets/hash_settings/sections_button.dart
index edd7d712..b8466db8 100644
--- a/lib/features/settings_page/presentation/widgets/hash_settings/sections_button.dart
+++ b/lib/features/settings_page/presentation/widgets/hash_settings/sections_button.dart
@@ -1,6 +1,7 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
import 'package:threedpass/features/settings_page/presentation/widgets/default_settings_button.dart';
@@ -27,6 +28,7 @@ class SectionsButton extends StatelessWidget {
iconColor: Colors.purple,
textValue: state.scanSettings.nSections.toString(),
onPressed: () => onPressed(context),
+ cardShape: CardShape.middle,
);
},
);
diff --git a/lib/features/settings_page/presentation/widgets/hash_settings/trans_bytes.dart b/lib/features/settings_page/presentation/widgets/hash_settings/trans_bytes.dart
index 0ccb4f2d..9b9c1e22 100644
--- a/lib/features/settings_page/presentation/widgets/hash_settings/trans_bytes.dart
+++ b/lib/features/settings_page/presentation/widgets/hash_settings/trans_bytes.dart
@@ -32,7 +32,7 @@ class _State extends State {
return D3pTextFormField(
controller: widget.controller,
labelText: 'trans_bytes_input_label'.tr(),
- suffixButton: Text('Clear'.tr()),
+ suffixButton: Icons.clear,
onSuffixButtonPressed: () => onClearPressed(context),
// onChanged: (final value) => changeSettings(value ?? '', context),
validator: (final input) => TransBytesInput(input ?? '').isValid,
diff --git a/lib/features/settings_page/presentation/widgets/hash_settings/trans_bytes_button.dart b/lib/features/settings_page/presentation/widgets/hash_settings/trans_bytes_button.dart
index 56fdfd8f..b535826b 100644
--- a/lib/features/settings_page/presentation/widgets/hash_settings/trans_bytes_button.dart
+++ b/lib/features/settings_page/presentation/widgets/hash_settings/trans_bytes_button.dart
@@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
import 'package:threedpass/features/settings_page/presentation/widgets/default_settings_button.dart';
@@ -31,6 +32,7 @@ class TransBytesButton extends StatelessWidget {
iconColor: Colors.purple,
textValue: text,
onPressed: () => onPressed(context),
+ cardShape: CardShape.bottom,
);
},
);
diff --git a/lib/features/settings_page/presentation/widgets/preview_settings/antialias_switch.dart b/lib/features/settings_page/presentation/widgets/preview_settings/antialias_switch.dart
index d1b834c7..c1186b9c 100644
--- a/lib/features/settings_page/presentation/widgets/preview_settings/antialias_switch.dart
+++ b/lib/features/settings_page/presentation/widgets/preview_settings/antialias_switch.dart
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
import 'package:threedpass/features/settings_page/domain/entities/preview_settings.dart';
@@ -30,6 +31,7 @@ class AntialiasSwitch extends StatelessWidget {
iconColor: Colors.green,
initialValue: state.previewSettings.antialias,
onPressedBool: (final bool p0) => onChanged(p0, context),
+ cardShape: CardShape.bottom,
),
);
}
diff --git a/lib/features/settings_page/presentation/widgets/preview_settings/pixel_ratio_button.dart b/lib/features/settings_page/presentation/widgets/preview_settings/pixel_ratio_button.dart
index 22858650..b53ebb4f 100644
--- a/lib/features/settings_page/presentation/widgets/preview_settings/pixel_ratio_button.dart
+++ b/lib/features/settings_page/presentation/widgets/preview_settings/pixel_ratio_button.dart
@@ -1,6 +1,7 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
import 'package:threedpass/features/settings_page/presentation/widgets/default_settings_button.dart';
@@ -27,6 +28,7 @@ class PixelRatioButton extends StatelessWidget {
textValue: state.previewSettings.pixelRatio.toString(),
onPressed: () => onPressed(context),
text: 'preview_settings_pixel_ratio_label',
+ cardShape: CardShape.top,
);
},
);
diff --git a/lib/features/settings_page/presentation/widgets/settings_text.dart b/lib/features/settings_page/presentation/widgets/settings_text.dart
index 9e24fe83..2190850f 100644
--- a/lib/features/settings_page/presentation/widgets/settings_text.dart
+++ b/lib/features/settings_page/presentation/widgets/settings_text.dart
@@ -1,31 +1,111 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
+import 'package:threedpass/core/theme/d3p_colors.dart';
import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/utils/copy_and_notify.dart';
+import 'package:threedpass/core/widgets/buttons/icon_button.dart';
import 'package:threedpass/features/settings_page/domain/entities/scan_settings.dart';
+const int $nbsp = 0x00A0; // Non-breaking space
+
extension ToText on ScanSettings {
- TextSpan toText(final BuildContext context) {
- return TextSpan(
- text: 'settings_text_span_title'.tr() + '\n',
- style: Theme.of(context).customTextStyles.d3pBodyLarge,
- children: [
- TextSpan(
- text: '- ' + 'algorithm_span'.tr() + ': ' + algorithm + '\n',
- ),
- TextSpan(
- text: '- ' + 'grid_span'.tr() + ': ${gridSize}x$gridSize\n',
- ),
- TextSpan(
- text: '- ' + 'n_sections_span'.tr() + ': $nSections\n',
- ),
+ List propertiesList() {
+ final res = [
+ '- ' + 'algorithm_span'.tr() + ': ' + algorithm + '\n',
+ '- ' + 'grid_span'.tr() + ': ${gridSize}x$gridSize\n',
+ '- ' + 'n_sections_span'.tr() + ': $nSections\n',
+ '- ' + 'lib_version_span'.tr() + ': $libVersion\n',
+ '- ' + 'trans_bytes_span'.tr() + ': ${transBytes.toLowerCase()}',
+ ];
+ return res;
+ }
+
+ String toRawString() {
+ return 'settings_text_span_title'.tr() + '\n' + propertiesList().join();
+ }
+
+ TextSpan toShort(
+ final BuildContext context,
+ ) {
+ final medium = Theme.of(context).customTextStyles.d3pBodyMedium;
+ final tags = [
+ 'A: ',
+ 'G: ',
+ 'N: ',
+ 'R:' + String.fromCharCode($nbsp) + '0x',
+ ];
+ final props = [
+ algorithm,
+ '${gridSize}x$gridSize',
+ nSections.toString(),
+ // libVersion,
+ transBytes.toLowerCase(),
+ ];
+ final children = [];
+ for (var i = 0; i < tags.length; i++) {
+ children.add(
TextSpan(
- text: '- ' + 'lib_version_span'.tr() + ': $libVersion\n',
+ text: tags[i],
+ style: medium.copyWith(color: D3pColors.disabled),
+ children: [
+ TextSpan(
+ text: props[i],
+ style: medium,
+ ),
+ TextSpan(
+ text: i != tags.length - 1 ? '; ' : '',
+ style: medium.copyWith(color: D3pColors.disabled),
+ ),
+ ],
),
+ );
+ }
+ return TextSpan(
+ text: '',
+ // style: ,
+ children: children,
+ );
+ }
+
+ TextSpan toText(final BuildContext context, [final TextStyle? style]) {
+ final props = propertiesList();
+ final children = [];
+ for (final str in props) {
+ // WidgetSpan(
+ // child: Icon(Icons.add, size: 14),
+ // ),
+ // recognizer: TapGestureRecognizer()
+ // ..onTap = () {
+ // print('Privacy Policy"');
+ // }),
+ children.add(
TextSpan(
- text:
- '- ' + 'trans_bytes_span'.tr() + ': ${transBytes.toLowerCase()}',
+ text: str,
+ children: [
+ if (str == props.last)
+ WidgetSpan(
+ child: Padding(
+ padding: const EdgeInsets.only(left: 16),
+ child: D3pIconButton(
+ iconData: Icons.copy,
+ size: 16,
+ onPressed: () => copyAndNotify(
+ textToCopy: transBytes,
+ textToShow: 'trans_bytes_copied_toast'.tr(),
+ ),
+ emptyContraints: true,
+ ),
+ ),
+ ),
+ ],
),
- ],
+ );
+ }
+
+ return TextSpan(
+ text: '',
+ style: style ?? Theme.of(context).customTextStyles.d3pBodyMedium,
+ children: children,
);
}
}
diff --git a/lib/features/settings_page/presentation/widgets/wallet_settings/node_url_button.dart b/lib/features/settings_page/presentation/widgets/wallet_settings/node_url_button.dart
index f5a6d455..492787c0 100644
--- a/lib/features/settings_page/presentation/widgets/wallet_settings/node_url_button.dart
+++ b/lib/features/settings_page/presentation/widgets/wallet_settings/node_url_button.dart
@@ -1,6 +1,7 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
import 'package:threedpass/features/settings_page/presentation/widgets/default_settings_button.dart';
@@ -30,6 +31,7 @@ class NodeUrlButton extends StatelessWidget {
iconColor: Colors.amber,
textValue: nodeUrlValue,
onPressed: () => onPressed(context),
+ cardShape: CardShape.all,
);
},
);
diff --git a/lib/features/settings_page/presentation/widgets/wallet_settings/node_url_textfield.dart b/lib/features/settings_page/presentation/widgets/wallet_settings/node_url_textfield.dart
index dde8be26..9b20f411 100644
--- a/lib/features/settings_page/presentation/widgets/wallet_settings/node_url_textfield.dart
+++ b/lib/features/settings_page/presentation/widgets/wallet_settings/node_url_textfield.dart
@@ -26,8 +26,8 @@ class NodeUrlTextfield extends StatelessWidget {
return D3pTextFormField(
controller: textEditingController,
labelText: 'node_url_label'.tr(),
- labelButton: Text('Reset'.tr()),
- onLabelButtonPressed: () => onResetButtonPressed(context),
+ suffixButton: Icons.restore_outlined,
+ onSuffixButtonPressed: () => onResetButtonPressed(context),
autofocus: true,
);
}
diff --git a/lib/features/wallet_screen/presentation/assets_page/assets_page.dart b/lib/features/wallet_screen/assets_page/assets_page.dart
similarity index 70%
rename from lib/features/wallet_screen/presentation/assets_page/assets_page.dart
rename to lib/features/wallet_screen/assets_page/assets_page.dart
index a9006ce9..f940dddc 100644
--- a/lib/features/wallet_screen/presentation/assets_page/assets_page.dart
+++ b/lib/features/wallet_screen/assets_page/assets_page.dart
@@ -4,11 +4,11 @@ import 'package:threedpass/core/polkawallet/app_service.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
import 'package:threedpass/core/theme/d3p_special_colors.dart';
import 'package:threedpass/core/widgets/paddings.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/asset_page_appbar.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/coins_balance.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/non_native_tokens.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/accounts_drawer.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/asset_page_appbar.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/buttons_panel.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/coins_balance.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart';
class AssetsPage extends StatelessWidget {
const AssetsPage({final Key? key}) : super(key: key);
@@ -38,8 +38,11 @@ class AssetsPage extends StatelessWidget {
CoinsBalance(),
SizedBoxH8(),
AssetPageButtonsPanel(),
+ // Flexible(
+ // child: NonNativeTokens(),
+ // ),
Flexible(
- child: NonNativeTokens(),
+ child: UploadedObjectsList(),
),
],
),
diff --git a/lib/features/wallet_screen/presentation/assets_page/remove_account_dialog.dart b/lib/features/wallet_screen/assets_page/remove_account_dialog.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/assets_page/remove_account_dialog.dart
rename to lib/features/wallet_screen/assets_page/remove_account_dialog.dart
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart b/lib/features/wallet_screen/assets_page/widgets/accounts_drawer.dart
similarity index 97%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart
rename to lib/features/wallet_screen/assets_page/widgets/accounts_drawer.dart
index ef1ad09b..a91aae1a 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/accounts_drawer.dart
@@ -11,7 +11,7 @@ import 'package:threedpass/core/widgets/buttons/list_tile_button.dart';
import 'package:threedpass/core/widgets/buttons/text_button.dart';
import 'package:threedpass/core/widgets/paddings.dart';
import 'package:threedpass/features/preview_page/bloc/outer_context_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/remove_account_dialog.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/remove_account_dialog.dart';
import 'package:threedpass/router/route_paths.dart';
part './accounts_drawer/account_text_button.dart';
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer/account_text_button.dart b/lib/features/wallet_screen/assets_page/widgets/accounts_drawer/account_text_button.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/accounts_drawer/account_text_button.dart
rename to lib/features/wallet_screen/assets_page/widgets/accounts_drawer/account_text_button.dart
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/actual_balance.dart b/lib/features/wallet_screen/assets_page/widgets/actual_balance.dart
similarity index 75%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/actual_balance.dart
rename to lib/features/wallet_screen/assets_page/widgets/actual_balance.dart
index 97abb964..055958c0 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/actual_balance.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/actual_balance.dart
@@ -3,10 +3,10 @@ import 'package:flutter/material.dart';
import 'package:polkawallet_sdk/api/types/balanceData.dart';
import 'package:threedpass/core/polkawallet/utils/balance_utils.dart';
import 'package:threedpass/core/widgets/d3p_card.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/balance_card/avaliable_balance_card.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/balance_card/locked_balance_card.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/balance_card/reserved_balance_card.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/asset_balance_text.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/balance_card/avaliable_balance_card.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/balance_card/locked_balance_card.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/balance_card/reserved_balance_card.dart';
+import 'package:threedpass/features/wallet_screen/widgets/asset_balance_text.dart';
import 'package:threedpass/router/router.gr.dart';
part './balance_card/main_balance_content.dart';
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/asset_page_appbar.dart b/lib/features/wallet_screen/assets_page/widgets/asset_page_appbar.dart
similarity index 81%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/asset_page_appbar.dart
rename to lib/features/wallet_screen/assets_page/widgets/asset_page_appbar.dart
index 9a4f722e..aead5918 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/asset_page_appbar.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/asset_page_appbar.dart
@@ -9,7 +9,7 @@ import 'package:threedpass/core/utils/copy_and_notify.dart';
import 'package:threedpass/core/utils/formatters.dart';
import 'package:threedpass/core/widgets/buttons/icon_button.dart';
import 'package:threedpass/core/widgets/paddings.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/notifications_icon_button.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/notifications_icon_button.dart';
class AssetPageAppbar extends AppBar {
AssetPageAppbar({
@@ -19,11 +19,13 @@ class AssetPageAppbar extends AppBar {
key: key,
backgroundColor: const D3pAppBarTheme().backgroundColor,
centerTitle: true,
- leading: const _SmartLeadingBackButton(),
+ leading: const _OpenDrawerButton(),
title: SizedBox(
+ // color: Colors.red,
height: kToolbarHeight,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.center,
children: [
D3pAddressIcon(
account.address,
@@ -43,21 +45,29 @@ class AssetPageAppbar extends AppBar {
),
actions: const [
NotificationsIconButton(),
+ SizedBox(width: 16),
],
);
}
-class _SmartLeadingBackButton extends StatelessWidget {
- const _SmartLeadingBackButton();
+class _OpenDrawerButton extends StatelessWidget {
+ const _OpenDrawerButton();
@override
Widget build(final BuildContext context) {
final theme = Theme.of(context);
- return D3pIconButton(
- iconData: Icons.switch_account_rounded,
- iconColor: theme.customColors.appBarButton,
- onPressed: () => Scaffold.of(context).openDrawer(),
+ return SizedBox(
+ // width: D3pAddressIcon.defaultSize,
+ height: kToolbarHeight,
+ child: Align(
+ child: D3pIconButton(
+ emptyContraints: true,
+ iconData: Icons.switch_account_rounded,
+ iconColor: theme.customColors.appBarButton,
+ onPressed: () => Scaffold.of(context).openDrawer(),
+ ),
+ ),
);
}
}
@@ -113,7 +123,7 @@ class _CopyButton extends StatelessWidget {
D3pIconButton(
emptyContraints: true,
iconData: Icons.copy,
- size: 20,
+ size: 24,
iconColor: theme.customColors.appBarButton,
onPressed: () => copyAndNotify(
textToCopy: accountAddress ?? '',
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/avaliable_balance_card.dart b/lib/features/wallet_screen/assets_page/widgets/balance_card/avaliable_balance_card.dart
similarity index 84%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/avaliable_balance_card.dart
rename to lib/features/wallet_screen/assets_page/widgets/balance_card/avaliable_balance_card.dart
index 51cbac3f..a7b41da3 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/avaliable_balance_card.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/balance_card/avaliable_balance_card.dart
@@ -1,6 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/balance_card/basic_balance_card.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/balance_card/basic_balance_card.dart';
class AvaliableBalanceCard extends StatelessWidget {
const AvaliableBalanceCard({
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/basic_balance_card.dart b/lib/features/wallet_screen/assets_page/widgets/balance_card/basic_balance_card.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/basic_balance_card.dart
rename to lib/features/wallet_screen/assets_page/widgets/balance_card/basic_balance_card.dart
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/locked_balance_card.dart b/lib/features/wallet_screen/assets_page/widgets/balance_card/locked_balance_card.dart
similarity index 85%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/locked_balance_card.dart
rename to lib/features/wallet_screen/assets_page/widgets/balance_card/locked_balance_card.dart
index 7d095bc1..e06bdc3b 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/locked_balance_card.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/balance_card/locked_balance_card.dart
@@ -1,6 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/balance_card/basic_balance_card.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/balance_card/basic_balance_card.dart';
class LockedBalanceCard extends StatelessWidget {
const LockedBalanceCard({
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/main_balance_content.dart b/lib/features/wallet_screen/assets_page/widgets/balance_card/main_balance_content.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/main_balance_content.dart
rename to lib/features/wallet_screen/assets_page/widgets/balance_card/main_balance_content.dart
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/reserved_balance_card.dart b/lib/features/wallet_screen/assets_page/widgets/balance_card/reserved_balance_card.dart
similarity index 85%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/reserved_balance_card.dart
rename to lib/features/wallet_screen/assets_page/widgets/balance_card/reserved_balance_card.dart
index 727d4a01..807e9812 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/balance_card/reserved_balance_card.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/balance_card/reserved_balance_card.dart
@@ -1,6 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/balance_card/basic_balance_card.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/balance_card/basic_balance_card.dart';
class ReservedBalanceCard extends StatelessWidget {
const ReservedBalanceCard({
diff --git a/lib/features/wallet_screen/assets_page/widgets/buttons_panel.dart b/lib/features/wallet_screen/assets_page/widgets/buttons_panel.dart
new file mode 100644
index 00000000..236c8773
--- /dev/null
+++ b/lib/features/wallet_screen/assets_page/widgets/buttons_panel.dart
@@ -0,0 +1,35 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/coin_transfer_button.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/recieve_button.dart';
+import 'package:threedpass/features/wallet_screen/widgets/is_account_ready_builder.dart';
+
+class AssetPageButtonsPanel extends StatelessWidget {
+ const AssetPageButtonsPanel({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ return IsAccountReadyBuilder(
+ builder: (final BuildContext context, final bool isReady) {
+ if (!isReady) {
+ return const SizedBox();
+ }
+ return const Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ SizedBox(width: 16),
+ Flexible(
+ flex: 3,
+ child: CoinTransferButton(),
+ ),
+ SizedBox(width: 8),
+ Flexible(
+ child: RecieveButton(),
+ ),
+ SizedBox(width: 16),
+ ],
+ );
+ },
+ );
+ }
+}
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/coin_transfer_button.dart b/lib/features/wallet_screen/assets_page/widgets/coin_transfer_button.dart
similarity index 70%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/coin_transfer_button.dart
rename to lib/features/wallet_screen/assets_page/widgets/coin_transfer_button.dart
index 61a0abbb..99ec5a5e 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/coin_transfer_button.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/coin_transfer_button.dart
@@ -1,11 +1,12 @@
import 'package:auto_route/auto_route.dart';
+import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
import 'package:threedpass/core/polkawallet/utils/network_state_data_extension.dart';
-import 'package:threedpass/core/widgets/buttons/floating_action_button.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_meta_dto.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/is_account_ready_builder.dart';
+import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
+import 'package:threedpass/features/wallet_screen/transfer_page/entities/transfer_meta_dto.dart';
+import 'package:threedpass/features/wallet_screen/widgets/is_account_ready_builder.dart';
import 'package:threedpass/router/router.gr.dart';
class CoinTransferButton extends StatelessWidget {
@@ -28,10 +29,9 @@ class CoinTransferButton extends StatelessWidget {
Widget build(final BuildContext context) {
return IsAccountReadyBuilder(
builder: (final BuildContext context, final bool isReady) {
- return D3pFloatingActionButton(
- heroTag: 'transfer_coins_button_label',
- text: 'transfer_coins_button_label',
- icons: Icons.arrow_upward_rounded,
+ return D3pElevatedButton(
+ text: 'transfer_coins_button_label'.tr(),
+ iconData: Icons.arrow_upward_rounded,
onPressed: isReady ? () => onPressed(context) : null,
);
},
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/coins_balance.dart b/lib/features/wallet_screen/assets_page/widgets/coins_balance.dart
similarity index 93%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/coins_balance.dart
rename to lib/features/wallet_screen/assets_page/widgets/coins_balance.dart
index bba528f5..118afbb5 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/coins_balance.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/coins_balance.dart
@@ -6,7 +6,7 @@ import 'package:threedpass/core/polkawallet/app_service.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
import 'package:threedpass/core/polkawallet/utils/balance_utils.dart';
import 'package:threedpass/core/polkawallet/utils/network_state_data_extension.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/actual_balance.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/actual_balance.dart';
class CoinsBalance extends StatelessWidget {
const CoinsBalance({final Key? key}) : super(key: key);
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_card.dart b/lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_card.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_card.dart
rename to lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_card.dart
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_column.dart b/lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_column.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_column.dart
rename to lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_column.dart
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_loading.dart b/lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_loading.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_loading.dart
rename to lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_loading.dart
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_loading_placeholder.dart b/lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_loading_placeholder.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_loading_placeholder.dart
rename to lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_loading_placeholder.dart
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_placeholder.dart b/lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_placeholder.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/assets_placeholder.dart
rename to lib/features/wallet_screen/assets_page/widgets/non_native_tokens/assets_placeholder.dart
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/non_native_tokens.dart b/lib/features/wallet_screen/assets_page/widgets/non_native_tokens/non_native_tokens.dart
similarity index 96%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/non_native_tokens.dart
rename to lib/features/wallet_screen/assets_page/widgets/non_native_tokens/non_native_tokens.dart
index ba4717c7..e069f6aa 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/non_native_tokens/non_native_tokens.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/non_native_tokens/non_native_tokens.dart
@@ -15,7 +15,7 @@ import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
import 'package:threedpass/core/widgets/text/d3p_title_large_text.dart';
import 'package:threedpass/features/settings_page/bloc/settings_page_cubit.dart';
import 'package:threedpass/features/settings_page/domain/entities/global_settings.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart';
import 'package:threedpass/router/router.gr.dart';
part 'assets_loading.dart';
diff --git a/lib/features/wallet_screen/assets_page/widgets/notifications_icon_button.dart b/lib/features/wallet_screen/assets_page/widgets/notifications_icon_button.dart
new file mode 100644
index 00000000..e497ea4f
--- /dev/null
+++ b/lib/features/wallet_screen/assets_page/widgets/notifications_icon_button.dart
@@ -0,0 +1,82 @@
+import 'package:auto_route/auto_route.dart';
+import 'package:badges/badges.dart';
+import 'package:badges/badges.dart' as badges;
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/core/theme/d3p_colors.dart';
+import 'package:threedpass/core/theme/d3p_special_styles.dart';
+import 'package:threedpass/core/theme/d3p_theme.dart';
+import 'package:threedpass/core/widgets/buttons/icon_button.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+import 'package:threedpass/router/router.gr.dart';
+
+class NotificationsIconButton extends StatelessWidget {
+ const NotificationsIconButton({super.key});
+
+ Color lastNTypeToBadgeColor(final ExtrinsicStatus status) {
+ switch (status) {
+ case ExtrinsicStatus.failed:
+ return Colors.red;
+ case ExtrinsicStatus.error:
+ return Colors.red;
+ case ExtrinsicStatus.success:
+ return D3pThemeData.mainColor;
+ case ExtrinsicStatus.loading:
+ return D3pColors.disabled;
+ }
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ final customTextStyles = Theme.of(context).customTextStyles;
+ // final customColors = Theme.of(context).customColors;
+
+ return BlocBuilder(
+ builder: (final context, final state) {
+ if (state.notifications.isEmpty) {
+ return const _NotificationIcon();
+ }
+
+ final String badgeText = state.notifications.length.toString();
+ final badgeColor = state.notifications.isNotEmpty
+ ? lastNTypeToBadgeColor(state.notifications.reversed.last.status)
+ : Colors.green;
+
+ return badges.Badge(
+ badgeContent: Text(
+ badgeText,
+ style: customTextStyles.d3pBodyMedium.copyWith(color: Colors.white),
+ ),
+ position: badges.BadgePosition.topEnd(top: 2, end: -8),
+ badgeAnimation: const BadgeAnimation.scale(),
+ badgeStyle: BadgeStyle(badgeColor: badgeColor),
+ child: const _NotificationIcon(),
+ );
+ },
+ );
+ }
+}
+
+class _NotificationIcon extends StatelessWidget {
+ const _NotificationIcon();
+
+ void onPressed(final BuildContext context) {
+ context.router.push(const NotificationsRoute());
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ return SizedBox(
+ // width: D3pAddressIcon.defaultSize,
+ height: kToolbarHeight,
+ child: Align(
+ child: D3pIconButton(
+ emptyContraints: true,
+ iconData: Icons.notifications_none_outlined,
+ onPressed: () => onPressed(context),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart
new file mode 100644
index 00000000..88179bcf
--- /dev/null
+++ b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list.dart
@@ -0,0 +1,63 @@
+import 'package:flutter/widgets.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/polkawallet/app_service.dart';
+import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/progress_indicator/thin_progress_indicator.dart';
+import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cubit.dart';
+import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart';
+import 'package:threedpass/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart';
+
+class UploadedObjectsList extends StatelessWidget {
+ const UploadedObjectsList({super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ return BlocBuilder(
+ builder: (final context, final appService) {
+ return BlocBuilder(
+ builder: (final context, final state) {
+ final relatedObjects = [];
+ state.objects.forEach((final obj) {
+ if (obj.owner == appService.keyring.current.address) {
+ relatedObjects.add(obj);
+ }
+ });
+
+ if (relatedObjects.isEmpty) {
+ return const SizedBox();
+ }
+
+ return Column(
+ children: [
+ const SizedBoxH16(),
+ const Padding(
+ padding: EdgeInsets.symmetric(horizontal: 16),
+ child: ObjectsListHeaderFull(),
+ ),
+ Flexible(
+ child: ListView.builder(
+ physics: const NeverScrollableScrollPhysics(),
+ padding:
+ const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
+ shrinkWrap: true,
+ itemCount: relatedObjects.length,
+ itemBuilder: (final context, final index) => Padding(
+ padding: const EdgeInsets.symmetric(vertical: 4),
+ child: ObjectsListItem(
+ uploadedObject: relatedObjects[index],
+ ),
+ ),
+ ),
+ ),
+ if (state.status == PoscanObjectStateStatus.loading)
+ const ThinProgressIndicator(),
+ ],
+ );
+ },
+ );
+ },
+ );
+ }
+}
diff --git a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart
new file mode 100644
index 00000000..dcb18206
--- /dev/null
+++ b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_header_full.dart
@@ -0,0 +1,32 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/core/widgets/buttons/icon_button.dart';
+import 'package:threedpass/core/widgets/text/d3p_title_large_text.dart';
+import 'package:threedpass/features/poscan_objects_query/bloc/poscan_objects_cubit.dart';
+
+class ObjectsListHeaderFull extends StatelessWidget {
+ const ObjectsListHeaderFull({
+ super.key,
+ });
+
+ Future refreshObjectsList(final BuildContext context) async {
+ final objectsCubit = BlocProvider.of(context);
+ objectsCubit.clear();
+ return objectsCubit.loadAll();
+ }
+
+ @override
+ Widget build(final BuildContext context) {
+ return Row(
+ mainAxisSize: MainAxisSize.max,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ const D3pTitleLargeText('objects_list_header'),
+ D3pIconButton(
+ iconData: Icons.refresh,
+ onPressed: () => refreshObjectsList(context),
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart
new file mode 100644
index 00000000..63d07d24
--- /dev/null
+++ b/lib/features/wallet_screen/assets_page/widgets/objects_list/objects_list_item.dart
@@ -0,0 +1,43 @@
+import 'package:auto_route/auto_route.dart';
+import 'package:flutter/widgets.dart';
+import 'package:threedpass/core/widgets/buttons/clickable_card.dart';
+import 'package:threedpass/features/poscan_objects_query/domain/entities/uploaded_object.dart';
+import 'package:threedpass/features/wallet_screen/uploaded_object_page/widgets/snapshot_connected_to_uploaded.dart';
+import 'package:threedpass/features/wallet_screen/uploaded_object_page/widgets/uploaded_object_id_text.dart';
+import 'package:threedpass/features/wallet_screen/uploaded_object_page/widgets/uploaded_object_status_text.dart';
+import 'package:threedpass/router/router.gr.dart';
+
+class ObjectsListItem extends StatelessWidget {
+ const ObjectsListItem({required this.uploadedObject, super.key});
+
+ final UploadedObject uploadedObject;
+
+ @override
+ Widget build(final BuildContext context) {
+ return ClickableCard(
+ child: Column(
+ children: [
+ Row(
+ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ UploadedObjectIdText(
+ uploadedObject: uploadedObject,
+ ),
+ const SizedBox(width: 16),
+ UploadedObjectStatusText(
+ uploadedObject: uploadedObject,
+ ),
+ ],
+ ),
+ SnapshotConnectedToUploaded(
+ uploadedObject: uploadedObject,
+ topPadding: 8,
+ ),
+ ],
+ ),
+ onTap: () => context.router.push(
+ UploadedObjectRoute(uploadedObject: uploadedObject),
+ ),
+ );
+ }
+}
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/recieve_button.dart b/lib/features/wallet_screen/assets_page/widgets/recieve_button.dart
similarity index 65%
rename from lib/features/wallet_screen/presentation/assets_page/widgets/recieve_button.dart
rename to lib/features/wallet_screen/assets_page/widgets/recieve_button.dart
index 213d8730..05a974d2 100644
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/recieve_button.dart
+++ b/lib/features/wallet_screen/assets_page/widgets/recieve_button.dart
@@ -1,6 +1,6 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
-import 'package:threedpass/core/widgets/buttons/floating_action_button.dart';
+import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
import 'package:threedpass/router/router.gr.dart';
class RecieveButton extends StatelessWidget {
@@ -12,10 +12,9 @@ class RecieveButton extends StatelessWidget {
@override
Widget build(final BuildContext context) {
- return D3pFloatingActionButton(
- heroTag: 'recieve_coins_button_label',
- text: 'recieve_coins_button_label',
- icons: Icons.arrow_downward_rounded,
+ return D3pElevatedButton(
+ text: '',
+ iconData: Icons.qr_code_2_rounded,
onPressed: () => onPressed(context),
);
}
diff --git a/lib/features/wallet_screen/bloc/notifications_cubit.dart b/lib/features/wallet_screen/bloc/notifications_cubit.dart
deleted file mode 100644
index ca3c2ab3..00000000
--- a/lib/features/wallet_screen/bloc/notifications_cubit.dart
+++ /dev/null
@@ -1,94 +0,0 @@
-import 'package:copy_with_extension/copy_with_extension.dart';
-import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-
-part 'notifications_cubit.g.dart';
-
-enum NotificationType { transfer, vote }
-
-@CopyWith()
-class NotificationDTO {
- final String? fromAddress;
- final String? toAddress;
- final String? amount;
- final NotificationType type;
- final ExtrisincStatus status;
- final String? message;
- final String? symbols;
- final DateTime? blockDateTime;
-
- const NotificationDTO({
- required this.type,
- required this.status,
- required this.amount,
- this.fromAddress,
- this.toAddress,
- this.message,
- this.symbols,
- this.blockDateTime,
- });
-}
-
-@CopyWith()
-class NotificationsState {
- final List notifications;
- final bool isLoading;
-
- const NotificationsState({
- required this.notifications,
- this.isLoading = false,
- });
-
- const NotificationsState.initial()
- : notifications = const [],
- isLoading = true;
-}
-
-class NotificationsCubit extends Cubit {
- NotificationsCubit() : super(const NotificationsState.initial());
-
- Future init() async {
- // final test = [
- // const NotificationDTO(
- // amount: '1231.23 P3D',
- // fromAddresses: ['d1D8TcfAy9UWY92uFsoeiMKCvyTgLgUPvyM5gMrBGtWY86oxF'],
- // toAddresses: ['d1D8TcfAy9UWY92uFsoeiMKCvyTgLgUPvyM5gMrBGtWY86oxF'],
- // status: ExtrisincStatus.loading,
- // type: NotificationType.transfer,
- // symbols: 'P3D',
- // ),
- // const NotificationDTO(
- // amount: '1231.23 P3D',
- // fromAddresses: ['d1D8TcfAy9UWY92uFsoeiMKCvyTgLgUPvyM5gMrBGtWY86oxF'],
- // toAddresses: ['d1D8TcfAy9UWY92uFsoeiMKCvyTgLgUPvyM5gMrBGtWY86oxF'],
- // status: ExtrisincStatus.success,
- // type: NotificationType.transfer,
- // symbols: 'P3D',
- // ),
- // const NotificationDTO(
- // amount: '1231.23 P3D',
- // fromAddresses: ['d1D8TcfAy9UWY92uFsoeiMKCvyTgLgUPvyM5gMrBGtWY86oxF'],
- // toAddresses: ['d1D8TcfAy9UWY92uFsoeiMKCvyTgLgUPvyM5gMrBGtWY86oxF'],
- // status: ExtrisincStatus.failed,
- // type: NotificationType.transfer,
- // symbols: 'P3D',
- // ),
- // ];
-
- // final newList = List.from(state.notifications);
- // newList.addAll(test);
- // emit(state.copyWith(notifications: newList));
- }
-
- void add(final NotificationDTO notification) {
- final newList = List.from(state.notifications);
- newList.insert(0, notification);
- emit(state.copyWith(notifications: newList));
- }
-
- void replace(final NotificationDTO oldN, final NotificationDTO newN) {
- final newList = List.from(state.notifications);
- newList[newList.indexOf(oldN)] = newN;
- emit(state.copyWith(notifications: newList));
- }
-}
diff --git a/lib/features/wallet_screen/bloc/notifications_cubit.g.dart b/lib/features/wallet_screen/bloc/notifications_cubit.g.dart
deleted file mode 100644
index b2dce231..00000000
--- a/lib/features/wallet_screen/bloc/notifications_cubit.g.dart
+++ /dev/null
@@ -1,198 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'notifications_cubit.dart';
-
-// **************************************************************************
-// CopyWithGenerator
-// **************************************************************************
-
-abstract class _$NotificationDTOCWProxy {
- NotificationDTO type(NotificationType type);
-
- NotificationDTO status(ExtrisincStatus status);
-
- NotificationDTO amount(String? amount);
-
- NotificationDTO fromAddress(String? fromAddress);
-
- NotificationDTO toAddress(String? toAddress);
-
- NotificationDTO message(String? message);
-
- NotificationDTO symbols(String? symbols);
-
- NotificationDTO blockDateTime(DateTime? blockDateTime);
-
- /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationDTO(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
- ///
- /// Usage
- /// ```dart
- /// NotificationDTO(...).copyWith(id: 12, name: "My name")
- /// ````
- NotificationDTO call({
- NotificationType? type,
- ExtrisincStatus? status,
- String? amount,
- String? fromAddress,
- String? toAddress,
- String? message,
- String? symbols,
- DateTime? blockDateTime,
- });
-}
-
-/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNotificationDTO.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNotificationDTO.copyWith.fieldName(...)`
-class _$NotificationDTOCWProxyImpl implements _$NotificationDTOCWProxy {
- const _$NotificationDTOCWProxyImpl(this._value);
-
- final NotificationDTO _value;
-
- @override
- NotificationDTO type(NotificationType type) => this(type: type);
-
- @override
- NotificationDTO status(ExtrisincStatus status) => this(status: status);
-
- @override
- NotificationDTO amount(String? amount) => this(amount: amount);
-
- @override
- NotificationDTO fromAddress(String? fromAddress) =>
- this(fromAddress: fromAddress);
-
- @override
- NotificationDTO toAddress(String? toAddress) => this(toAddress: toAddress);
-
- @override
- NotificationDTO message(String? message) => this(message: message);
-
- @override
- NotificationDTO symbols(String? symbols) => this(symbols: symbols);
-
- @override
- NotificationDTO blockDateTime(DateTime? blockDateTime) =>
- this(blockDateTime: blockDateTime);
-
- @override
-
- /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationDTO(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
- ///
- /// Usage
- /// ```dart
- /// NotificationDTO(...).copyWith(id: 12, name: "My name")
- /// ````
- NotificationDTO call({
- Object? type = const $CopyWithPlaceholder(),
- Object? status = const $CopyWithPlaceholder(),
- Object? amount = const $CopyWithPlaceholder(),
- Object? fromAddress = const $CopyWithPlaceholder(),
- Object? toAddress = const $CopyWithPlaceholder(),
- Object? message = const $CopyWithPlaceholder(),
- Object? symbols = const $CopyWithPlaceholder(),
- Object? blockDateTime = const $CopyWithPlaceholder(),
- }) {
- return NotificationDTO(
- type: type == const $CopyWithPlaceholder() || type == null
- ? _value.type
- // ignore: cast_nullable_to_non_nullable
- : type as NotificationType,
- status: status == const $CopyWithPlaceholder() || status == null
- ? _value.status
- // ignore: cast_nullable_to_non_nullable
- : status as ExtrisincStatus,
- amount: amount == const $CopyWithPlaceholder()
- ? _value.amount
- // ignore: cast_nullable_to_non_nullable
- : amount as String?,
- fromAddress: fromAddress == const $CopyWithPlaceholder()
- ? _value.fromAddress
- // ignore: cast_nullable_to_non_nullable
- : fromAddress as String?,
- toAddress: toAddress == const $CopyWithPlaceholder()
- ? _value.toAddress
- // ignore: cast_nullable_to_non_nullable
- : toAddress as String?,
- message: message == const $CopyWithPlaceholder()
- ? _value.message
- // ignore: cast_nullable_to_non_nullable
- : message as String?,
- symbols: symbols == const $CopyWithPlaceholder()
- ? _value.symbols
- // ignore: cast_nullable_to_non_nullable
- : symbols as String?,
- blockDateTime: blockDateTime == const $CopyWithPlaceholder()
- ? _value.blockDateTime
- // ignore: cast_nullable_to_non_nullable
- : blockDateTime as DateTime?,
- );
- }
-}
-
-extension $NotificationDTOCopyWith on NotificationDTO {
- /// Returns a callable class that can be used as follows: `instanceOfNotificationDTO.copyWith(...)` or like so:`instanceOfNotificationDTO.copyWith.fieldName(...)`.
- // ignore: library_private_types_in_public_api
- _$NotificationDTOCWProxy get copyWith => _$NotificationDTOCWProxyImpl(this);
-}
-
-abstract class _$NotificationsStateCWProxy {
- NotificationsState notifications(List notifications);
-
- NotificationsState isLoading(bool isLoading);
-
- /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationsState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
- ///
- /// Usage
- /// ```dart
- /// NotificationsState(...).copyWith(id: 12, name: "My name")
- /// ````
- NotificationsState call({
- List? notifications,
- bool? isLoading,
- });
-}
-
-/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNotificationsState.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNotificationsState.copyWith.fieldName(...)`
-class _$NotificationsStateCWProxyImpl implements _$NotificationsStateCWProxy {
- const _$NotificationsStateCWProxyImpl(this._value);
-
- final NotificationsState _value;
-
- @override
- NotificationsState notifications(List notifications) =>
- this(notifications: notifications);
-
- @override
- NotificationsState isLoading(bool isLoading) => this(isLoading: isLoading);
-
- @override
-
- /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationsState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
- ///
- /// Usage
- /// ```dart
- /// NotificationsState(...).copyWith(id: 12, name: "My name")
- /// ````
- NotificationsState call({
- Object? notifications = const $CopyWithPlaceholder(),
- Object? isLoading = const $CopyWithPlaceholder(),
- }) {
- return NotificationsState(
- notifications:
- notifications == const $CopyWithPlaceholder() || notifications == null
- ? _value.notifications
- // ignore: cast_nullable_to_non_nullable
- : notifications as List,
- isLoading: isLoading == const $CopyWithPlaceholder() || isLoading == null
- ? _value.isLoading
- // ignore: cast_nullable_to_non_nullable
- : isLoading as bool,
- );
- }
-}
-
-extension $NotificationsStateCopyWith on NotificationsState {
- /// Returns a callable class that can be used as follows: `instanceOfNotificationsState.copyWith(...)` or like so:`instanceOfNotificationsState.copyWith.fieldName(...)`.
- // ignore: library_private_types_in_public_api
- _$NotificationsStateCWProxy get copyWith =>
- _$NotificationsStateCWProxyImpl(this);
-}
diff --git a/lib/features/wallet_screen/di_wallet_page.dart b/lib/features/wallet_screen/di_wallet_page.dart
new file mode 100644
index 00000000..4e25710e
--- /dev/null
+++ b/lib/features/wallet_screen/di_wallet_page.dart
@@ -0,0 +1,12 @@
+import 'package:get_it/get_it.dart';
+import 'package:super_core/super_core.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+
+class DIWalletPage extends DIModule {
+ @override
+ Future setup(final GetIt getIt) async {
+ getIt.registerSingleton(
+ NotificationsBloc(),
+ );
+ }
+}
diff --git a/lib/features/wallet_screen/presentation/init_page/appservice_init_loader_page.dart b/lib/features/wallet_screen/init_page/appservice_init_loader_page.dart
similarity index 85%
rename from lib/features/wallet_screen/presentation/init_page/appservice_init_loader_page.dart
rename to lib/features/wallet_screen/init_page/appservice_init_loader_page.dart
index 7d7e29db..0321f1b4 100644
--- a/lib/features/wallet_screen/presentation/init_page/appservice_init_loader_page.dart
+++ b/lib/features/wallet_screen/init_page/appservice_init_loader_page.dart
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:threedpass/core/widgets/d3p_scaffold.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/connect_status.dart';
+import 'package:threedpass/features/wallet_screen/widgets/connect_status.dart';
class AppServiceInitLoaderPage extends StatelessWidget {
const AppServiceInitLoaderPage({final Key? key}) : super(key: key);
diff --git a/lib/features/wallet_screen/presentation/no_accounts_page/no_accounts_page.dart b/lib/features/wallet_screen/no_accounts_page/no_accounts_page.dart
similarity index 75%
rename from lib/features/wallet_screen/presentation/no_accounts_page/no_accounts_page.dart
rename to lib/features/wallet_screen/no_accounts_page/no_accounts_page.dart
index 644de4d7..70fb9480 100644
--- a/lib/features/wallet_screen/presentation/no_accounts_page/no_accounts_page.dart
+++ b/lib/features/wallet_screen/no_accounts_page/no_accounts_page.dart
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:threedpass/core/widgets/d3p_scaffold.dart';
import 'package:threedpass/core/widgets/paddings.dart';
-import 'package:threedpass/features/wallet_screen/presentation/no_accounts_page/widgets/account_card.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/connect_status.dart';
+import 'package:threedpass/features/wallet_screen/no_accounts_page/widgets/account_card.dart';
+import 'package:threedpass/features/wallet_screen/widgets/connect_status.dart';
class NoAccountsPage extends StatelessWidget {
const NoAccountsPage({final Key? key}) : super(key: key);
diff --git a/lib/features/wallet_screen/presentation/no_accounts_page/widgets/account_card.dart b/lib/features/wallet_screen/no_accounts_page/widgets/account_card.dart
similarity index 74%
rename from lib/features/wallet_screen/presentation/no_accounts_page/widgets/account_card.dart
rename to lib/features/wallet_screen/no_accounts_page/widgets/account_card.dart
index 05a86f40..0f34a379 100644
--- a/lib/features/wallet_screen/presentation/no_accounts_page/widgets/account_card.dart
+++ b/lib/features/wallet_screen/no_accounts_page/widgets/account_card.dart
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:threedpass/core/widgets/d3p_card.dart';
import 'package:threedpass/core/widgets/paddings.dart';
-import 'package:threedpass/features/wallet_screen/presentation/no_accounts_page/widgets/create_account_button.dart';
-import 'package:threedpass/features/wallet_screen/presentation/no_accounts_page/widgets/import_account_button.dart';
+import 'package:threedpass/features/wallet_screen/no_accounts_page/widgets/create_account_button.dart';
+import 'package:threedpass/features/wallet_screen/no_accounts_page/widgets/import_account_button.dart';
class AccountCard extends StatelessWidget {
const AccountCard({final Key? key}) : super(key: key);
diff --git a/lib/features/wallet_screen/presentation/no_accounts_page/widgets/create_account_button.dart b/lib/features/wallet_screen/no_accounts_page/widgets/create_account_button.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/no_accounts_page/widgets/create_account_button.dart
rename to lib/features/wallet_screen/no_accounts_page/widgets/create_account_button.dart
diff --git a/lib/features/wallet_screen/presentation/no_accounts_page/widgets/import_account_button.dart b/lib/features/wallet_screen/no_accounts_page/widgets/import_account_button.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/no_accounts_page/widgets/import_account_button.dart
rename to lib/features/wallet_screen/no_accounts_page/widgets/import_account_button.dart
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart b/lib/features/wallet_screen/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart
similarity index 82%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart
rename to lib/features/wallet_screen/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart
index 4d029477..f39d9776 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart
@@ -7,11 +7,11 @@ import 'package:polkawallet_sdk/plugin/store/balances.dart';
import 'package:super_core/super_core.dart';
import 'package:threedp_graphql/features/events/domain/events_request_params.dart';
import 'package:threedp_graphql/features/extrinsics/domain/extrisincs_request_params.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/get_events_usecase.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart';
import 'package:threedpass/setup.dart';
class AssetsGetExtrinsicsCubit extends Cubit {
@@ -37,8 +37,8 @@ class AssetsGetExtrinsicsCubit extends Cubit {
if (pagingController.itemList != null) {
for (final item in pagingController.itemList!) {
// await Future.delayed(Duration(seconds: 2));
- if (item.extrisincStatus == ExtrisincStatus.loading ||
- item.extrisincStatus == ExtrisincStatus.error) {
+ if (item.extrisincStatus == ExtrinsicStatus.loading ||
+ item.extrisincStatus == ExtrinsicStatus.error) {
final events = await getEvents(
GetEventsParams(
pageKey: '1',
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart b/lib/features/wallet_screen/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart
similarity index 84%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart
rename to lib/features/wallet_screen/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart
index f2be5af6..c24baed7 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart
@@ -7,9 +7,9 @@ import 'package:threedp_graphql/features/extrinsics/data/repositories/extrinsic_
import 'package:threedp_graphql/features/extrinsics/domain/extrisincs_request_params.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
import 'package:threedpass/core/polkawallet/utils/decode_address.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/extensions/is_extrinsic_relevant.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/extensions/is_extrinsic_relevant.dart';
class AssetsExtrinsicsRepository {
final Client client;
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/data/repositories/events_repository.dart b/lib/features/wallet_screen/non_native_token_screen/data/repositories/events_repository.dart
similarity index 93%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/data/repositories/events_repository.dart
rename to lib/features/wallet_screen/non_native_token_screen/data/repositories/events_repository.dart
index d6817362..efa201dc 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/data/repositories/events_repository.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/data/repositories/events_repository.dart
@@ -4,7 +4,7 @@ import 'package:threedp_graphql/features/events/data/repositories/events_datasou
import 'package:threedp_graphql/features/events/data/repositories/events_datasource_remote.dart';
import 'package:threedp_graphql/features/events/domain/events_request_params.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/success_event_type.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/success_event_type.dart';
class EventsRepository {
final Client client;
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/di/di_non_native_token.dart b/lib/features/wallet_screen/non_native_token_screen/di/di_non_native_token.dart
similarity index 70%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/di/di_non_native_token.dart
rename to lib/features/wallet_screen/non_native_token_screen/di/di_non_native_token.dart
index 38e5e885..9778f40a 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/di/di_non_native_token.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/di/di_non_native_token.dart
@@ -5,12 +5,12 @@ import 'package:threedp_graphql/features/events/data/repositories/events_datasou
import 'package:threedp_graphql/features/events/data/repositories/events_datasource_remote.dart';
import 'package:threedp_graphql/features/extrinsics/data/repositories/extrinsic_datasource.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/data/repositories/events_repository.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/get_events_usecase.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/data/repositories/events_repository.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart';
class DINonNativeToken extends DIModule {
@override
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_create.dart
similarity index 67%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_create.dart
index 181700d8..48f48327 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_create.dart
@@ -1,6 +1,6 @@
import 'package:copy_with_extension/copy_with_extension.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
part 'asset_history_create.g.dart';
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.g.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_create.g.dart
similarity index 95%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.g.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_create.g.dart
index 709b0cf8..fd9f8a45 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.g.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_create.g.dart
@@ -13,7 +13,7 @@ abstract class _$AssetHistoryCreateCWProxy {
AssetHistoryCreate authorAddress(String authorAddress);
- AssetHistoryCreate extrisincStatus(ExtrisincStatus extrisincStatus);
+ AssetHistoryCreate extrisincStatus(ExtrinsicStatus extrisincStatus);
AssetHistoryCreate blockNumber(int blockNumber);
@@ -27,7 +27,7 @@ abstract class _$AssetHistoryCreateCWProxy {
DateTime? blockDatetime,
int? extrinsicIdx,
String? authorAddress,
- ExtrisincStatus? extrisincStatus,
+ ExtrinsicStatus? extrisincStatus,
int? blockNumber,
});
}
@@ -51,7 +51,7 @@ class _$AssetHistoryCreateCWProxyImpl implements _$AssetHistoryCreateCWProxy {
this(authorAddress: authorAddress);
@override
- AssetHistoryCreate extrisincStatus(ExtrisincStatus extrisincStatus) =>
+ AssetHistoryCreate extrisincStatus(ExtrinsicStatus extrisincStatus) =>
this(extrisincStatus: extrisincStatus);
@override
@@ -93,7 +93,7 @@ class _$AssetHistoryCreateCWProxyImpl implements _$AssetHistoryCreateCWProxy {
extrisincStatus == null
? _value.extrisincStatus
// ignore: cast_nullable_to_non_nullable
- : extrisincStatus as ExtrisincStatus,
+ : extrisincStatus as ExtrinsicStatus,
blockNumber:
blockNumber == const $CopyWithPlaceholder() || blockNumber == null
? _value.blockNumber
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_mint.dart
similarity index 69%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_mint.dart
index 19a2f9eb..e93889b6 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_mint.dart
@@ -1,6 +1,6 @@
import 'package:copy_with_extension/copy_with_extension.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
part 'asset_history_mint.g.dart';
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.g.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_mint.g.dart
similarity index 95%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.g.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_mint.g.dart
index 7f3d4297..34d93691 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.g.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_mint.g.dart
@@ -15,7 +15,7 @@ abstract class _$AssetHistoryMintCWProxy {
AssetHistoryMint value(String value);
- AssetHistoryMint extrisincStatus(ExtrisincStatus extrisincStatus);
+ AssetHistoryMint extrisincStatus(ExtrinsicStatus extrisincStatus);
AssetHistoryMint blockNumber(int blockNumber);
@@ -30,7 +30,7 @@ abstract class _$AssetHistoryMintCWProxy {
int? extrinsicIdx,
String? authorAddress,
String? value,
- ExtrisincStatus? extrisincStatus,
+ ExtrinsicStatus? extrisincStatus,
int? blockNumber,
});
}
@@ -57,7 +57,7 @@ class _$AssetHistoryMintCWProxyImpl implements _$AssetHistoryMintCWProxy {
AssetHistoryMint value(String value) => this(value: value);
@override
- AssetHistoryMint extrisincStatus(ExtrisincStatus extrisincStatus) =>
+ AssetHistoryMint extrisincStatus(ExtrinsicStatus extrisincStatus) =>
this(extrisincStatus: extrisincStatus);
@override
@@ -104,7 +104,7 @@ class _$AssetHistoryMintCWProxyImpl implements _$AssetHistoryMintCWProxy {
extrisincStatus == null
? _value.extrisincStatus
// ignore: cast_nullable_to_non_nullable
- : extrisincStatus as ExtrisincStatus,
+ : extrisincStatus as ExtrinsicStatus,
blockNumber:
blockNumber == const $CopyWithPlaceholder() || blockNumber == null
? _value.blockNumber
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart
similarity index 73%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart
index 853c2988..3fb07fc3 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart
@@ -1,6 +1,6 @@
import 'package:copy_with_extension/copy_with_extension.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
part 'asset_history_set_meta_data.g.dart';
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart
similarity index 96%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart
index 847b2bcb..8cc82f54 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_set_meta_data.g.dart
@@ -19,7 +19,7 @@ abstract class _$AssetHistorySetMetadataCWProxy {
AssetHistorySetMetadata symbol(String symbol);
- AssetHistorySetMetadata extrisincStatus(ExtrisincStatus extrisincStatus);
+ AssetHistorySetMetadata extrisincStatus(ExtrinsicStatus extrisincStatus);
AssetHistorySetMetadata blockNumber(int blockNumber);
@@ -36,7 +36,7 @@ abstract class _$AssetHistorySetMetadataCWProxy {
String? decimals,
String? name,
String? symbol,
- ExtrisincStatus? extrisincStatus,
+ ExtrinsicStatus? extrisincStatus,
int? blockNumber,
});
}
@@ -70,7 +70,7 @@ class _$AssetHistorySetMetadataCWProxyImpl
AssetHistorySetMetadata symbol(String symbol) => this(symbol: symbol);
@override
- AssetHistorySetMetadata extrisincStatus(ExtrisincStatus extrisincStatus) =>
+ AssetHistorySetMetadata extrisincStatus(ExtrinsicStatus extrisincStatus) =>
this(extrisincStatus: extrisincStatus);
@override
@@ -127,7 +127,7 @@ class _$AssetHistorySetMetadataCWProxyImpl
extrisincStatus == null
? _value.extrisincStatus
// ignore: cast_nullable_to_non_nullable
- : extrisincStatus as ExtrisincStatus,
+ : extrisincStatus as ExtrinsicStatus,
blockNumber:
blockNumber == const $CopyWithPlaceholder() || blockNumber == null
? _value.blockNumber
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_transfer.dart
similarity index 80%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_transfer.dart
index 0fed694a..ac4cd5e1 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_transfer.dart
@@ -1,6 +1,7 @@
import 'package:copy_with_extension/copy_with_extension.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/features/wallet_screen/transfer_page/entities/transfer_history_ui.dart';
part 'asset_history_transfer.g.dart';
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.g.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_transfer.g.dart
similarity index 96%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.g.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_transfer.g.dart
index e4bed4b6..0bd2cad4 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.g.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_transfer.g.dart
@@ -23,7 +23,7 @@ abstract class _$AssetHistoryTransferCWProxy {
AssetHistoryTransfer decimals(int decimals);
- AssetHistoryTransfer extrisincStatus(ExtrisincStatus extrisincStatus);
+ AssetHistoryTransfer extrisincStatus(ExtrinsicStatus extrisincStatus);
AssetHistoryTransfer blockNumber(int blockNumber);
@@ -42,7 +42,7 @@ abstract class _$AssetHistoryTransferCWProxy {
bool? isFrom,
String? symbols,
int? decimals,
- ExtrisincStatus? extrisincStatus,
+ ExtrinsicStatus? extrisincStatus,
int? blockNumber,
});
}
@@ -83,7 +83,7 @@ class _$AssetHistoryTransferCWProxyImpl
AssetHistoryTransfer decimals(int decimals) => this(decimals: decimals);
@override
- AssetHistoryTransfer extrisincStatus(ExtrisincStatus extrisincStatus) =>
+ AssetHistoryTransfer extrisincStatus(ExtrinsicStatus extrisincStatus) =>
this(extrisincStatus: extrisincStatus);
@override
@@ -151,7 +151,7 @@ class _$AssetHistoryTransferCWProxyImpl
extrisincStatus == null
? _value.extrisincStatus
// ignore: cast_nullable_to_non_nullable
- : extrisincStatus as ExtrisincStatus,
+ : extrisincStatus as ExtrinsicStatus,
blockNumber:
blockNumber == const $CopyWithPlaceholder() || blockNumber == null
? _value.blockNumber
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_unknown.dart
similarity index 72%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_unknown.dart
index a1bf9f61..f51a35a2 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_unknown.dart
@@ -1,6 +1,6 @@
import 'package:copy_with_extension/copy_with_extension.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
part 'asset_history_unknown.g.dart';
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.g.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_unknown.g.dart
similarity index 95%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.g.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_unknown.g.dart
index 383d308f..04b7440c 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.g.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_unknown.g.dart
@@ -17,7 +17,7 @@ abstract class _$AssetHistoryUnkownCWProxy {
AssetHistoryUnkown callModule(String callModule);
- AssetHistoryUnkown extrisincStatus(ExtrisincStatus extrisincStatus);
+ AssetHistoryUnkown extrisincStatus(ExtrinsicStatus extrisincStatus);
AssetHistoryUnkown blockNumber(int blockNumber);
@@ -33,7 +33,7 @@ abstract class _$AssetHistoryUnkownCWProxy {
String? authorAddress,
String? arguments,
String? callModule,
- ExtrisincStatus? extrisincStatus,
+ ExtrinsicStatus? extrisincStatus,
int? blockNumber,
});
}
@@ -64,7 +64,7 @@ class _$AssetHistoryUnkownCWProxyImpl implements _$AssetHistoryUnkownCWProxy {
this(callModule: callModule);
@override
- AssetHistoryUnkown extrisincStatus(ExtrisincStatus extrisincStatus) =>
+ AssetHistoryUnkown extrisincStatus(ExtrinsicStatus extrisincStatus) =>
this(extrisincStatus: extrisincStatus);
@override
@@ -117,7 +117,7 @@ class _$AssetHistoryUnkownCWProxyImpl implements _$AssetHistoryUnkownCWProxy {
extrisincStatus == null
? _value.extrisincStatus
// ignore: cast_nullable_to_non_nullable
- : extrisincStatus as ExtrisincStatus,
+ : extrisincStatus as ExtrinsicStatus,
blockNumber:
blockNumber == const $CopyWithPlaceholder() || blockNumber == null
? _value.blockNumber
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/success_event_type.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/success_event_type.dart
similarity index 59%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/success_event_type.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/success_event_type.dart
index dc917fd1..96286bb7 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/success_event_type.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/success_event_type.dart
@@ -1,26 +1,26 @@
import 'package:threedp_graphql/features/events/data/query/__generated__/get_events.data.gql.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
class SuccessEvenType {
- final ExtrisincStatus isSuccessful;
+ final ExtrinsicStatus isSuccessful;
SuccessEvenType(final GGetEventsData event)
: isSuccessful = _initIsSuccessful(event);
- static ExtrisincStatus _initIsSuccessful(final GGetEventsData event) {
+ static ExtrinsicStatus _initIsSuccessful(final GGetEventsData event) {
try {
final ex = event.getEvents?.objects
?.firstWhere((final p0) => p0.eventModule == 'System');
switch (ex?.eventName ?? '') {
case 'ExtrinsicFailed':
- return ExtrisincStatus.failed;
+ return ExtrinsicStatus.failed;
case 'ExtrinsicSuccess':
- return ExtrisincStatus.success;
+ return ExtrinsicStatus.success;
default:
- return ExtrisincStatus.error;
+ return ExtrinsicStatus.error;
}
} on Object catch (_) {
- return ExtrisincStatus.error;
+ return ExtrinsicStatus.error;
}
}
}
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart
similarity index 81%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart
index bc78dc5e..e91c2ea9 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart
@@ -5,14 +5,14 @@ import 'dart:convert';
import 'package:threedp_graphql/features/extrinsics/data/query/__generated__/get_extrnsics.data.gql.dart';
import 'package:threedpass/core/polkawallet/app_service.dart';
import 'package:threedpass/core/polkawallet/utils/encode_address.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
import 'package:threedpass/core/polkawallet/utils/find_token_symbol.dart';
import 'package:threedpass/core/polkawallet/utils/network_state_data_extension.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_create.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_mint.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_transfer.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_unknown.dart';
abstract class NonNativeTokenHistoryAtomBase {
const NonNativeTokenHistoryAtomBase({
@@ -27,11 +27,11 @@ abstract class NonNativeTokenHistoryAtomBase {
final int extrinsicIdx;
final String authorAddress;
final int blockNumber;
- final ExtrisincStatus extrisincStatus;
+ final ExtrinsicStatus extrisincStatus;
NonNativeTokenExtrinsicType get extrinsicType;
- NonNativeTokenHistoryAtomBase ultimateCopyWith(final ExtrisincStatus status) {
+ NonNativeTokenHistoryAtomBase ultimateCopyWith(final ExtrinsicStatus status) {
switch (extrinsicType) {
case NonNativeTokenExtrinsicType.create:
final typed = this as AssetHistoryCreate;
@@ -83,7 +83,7 @@ abstract class NonNativeTokenHistoryAtomBase {
blockNumber: blockNumber,
extrinsicIdx: extrinsicIdx,
authorAddress: authorAddress,
- extrisincStatus: ExtrisincStatus.loading,
+ extrisincStatus: ExtrinsicStatus.loading,
);
case 'set_metadata':
return AssetHistorySetMetadata(
@@ -94,7 +94,7 @@ abstract class NonNativeTokenHistoryAtomBase {
name: a2[1]['value'].toString(),
symbol: a2[2]['value'].toString(),
decimals: a2[3]['value'].toString(),
- extrisincStatus: ExtrisincStatus.loading,
+ extrisincStatus: ExtrinsicStatus.loading,
);
case 'mint':
return AssetHistoryMint(
@@ -103,7 +103,7 @@ abstract class NonNativeTokenHistoryAtomBase {
extrinsicIdx: extrinsicIdx,
authorAddress: authorAddress,
value: a2[2]['value'].toString(),
- extrisincStatus: ExtrisincStatus.loading,
+ extrisincStatus: ExtrinsicStatus.loading,
);
case 'transfer':
@@ -127,7 +127,7 @@ abstract class NonNativeTokenHistoryAtomBase {
targetAddress: targetAddress2,
symbols: tokenBalanceData.symbol ?? '',
decimals: tokenBalanceData.decimals ?? safeDecimals,
- extrisincStatus: ExtrisincStatus.loading,
+ extrisincStatus: ExtrinsicStatus.loading,
);
// break;
@@ -139,7 +139,7 @@ abstract class NonNativeTokenHistoryAtomBase {
authorAddress: authorAddress,
arguments: autoGeneratedObject.callArguments?.value ?? '',
callModule: autoGeneratedObject.callModule ?? '',
- extrisincStatus: ExtrisincStatus.loading,
+ extrisincStatus: ExtrinsicStatus.loading,
);
// break;
}
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart b/lib/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart
similarity index 61%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart
index 9dfc62a4..c2010c8c 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart
@@ -1,4 +1,4 @@
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
class TransfersNonNativeTokenDTO {
final List objects;
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/extensions/is_extrinsic_relevant.dart b/lib/features/wallet_screen/non_native_token_screen/domain/extensions/is_extrinsic_relevant.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/extensions/is_extrinsic_relevant.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/extensions/is_extrinsic_relevant.dart
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart b/lib/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart
similarity index 63%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart
index ed15d1ae..ed076aff 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart
@@ -1,9 +1,9 @@
import 'package:super_core/super_core.dart';
import 'package:threedp_graphql/features/extrinsics/domain/extrisincs_request_params.dart';
import 'package:threedpass/core/utils/usecase.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_tokens_dto.dart';
class AssetsGetExtrinsics
extends UseCase {
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/get_events_usecase.dart b/lib/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart
similarity index 66%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/get_events_usecase.dart
rename to lib/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart
index 81a324a8..dafc9804 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/get_events_usecase.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart
@@ -1,8 +1,8 @@
import 'package:super_core/super_core.dart';
import 'package:threedp_graphql/features/events/domain/events_request_params.dart';
import 'package:threedpass/core/utils/usecase.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/data/repositories/events_repository.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/success_event_type.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/data/repositories/events_repository.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/success_event_type.dart';
class GetEventsUseCase extends UseCase {
final EventsRepository repository;
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/non_native_token_screen.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/non_native_token_screen.dart
similarity index 61%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/presentation/non_native_token_screen.dart
rename to lib/features/wallet_screen/non_native_token_screen/presentation/non_native_token_screen.dart
index 58e962d2..b1a0e8b0 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/non_native_token_screen.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/presentation/non_native_token_screen.dart
@@ -9,19 +9,19 @@ import 'package:threedpass/core/widgets/paddings.dart';
import 'package:threedpass/core/widgets/text/d3p_body_large_text.dart';
import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
import 'package:threedpass/core/widgets/text/d3p_title_large_text.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_create.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_mint.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_transfer.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/asset_history_unknown.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_transfer_button.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/asset_balance_text.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/block_datetime_w.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/extrinsic_status_icon.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/short_address.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/transaction_item.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_create.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_mint.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_set_meta_data.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_transfer.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/asset_history_unknown.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/transfer_non_native_token_atom.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_transfer_button.dart';
+import 'package:threedpass/features/wallet_screen/widgets/asset_balance_text.dart';
+import 'package:threedpass/features/wallet_screen/widgets/block_datetime_w.dart';
+import 'package:threedpass/features/wallet_screen/widgets/extrinsic_status_icon.dart';
+import 'package:threedpass/features/wallet_screen/widgets/short_address.dart';
+import 'package:threedpass/features/wallet_screen/widgets/transaction_item.dart';
part 'widgets/assets_history_paged_list.dart';
part './widgets/no_history_found.dart';
diff --git a/lib/features/wallet_screen/non_native_token_screen/presentation/non_native_token_wrapper.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/non_native_token_wrapper.dart
new file mode 100644
index 00000000..e2c77575
--- /dev/null
+++ b/lib/features/wallet_screen/non_native_token_screen/presentation/non_native_token_wrapper.dart
@@ -0,0 +1,38 @@
+import 'package:auto_route/auto_route.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/data/repositories/events_repository.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/domain/usecases/get_events_usecase.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/presentation/non_native_token_screen.dart';
+import 'package:threedpass/setup.dart';
+
+@RoutePage()
+class NonNativeTokenPageWrapper extends StatelessWidget {
+ final GetExtrinsicsUseCaseParams params;
+
+ const NonNativeTokenPageWrapper(this.params, {super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ return MultiBlocProvider(
+ providers: [
+ BlocProvider(
+ create: (final _) => getIt(
+ param1: getIt(
+ param1: getIt(),
+ param2: params,
+ ),
+ param2: getIt(
+ param1: getIt(),
+ ),
+ ),
+ ),
+ ],
+ child: const NonNativeTokenScreen(),
+ );
+ }
+}
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_create_widget.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_create_widget.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_create_widget.dart
rename to lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_create_widget.dart
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_list_item.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_list_item.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_list_item.dart
rename to lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_list_item.dart
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_mint_widget.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_mint_widget.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_mint_widget.dart
rename to lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_mint_widget.dart
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_set_metadata_widget.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_set_metadata_widget.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_set_metadata_widget.dart
rename to lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_set_metadata_widget.dart
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_unknown_widget.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_unknown_widget.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_history_unknown_widget.dart
rename to lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_history_unknown_widget.dart
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_transfer_button.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_transfer_button.dart
similarity index 81%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_transfer_button.dart
rename to lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_transfer_button.dart
index 1626dc1d..45ed7108 100644
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/asset_transfer_button.dart
+++ b/lib/features/wallet_screen/non_native_token_screen/presentation/widgets/asset_transfer_button.dart
@@ -3,8 +3,8 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_meta_dto.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart';
+import 'package:threedpass/features/wallet_screen/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transfer_page/entities/transfer_meta_dto.dart';
import 'package:threedpass/router/router.gr.dart';
class AssetTransferButton extends StatelessWidget {
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/assets_history_paged_list.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/widgets/assets_history_paged_list.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/assets_history_paged_list.dart
rename to lib/features/wallet_screen/non_native_token_screen/presentation/widgets/assets_history_paged_list.dart
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/no_history_found.dart b/lib/features/wallet_screen/non_native_token_screen/presentation/widgets/no_history_found.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/non_native_token_screen/presentation/widgets/no_history_found.dart
rename to lib/features/wallet_screen/non_native_token_screen/presentation/widgets/no_history_found.dart
diff --git a/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart b/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart
new file mode 100644
index 00000000..268e53e8
--- /dev/null
+++ b/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart
@@ -0,0 +1,43 @@
+import 'package:copy_with_extension/copy_with_extension.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:logger/logger.dart';
+import 'package:polkawallet_sdk/storage/types/keyPairData.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/setup.dart';
+
+part 'notifications_bloc.g.dart';
+part 'notifications_bloc_state.dart';
+part 'notifications_bloc_event.dart';
+
+class NotificationsBloc
+ extends Bloc {
+ NotificationsBloc() : super(const NotificationsState.initial()) {
+ on(_addNotification);
+ on(_updateNotification);
+ }
+
+ void _addNotification(
+ final AddNotification event,
+ final Emitter emit,
+ ) {
+ final newList = List.from(state.notifications);
+ newList.insert(0, event.notification);
+ emit(state.copyWith(notifications: newList));
+ }
+
+ void _updateNotification(
+ final UpdateNotification event,
+ final Emitter emit,
+ ) {
+ final newList = List.from(state.notifications);
+ final index = newList.indexOf(event.oldN);
+ if (index == -1) {
+ getIt().e(
+ 'Notifications was not found in list. N=${event.oldN} ${event.oldN}, L=${newList.length}',
+ );
+ return;
+ }
+ newList[index] = event.newN;
+ emit(state.copyWith(notifications: newList));
+ }
+}
diff --git a/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc.g.dart b/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc.g.dart
new file mode 100644
index 00000000..44ae9fd8
--- /dev/null
+++ b/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc.g.dart
@@ -0,0 +1,277 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'notifications_bloc.dart';
+
+// **************************************************************************
+// CopyWithGenerator
+// **************************************************************************
+
+abstract class _$NotificationTransferCWProxy {
+ NotificationTransfer amount(String amount);
+
+ NotificationTransfer fromAddress(String fromAddress);
+
+ NotificationTransfer symbols(String symbols);
+
+ NotificationTransfer toAddress(String toAddress);
+
+ NotificationTransfer message(String? message);
+
+ NotificationTransfer status(ExtrinsicStatus status);
+
+ NotificationTransfer blockDateTime(DateTime? blockDateTime);
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationTransfer(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// NotificationTransfer(...).copyWith(id: 12, name: "My name")
+ /// ````
+ NotificationTransfer call({
+ String? amount,
+ String? fromAddress,
+ String? symbols,
+ String? toAddress,
+ String? message,
+ ExtrinsicStatus? status,
+ DateTime? blockDateTime,
+ });
+}
+
+/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNotificationTransfer.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNotificationTransfer.copyWith.fieldName(...)`
+class _$NotificationTransferCWProxyImpl
+ implements _$NotificationTransferCWProxy {
+ const _$NotificationTransferCWProxyImpl(this._value);
+
+ final NotificationTransfer _value;
+
+ @override
+ NotificationTransfer amount(String amount) => this(amount: amount);
+
+ @override
+ NotificationTransfer fromAddress(String fromAddress) =>
+ this(fromAddress: fromAddress);
+
+ @override
+ NotificationTransfer symbols(String symbols) => this(symbols: symbols);
+
+ @override
+ NotificationTransfer toAddress(String toAddress) =>
+ this(toAddress: toAddress);
+
+ @override
+ NotificationTransfer message(String? message) => this(message: message);
+
+ @override
+ NotificationTransfer status(ExtrinsicStatus status) => this(status: status);
+
+ @override
+ NotificationTransfer blockDateTime(DateTime? blockDateTime) =>
+ this(blockDateTime: blockDateTime);
+
+ @override
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationTransfer(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// NotificationTransfer(...).copyWith(id: 12, name: "My name")
+ /// ````
+ NotificationTransfer call({
+ Object? amount = const $CopyWithPlaceholder(),
+ Object? fromAddress = const $CopyWithPlaceholder(),
+ Object? symbols = const $CopyWithPlaceholder(),
+ Object? toAddress = const $CopyWithPlaceholder(),
+ Object? message = const $CopyWithPlaceholder(),
+ Object? status = const $CopyWithPlaceholder(),
+ Object? blockDateTime = const $CopyWithPlaceholder(),
+ }) {
+ return NotificationTransfer(
+ amount: amount == const $CopyWithPlaceholder() || amount == null
+ ? _value.amount
+ // ignore: cast_nullable_to_non_nullable
+ : amount as String,
+ fromAddress:
+ fromAddress == const $CopyWithPlaceholder() || fromAddress == null
+ ? _value.fromAddress
+ // ignore: cast_nullable_to_non_nullable
+ : fromAddress as String,
+ symbols: symbols == const $CopyWithPlaceholder() || symbols == null
+ ? _value.symbols
+ // ignore: cast_nullable_to_non_nullable
+ : symbols as String,
+ toAddress: toAddress == const $CopyWithPlaceholder() || toAddress == null
+ ? _value.toAddress
+ // ignore: cast_nullable_to_non_nullable
+ : toAddress as String,
+ message: message == const $CopyWithPlaceholder()
+ ? _value.message
+ // ignore: cast_nullable_to_non_nullable
+ : message as String?,
+ status: status == const $CopyWithPlaceholder() || status == null
+ ? _value.status
+ // ignore: cast_nullable_to_non_nullable
+ : status as ExtrinsicStatus,
+ blockDateTime: blockDateTime == const $CopyWithPlaceholder()
+ ? _value.blockDateTime
+ // ignore: cast_nullable_to_non_nullable
+ : blockDateTime as DateTime?,
+ );
+ }
+}
+
+extension $NotificationTransferCopyWith on NotificationTransfer {
+ /// Returns a callable class that can be used as follows: `instanceOfNotificationTransfer.copyWith(...)` or like so:`instanceOfNotificationTransfer.copyWith.fieldName(...)`.
+ // ignore: library_private_types_in_public_api
+ _$NotificationTransferCWProxy get copyWith =>
+ _$NotificationTransferCWProxyImpl(this);
+}
+
+abstract class _$NotificationPutObjectCWProxy {
+ NotificationPutObject account(KeyPairData account);
+
+ NotificationPutObject localSnapshotName(String localSnapshotName);
+
+ NotificationPutObject status(ExtrinsicStatus status);
+
+ NotificationPutObject message(String? message);
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationPutObject(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// NotificationPutObject(...).copyWith(id: 12, name: "My name")
+ /// ````
+ NotificationPutObject call({
+ KeyPairData? account,
+ String? localSnapshotName,
+ ExtrinsicStatus? status,
+ String? message,
+ });
+}
+
+/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNotificationPutObject.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNotificationPutObject.copyWith.fieldName(...)`
+class _$NotificationPutObjectCWProxyImpl
+ implements _$NotificationPutObjectCWProxy {
+ const _$NotificationPutObjectCWProxyImpl(this._value);
+
+ final NotificationPutObject _value;
+
+ @override
+ NotificationPutObject account(KeyPairData account) => this(account: account);
+
+ @override
+ NotificationPutObject localSnapshotName(String localSnapshotName) =>
+ this(localSnapshotName: localSnapshotName);
+
+ @override
+ NotificationPutObject status(ExtrinsicStatus status) => this(status: status);
+
+ @override
+ NotificationPutObject message(String? message) => this(message: message);
+
+ @override
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationPutObject(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// NotificationPutObject(...).copyWith(id: 12, name: "My name")
+ /// ````
+ NotificationPutObject call({
+ Object? account = const $CopyWithPlaceholder(),
+ Object? localSnapshotName = const $CopyWithPlaceholder(),
+ Object? status = const $CopyWithPlaceholder(),
+ Object? message = const $CopyWithPlaceholder(),
+ }) {
+ return NotificationPutObject(
+ account: account == const $CopyWithPlaceholder() || account == null
+ ? _value.account
+ // ignore: cast_nullable_to_non_nullable
+ : account as KeyPairData,
+ localSnapshotName: localSnapshotName == const $CopyWithPlaceholder() ||
+ localSnapshotName == null
+ ? _value.localSnapshotName
+ // ignore: cast_nullable_to_non_nullable
+ : localSnapshotName as String,
+ status: status == const $CopyWithPlaceholder() || status == null
+ ? _value.status
+ // ignore: cast_nullable_to_non_nullable
+ : status as ExtrinsicStatus,
+ message: message == const $CopyWithPlaceholder()
+ ? _value.message
+ // ignore: cast_nullable_to_non_nullable
+ : message as String?,
+ );
+ }
+}
+
+extension $NotificationPutObjectCopyWith on NotificationPutObject {
+ /// Returns a callable class that can be used as follows: `instanceOfNotificationPutObject.copyWith(...)` or like so:`instanceOfNotificationPutObject.copyWith.fieldName(...)`.
+ // ignore: library_private_types_in_public_api
+ _$NotificationPutObjectCWProxy get copyWith =>
+ _$NotificationPutObjectCWProxyImpl(this);
+}
+
+abstract class _$NotificationsStateCWProxy {
+ NotificationsState notifications(List notifications);
+
+ NotificationsState isLoading(bool isLoading);
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationsState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// NotificationsState(...).copyWith(id: 12, name: "My name")
+ /// ````
+ NotificationsState call({
+ List? notifications,
+ bool? isLoading,
+ });
+}
+
+/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNotificationsState.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNotificationsState.copyWith.fieldName(...)`
+class _$NotificationsStateCWProxyImpl implements _$NotificationsStateCWProxy {
+ const _$NotificationsStateCWProxyImpl(this._value);
+
+ final NotificationsState _value;
+
+ @override
+ NotificationsState notifications(List notifications) =>
+ this(notifications: notifications);
+
+ @override
+ NotificationsState isLoading(bool isLoading) => this(isLoading: isLoading);
+
+ @override
+
+ /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NotificationsState(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
+ ///
+ /// Usage
+ /// ```dart
+ /// NotificationsState(...).copyWith(id: 12, name: "My name")
+ /// ````
+ NotificationsState call({
+ Object? notifications = const $CopyWithPlaceholder(),
+ Object? isLoading = const $CopyWithPlaceholder(),
+ }) {
+ return NotificationsState(
+ notifications:
+ notifications == const $CopyWithPlaceholder() || notifications == null
+ ? _value.notifications
+ // ignore: cast_nullable_to_non_nullable
+ : notifications as List,
+ isLoading: isLoading == const $CopyWithPlaceholder() || isLoading == null
+ ? _value.isLoading
+ // ignore: cast_nullable_to_non_nullable
+ : isLoading as bool,
+ );
+ }
+}
+
+extension $NotificationsStateCopyWith on NotificationsState {
+ /// Returns a callable class that can be used as follows: `instanceOfNotificationsState.copyWith(...)` or like so:`instanceOfNotificationsState.copyWith.fieldName(...)`.
+ // ignore: library_private_types_in_public_api
+ _$NotificationsStateCWProxy get copyWith =>
+ _$NotificationsStateCWProxyImpl(this);
+}
diff --git a/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc_event.dart b/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc_event.dart
new file mode 100644
index 00000000..755dabbc
--- /dev/null
+++ b/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc_event.dart
@@ -0,0 +1,21 @@
+part of 'notifications_bloc.dart';
+
+abstract class NotificationsBlocEvent {
+ const NotificationsBlocEvent();
+}
+
+class AddNotification extends NotificationsBlocEvent {
+ final NotificationDTO notification;
+
+ const AddNotification(this.notification);
+}
+
+class UpdateNotification extends NotificationsBlocEvent {
+ final NotificationDTO oldN;
+ final NotificationDTO newN;
+
+ const UpdateNotification({
+ required this.newN,
+ required this.oldN,
+ });
+}
diff --git a/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc_state.dart b/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc_state.dart
new file mode 100644
index 00000000..e0046c2a
--- /dev/null
+++ b/lib/features/wallet_screen/notifications_page/bloc/notifications_bloc_state.dart
@@ -0,0 +1,69 @@
+part of 'notifications_bloc.dart';
+
+enum NotificationType { transfer, putObject }
+
+abstract class NotificationDTO {
+ final DateTime notificationCreated = DateTime.now().toUtc();
+ final ExtrinsicStatus status;
+ final String? message;
+
+ NotificationDTO({
+ required this.status,
+ required this.message,
+ });
+
+ NotificationType get type;
+}
+
+@CopyWith()
+class NotificationTransfer extends NotificationDTO {
+ final String fromAddress;
+ final String toAddress;
+ final String amount;
+ final String symbols;
+ final DateTime? blockDateTime;
+
+ NotificationTransfer({
+ required this.amount,
+ required this.fromAddress,
+ required this.symbols,
+ required this.toAddress,
+ required super.message,
+ required super.status,
+ required this.blockDateTime,
+ });
+
+ @override
+ final NotificationType type = NotificationType.transfer;
+}
+
+@CopyWith()
+class NotificationPutObject extends NotificationDTO {
+ final String localSnapshotName;
+ final KeyPairData account;
+
+ NotificationPutObject({
+ required this.account,
+ required this.localSnapshotName,
+ required super.status,
+ required super.message,
+ });
+
+ @override
+ final NotificationType type = NotificationType.putObject;
+}
+
+@CopyWith()
+class NotificationsState {
+ final List notifications;
+ final bool isLoading;
+
+ const NotificationsState({
+ required this.notifications,
+ this.isLoading = false,
+ });
+
+ const NotificationsState.initial()
+ : notifications = const [],
+ isLoading = true;
+}
diff --git a/lib/features/wallet_screen/presentation/notifications_page/notifications_page.dart b/lib/features/wallet_screen/notifications_page/presentation/notifications_page.dart
similarity index 70%
rename from lib/features/wallet_screen/presentation/notifications_page/notifications_page.dart
rename to lib/features/wallet_screen/notifications_page/presentation/notifications_page.dart
index 3b0e00a1..145bcb41 100644
--- a/lib/features/wallet_screen/presentation/notifications_page/notifications_page.dart
+++ b/lib/features/wallet_screen/notifications_page/presentation/notifications_page.dart
@@ -1,7 +1,7 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/material.dart';
import 'package:threedpass/core/widgets/d3p_scaffold.dart';
-import 'package:threedpass/features/wallet_screen/presentation/notifications_page/widgets/notifications_list.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/presentation/widgets/notifications_list.dart';
@RoutePage()
class NotificationsPage extends StatelessWidget {
@@ -11,7 +11,7 @@ class NotificationsPage extends StatelessWidget {
Widget build(final BuildContext context) {
return const D3pScaffold(
body: NotificationsList(),
- appbarTitle: 'notifications_titile',
+ appbarTitle: 'notifications_title',
);
}
}
diff --git a/lib/features/wallet_screen/notifications_page/presentation/widgets/notfication_put_object.dart b/lib/features/wallet_screen/notifications_page/presentation/widgets/notfication_put_object.dart
new file mode 100644
index 00000000..9b7a144c
--- /dev/null
+++ b/lib/features/wallet_screen/notifications_page/presentation/widgets/notfication_put_object.dart
@@ -0,0 +1,86 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/core/polkawallet/widgets/account_choose_tile_text.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/presentation/widgets/notification_card_basic.dart';
+
+class NotificationPutObjectCard extends StatelessWidget {
+ final NotificationPutObject notificationDTO;
+
+ const NotificationPutObjectCard(this.notificationDTO, {super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ return NotificationCardBasic(
+ message: notificationDTO.message,
+ status: notificationDTO.status,
+ child: _PutObjectBody(
+ notificationDTO: notificationDTO,
+ ),
+ );
+ }
+}
+
+class _PutObjectBody extends StatelessWidget {
+ final NotificationPutObject notificationDTO;
+
+ const _PutObjectBody({required this.notificationDTO});
+
+ @override
+ Widget build(final BuildContext context) {
+ return Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const SizedBoxH8(),
+ const _FastTile(
+ iconData: Icons.keyboard_double_arrow_right,
+ child: D3pBodyMediumText(
+ 'poScan.putObject',
+ translate: false,
+ ),
+ ),
+ const SizedBoxH8(),
+ _FastTile(
+ iconData: Icons.person,
+ child: AccountChooseTileText(
+ address: notificationDTO.account.address,
+ name: notificationDTO.account.name,
+ ),
+ ),
+ SizedBoxH8(),
+ _FastTile(
+ iconData: Icons.file_copy,
+ child: Flexible(
+ child: D3pBodyMediumText(
+ notificationDTO.localSnapshotName,
+ translate: false,
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+}
+
+class _FastTile extends StatelessWidget {
+ final IconData iconData;
+ final Widget child;
+
+ const _FastTile({
+ required this.iconData,
+ required this.child,
+ });
+
+ @override
+ Widget build(final BuildContext context) {
+ return Row(
+ children: [
+ Icon(iconData),
+ const SizedBox(width: 16),
+ child,
+ ],
+ );
+ }
+}
diff --git a/lib/features/wallet_screen/notifications_page/presentation/widgets/notification_card.dart b/lib/features/wallet_screen/notifications_page/presentation/widgets/notification_card.dart
new file mode 100644
index 00000000..d7e31502
--- /dev/null
+++ b/lib/features/wallet_screen/notifications_page/presentation/widgets/notification_card.dart
@@ -0,0 +1,24 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/presentation/widgets/notfication_put_object.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/presentation/widgets/notification_transfer.dart';
+
+class NotificationCard extends StatelessWidget {
+ const NotificationCard({required this.notificationDTO, super.key});
+
+ final NotificationDTO notificationDTO;
+
+ @override
+ Widget build(final BuildContext context) {
+ switch (notificationDTO.type) {
+ case NotificationType.transfer:
+ return NotificationTransferCard(
+ notificationDTO as NotificationTransfer,
+ );
+ case NotificationType.putObject:
+ return NotificationPutObjectCard(
+ notificationDTO as NotificationPutObject,
+ );
+ }
+ }
+}
diff --git a/lib/features/wallet_screen/notifications_page/presentation/widgets/notification_card_basic.dart b/lib/features/wallet_screen/notifications_page/presentation/widgets/notification_card_basic.dart
new file mode 100644
index 00000000..85377c3b
--- /dev/null
+++ b/lib/features/wallet_screen/notifications_page/presentation/widgets/notification_card_basic.dart
@@ -0,0 +1,119 @@
+import 'package:flutter/material.dart';
+import 'package:shimmer/shimmer.dart';
+import 'package:threedpass/core/polkawallet/utils/extrinsic_status.dart';
+import 'package:threedpass/core/theme/d3p_special_colors.dart';
+import 'package:threedpass/core/widgets/paddings.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_large_text.dart';
+import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
+
+class NotificationCardBasic extends StatelessWidget {
+ const NotificationCardBasic({
+ required this.message,
+ required this.status,
+ required this.child,
+ super.key,
+ });
+
+ final ExtrinsicStatus status;
+ final String? message;
+ final Widget child;
+
+ @override
+ Widget build(final BuildContext context) {
+ final cardBG =
+ status == ExtrinsicStatus.failed || status == ExtrinsicStatus.error
+ ? Theme.of(context).customColors.errorCardBGColor
+ : null;
+
+ return Card(
+ color: cardBG,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
+ child: SizedBox(
+ width: double.infinity,
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ const D3pBodyMediumText('extrinsic_status'),
+ const SizedBox(width: 8),
+ _TransferStatus(status),
+ ],
+ ),
+ const SizedBoxH4(),
+ _Message(message, status),
+ child,
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+}
+
+class _TransferStatus extends StatelessWidget {
+ const _TransferStatus(this.status);
+
+ final ExtrinsicStatus status;
+
+ @override
+ Widget build(final BuildContext context) {
+ switch (status) {
+ case ExtrinsicStatus.loading:
+ return Shimmer.fromColors(
+ baseColor: Colors.grey.shade400,
+ highlightColor: Colors.grey.shade100,
+ enabled: true,
+ child: const Row(
+ children: [
+ D3pBodyMediumText('status_pending'),
+ SizedBox(width: 8),
+ Icon(
+ Icons.access_time_outlined,
+ size: 16,
+ ),
+ ],
+ ),
+ );
+ case ExtrinsicStatus.success:
+ return const D3pBodyMediumText(
+ 'status_success',
+ color: Colors.green,
+ );
+ case ExtrinsicStatus.error:
+ return const D3pBodyMediumText(
+ 'status_error',
+ );
+ case ExtrinsicStatus.failed:
+ return const D3pBodyMediumText(
+ 'status_failed',
+ );
+ }
+ }
+}
+
+class _Message extends StatelessWidget {
+ final String? message;
+ final ExtrinsicStatus? status;
+
+ const _Message(this.message, this.status);
+
+ @override
+ Widget build(final BuildContext context) {
+ if (message != null && status != ExtrinsicStatus.success) {
+ return Column(
+ children: [
+ D3pBodyLargeText(
+ message!,
+ translate: false,
+ ),
+ const SizedBoxH4(),
+ ],
+ );
+ } else {
+ return const SizedBox();
+ }
+ }
+}
diff --git a/lib/features/wallet_screen/notifications_page/presentation/widgets/notification_transfer.dart b/lib/features/wallet_screen/notifications_page/presentation/widgets/notification_transfer.dart
new file mode 100644
index 00000000..8818b603
--- /dev/null
+++ b/lib/features/wallet_screen/notifications_page/presentation/widgets/notification_transfer.dart
@@ -0,0 +1,65 @@
+import 'package:flutter/material.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/presentation/widgets/notification_card_basic.dart';
+import 'package:threedpass/features/wallet_screen/transfer_page/entities/transfer_history_ui.dart';
+import 'package:threedpass/features/wallet_screen/widgets/transaction_item.dart';
+
+class NotificationTransferCard extends StatelessWidget {
+ final NotificationTransfer notificationDTO;
+
+ const NotificationTransferCard(this.notificationDTO, {super.key});
+
+ @override
+ Widget build(final BuildContext context) {
+ return NotificationCardBasic(
+ message: notificationDTO.message,
+ status: notificationDTO.status,
+ child: _Transaction(
+ fromAddress: notificationDTO.fromAddress,
+ toAddress: notificationDTO.toAddress,
+ amount: notificationDTO.amount,
+ symbols: notificationDTO.symbols,
+ blockDateTime: notificationDTO.blockDateTime,
+ ),
+ );
+ }
+}
+
+class _Transaction extends StatelessWidget {
+ const _Transaction({
+ required this.amount,
+ required this.fromAddress,
+ required this.toAddress,
+ required this.blockDateTime,
+ required this.symbols,
+ });
+
+ final String? fromAddress;
+ final String? toAddress;
+ final String? amount;
+ final String? symbols;
+ final DateTime? blockDateTime;
+
+ @override
+ Widget build(final BuildContext context) {
+ if (fromAddress != null && toAddress != null && amount != null) {
+ return TransactionItem(
+ object: TransferHistoryUI(
+ amount: amount!,
+ decimals: 1,
+ symbols: symbols ?? '',
+ direction: TransferDirection
+ .all, // Transfers are always "from", but from different accounts
+ blockDateTime: blockDateTime,
+ fromAddress: fromAddress!,
+ toAddress: toAddress!,
+ extrisincStatus: null,
+ ),
+ );
+ // },
+ // );
+ } else {
+ return const SizedBox();
+ }
+ }
+}
diff --git a/lib/features/wallet_screen/presentation/notifications_page/widgets/notifications_list.dart b/lib/features/wallet_screen/notifications_page/presentation/widgets/notifications_list.dart
similarity index 63%
rename from lib/features/wallet_screen/presentation/notifications_page/widgets/notifications_list.dart
rename to lib/features/wallet_screen/notifications_page/presentation/widgets/notifications_list.dart
index 889e41fb..c68c7076 100644
--- a/lib/features/wallet_screen/presentation/notifications_page/widgets/notifications_list.dart
+++ b/lib/features/wallet_screen/notifications_page/presentation/widgets/notifications_list.dart
@@ -1,17 +1,17 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:threedpass/features/wallet_screen/bloc/notifications_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/notifications_page/widgets/notification_card.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/presentation/widgets/notification_card.dart';
class NotificationsList extends StatelessWidget {
const NotificationsList({super.key});
@override
Widget build(final BuildContext context) {
- return BlocBuilder(
+ return BlocBuilder(
builder: (final context, final state) {
return ListView.builder(
- padding: const EdgeInsets.only(top: 8),
+ padding: const EdgeInsets.only(top: 8, left: 16, right: 16),
itemCount: state.notifications.length,
shrinkWrap: true,
itemBuilder: (final _, final index) {
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart
deleted file mode 100644
index 4425292d..00000000
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/buttons_panel.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/coin_transfer_button.dart';
-import 'package:threedpass/features/wallet_screen/presentation/assets_page/widgets/recieve_button.dart';
-
-class AssetPageButtonsPanel extends StatelessWidget {
- const AssetPageButtonsPanel({super.key});
-
- @override
- Widget build(final BuildContext context) {
- return const Row(
- mainAxisAlignment: MainAxisAlignment.center,
- mainAxisSize: MainAxisSize.min,
- children: [
- CoinTransferButton(),
- SizedBox(width: 8),
- RecieveButton(),
- ],
- );
- }
-}
diff --git a/lib/features/wallet_screen/presentation/assets_page/widgets/notifications_icon_button.dart b/lib/features/wallet_screen/presentation/assets_page/widgets/notifications_icon_button.dart
deleted file mode 100644
index 7422a546..00000000
--- a/lib/features/wallet_screen/presentation/assets_page/widgets/notifications_icon_button.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-import 'package:auto_route/auto_route.dart';
-import 'package:badges/badges.dart';
-import 'package:badges/badges.dart' as badges;
-import 'package:flutter/material.dart';
-import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:threedpass/core/theme/d3p_special_styles.dart';
-import 'package:threedpass/core/theme/d3p_theme.dart';
-import 'package:threedpass/core/widgets/buttons/icon_button.dart';
-import 'package:threedpass/features/wallet_screen/bloc/notifications_cubit.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/router/router.gr.dart';
-
-class NotificationsIconButton extends StatelessWidget {
- const NotificationsIconButton({super.key});
-
- void onPressed(final BuildContext context) {
- // final outerContext = BlocProvider.of(context).state;
-
- context.router.push(const NotificationsRoute());
- }
-
- @override
- Widget build(final BuildContext context) {
- final customTextStyles = Theme.of(context).customTextStyles;
- // final customColors = Theme.of(context).customColors;
-
- return BlocBuilder(
- builder: (final context, final state) {
- if (state.notifications.isEmpty) {
- return SizedBox(
- height: kToolbarHeight,
- child: D3pIconButton(
- iconData: Icons.notifications_none_outlined,
- onPressed: () => onPressed(context),
- ),
- );
- }
- bool hasErrors = false;
- for (final notification in state.notifications) {
- if (notification.status == ExtrisincStatus.failed ||
- notification.status == ExtrisincStatus.error) {
- hasErrors = true;
- }
- }
-
- final String badgeText = state.notifications.length.toString();
- final badgeColor = hasErrors ? Colors.red : D3pThemeData.mainColor;
-
- return badges.Badge(
- badgeContent: Text(
- badgeText,
- style: customTextStyles.d3pBodyMedium.copyWith(color: Colors.white),
- ),
- position: badges.BadgePosition.topEnd(top: 2, end: 2),
- badgeAnimation: const BadgeAnimation.scale(),
- badgeStyle: BadgeStyle(badgeColor: badgeColor),
- child: SizedBox(
- height: kToolbarHeight,
- child: D3pIconButton(
- iconData: Icons.notifications,
- onPressed: () => onPressed(context),
- ),
- ),
- );
- },
- );
- }
-}
diff --git a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/non_native_token_wrapper.dart b/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/non_native_token_wrapper.dart
deleted file mode 100644
index 3179b022..00000000
--- a/lib/features/wallet_screen/presentation/non_native_token_screen/presentation/non_native_token_wrapper.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-import 'package:auto_route/auto_route.dart';
-import 'package:flutter/widgets.dart';
-import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/bloc/assets_get_extrisincs_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/data/repositories/assets_extrinsics_repository.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/data/repositories/events_repository.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/entities/get_extrinsics_usecase_params.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/assets_get_extrinsics.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/domain/usecases/get_events_usecase.dart';
-import 'package:threedpass/features/wallet_screen/presentation/non_native_token_screen/presentation/non_native_token_screen.dart';
-import 'package:threedpass/setup.dart';
-
-@RoutePage()
-class NonNativeTokenPageWrapper extends StatelessWidget {
- final GetExtrinsicsUseCaseParams params;
-
- const NonNativeTokenPageWrapper(this.params, {super.key});
-
- @override
- Widget build(final BuildContext context) {
- return MultiBlocProvider(
- providers: [
- BlocProvider(
- create: (final _) => getIt(
- param1: getIt(
- param1: getIt(),
- param2: params,
- ),
- param2: getIt(
- param1: getIt(),
- ),
- ),
- ),
- ],
- child: const NonNativeTokenScreen(),
- );
- }
-}
diff --git a/lib/features/wallet_screen/presentation/notifications_page/widgets/notifcation_transfer.dart b/lib/features/wallet_screen/presentation/notifications_page/widgets/notifcation_transfer.dart
deleted file mode 100644
index 5f01678b..00000000
--- a/lib/features/wallet_screen/presentation/notifications_page/widgets/notifcation_transfer.dart
+++ /dev/null
@@ -1,168 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:shimmer/shimmer.dart';
-import 'package:threedpass/core/theme/d3p_special_colors.dart';
-import 'package:threedpass/core/widgets/paddings.dart';
-import 'package:threedpass/core/widgets/text/d3p_body_large_text.dart';
-import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
-import 'package:threedpass/features/wallet_screen/bloc/notifications_cubit.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/transaction_item.dart';
-
-class NotificationTransferCard extends StatelessWidget {
- final NotificationDTO notificationDTO;
-
- const NotificationTransferCard(this.notificationDTO, {super.key});
-
- @override
- Widget build(final BuildContext context) {
- final cardBG = notificationDTO.status == ExtrisincStatus.failed ||
- notificationDTO.status == ExtrisincStatus.error
- ? Theme.of(context).customColors.errorCardBGColor
- : null;
-
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16),
- child: Card(
- color: cardBG,
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
- child: SizedBox(
- width: double.infinity,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- children: [
- const D3pBodyMediumText('transfer_status'),
- const SizedBox(width: 8),
- _TransferStatus(notificationDTO.status),
- ],
- ),
- const SizedBoxH4(),
- _Message(notificationDTO.message, notificationDTO.status),
- _Transaction(
- fromAddress: notificationDTO.fromAddress,
- toAddress: notificationDTO.toAddress,
- amount: notificationDTO.amount,
- symbols: notificationDTO.symbols,
- blockDateTime: notificationDTO.blockDateTime,
- ),
- ],
- ),
- ),
- ),
- ),
- );
- }
-}
-
-class _Transaction extends StatelessWidget {
- const _Transaction({
- required this.amount,
- required this.fromAddress,
- required this.toAddress,
- required this.blockDateTime,
- required this.symbols,
- });
-
- final String? fromAddress;
- final String? toAddress;
- final String? amount;
- final String? symbols;
- final DateTime? blockDateTime;
-
- @override
- Widget build(final BuildContext context) {
- if (fromAddress != null && toAddress != null && amount != null) {
- // return ListView.separated(
- // physics: const NeverScrollableScrollPhysics(),
- // padding: EdgeInsets.zero,
- // shrinkWrap: true,
- // itemCount: fromAddresses!.length,
- // separatorBuilder: (final context, final index) => const Divider(),
- // itemBuilder: (final context, final int index) {
- return TransactionItem(
- object: TransferHistoryUI(
- amount: amount!,
- decimals: 1,
- symbols: symbols ?? '',
- direction: TransferDirection
- .all, // Transfers are always "from", but from different accounts
- blockDateTime: blockDateTime,
- fromAddress: fromAddress!,
- toAddress: toAddress!,
- extrisincStatus: null,
- ),
- );
- // },
- // );
- } else {
- return const SizedBox();
- }
- }
-}
-
-class _TransferStatus extends StatelessWidget {
- const _TransferStatus(this.status);
-
- final ExtrisincStatus status;
-
- @override
- Widget build(final BuildContext context) {
- switch (status) {
- case ExtrisincStatus.loading:
- return Shimmer.fromColors(
- baseColor: Colors.grey.shade400,
- highlightColor: Colors.grey.shade100,
- enabled: true,
- child: const Row(
- children: [
- D3pBodyMediumText('status_pending'),
- SizedBox(width: 8),
- Icon(
- Icons.access_time_outlined,
- size: 16,
- ),
- ],
- ),
- );
- case ExtrisincStatus.success:
- return const D3pBodyMediumText(
- 'status_success',
- color: Colors.green,
- );
- case ExtrisincStatus.error:
- return const D3pBodyMediumText(
- 'status_error',
- );
- case ExtrisincStatus.failed:
- return const D3pBodyMediumText(
- 'status_failed',
- );
- }
- }
-}
-
-class _Message extends StatelessWidget {
- final String? message;
- final ExtrisincStatus? status;
-
- const _Message(this.message, this.status);
-
- @override
- Widget build(final BuildContext context) {
- if (message != null && status != ExtrisincStatus.success) {
- return Column(
- children: [
- D3pBodyLargeText(
- message!,
- translate: false,
- ),
- const SizedBoxH4(),
- ],
- );
- } else {
- return const SizedBox();
- }
- }
-}
diff --git a/lib/features/wallet_screen/presentation/notifications_page/widgets/notification_card.dart b/lib/features/wallet_screen/presentation/notifications_page/widgets/notification_card.dart
deleted file mode 100644
index e3e2c9f7..00000000
--- a/lib/features/wallet_screen/presentation/notifications_page/widgets/notification_card.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:threedpass/features/wallet_screen/bloc/notifications_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/notifications_page/widgets/notifcation_transfer.dart';
-
-class NotificationCard extends StatelessWidget {
- const NotificationCard({required this.notificationDTO, super.key});
-
- final NotificationDTO notificationDTO;
-
- @override
- Widget build(final BuildContext context) {
- switch (notificationDTO.type) {
- case NotificationType.transfer:
- return NotificationTransferCard(notificationDTO);
- case NotificationType.vote:
- return Text('Not implemented yet');
- }
- }
-}
diff --git a/lib/features/wallet_screen/presentation/transfer_page/widgets/from_address_textfield.dart b/lib/features/wallet_screen/presentation/transfer_page/widgets/from_address_textfield.dart
deleted file mode 100644
index f65b8663..00000000
--- a/lib/features/wallet_screen/presentation/transfer_page/widgets/from_address_textfield.dart
+++ /dev/null
@@ -1,217 +0,0 @@
-import 'package:easy_localization/easy_localization.dart';
-import 'package:flutter/material.dart';
-import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
-import 'package:polkawallet_sdk/storage/types/keyPairData.dart';
-import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
-import 'package:threedpass/core/theme/d3p_colors.dart';
-import 'package:threedpass/core/theme/d3p_special_colors.dart';
-import 'package:threedpass/core/theme/d3p_special_styles.dart';
-import 'package:threedpass/core/utils/formatters.dart';
-import 'package:threedpass/core/widgets/buttons/elevated_button.dart';
-import 'package:threedpass/core/widgets/buttons/enum_button.dart';
-import 'package:threedpass/core/widgets/paddings.dart';
-import 'package:threedpass/core/widgets/text/d3p_body_medium_text.dart';
-import 'package:threedpass/features/wallet_screen/bloc/transfer_info_bloc.dart';
-
-class FromAddressTextField extends StatelessWidget {
- const FromAddressTextField({
- required this.data,
- super.key,
- });
-
- final FromAddressData data;
-
- @override
- Widget build(final BuildContext context) {
- // final appService = BlocProvider.of(context).state;
- // final theme = Theme.of(context);
- // Colors from https://github.com/flutter/flutter/blob/936763f58963ef3dd103986fc232310c43360344/packages/flutter/lib/src/material/input_decorator.dart#L4561
-
- // switch (Theme.of(context).brightness) {
- // case Brightness.dark:
- // return const Color(0x0DFFFFFF);
- // case Brightness.light:
- // return const Color(0x05000000) ;
- // }
- final textStyle = Theme.of(context).customTextStyles;
- final colors = Theme.of(context).customColors;
-
- return Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- 'from_address_label'.tr(),
- style: textStyle.hintStyle,
- ),
- const SizedBoxH4(),
- SizedBox(
- height: 43,
- child: D3pElevatedButton(
- text: null,
- onPressed: () => openDialog(context),
- backgroundColor: colors.defaultInputColor,
- elevation: 0,
- childAlignment: MainAxisAlignment.start,
- textStyle: textStyle.d3pBodyMedium,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- _ButtonText(data: data.data),
- Icon(
- Icons.keyboard_arrow_down_rounded,
- color: colors.themeOpposite,
- ),
- ],
- ),
- ),
- ),
- ],
- );
-
- // return BasicTransferTextField(
- // enabled: false,
- // labelText: 'from_address_label'.tr(),
- // controller: TextEditingController(
- // text: Fmt.shorterAddress(
- // appService.keyring.current.address,
- // ),
- // ),
- // );
- }
-
- Future openDialog(final BuildContext context) {
- final allAccounts = BlocProvider.of(context)
- .state
- .keyring
- .allAccounts;
- final chosenFromAddresses =
- BlocProvider.of(context).state.fromAddresses;
-
- final accounts = AccountsList(
- allAccounts: allAccounts,
- chosenAccounts: chosenFromAddresses,
- ).buildListToChoose();
-
- return showPlatformModalSheet(
- context: context,
- material: MaterialModalSheetData(
- shape: const RoundedRectangleBorder(
- side: BorderSide.none,
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(16),
- topRight: Radius.circular(16),
- ),
- ),
- ),
- builder: (final _) => Column(
- children: [
- const SizedBoxH24(),
- ListView.builder(
- shrinkWrap: true,
- itemCount: accounts.length,
- itemBuilder: (final context, final index) => EnumButton(
- text: null,
- isChosen: false,
- onPressed: () => onAccountChoose(context, accounts[index]),
- child: _AccountChooseTileText(
- address: accounts[index].address,
- name: accounts[index].name,
- ),
- ),
- ),
- ],
- ),
- );
- }
-
- void onAccountChoose(final BuildContext context, final KeyPairData acc) {
- final transferInfoCubit = BlocProvider.of(context);
- transferInfoCubit
- .add(ChangeChosenAccountEvent(acc: acc, dataToChange: data));
- Navigator.of(context).pop();
- }
-}
-
-class _ButtonText extends StatelessWidget {
- const _ButtonText({required this.data});
- final KeyPairData? data;
-
- @override
- Widget build(final BuildContext context) {
- if (data != null) {
- return _AccountChooseTileText(
- address: data?.address,
- name: data?.name,
- );
- } else {
- final colors = Theme.of(context).customColors;
- return D3pBodyMediumText(
- 'from_select_account_title',
- color: colors.themeOpposite,
- );
- }
- }
-}
-
-class _AccountChooseTileText extends StatelessWidget {
- const _AccountChooseTileText({
- required this.address,
- required this.name,
- });
-
- final String? name;
- final String? address;
-
- String fixedName() {
- if (name != null) {
- return name! + ' ';
- } else {
- return '';
- }
- }
-
- String shortAddress() {
- return Fmt.shorterAddress(address);
- }
-
- @override
- Widget build(final BuildContext context) {
- final textStyles = Theme.of(context).customTextStyles;
- return Text.rich(
- TextSpan(
- text: fixedName(),
- style: textStyles.d3pBodyMedium,
- children: [
- TextSpan(
- text: shortAddress(),
- style: textStyles.d3pBodyMedium.copyWith(color: D3pColors.disabled),
- ),
- ],
- ),
- );
- // return '${fixedName()}${shortAddress()}';
- }
-}
-
-class AccountsList {
- final List allAccounts;
- final List chosenAccounts;
-
- const AccountsList({
- required this.allAccounts,
- required this.chosenAccounts,
- });
-
- List buildListToChoose() {
- final setOfChosen = {};
- for (final i in chosenAccounts) {
- setOfChosen.add(i.data?.address ?? '');
- }
- final newList = List.from(allAccounts);
-
- newList
- .removeWhere((final element) => setOfChosen.contains(element.address));
- return newList;
- }
-}
diff --git a/lib/features/wallet_screen/presentation/transfer_page/widgets/password_textfield.dart b/lib/features/wallet_screen/presentation/transfer_page/widgets/password_textfield.dart
deleted file mode 100644
index 25c80c7a..00000000
--- a/lib/features/wallet_screen/presentation/transfer_page/widgets/password_textfield.dart
+++ /dev/null
@@ -1,61 +0,0 @@
-import 'package:easy_localization/easy_localization.dart';
-import 'package:flutter/material.dart';
-import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:threedpass/core/utils/validators.dart';
-import 'package:threedpass/features/wallet_screen/bloc/transfer_info_bloc.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transfer_page/widgets/basic_transfer_textfield.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transfer_page/widgets/password_hint.dart';
-
-class PasswordTextField extends StatefulWidget {
- const PasswordTextField({
- required this.passwordController,
- required this.isFirst,
- required this.data,
- final Key? key,
- }) : super(key: key);
-
- final bool isFirst;
- final FromAddressData data;
- final TextEditingController passwordController;
-
- @override
- State createState() => _State();
-}
-
-class _State extends State {
- bool obscureText = true;
-
- String? _passValidator(final String? v) {
- return v != null && Validators.checkPassword(v)
- ? null
- : 'create_credentials_password_error'.tr();
- }
-
- @override
- Widget build(final BuildContext context) {
- return BasicTransferTextField(
- labelText: 'enter_password_label'.tr(),
- controller: widget.passwordController,
- hintText: 'enter_password_hint'.tr(),
- validator: _passValidator,
- obscureText: obscureText,
- maxLines: 1,
- suffixButton: Icon(obscureText ? Icons.visibility : Icons.visibility_off),
- onSuffixButtonPressed: obscureTextPressed,
- labelButton: widget.isFirst ? null : const Icon(Icons.content_paste_go),
- onLabelButtonPressed: () => onLabelButtonPressed(context),
- bottomWidget: widget.isFirst ? null : const PasswordHint(),
- );
- }
-
- void obscureTextPressed() {
- setState(() {
- obscureText = !obscureText;
- });
- }
-
- void onLabelButtonPressed(final BuildContext context) {
- final transferInfo = BlocProvider.of(context);
- transferInfo.add(CopyPasswordEvent(widget.data));
- }
-}
diff --git a/lib/features/wallet_screen/presentation/recieve_page/recieve_page.dart b/lib/features/wallet_screen/recieve_page/recieve_page.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/recieve_page/recieve_page.dart
rename to lib/features/wallet_screen/recieve_page/recieve_page.dart
diff --git a/lib/features/wallet_screen/presentation/recieve_page/widgets/address_text.dart b/lib/features/wallet_screen/recieve_page/widgets/address_text.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/recieve_page/widgets/address_text.dart
rename to lib/features/wallet_screen/recieve_page/widgets/address_text.dart
diff --git a/lib/features/wallet_screen/presentation/recieve_page/widgets/copy_button.dart b/lib/features/wallet_screen/recieve_page/widgets/copy_button.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/recieve_page/widgets/copy_button.dart
rename to lib/features/wallet_screen/recieve_page/widgets/copy_button.dart
diff --git a/lib/features/wallet_screen/presentation/recieve_page/widgets/qr_code.dart b/lib/features/wallet_screen/recieve_page/widgets/qr_code.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/recieve_page/widgets/qr_code.dart
rename to lib/features/wallet_screen/recieve_page/widgets/qr_code.dart
diff --git a/lib/features/wallet_screen/presentation/transactions_history/bloc/get_transfers_cubit.dart b/lib/features/wallet_screen/transactions_history/bloc/get_transfers_cubit.dart
similarity index 81%
rename from lib/features/wallet_screen/presentation/transactions_history/bloc/get_transfers_cubit.dart
rename to lib/features/wallet_screen/transactions_history/bloc/get_transfers_cubit.dart
index aa0374ea..37880e01 100644
--- a/lib/features/wallet_screen/presentation/transactions_history/bloc/get_transfers_cubit.dart
+++ b/lib/features/wallet_screen/transactions_history/bloc/get_transfers_cubit.dart
@@ -1,8 +1,8 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
import 'package:super_core/super_core.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfer_item.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfers_dto.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfer_item.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfers_dto.dart';
abstract class GetTransfersCubit extends Cubit {
GetTransfersCubit() : super(null) {
diff --git a/lib/features/wallet_screen/presentation/transactions_history/bloc/transfers_from_cubit.dart b/lib/features/wallet_screen/transactions_history/bloc/transfers_from_cubit.dart
similarity index 63%
rename from lib/features/wallet_screen/presentation/transactions_history/bloc/transfers_from_cubit.dart
rename to lib/features/wallet_screen/transactions_history/bloc/transfers_from_cubit.dart
index c408f1e7..72123538 100644
--- a/lib/features/wallet_screen/presentation/transactions_history/bloc/transfers_from_cubit.dart
+++ b/lib/features/wallet_screen/transactions_history/bloc/transfers_from_cubit.dart
@@ -1,8 +1,8 @@
import 'package:super_core/super_core.dart';
import 'package:threedp_graphql/features/transfers_history/domain/entities/transfers_request_params.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/bloc/get_transfers_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfers_dto.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/usecases/get_transfers.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/bloc/get_transfers_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfers_dto.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart';
class TransfersFromCubit extends GetTransfersCubit {
TransfersFromCubit({
diff --git a/lib/features/wallet_screen/presentation/transactions_history/bloc/transfers_to_cubit.dart b/lib/features/wallet_screen/transactions_history/bloc/transfers_to_cubit.dart
similarity index 63%
rename from lib/features/wallet_screen/presentation/transactions_history/bloc/transfers_to_cubit.dart
rename to lib/features/wallet_screen/transactions_history/bloc/transfers_to_cubit.dart
index ee8b6ecc..087ae6b5 100644
--- a/lib/features/wallet_screen/presentation/transactions_history/bloc/transfers_to_cubit.dart
+++ b/lib/features/wallet_screen/transactions_history/bloc/transfers_to_cubit.dart
@@ -1,8 +1,8 @@
import 'package:super_core/super_core.dart';
import 'package:threedp_graphql/features/transfers_history/domain/entities/transfers_request_params.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/bloc/get_transfers_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfers_dto.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/usecases/get_transfers.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/bloc/get_transfers_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfers_dto.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart';
class TransfersToCubit extends GetTransfersCubit {
TransfersToCubit({
diff --git a/lib/features/wallet_screen/presentation/transactions_history/data/repositories/transfers_repository.dart b/lib/features/wallet_screen/transactions_history/data/repositories/transfers_repository.dart
similarity index 87%
rename from lib/features/wallet_screen/presentation/transactions_history/data/repositories/transfers_repository.dart
rename to lib/features/wallet_screen/transactions_history/data/repositories/transfers_repository.dart
index 84095628..440f15e7 100644
--- a/lib/features/wallet_screen/presentation/transactions_history/data/repositories/transfers_repository.dart
+++ b/lib/features/wallet_screen/transactions_history/data/repositories/transfers_repository.dart
@@ -4,8 +4,8 @@ import 'package:threedp_graphql/features/transfers_history/data/query/__generate
import 'package:threedp_graphql/features/transfers_history/data/repositories/transfers_repository.dart';
import 'package:threedp_graphql/features/transfers_history/domain/entities/transfers_request_params.dart';
import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfer_item.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfers_dto.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfer_item.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfers_dto.dart';
class TransfersRepository {
final Client client;
diff --git a/lib/features/wallet_screen/presentation/transactions_history/domain/entities/mapper_transfer_item.dart b/lib/features/wallet_screen/transactions_history/domain/entities/mapper_transfer_item.dart
similarity index 82%
rename from lib/features/wallet_screen/presentation/transactions_history/domain/entities/mapper_transfer_item.dart
rename to lib/features/wallet_screen/transactions_history/domain/entities/mapper_transfer_item.dart
index cac65744..e20dd36e 100644
--- a/lib/features/wallet_screen/presentation/transactions_history/domain/entities/mapper_transfer_item.dart
+++ b/lib/features/wallet_screen/transactions_history/domain/entities/mapper_transfer_item.dart
@@ -1,8 +1,8 @@
import 'package:polkawallet_sdk/api/types/networkStateData.dart';
import 'package:threedpass/core/polkawallet/utils/balance_utils.dart';
import 'package:threedpass/core/polkawallet/utils/network_state_data_extension.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_history_ui.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfer_item.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfer_item.dart';
+import 'package:threedpass/features/wallet_screen/transfer_page/entities/transfer_history_ui.dart';
class MapperTransferItemToUI {
static TransferHistoryUI fromP3DTransfer({
diff --git a/lib/features/wallet_screen/presentation/transactions_history/domain/entities/transfer_item.dart b/lib/features/wallet_screen/transactions_history/domain/entities/transfer_item.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/transactions_history/domain/entities/transfer_item.dart
rename to lib/features/wallet_screen/transactions_history/domain/entities/transfer_item.dart
diff --git a/lib/features/wallet_screen/presentation/transactions_history/domain/entities/transfers_dto.dart b/lib/features/wallet_screen/transactions_history/domain/entities/transfers_dto.dart
similarity index 59%
rename from lib/features/wallet_screen/presentation/transactions_history/domain/entities/transfers_dto.dart
rename to lib/features/wallet_screen/transactions_history/domain/entities/transfers_dto.dart
index f76e15a8..f7f2e924 100644
--- a/lib/features/wallet_screen/presentation/transactions_history/domain/entities/transfers_dto.dart
+++ b/lib/features/wallet_screen/transactions_history/domain/entities/transfers_dto.dart
@@ -1,4 +1,4 @@
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfer_item.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfer_item.dart';
class TransfersDTO {
final List objects;
diff --git a/lib/features/wallet_screen/presentation/transactions_history/domain/usecases/get_transfers.dart b/lib/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart
similarity index 67%
rename from lib/features/wallet_screen/presentation/transactions_history/domain/usecases/get_transfers.dart
rename to lib/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart
index 73fe9fdf..2678e7dd 100644
--- a/lib/features/wallet_screen/presentation/transactions_history/domain/usecases/get_transfers.dart
+++ b/lib/features/wallet_screen/transactions_history/domain/usecases/get_transfers.dart
@@ -1,8 +1,8 @@
import 'package:super_core/super_core.dart';
import 'package:threedp_graphql/features/transfers_history/domain/entities/transfers_request_params.dart';
import 'package:threedpass/core/utils/usecase.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/data/repositories/transfers_repository.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfers_dto.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/data/repositories/transfers_repository.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfers_dto.dart';
class GetTransfers extends UseCase {
final TransfersRepository repository;
diff --git a/lib/features/wallet_screen/presentation/transactions_history/presentation/transactions_history_page.dart b/lib/features/wallet_screen/transactions_history/presentation/transactions_history_page.dart
similarity index 67%
rename from lib/features/wallet_screen/presentation/transactions_history/presentation/transactions_history_page.dart
rename to lib/features/wallet_screen/transactions_history/presentation/transactions_history_page.dart
index 1db598af..d7f45339 100644
--- a/lib/features/wallet_screen/presentation/transactions_history/presentation/transactions_history_page.dart
+++ b/lib/features/wallet_screen/transactions_history/presentation/transactions_history_page.dart
@@ -6,13 +6,13 @@ import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
import 'package:threedpass/core/theme/d3p_appbar_theme.dart';
import 'package:threedpass/core/theme/d3p_special_colors.dart';
import 'package:threedpass/core/theme/d3p_theme.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/bloc/transfers_from_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/bloc/transfers_to_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/mapper_transfer_item.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/domain/entities/transfer_item.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/presentation/widgets/first_page_exception_indicator.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/no_transfer_items_found.dart';
-import 'package:threedpass/features/wallet_screen/presentation/widgets/transaction_item.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/bloc/transfers_from_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/bloc/transfers_to_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/mapper_transfer_item.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/domain/entities/transfer_item.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/presentation/widgets/first_page_exception_indicator.dart';
+import 'package:threedpass/features/wallet_screen/widgets/no_transfer_items_found.dart';
+import 'package:threedpass/features/wallet_screen/widgets/transaction_item.dart';
import 'package:unicons/unicons.dart';
part './widgets/transactions_list.dart';
diff --git a/lib/features/wallet_screen/presentation/transactions_history/presentation/transactions_history_wrapper.dart b/lib/features/wallet_screen/transactions_history/presentation/transactions_history_wrapper.dart
similarity index 67%
rename from lib/features/wallet_screen/presentation/transactions_history/presentation/transactions_history_wrapper.dart
rename to lib/features/wallet_screen/transactions_history/presentation/transactions_history_wrapper.dart
index 7d1e1eda..c6ff7cb5 100644
--- a/lib/features/wallet_screen/presentation/transactions_history/presentation/transactions_history_wrapper.dart
+++ b/lib/features/wallet_screen/transactions_history/presentation/transactions_history_wrapper.dart
@@ -1,9 +1,9 @@
import 'package:auto_route/auto_route.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/bloc/transfers_from_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/bloc/transfers_to_cubit.dart';
-import 'package:threedpass/features/wallet_screen/presentation/transactions_history/presentation/transactions_history_page.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/bloc/transfers_from_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/bloc/transfers_to_cubit.dart';
+import 'package:threedpass/features/wallet_screen/transactions_history/presentation/transactions_history_page.dart';
import 'package:threedpass/setup.dart';
@RoutePage()
diff --git a/lib/features/wallet_screen/presentation/transactions_history/presentation/widgets/first_page_exception_indicator.dart b/lib/features/wallet_screen/transactions_history/presentation/widgets/first_page_exception_indicator.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/transactions_history/presentation/widgets/first_page_exception_indicator.dart
rename to lib/features/wallet_screen/transactions_history/presentation/widgets/first_page_exception_indicator.dart
diff --git a/lib/features/wallet_screen/presentation/transactions_history/presentation/widgets/transactions_list.dart b/lib/features/wallet_screen/transactions_history/presentation/widgets/transactions_list.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/transactions_history/presentation/widgets/transactions_list.dart
rename to lib/features/wallet_screen/transactions_history/presentation/widgets/transactions_list.dart
diff --git a/lib/features/wallet_screen/presentation/transactions_history/presentation/widgets/transactions_list_from.dart b/lib/features/wallet_screen/transactions_history/presentation/widgets/transactions_list_from.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/transactions_history/presentation/widgets/transactions_list_from.dart
rename to lib/features/wallet_screen/transactions_history/presentation/widgets/transactions_list_from.dart
diff --git a/lib/features/wallet_screen/presentation/transactions_history/presentation/widgets/transactions_list_to.dart b/lib/features/wallet_screen/transactions_history/presentation/widgets/transactions_list_to.dart
similarity index 100%
rename from lib/features/wallet_screen/presentation/transactions_history/presentation/widgets/transactions_list_to.dart
rename to lib/features/wallet_screen/transactions_history/presentation/widgets/transactions_list_to.dart
diff --git a/lib/features/wallet_screen/bloc/meta_tx_infos_fabric.dart b/lib/features/wallet_screen/transfer_page/bloc/meta_tx_infos_fabric.dart
similarity index 100%
rename from lib/features/wallet_screen/bloc/meta_tx_infos_fabric.dart
rename to lib/features/wallet_screen/transfer_page/bloc/meta_tx_infos_fabric.dart
diff --git a/lib/features/wallet_screen/bloc/transfer_info_bloc.dart b/lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc.dart
similarity index 95%
rename from lib/features/wallet_screen/bloc/transfer_info_bloc.dart
rename to lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc.dart
index c5be0c69..ed8a5fb2 100644
--- a/lib/features/wallet_screen/bloc/transfer_info_bloc.dart
+++ b/lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc.dart
@@ -15,9 +15,9 @@ import 'package:threedpass/core/polkawallet/bloc/app_service_cubit.dart';
import 'package:threedpass/core/polkawallet/non_native_tokens_api.dart';
import 'package:threedpass/core/polkawallet/utils/balance_utils.dart';
import 'package:threedpass/core/polkawallet/utils/network_state_data_extension.dart';
-import 'package:threedpass/features/wallet_screen/bloc/notifications_cubit.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer.dart';
-import 'package:threedpass/features/wallet_screen/domain/entities/transfer_meta_dto.dart';
+import 'package:threedpass/features/wallet_screen/notifications_page/bloc/notifications_bloc.dart';
+import 'package:threedpass/features/wallet_screen/transfer_page/entities/transfer.dart';
+import 'package:threedpass/features/wallet_screen/transfer_page/entities/transfer_meta_dto.dart';
part 'meta_tx_infos_fabric.dart';
part 'transfer_info_bloc.g.dart';
@@ -144,7 +144,7 @@ class TransferInfoBloc
required final GlobalKey formKey,
}) async {
try {
- final notificationsCubit = BlocProvider.of(context);
+ final notificationsCubit = BlocProvider.of(context);
final appServiceCubit = BlocProvider.of(context);
final metaTxInfos =
@@ -162,8 +162,8 @@ class TransferInfoBloc
context: context,
passwords: passwords,
formKey: formKey,
- notificationsCubit: notificationsCubit,
- addHandler: appServiceCubit.addHandler,
+ notificationsBloc: notificationsCubit,
+ appServiceCubit: appServiceCubit,
symbols: metaDTO.name,
decimals: metaDTO.decimals,
).sendFunds();
diff --git a/lib/features/wallet_screen/bloc/transfer_info_bloc.g.dart b/lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc.g.dart
similarity index 100%
rename from lib/features/wallet_screen/bloc/transfer_info_bloc.g.dart
rename to lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc.g.dart
diff --git a/lib/features/wallet_screen/bloc/transfer_info_bloc_event.dart b/lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc_event.dart
similarity index 100%
rename from lib/features/wallet_screen/bloc/transfer_info_bloc_event.dart
rename to lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc_event.dart
diff --git a/lib/features/wallet_screen/bloc/transfer_info_bloc_fields_events.dart b/lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc_fields_events.dart
similarity index 100%
rename from lib/features/wallet_screen/bloc/transfer_info_bloc_fields_events.dart
rename to lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc_fields_events.dart
diff --git a/lib/features/wallet_screen/bloc/transfer_info_bloc_state.dart b/lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc_state.dart
similarity index 100%
rename from lib/features/wallet_screen/bloc/transfer_info_bloc_state.dart
rename to lib/features/wallet_screen/transfer_page/bloc/transfer_info_bloc_state.dart
diff --git a/lib/features/wallet_screen/domain/entities/transaction.dart b/lib/features/wallet_screen/transfer_page/entities/transaction.dart
similarity index 94%
rename from lib/features/wallet_screen/domain/entities/transaction.dart
rename to lib/features/wallet_screen/transfer_page/entities/transaction.dart
index c3615273..d7e10923 100644
--- a/lib/features/wallet_screen/domain/entities/transaction.dart
+++ b/lib/features/wallet_screen/transfer_page/entities/transaction.dart
@@ -11,7 +11,6 @@ abstract class _Transaction {
required this.addHandler,
required this.appService,
required this.context,
- required this.finishNotificationWithError,
required this.globalContext,
});
@@ -19,7 +18,6 @@ abstract class _Transaction {
final BuildContext context;
final BuildContext globalContext;
final void Function(Map, String> data) addHandler;
- final void Function(String error) finishNotificationWithError;
Future