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:
@@ -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);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user