fix: reset espacement calibration + refresh auto historique
This commit is contained in:
@@ -15,13 +15,16 @@ class MainNavigationHolder extends StatefulWidget {
|
||||
class _MainNavigationHolderState extends State<MainNavigationHolder> {
|
||||
int _selectedIndex = 0;
|
||||
|
||||
// Incrémenté à chaque ouverture de l'onglet Stats pour forcer le rechargement
|
||||
// (l'écran est gardé vivant par l'IndexedStack et ne se rafraîchit pas seul).
|
||||
// Incrémentés à chaque ouverture de l'onglet correspondant pour forcer le
|
||||
// rechargement (les écrans sont gardés vivants par l'IndexedStack et ne se
|
||||
// rafraîchissent pas seuls).
|
||||
int _statsTick = 0;
|
||||
int _historyTick = 0;
|
||||
|
||||
void _onItemTapped(int index) {
|
||||
setState(() {
|
||||
_selectedIndex = index;
|
||||
if (index == 1) _historyTick++;
|
||||
if (index == 2) _statsTick++;
|
||||
});
|
||||
}
|
||||
@@ -30,7 +33,7 @@ class _MainNavigationHolderState extends State<MainNavigationHolder> {
|
||||
Widget build(BuildContext context) {
|
||||
final screens = [
|
||||
const HomeScreen(),
|
||||
const HistoryScreen(),
|
||||
HistoryScreen(refreshTick: _historyTick),
|
||||
StatisticsScreen(refreshTick: _statsTick),
|
||||
const WeaponListScreen(),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user