Skip to content

Commit

Permalink
V1.0.0 + graph edit
Browse files Browse the repository at this point in the history
  • Loading branch information
byackee committed Nov 4, 2024
1 parent cdeca04 commit 1224438
Show file tree
Hide file tree
Showing 27 changed files with 458 additions and 164 deletions.
10 changes: 10 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ PODS:
- nanopb/encode (= 2.30910.0)
- nanopb/decode (2.30910.0)
- nanopb/encode (2.30910.0)
- ObjectBox (4.0.1)
- objectbox_flutter_libs (0.0.1):
- Flutter
- ObjectBox (= 4.0.1)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand Down Expand Up @@ -226,6 +230,7 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`)
- objectbox_flutter_libs (from `.symlinks/plugins/objectbox_flutter_libs/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
Expand Down Expand Up @@ -257,6 +262,7 @@ SPEC REPOS:
- MLKitCommon
- MLKitVision
- nanopb
- ObjectBox
- PromisesObjC
- PromisesSwift
- SDWebImage
Expand All @@ -277,6 +283,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_native_splash/ios"
mobile_scanner:
:path: ".symlinks/plugins/mobile_scanner/ios"
objectbox_flutter_libs:
:path: ".symlinks/plugins/objectbox_flutter_libs/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
share_plus:
Expand Down Expand Up @@ -319,6 +327,8 @@ SPEC CHECKSUMS:
MLKitVision: e858c5f125ecc288e4a31127928301eaba9ae0c1
mobile_scanner: 96e91f2e1fb396bb7df8da40429ba8dfad664740
nanopb: 438bc412db1928dac798aa6fd75726007be04262
ObjectBox: 0bc4bb75eea85f6af06b369148b334c2056bbc29
objectbox_flutter_libs: 2ce0da386c780878687c736b528ceaf371573efb
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
Expand Down
3 changes: 3 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -585,6 +586,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -642,6 +644,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down
40 changes: 24 additions & 16 deletions lib/api/data_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:logger/logger.dart';

