Melhoria no funcionamento do histórico, Os nomes no dashboard do aluno carregam a primeira vez e ficam salvos para n ficarem sempre a carregar quando se volta ao dashboard, removi o butão de novo chat na interface de introdução da IA, mudei a aparencia dessa introdução e do histórico

This commit is contained in:
2026-05-23 16:20:27 +01:00
parent 7ee262f4c7
commit 895ce64c6f
22 changed files with 1330 additions and 582 deletions

View File

@@ -17,12 +17,22 @@ class ProgressHeroWidget extends StatefulWidget {
}
class _ProgressHeroWidgetState extends State<ProgressHeroWidget> {
UserStats? _cachedUserStats;
bool _isFirstLoad = true;
@override
Widget build(BuildContext context) {
return FutureBuilder<UserStats?>(
future: _loadUserStats(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
// Show cached data while loading to prevent flickering
if (snapshot.connectionState == ConnectionState.waiting &&
_cachedUserStats != null) {
return _buildContent(_cachedUserStats);
}
if (snapshot.connectionState == ConnectionState.waiting &&
_isFirstLoad) {
return _buildLoadingState();
}
@@ -31,6 +41,10 @@ class _ProgressHeroWidgetState extends State<ProgressHeroWidget> {
}
final userStats = snapshot.data;
if (userStats != null) {
_cachedUserStats = userStats;
_isFirstLoad = false;
}
return _buildContent(userStats);
},
);