Skip to content

Commit

Permalink
Created state loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol committed Jan 13, 2025
1 parent a6c75bc commit bfc2d0e
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions app/lib/pages/chat_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,20 @@ class _ChatBodyState extends State<ChatBody> {
),
),

// Loading indicator
if (apiProvider.isLoading)
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
for (int i = 0; i < 3; i++)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: Text(
i < _dotAnimation.value ? '.' : '',
style: const TextStyle(
color: Colors.white,
fontSize: 30,
fontWeight: FontWeight.bold,
),
),
),
if (apiProvider.isLoading) // Show the loading dots
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
SizedBox(width: 10),
Text("Loading...", style: TextStyle(color: Colors.white)),
],
),
),
],
),
),
Expand Down

0 comments on commit bfc2d0e

Please sign in to comment.