class BalanceRecord {
final String tokenType;
final double balance;
late final double balance;
final DateTime timestamp;

BalanceRecord({
Expand Down Expand Up @@ -204,6 +204,14 @@ Future<void> loadWalletBalanceHistory() async {

}

// Sauvegarde l'historique des balances dans Hive
Future<void> saveWalletBalanceHistory() async {
var box = Hive.box('walletValueArchive');
List<Map<String, dynamic>> balanceHistoryJson = walletBalanceHistory.map((record) => record.toJson()).toList();
await box.put('balanceHistory_totalWalletValue', balanceHistoryJson);
notifyListeners(); // Notifier les listeners de tout changement
}

Future<void> updatedDetailRentVariables({bool forceFetch = false}) async {
var box = Hive.box('realTokens'); // Ouvrir la boîte Hive pour le cache

Expand Down Expand Up @@ -343,7 +351,7 @@ Future<void> fetchAndStoreAllTokens() async {
'yearlyIncome': realToken['netRentYearPerToken'] * realToken['totalTokens'],
'initialLaunchDate': realToken['initialLaunchDate']?['date'],
'totalInvestment': realToken['totalInvestment'],
'underlyingAssetPrice': realToken['underlyingAssetPrice'],
'underlyingAssetPrice': realToken['underlyingAssetPrice'] ?? 0.0,
'initialMaintenanceReserve': realToken['initialMaintenanceReserve'],
'rentalType': realToken['rentalType'],
'rentStartDate': realToken['rentStartDate']?['date'],
Expand Down Expand Up @@ -484,15 +492,15 @@ Future<void> fetchAndStoreAllTokens() async {


// Variables temporaires pour calculer les valeurs
double walletValueSum = 0;
double rmmValueSum = 0;
double rwaValue = 0;
double walletTokensSum = 0;
double rmmTokensSum = 0;
double annualYieldSum = 0;
double dailyRentSum = 0;
double monthlyRentSum = 0;
double yearlyRentSum = 0;
double walletValueSum = 0.0;
double rmmValueSum = 0.0;
double rwaValue = 0.0;
double walletTokensSum = 0.0;
double rmmTokensSum = 0.0;
double annualYieldSum = 0.0;
double dailyRentSum = 0.0;
double monthlyRentSum = 0.0;
double yearlyRentSum = 0.0;
int yieldCount = 0;
List<Map<String, dynamic>> newPortfolio = [];

Expand All @@ -501,7 +509,7 @@ Future<void> fetchAndStoreAllTokens() async {
rmmTokenCount = 0;
rentedUnits = 0;
totalUnits = 0;

// Utilisation des ensembles pour stocker les adresses uniques
Set<String> uniqueWalletTokens = {};
Set<String> uniqueRmmTokens = {};
Expand Down Expand Up @@ -589,8 +597,8 @@ Future<void> fetchAndStoreAllTokens() async {
'bedroomBath': matchingRealToken['bedroomBath'],

// financials details
'totalInvestment': matchingRealToken['totalInvestment'],
'underlyingAssetPrice': matchingRealToken['underlyingAssetPrice'],
'totalInvestment': matchingRealToken['totalInvestment'] ?? 0.0,
'underlyingAssetPrice': matchingRealToken['underlyingAssetPrice'] ?? 0.0,
'realtListingFee': matchingRealToken['realtListingFee'],
'initialMaintenanceReserve': matchingRealToken['initialMaintenanceReserve'],
'renovationReserve': matchingRealToken['renovationReserve'],
Expand Down Expand Up @@ -714,8 +722,8 @@ Future<void> fetchAndStoreAllTokens() async {
'bedroomBath': matchingRealToken['bedroomBath'],

// financials details
'totalInvestment': matchingRealToken['totalInvestment'],
'underlyingAssetPrice': matchingRealToken['underlyingAssetPrice'],
'totalInvestment': matchingRealToken['totalInvestment'] ?? 0.0,
'underlyingAssetPrice': matchingRealToken['underlyingAssetPrice'] ?? 0.0,
'realtListingFee': matchingRealToken['realtListingFee'],
'initialMaintenanceReserve': matchingRealToken['initialMaintenanceReserve'],
'renovationReserve': matchingRealToken['renovationReserve'],
Expand Down
5 changes: 5 additions & 0 deletions lib/generated/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class MessageLookup extends MessageLookupByLibrary {
"ascending": MessageLookupByLibrary.simpleMessage("Ascending"),
"author": MessageLookupByLibrary.simpleMessage("Author"),
"averageApy": MessageLookupByLibrary.simpleMessage("average APY"),
"balance": MessageLookupByLibrary.simpleMessage("Balance"),
"bedroomBath": MessageLookupByLibrary.simpleMessage("Bedroom/Bath"),
"blockchain": MessageLookupByLibrary.simpleMessage("Blockchain"),
"borrowBalance": MessageLookupByLibrary.simpleMessage("Borrows"),
Expand Down Expand Up @@ -93,6 +94,9 @@ class MessageLookup extends MessageLookupByLibrary {
"Properties present in multiple wallets/RMM"),
"duplicate_title":
MessageLookupByLibrary.simpleMessage("Duplicate properties"),
"edit": MessageLookupByLibrary.simpleMessage("Edit"),
"editWalletBalance":
MessageLookupByLibrary.simpleMessage("Edit Wallet Balance History"),
"english": MessageLookupByLibrary.simpleMessage("English"),
"ethereumContract":
MessageLookupByLibrary.simpleMessage("Ethereum contract"),
Expand Down Expand Up @@ -230,6 +234,7 @@ class MessageLookup extends MessageLookupByLibrary {
"roiPerProperties":
MessageLookupByLibrary.simpleMessage("Property ROI"),
"rwaHoldings": MessageLookupByLibrary.simpleMessage("RWA Holdings SA"),
"save": MessageLookupByLibrary.simpleMessage("Save"),
"searchHint": MessageLookupByLibrary.simpleMessage("Search..."),
"sendDonations": MessageLookupByLibrary.simpleMessage(
"Send your donations to the following address:"),
Expand Down
9 changes: 7 additions & 2 deletions lib/generated/intl/messages_es.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class MessageLookup extends MessageLookupByLibrary {
"author": MessageLookupByLibrary.simpleMessage("Autor"),
"averageApy":
MessageLookupByLibrary.simpleMessage("APY promedio global"),
"balance": MessageLookupByLibrary.simpleMessage("Saldo"),
"bedroomBath": MessageLookupByLibrary.simpleMessage("Dormitorio/Baño"),
"blockchain": MessageLookupByLibrary.simpleMessage("Blockchain"),
"borrowBalance": MessageLookupByLibrary.simpleMessage("Préstamos"),
Expand Down Expand Up @@ -96,6 +97,9 @@ class MessageLookup extends MessageLookupByLibrary {
"Propiedades presentes en varias carteras/RMM"),
"duplicate_title":
MessageLookupByLibrary.simpleMessage("Propiedades duplicadas"),
"edit": MessageLookupByLibrary.simpleMessage("Editar"),
"editWalletBalance":
MessageLookupByLibrary.simpleMessage("Editar Historial del Wallet"),
"english": MessageLookupByLibrary.simpleMessage("English"),
"ethereumContract":
MessageLookupByLibrary.simpleMessage("Contrato de Ethereum"),
Expand Down Expand Up @@ -243,6 +247,7 @@ class MessageLookup extends MessageLookupByLibrary {
"roiPerProperties":
MessageLookupByLibrary.simpleMessage("ROI de la propiedad"),
"rwaHoldings": MessageLookupByLibrary.simpleMessage("RWA Holdings SA"),
"save": MessageLookupByLibrary.simpleMessage("Guardar"),
"searchHint": MessageLookupByLibrary.simpleMessage("Buscar..."),
"sendDonations": MessageLookupByLibrary.simpleMessage(
"Envía tus donaciones a la siguiente dirección:"),
Expand Down Expand Up @@ -314,8 +319,8 @@ class MessageLookup extends MessageLookupByLibrary {
"viewOnMap": MessageLookupByLibrary.simpleMessage("Ver en el mapa"),
"viewOnRealT": MessageLookupByLibrary.simpleMessage("Ver en RealT"),
"wallet": MessageLookupByLibrary.simpleMessage("Monedero"),
"walletBalanceHistory":
MessageLookupByLibrary.simpleMessage("Evolución del portafolio"),
"walletBalanceHistory": MessageLookupByLibrary.simpleMessage(
"Historial de Saldo del Wallet"),
"week": MessageLookupByLibrary.simpleMessage("Semana"),
"weekly": MessageLookupByLibrary.simpleMessage("Semanal"),
"weeks": MessageLookupByLibrary.simpleMessage("Semanas"),
Expand Down
13 changes: 9 additions & 4 deletions lib/generated/intl/messages_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ class MessageLookup extends MessageLookupByLibrary {
"application": MessageLookupByLibrary.simpleMessage("Application"),
"apy": MessageLookupByLibrary.simpleMessage("Rendement net"),
"areYouSureClearData": MessageLookupByLibrary.simpleMessage(
"Êtes-vous sûr de vouloir effacer le cache et les données ?"),
"Êtes-vous sûr de vouloir effacer le cache et les données ?"),
"ascending": MessageLookupByLibrary.simpleMessage("Ascendant"),
"author": MessageLookupByLibrary.simpleMessage("Auteur"),
"averageApy": MessageLookupByLibrary.simpleMessage("APY moyen global"),
"balance": MessageLookupByLibrary.simpleMessage("Balance"),
"bedroomBath":
MessageLookupByLibrary.simpleMessage("Chambre/Salle de bain"),
"blockchain": MessageLookupByLibrary.simpleMessage("Blockchain"),
Expand All @@ -60,7 +61,7 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Caractéristiques"),
"chinese": MessageLookupByLibrary.simpleMessage("中文"),
"clearCacheData": MessageLookupByLibrary.simpleMessage(
"Effacer le cache et les données"),
"Effacer le cache/les données"),
"close": MessageLookupByLibrary.simpleMessage("Fermer"),
"commercial": MessageLookupByLibrary.simpleMessage("Commercial"),
"condominium": MessageLookupByLibrary.simpleMessage("Condominium"),
Expand Down Expand Up @@ -95,6 +96,9 @@ class MessageLookup extends MessageLookupByLibrary {
"Propriétés présentes sur plusieurs portefeuilles/RMM"),
"duplicate_title":
MessageLookupByLibrary.simpleMessage("Propriétés en doublons"),
"edit": MessageLookupByLibrary.simpleMessage("Éditer"),
"editWalletBalance": MessageLookupByLibrary.simpleMessage(
"Éditer l\'historique du wallet"),
"english": MessageLookupByLibrary.simpleMessage("English"),
"ethereumContract":
MessageLookupByLibrary.simpleMessage("Contrat Ethereum"),
Expand Down Expand Up @@ -184,7 +188,7 @@ class MessageLookup extends MessageLookupByLibrary {
"other": MessageLookupByLibrary.simpleMessage("Autre"),
"others": MessageLookupByLibrary.simpleMessage("Autres"),
"othersTitle": MessageLookupByLibrary.simpleMessage(
"\'Détails de la section Autres\'"),
"Détails de la section Autres"),
"paypal": MessageLookupByLibrary.simpleMessage("PayPal"),
"period": MessageLookupByLibrary.simpleMessage("Période"),
"portfolio": MessageLookupByLibrary.simpleMessage("Portefeuille"),
Expand Down Expand Up @@ -244,6 +248,7 @@ class MessageLookup extends MessageLookupByLibrary {
"roiPerProperties":
MessageLookupByLibrary.simpleMessage("ROI de la propriété"),
"rwaHoldings": MessageLookupByLibrary.simpleMessage("RWA Holdings SA"),
"save": MessageLookupByLibrary.simpleMessage("Enregistrer"),
"searchHint": MessageLookupByLibrary.simpleMessage("Rechercher..."),
"sendDonations": MessageLookupByLibrary.simpleMessage(
"Envoyez vos dons à l\'adresse suivante :"),
Expand Down Expand Up @@ -314,7 +319,7 @@ class MessageLookup extends MessageLookupByLibrary {
"viewOnRealT": MessageLookupByLibrary.simpleMessage("Voir sur RealT"),
"wallet": MessageLookupByLibrary.simpleMessage("Portefeuille"),
"walletBalanceHistory":
MessageLookupByLibrary.simpleMessage("Évolution du portefeuille"),
MessageLookupByLibrary.simpleMessage("Historique du Wallet"),
"week": MessageLookupByLibrary.simpleMessage("Semaine"),
"weekly": MessageLookupByLibrary.simpleMessage("Hebdomadaire"),
"weeks": MessageLookupByLibrary.simpleMessage("Semaines"),
Expand Down
7 changes: 6 additions & 1 deletion lib/generated/intl/messages_it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class MessageLookup extends MessageLookupByLibrary {
"ascending": MessageLookupByLibrary.simpleMessage("Crescente"),
"author": MessageLookupByLibrary.simpleMessage("Autore"),
"averageApy": MessageLookupByLibrary.simpleMessage("Rendimento medio"),
"balance": MessageLookupByLibrary.simpleMessage("Saldo"),
"bedroomBath": MessageLookupByLibrary.simpleMessage("Camera/Bagno"),
"blockchain": MessageLookupByLibrary.simpleMessage("Blockchain"),
"borrowBalance": MessageLookupByLibrary.simpleMessage("Prestiti"),
Expand Down Expand Up @@ -95,6 +96,9 @@ class MessageLookup extends MessageLookupByLibrary {
"Proprietà presenti in più portafogli/RMM"),
"duplicate_title":
MessageLookupByLibrary.simpleMessage("Proprietà duplicate"),
"edit": MessageLookupByLibrary.simpleMessage("Modifica"),
"editWalletBalance":
MessageLookupByLibrary.simpleMessage("Modifica Storico del Wallet"),
"english": MessageLookupByLibrary.simpleMessage("English"),
"ethereumContract":
MessageLookupByLibrary.simpleMessage("Contratto Ethereum"),
Expand Down Expand Up @@ -238,6 +242,7 @@ class MessageLookup extends MessageLookupByLibrary {
"roiPerProperties":
MessageLookupByLibrary.simpleMessage("ROI per proprietà"),
"rwaHoldings": MessageLookupByLibrary.simpleMessage("RWA Holdings SA"),
"save": MessageLookupByLibrary.simpleMessage("Salva"),
"searchHint": MessageLookupByLibrary.simpleMessage("Cerca..."),
"sendDonations": MessageLookupByLibrary.simpleMessage(
"Invia le tue donazioni al seguente indirizzo:"),
Expand Down Expand Up @@ -311,7 +316,7 @@ class MessageLookup extends MessageLookupByLibrary {
"viewOnRealT": MessageLookupByLibrary.simpleMessage("Vedi su RealT"),
"wallet": MessageLookupByLibrary.simpleMessage("Portafoglio"),
"walletBalanceHistory": MessageLookupByLibrary.simpleMessage(
"Storico del saldo del portafoglio"),
"Storico del Saldo del Wallet"),
"week": MessageLookupByLibrary.simpleMessage("Settimana"),
"weekly": MessageLookupByLibrary.simpleMessage("Settimanale"),
"weeks": MessageLookupByLibrary.simpleMessage("Settimane"),
Expand Down
7 changes: 6 additions & 1 deletion lib/generated/intl/messages_pt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class MessageLookup extends MessageLookupByLibrary {
"ascending": MessageLookupByLibrary.simpleMessage("Ascendente"),
"author": MessageLookupByLibrary.simpleMessage("Autor"),
"averageApy": MessageLookupByLibrary.simpleMessage("Rendimento Médio"),
"balance": MessageLookupByLibrary.simpleMessage("Saldo"),
"bedroomBath": MessageLookupByLibrary.simpleMessage("Quarto/Banheiro"),
"blockchain": MessageLookupByLibrary.simpleMessage("Blockchain"),
"borrowBalance": MessageLookupByLibrary.simpleMessage("Empréstimos"),
Expand Down Expand Up @@ -95,6 +96,9 @@ class MessageLookup extends MessageLookupByLibrary {
"Propriedades presentes em várias carteiras/RMM"),
"duplicate_title":
MessageLookupByLibrary.simpleMessage("Propriedades Duplicadas"),
"edit": MessageLookupByLibrary.simpleMessage("Editar"),
"editWalletBalance":
MessageLookupByLibrary.simpleMessage("Editar Histórico do Wallet"),
"english": MessageLookupByLibrary.simpleMessage("English"),
"ethereumContract":
MessageLookupByLibrary.simpleMessage("Contrato Ethereum"),
Expand Down Expand Up @@ -242,6 +246,7 @@ class MessageLookup extends MessageLookupByLibrary {
"roiPerProperties":
MessageLookupByLibrary.simpleMessage("ROI por Propriedade"),
"rwaHoldings": MessageLookupByLibrary.simpleMessage("RWA Holdings SA"),
"save": MessageLookupByLibrary.simpleMessage("Salvar"),
"searchHint": MessageLookupByLibrary.simpleMessage("Buscar..."),
"sendDonations": MessageLookupByLibrary.simpleMessage(
"Envie suas doações para o endereço abaixo:"),
Expand Down Expand Up @@ -313,7 +318,7 @@ class MessageLookup extends MessageLookupByLibrary {
"viewOnRealT": MessageLookupByLibrary.simpleMessage("Ver no RealT"),
"wallet": MessageLookupByLibrary.simpleMessage("Carteira"),
"walletBalanceHistory": MessageLookupByLibrary.simpleMessage(
"Histórico do Saldo da Carteira"),
"Histórico de Saldo do Wallet"),
"week": MessageLookupByLibrary.simpleMessage("Semana"),
"weekly": MessageLookupByLibrary.simpleMessage("Semanal"),
"weeks": MessageLookupByLibrary.simpleMessage("Semanas"),
Expand Down
Loading

0 comments on commit 1224438

Please sign in to comment.