Skip to content

Commit

Permalink
preparation V1.3.0 suite
Browse files Browse the repository at this point in the history
  • Loading branch information
byackee committed Nov 13, 2024
1 parent a3e43ea commit f125fee
Show file tree
Hide file tree
Showing 17 changed files with 320 additions and 236 deletions.
4 changes: 3 additions & 1 deletion lib/api/api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class ApiService {
// Si lastFetchTime est déjà défini et que le temps minimum n'est pas atteint, on vérifie d'abord la validité du cache
if (!forceFetch && lastFetchTime != null) {
final DateTime lastFetch = DateTime.parse(lastFetchTime);
if (now.difference(lastFetch) < Parameters.apiCacheDuration) {
if (now.difference(lastFetch) < Duration(minutes: 5)) {
if (cachedData != null) {
logger.i("apiService: fetchYamMarket -> Requête annulée, temps minimum pas atteint");
return [];
Expand Down Expand Up @@ -271,6 +271,8 @@ class ApiService {
box.put('yamlastFetchTime', now.toIso8601String());
// Enregistrer la nouvelle date de mise à jour renvoyée par l'API
box.put('lastUpdateTime_YamMarket', lastUpdateDateString);
box.put('lastExecutionTime_Yam', now.toIso8601String());


return data;
} else {
Expand Down
1 change: 1 addition & 0 deletions lib/api/data_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,7 @@ class DataManager extends ChangeNotifier {
'annualPercentageYield': matchingToken['annualPercentageYield'],
'tokenDigit': offer['token_digit'],
'creationDate': offer['creation_date'],
'token_to_pay': offer['token_to_pay'],
'token_to_sell': offer['token_to_sell'],
'token_to_buy': offer['token_to_buy'],
'id_offer': offer['id_offer'],
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void main() async {
dataManager.loadSelectedCurrency(),
dataManager.loadUserIdToAddresses(),
]);

FlutterNativeSplash.remove(); // Supprimer le splash screen natif après l'initialisation

// Ensuite, exécuter fetchAndCalculateData une fois que les précédentes sont terminées
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/Statistics/portfolio_stats.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ class _PortfolioStats extends State<PortfolioStats> {
sliver: SliverGrid(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: isWideScreen ? 2 : 1,

mainAxisSpacing: 8.0, // Espacement vertical entre les cartes
crossAxisSpacing: 8.0, // Espacement horizontal entre les cartes
mainAxisExtent: fixedCardHeight, // Hauteur fixe pour chaque carte
),
delegate: SliverChildBuilderDelegate(
Expand Down
5 changes: 3 additions & 2 deletions lib/pages/Statistics/rmm_stats.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class RmmStatsState extends State<RmmStats> {
sliver: SliverGrid(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: screenWidth > 700 ? 2 : 1,
mainAxisSpacing: 8.0, // Espacement vertical entre les cartes
crossAxisSpacing: 8.0, // Espacement horizontal entre les cartes
mainAxisExtent: fixedCardHeight, // Hauteur fixe pour chaque carte
),
delegate: SliverChildBuilderDelegate(
Expand All @@ -67,7 +69,6 @@ class RmmStatsState extends State<RmmStats> {

// Fonction pour créer la carte APY en pleine largeur
Widget _buildApyCard(DataManager dataManager, double screenWidth) {

return SizedBox(
height: 180,
width: double.infinity,
Expand Down Expand Up @@ -215,7 +216,7 @@ class RmmStatsState extends State<RmmStats> {
return Table(
border: TableBorder(
horizontalInside: BorderSide(
color: Colors.black.withOpacity(0.3), // Couleur du fond grisé
color: Colors.black.withOpacity(0.3), // Couleur du fond grisé
width: 1,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/Statistics/stats_selector_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class StatsSelectorPageState extends State<StatsSelectorPage> {
expandedHeight: Utils.getSliverAppBarHeight(context), // Hauteur étendue si besoin
flexibleSpace: FlexibleSpaceBar(
background: Container(
color: Theme.of(context).cardColor,
color: Theme.of(context).scaffoldBackgroundColor,
child: Column(
mainAxisAlignment: MainAxisAlignment.end, // Aligne les éléments vers le bas
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
10 changes: 5 additions & 5 deletions lib/pages/dashboard/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class DashboardPageState extends State<DashboardPage> {
backDrawRodData: BackgroundBarChartRodData(
show: true,
toY: 100, // Fond de la jauge
color: const Color.fromARGB(255, 78, 78, 78).withOpacity(0.3), // Couleur du fond grisé
color: const Color.fromARGB(255, 78, 78, 78).withOpacity(0.3), // Couleur du fond grisé
),
rodStackItems: [
BarChartRodStackItem(0, displayValue, Colors.blueAccent.withOpacity(0.6)),
Expand Down Expand Up @@ -619,7 +619,7 @@ class DashboardPageState extends State<DashboardPage> {
hasGraph: true,
rightWidget: _buildVerticalGauge(_getPortfolioBarGraphData(dataManager), context),
),
const SizedBox(height: 15),
const SizedBox(height: 8),
_buildCard(
S.of(context).properties,
Icons.home,
Expand Down Expand Up @@ -688,7 +688,7 @@ class DashboardPageState extends State<DashboardPage> {
},
),
),
const SizedBox(height: 15),
const SizedBox(height: 8),
_buildCard(
S.of(context).tokens,
Icons.account_balance_wallet,
Expand Down Expand Up @@ -716,7 +716,7 @@ class DashboardPageState extends State<DashboardPage> {
},
),
),
const SizedBox(height: 15),
const SizedBox(height: 8),
_buildCard(
S.of(context).rents,
Icons.attach_money,
Expand Down Expand Up @@ -779,7 +779,7 @@ class DashboardPageState extends State<DashboardPage> {
hasGraph: true,
rightWidget: _buildMiniGraphForRendement(_getLast12MonthsRent(dataManager), context, dataManager),
),
const SizedBox(height: 15),
const SizedBox(height: 8),
_buildCard(
S.of(context).nextRondays,
Icons.trending_up,
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/portfolio/portfolio_display_1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PortfolioDisplay1 extends StatelessWidget {
height: 10,
width: maxWidth,
decoration: BoxDecoration(
color: const Color.fromARGB(255, 78, 78, 78).withOpacity(0.3), // Couleur du fond grisé
color: const Color.fromARGB(255, 78, 78, 78).withOpacity(0.3), // Couleur du fond grisé
borderRadius: BorderRadius.circular(5),
),
),
Expand Down Expand Up @@ -103,8 +103,8 @@ class PortfolioDisplay1 extends StatelessWidget {
padding: const EdgeInsets.only(top: 20, bottom: 80),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: MediaQuery.of(context).size.width > 700 ? 2 : 1,
mainAxisExtent: 170 * (1 + (appState.getTextSizeOffset() / 35)), // Ajustez ici pour plus de hauteur

mainAxisExtent: 180 * (1 + (appState.getTextSizeOffset() / 35)), // Ajustez ici pour plus de hauteur
),
itemCount: portfolio.length,
itemBuilder: (context, index) {
Expand Down
6 changes: 3 additions & 3 deletions lib/pages/portfolio/portfolio_display_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PortfolioDisplay2State extends State<PortfolioDisplay2> {
height: 15,
width: maxWidth,
decoration: BoxDecoration(
color: const Color.fromARGB(255, 78, 78, 78).withOpacity(0.3), // Couleur du fond grisé
color: const Color.fromARGB(255, 78, 78, 78).withOpacity(0.3), // Couleur du fond grisé
borderRadius: BorderRadius.circular(5),
),
),
Expand Down Expand Up @@ -117,7 +117,7 @@ class PortfolioDisplay2State extends State<PortfolioDisplay2> {
child: AlignedGridView.count(
padding: const EdgeInsets.only(top: 20, bottom: 80),
crossAxisCount: widthScreen > 700 ? 2 : 1, // Nombre de colonnes basé sur la largeur de l'écran

itemCount: filteredPortfolio.length,
itemBuilder: (context, index) {
final token = filteredPortfolio[index];
Expand All @@ -134,7 +134,7 @@ class PortfolioDisplay2State extends State<PortfolioDisplay2> {
: 0.5;

return Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8.0),
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8.0),
child: GestureDetector(
onTap: () => showTokenDetails(context, token),
child: Card(
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/portfolio/portfolio_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class PortfolioPageState extends State<PortfolioPage> {
expandedHeight: Utils.getSliverAppBarHeight(context), // Hauteur étendue
flexibleSpace: FlexibleSpaceBar(
background: Container(
color: Theme.of(context).cardColor,
color: Theme.of(context).scaffoldBackgroundColor,
child: Column(
mainAxisAlignment: MainAxisAlignment.end, // Aligne les éléments vers le bas
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/propertiesForSale/PropertiesForSaleRealt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _PropertiesForSaleRealtState extends State<PropertiesForSaleRealt> {
height: 15,
width: maxWidth,
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.3), // Couleur du fond grisé
color: Colors.black.withOpacity(0.3), // Couleur du fond grisé
borderRadius: BorderRadius.circular(5),
),
),
Expand Down Expand Up @@ -89,7 +89,7 @@ class _PropertiesForSaleRealtState extends State<PropertiesForSaleRealt> {
: AlignedGridView.count(
padding: const EdgeInsets.only(top: 20, bottom: 80),
crossAxisCount: MediaQuery.of(context).size.width > 700 ? 2 : 1, // Nombre de colonnes selon la largeur de l'écran

itemCount: propertiesForSale.length,
itemBuilder: (context, index) {
final property = propertiesForSale[index];
Expand Down
Loading

0 comments on commit f125fee

Please sign in to comment.