Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speech Profile Page Improvements #971

Merged
merged 11 commits into from
Oct 8, 2024
Merged

Speech Profile Page Improvements #971

merged 11 commits into from
Oct 8, 2024

Conversation

mdmohsin7
Copy link
Collaborator

@mdmohsin7 mdmohsin7 commented Oct 4, 2024

Related to #979

  • On getting started page mention that this works only for english.
  • 150 seconds limit instead of 90, and when get to it, show a different message like "Are you still there?" instead of "Invalid speech .... " Explain that it took them too long so they will have to restart, if they did 80% of the words, let them go through.
  • "Try again" when multiple speakers is not triggering correctly
  • Multiple speakers validation only happens if more than 20 words (reduced it to 8 words)
  • Explain probably that language is only english, yea some people might have confused.
  • UI empty is really bad, an empty white line at the bottom.
onboarding.1.mp4
settings.1.mp4

Summary by Entelligence.AI

  • New Feature: Enhanced the user interface of the SpeechProfilePage with improved progress bar display and text styling.
  • Refactor: Updated the SpeechProfileProvider class to increase the maximum duration from 90 to 150 and target words count to 60, providing a more flexible speech profile creation process.
  • Bug Fix: Improved error notifications and conditions for detecting multiple speakers in the SpeechProfileProvider, enhancing the accuracy of speech analysis.
  • Chore: Removed the unused MemoryCreatedWidget from the _OnboardingWrapperState class, optimizing the rendering performance.

Copy link

github-actions bot commented Oct 4, 2024

Image description Entelligence.AI

Walkthrough

This pull request primarily focuses on enhancing the user experience and visual presentation of the application. It introduces new widgets for progress display, adjusts UI layout, updates text, and modifies validation rules in the SpeechProfileProvider. Additionally, it reduces the number of widgets being rendered by removing the MemoryCreatedWidget.

Changes

File(s) Summary
app/lib/pages/onboarding/speech_profile_widget.dart, app/lib/pages/speech_profile/page.dart, app/lib/pages/speech_profile/percentage_bar_progress.dart Introduced new widgets for progress display, adjusted UI layout, updated text, and enhanced the SpeechProfilePage widget.
app/lib/providers/speech_profile_provider.dart Modified validation rules including increasing maxDuration and targetWordsCount, updating error notifications, and adjusting conditions for detecting multiple speakers.
app/lib/pages/onboarding/wrapper.dart Reduced the number of widgets being rendered by removing the MemoryCreatedWidget.

"In the land of code, where logic is king, 🤴
A pull request arrives, changes it brings. 📦
Widgets are dancing, layouts take flight, 🕺💃
Validation rules adjust to just right. ✅
Memory fades as a widget departs, 🚀
Leaving behind more room for art. 🎨
Celebrate now, for the code's been refined, 🎉
In the quest for perfection, improvement we find." 🌟


Uplevel your code reviews with Entelligence.AI Pro

Entelligence.AI Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, Entelligence.AI Pro is free for open source projects.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between 66b7a6a and e69da43 commits.
Files selected (4)
  • app/lib/pages/onboarding/speech_profile_widget.dart (5)
  • app/lib/pages/speech_profile/page.dart (4)
  • app/lib/pages/speech_profile/percentage_bar_progress.dart (1)
  • app/lib/providers/speech_profile_provider.dart (2)
Review comments generated (14)
  • Review: 13
  • LGTM: 1

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

@@ -26,7 +26,7 @@ class SpeechProfileProvider extends ChangeNotifier
BtDevice? device;

final targetWordsCount = 70;
final maxDuration = 90;
final maxDuration = 150;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The maxDuration has been increased from 90 to 150. Ensure that this change is reflected in all parts of the application where maxDuration is used, and that it doesn't negatively impact other functionalities or performance.

- final maxDuration = 90;
+ final maxDuration = 150;

class ProgressBarWithPercentage extends StatefulWidget {
final double progressValue;

const ProgressBarWithPercentage({super.key, required this.progressValue});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The super.key in the constructor of ProgressBarWithPercentage is not valid. If you want to pass a key to the superclass, it should be done like this: Key key. Here's how to fix it:

- const ProgressBarWithPercentage({super.key, required this.progressValue});
+ const ProgressBarWithPercentage({Key? key, required this.progressValue}) : super(key: key);

}

@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The shouldRepaint method in TrianglePainter always returns false. This means that the triangle will never be repainted even if its properties change. If you want the triangle to repaint when its color or dimensions change, you should compare these properties with those of the old delegate. Here's how to fix it:

- bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
+ bool shouldRepaint(covariant TrianglePainter oldDelegate) {
+   return oldDelegate.color != color ||
+          oldDelegate.shadowColor != shadowColor ||
+          oldDelegate.triangleHeight != triangleHeight ||
+          oldDelegate.triangleBaseWidth != triangleBaseWidth;
+ }

@@ -290,7 +292,7 @@ class _SpeechProfilePageState extends State<SpeechProfilePage> with TickerProvid
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.fromLTRB(24, 0, 24, 48),
padding: const EdgeInsets.fromLTRB(0, 0, 0, 48),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The padding on the left and right of the bottom widget has been removed. This could affect the layout and appearance of the page. Ensure that this change aligns with the intended design.

- padding: const EdgeInsets.fromLTRB(24, 0, 24, 48),
+ padding: const EdgeInsets.fromLTRB(0, 0, 0, 48),

Comment on lines 424 to 441
padding: const EdgeInsets.symmetric(horizontal: 0),
child: Stack(
children: [
// LinearProgressIndicator(
// backgroundColor: Colors.grey[300],
// valueColor: AlwaysStoppedAnimation<Color>(Colors.grey.withOpacity(0.3)),
// ),
LinearProgressIndicator(
value: provider.percentageCompleted,
backgroundColor:
Colors.grey.shade300, // Make sure background is transparent
valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
),
// LinearProgressIndicator(
// value: provider.percentageCompleted,
// backgroundColor:
// Colors.grey.shade300, // Make sure background is transparent
// valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
// ),
ProgressBarWithPercentage(progressValue: provider.percentageCompleted),
],
),
),
const SizedBox(height: 12),
const SizedBox(height: 18),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The LinearProgressIndicator has been replaced with a custom ProgressBarWithPercentage widget. The padding around the progress bar has also been removed, and the space below the progress bar has been increased. These changes will alter the visual representation of the progress bar and its surrounding space.

- padding: const EdgeInsets.symmetric(horizontal: 32),
- LinearProgressIndicator(
-   value: provider.percentageCompleted,
-   backgroundColor: Colors.grey.shade300,
-   valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
- ),
- const SizedBox(height: 12),

+ padding: const EdgeInsets.symmetric(horizontal: 0),
+ ProgressBarWithPercentage(progressValue: provider.percentageCompleted),
+ const SizedBox(height: 18),

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between e69da43 and 5038176 commits.
Files selected (3)
  • app/lib/pages/onboarding/speech_profile_widget.dart (5)
  • app/lib/pages/speech_profile/page.dart (4)
  • app/lib/providers/speech_profile_provider.dart (2)
Files skipped from review due to trivial changes (1)
  • app/lib/pages/speech_profile/page.dart
Review comments generated (7)
  • Review: 7
  • LGTM: 0

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines 28 to 29
final targetWordsCount = 15; //TODO: 70 or 15?
final maxDuration = 150;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The change in maxDuration from 90 to 150 seems fine, but the comment on line 28 (//TODO: 70 or 15?) indicates that there might be some uncertainty about the correct value for targetWordsCount. It's important to resolve such TODOs and not leave them in the codebase as they can cause confusion in the future. If this is a parameter that might need to be tuned frequently, consider making it configurable via an external configuration file or environment variable.

- final targetWordsCount = 15; //TODO: 70 or 15?
+ final targetWordsCount = 15; // Decided to use 15 after thorough testing

Comment on lines 147 to 148
if (duration < 10 || duration > 155) {
notifyError('No_SPEECH');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The validation logic for duration has been updated to reflect the new minimum and maximum durations (10 and 155 respectively). This change is consistent with the update to maxDuration. However, the error message 'No_SPEECH' might be misleading if the duration is greater than 155. Consider using a more descriptive error message.

- notifyError('No_SPEECH');
+ notifyError(duration < 10 ? 'SPEECH_TOO_SHORT' : 'SPEECH_TOO_LONG');

Comment on lines 169 to 172
padding: EdgeInsets.fromLTRB(40, !provider.startedRecording ? 20 : 0, 40, 20),
child: !provider.startedRecording
? const Text(
'Now, Omi needs to learn your voice to be able to recognise you.',
'Omi needs to learn your voice to recognize you',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The padding and text have been adjusted. The padding now depends on whether recording has started or not. The text has also been slightly modified. These changes seem to be aimed at improving the UI and UX.

- padding: const EdgeInsets.fromLTRB(40, 20, 40, 20),
+ padding: EdgeInsets.fromLTRB(40, !provider.startedRecording ? 20 : 0, 40, 20),
- 'Now, Omi needs to learn your voice to be able to recognise you.',
+ 'Omi needs to learn your voice to recognize you',

@@ -210,6 +228,7 @@ class _SpeechProfileWidgetState extends State<SpeechProfileWidget> with TickerPr
: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
const Text("Note: This only works in English", style: TextStyle(color: Colors.white)),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

A note about language support has been added. This is a good addition for user awareness.

+ const Text("Note: This only works in English", style: TextStyle(color: Colors.white)),

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between 5038176 and 8ab232d commits.
Files selected (2)
  • app/lib/pages/speech_profile/percentage_bar_progress.dart (1)
  • app/lib/providers/speech_profile_provider.dart (4)
Review comments generated (5)
  • Review: 3
  • LGTM: 2

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines 28 to 30
final targetWordsCount = 60; //TODO: 70 or 15?
final maxDuration = 150;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The targetWordsCount and maxDuration constants have been increased. This change might affect the user experience, as it requires more words and a longer duration for speech profiles. The comment on line 28 indicates uncertainty about the appropriate value for targetWordsCount. It would be beneficial to clarify this value based on user needs or application requirements.

- final targetWordsCount = 15;
- final maxDuration = 90;
+ final targetWordsCount = 60; //TODO: 70 or 15?
+ final maxDuration = 150;

Comment on lines 229 to 231
if (speakerToWords.values.every((element) => element / segments.length > 0.05)) {
notifyError('MULTIPLE_SPEAKERS');
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The condition for detecting multiple speakers has been revised. Previously, an error was notified if every speaker spoke more than 20% of the time. Now, the threshold has been lowered to 5%. This change will make the detection of multiple speakers more sensitive. Ensure that this new threshold is appropriate for your use case.

- if (speakerToWords.values.every((element) => element / segments.length > 0.2)) {
+ if (speakerToWords.values.every((element) => element / segments.length > 0.05)) {
    notifyError('MULTIPLE_SPEAKERS');
  }

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between 8ab232d and dd1af99 commits.
Files selected (1)
  • app/lib/pages/speech_profile/page.dart (5)
Files skipped from review due to trivial changes (1)
  • app/lib/pages/speech_profile/page.dart
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between dd1af99 and c812cd4 commits.
Files selected (2)
  • app/lib/pages/speech_profile/page.dart (4)
  • app/lib/providers/speech_profile_provider.dart (5)
Review comments generated (8)
  • Review: 7
  • LGTM: 1

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines +27 to +28
final targetWordsCount = 30; //TODO: 15 seems way too less
final maxDuration = 150;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The increase in targetWordsCount and maxDuration may affect the performance of the application if not handled properly. Ensure that the backend and frontend can handle these increased limits without any issues.

Comment on lines +146 to +157
if (duration < 10 || duration > 155) {
if (percentageCompleted < 80) {
notifyError('NO_SPEECH');
return;
}
}

String text = segments.map((e) => e.text).join(' ').trim();
if (text.split(' ').length < (targetWordsCount / 2)) {
// 25 words
notifyError('TOO_SHORT');
return;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

There seems to be a discrepancy between the maxDuration value (150) and the duration check (155). This could lead to confusion or unexpected behavior. The condition should be consistent with the defined maxDuration.

-  if (duration < 10 || duration > 155) {
+  if (duration < 10 || duration > maxDuration) {

Comment on lines +238 to +239
text = '';
percentageCompleted = 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Clearing additional fields when resetting the state is a good practice to avoid stale data. However, ensure that these cleared fields are not required elsewhere in the code after the reset, which could potentially lead to null reference errors.

Comment on lines +19 to +20
import 'percentage_bar_progress.dart';

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The import statement for percentage_bar_progress.dart has been added. This is necessary to use the new ProgressBarWithPercentage widget in this file.

+ import 'package:intercom_flutter/intercom_flutter.dart';
+ import 'package:provider/provider.dart';
+ 
+ import 'percentage_bar_progress.dart';

Comment on lines 425 to 436
const SizedBox(height: 24),
SizedBox(
width: 336,
child: ProgressBarWithPercentage(progressValue: provider.percentageCompleted),
),
const SizedBox(height: 18),
Text(
provider.message,
style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
textAlign: TextAlign.center,
),
const SizedBox(height: 24),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Stack(
children: [
// LinearProgressIndicator(
// backgroundColor: Colors.grey[300],
// valueColor: AlwaysStoppedAnimation<Color>(Colors.grey.withOpacity(0.3)),
// ),
LinearProgressIndicator(
value: provider.percentageCompleted,
backgroundColor:
Colors.grey.shade300, // Make sure background is transparent
valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
),
],
),
),
const SizedBox(height: 12),
Text('${(provider.percentageCompleted * 100).toInt()}%',
style: const TextStyle(color: Colors.white)),
const SizedBox(height: 30),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The ProgressBarWithPercentage widget has been introduced to replace the LinearProgressIndicator. This change provides a more detailed and visually appealing progress display. The padding and text styling have also been adjusted for better UI layout.

- Text(
-   provider.message,
-   style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
-   textAlign: TextAlign.center,
- ),
- const SizedBox(height: 24),
- Padding(
-   padding: const EdgeInsets.symmetric(horizontal: 32),
-   child: Stack(
-     children: [
-       // LinearProgressIndicator(
-       //   backgroundColor: Colors.grey[300],
-       //   valueColor: AlwaysStoppedAnimation<Color>(Colors.grey.withOpacity(0.3)),
-       // ),
-       LinearProgressIndicator(
-         value: provider.percentageCompleted,
-         backgroundColor:
-             Colors.grey.shade300, // Make sure background is transparent
-         valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
-       ),
-     ],
-   ),
- ),
- const SizedBox(height: 12),
- Text('${(provider.percentageCompleted * 100).toInt()}%',
-     style: const TextStyle(color: Colors.white)),
+ const SizedBox(height: 24),
+ SizedBox(
+   width: 336,
+   child: ProgressBarWithPercentage(progressValue: provider.percentageCompleted),
+ ),
+ const SizedBox(height: 18),
+  Text(
+    provider.message,
+    style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
+    textAlign: TextAlign.center,
+  ),
+ const SizedBox(height: 30),

@mdmohsin7 mdmohsin7 marked this pull request as ready for review October 5, 2024 18:26
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between c812cd4 and 31ea9cb commits.
Files selected (3)
  • app/lib/pages/onboarding/speech_profile_widget.dart (4)
  • app/lib/pages/speech_profile/page.dart (4)
  • app/lib/pages/speech_profile/percentage_bar_progress.dart (1)
Review comments generated (11)
  • Review: 8
  • LGTM: 3

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines +56 to +90
class TrianglePainter extends CustomPainter {
final Color color;
final Color shadowColor;
final double triangleHeight;
final double triangleBaseWidth;

TrianglePainter({
required this.color,
required this.shadowColor,
this.triangleHeight = 10.0, // Default height
this.triangleBaseWidth = 10.0, // Default base width
});

@override
void paint(Canvas canvas, Size size) {
final paint = Paint()
..color = color
..style = PaintingStyle.fill;

final trianglePath = Path()
// Move to the left point of the base of the triangle
..moveTo(size.width / 2 - triangleBaseWidth / 2, 0)
// Draw a line to the right point of the base
..lineTo(size.width / 2 + triangleBaseWidth / 2, 0)
// Draw a line to the tip of the triangle (height)
..lineTo(size.width / 2, triangleHeight)
..close();

// Draw triangle
canvas.drawPath(trianglePath, paint);
}

@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

In the TrianglePainter class, the shouldRepaint method is returning a constant value of false. This means that the triangle will never be repainted even if the properties change. If you want to optimize and avoid unnecessary repaints, you should compare the old delegate's properties with the new ones.

  @override
-89:   bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
+89:   bool shouldRepaint(covariant TrianglePainter oldDelegate) {
+90:     return oldDelegate.color != color ||
+91:            oldDelegate.shadowColor != shadowColor ||
+92:            oldDelegate.triangleHeight != triangleHeight ||
+93:            oldDelegate.triangleBaseWidth != triangleBaseWidth;
+94:   }

Comment on lines 169 to 184
padding: EdgeInsets.fromLTRB(40, !provider.startedRecording ? 20 : 0, 40, 20),
child: !provider.startedRecording
? const Text(
'Now, Omi needs to learn your voice to be able to recognise you.',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 20,
height: 1.4,
fontWeight: FontWeight.w400,
),
? const Column(
children: [
Text(
'Omi needs to learn your voice to recognize you',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 20,
height: 1.4,
fontWeight: FontWeight.w400,
),
),
Text("Note: This only works in English", style: TextStyle(color: Colors.white)),
],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The padding and text content have been updated. The changes seem fine, but again, consider moving hardcoded strings to a separate constants file or use localization for better maintainability.

Comment on lines 321 to 338
const SizedBox(height: 20),
provider.percentageCompleted > 0
? const SizedBox()
: const Text(
"Introduce\nyourself",
style: TextStyle(color: Colors.white, fontSize: 24, height: 1.4),
textAlign: TextAlign.center,
),
// const SizedBox(height: 30),

// const SizedBox(height: 18),
ProgressBarWithPercentage(progressValue: provider.percentageCompleted),
const SizedBox(height: 12),
Text(
provider.message,
style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
textAlign: TextAlign.center,
),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The progress bar has been replaced with ProgressBarWithPercentage which provides a more detailed progress display. This is a good improvement for user experience. However, the hardcoded string "Introduce\nyourself" should be moved to a constants file or handled through localization.

@@ -16,6 +16,8 @@ import 'package:gradient_borders/box_borders/gradient_box_border.dart';
import 'package:intercom_flutter/intercom_flutter.dart';
import 'package:provider/provider.dart';

import 'percentage_bar_progress.dart';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The import statement for percentage_bar_progress.dart has been added. This is necessary to use the new ProgressBarWithPercentage widget in this file.

+ import 'percentage_bar_progress.dart';

@@ -114,7 +116,7 @@ class _SpeechProfilePageState extends State<SpeechProfilePage> with TickerProvid
Navigator.pop(context);
},
() {},
'Invalid recording detected',
'Multiple speakers detected',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The error message title has been updated to be more specific about the error. This change improves user experience by providing clearer feedback.

- 'Invalid recording detected',
+ 'Multiple speakers detected',

Comment on lines +213 to 298
fontSize: 20,
height: 1.4,
fontWeight: FontWeight.w400,
),
),
SizedBox(height: 20),
Text("Note: This only works in English",
style: TextStyle(color: Colors.white, fontSize: 16)),
],
)
: provider.text.isEmpty
? const DeviceAnimationWidget(
sizeMultiplier: 0.7,
)
: LayoutBuilder(
builder: (context, constraints) {
return ShaderMask(
shaderCallback: (bounds) {
if (provider.text.split(' ').length < 10) {
return const LinearGradient(colors: [Colors.white, Colors.white])
.createShader(bounds);
}
return const LinearGradient(
colors: [Colors.transparent, Colors.white],
stops: [0.0, 0.5],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
).createShader(bounds);
},
blendMode: BlendMode.dstIn,
child: SizedBox(
height: 120,
child: ListView(
controller: _scrollController,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
children: [
Text(
provider.text,
textAlign: TextAlign.center,
style: const TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w400,
height: 1.5,
? (provider.percentageCompleted > 0
? const SizedBox()
: const Text(
"Introduce\nyourself",
style: TextStyle(color: Colors.white, fontSize: 24, height: 1.4),
textAlign: TextAlign.center,
))
: Padding(
padding: const EdgeInsets.only(top: 80.0),
child: LayoutBuilder(
builder: (context, constraints) {
return ShaderMask(
shaderCallback: (bounds) {
if (provider.text.split(' ').length < 10) {
return const LinearGradient(colors: [Colors.white, Colors.white])
.createShader(bounds);
}
return const LinearGradient(
colors: [Colors.transparent, Colors.white],
stops: [0.0, 0.5],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
).createShader(bounds);
},
blendMode: BlendMode.dstIn,
child: SizedBox(
height: 130,
child: ListView(
controller: _scrollController,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
children: [
Text(
provider.text,
textAlign: TextAlign.center,
style: const TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w400,
height: 1.5,
),
),
),
],
],
),
),
),
);
},
);
},
),
),
),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

This hunk contains several changes related to UI improvements and adjustments. The padding, text styling, and content have been modified to enhance the visual presentation of the SpeechProfilePage widget. A note has also been added to inform users that the feature only works in English. These changes are subjective and depend on the design requirements of the application.

However, there's a potential issue with the hardcoded sizes and dimensions (e.g., EdgeInsets.fromLTRB(24, 8, 24, 0), SizedBox(height: 10), etc.). It's recommended to use relative sizes or responsive layout techniques to ensure the UI looks good across different screen sizes and resolutions.

Comment on lines +425 to +436
const SizedBox(height: 24),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.9,
child: ProgressBarWithPercentage(progressValue: provider.percentageCompleted),
),
const SizedBox(height: 18),
Text(
provider.message,
style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
textAlign: TextAlign.center,
),
const SizedBox(height: 24),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Stack(
children: [
// LinearProgressIndicator(
// backgroundColor: Colors.grey[300],
// valueColor: AlwaysStoppedAnimation<Color>(Colors.grey.withOpacity(0.3)),
// ),
LinearProgressIndicator(
value: provider.percentageCompleted,
backgroundColor:
Colors.grey.shade300, // Make sure background is transparent
valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
),
],
),
),
const SizedBox(height: 12),
Text('${(provider.percentageCompleted * 100).toInt()}%',
style: const TextStyle(color: Colors.white)),
const SizedBox(height: 30),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The old progress bar (LinearProgressIndicator) has been replaced with a new custom widget (ProgressBarWithPercentage). This new widget provides a more detailed progress display, which can improve user experience. However, it's important to thoroughly test this new widget to ensure it behaves as expected in all scenarios.

- LinearProgressIndicator(
-   value: provider.percentageCompleted,
-   backgroundColor: Colors.grey.shade300,
-   valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
- ),
+ SizedBox(
+   width: MediaQuery.sizeOf(context).width * 0.9,
+   child: ProgressBarWithPercentage(progressValue: provider.percentageCompleted),
+ ),

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between 31ea9cb and b4a1151 commits.
Files selected (1)
  • app/lib/pages/onboarding/speech_profile_widget.dart (4)
Review comments generated (4)
  • Review: 4
  • LGTM: 0

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

@@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_provider_utilities/flutter_provider_utilities.dart';
import 'package:friend_private/backend/preferences.dart';
import 'package:friend_private/pages/speech_profile/percentage_bar_progress.dart';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The import of percentage_bar_progress.dart is new. Ensure that this file exists and is accessible from the current file's location. If it doesn't exist or isn't accessible, it will cause a compilation error.

+ import 'package:friend_private/pages/speech_profile/percentage_bar_progress.dart';

Comment on lines 227 to 339
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(
height: 24,
width: 24,
child: Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
),
),
const SizedBox(width: 24),
Text(provider.loadingText,
style: const TextStyle(color: Colors.white, fontSize: 18)),
],
),
)
: Column(
mainAxisSize: MainAxisSize.min,
borderRadius: BorderRadius.circular(12),
),
child: TextButton(
onPressed: () {
provider.close();
widget.goNext();
},
child: const Text(
"All done!",
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
)
: provider.uploadingProfile
? Padding(
padding: const EdgeInsets.only(top: 40.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 30),
Text(
provider.message,
style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
textAlign: TextAlign.center,
),
const SizedBox(height: 18),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Stack(
children: [
LinearProgressIndicator(
value: provider.percentageCompleted,
backgroundColor: Colors.grey.shade300,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
),
],
const SizedBox(
height: 24,
width: 24,
child: Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
),
),
const SizedBox(height: 12),
Text(
'${(provider.percentageCompleted * 100).toInt()}%',
style: const TextStyle(color: Colors.white),
),
const SizedBox(width: 24),
Text(provider.loadingText,
style: const TextStyle(color: Colors.white, fontSize: 18)),
],
),
),
)
: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 20),
provider.percentageCompleted > 0
? const SizedBox()
: const Text(
"Introduce\nyourself",
style: TextStyle(color: Colors.white, fontSize: 24, height: 1.4),
textAlign: TextAlign.center,
),
const SizedBox(height: 12),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.9,
child: ProgressBarWithPercentage(progressValue: provider.percentageCompleted)),
const SizedBox(height: 14),
Text(
provider.message,
style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
textAlign: TextAlign.center,
),
],
),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The UI for the recording state has been updated. The changes seem fine, but ensure that the conditions !provider.startedRecording, provider.isInitialising, provider.profileCompleted, and provider.uploadingProfile are correctly used to determine the appropriate UI to display.

- Padding(
-   padding: const EdgeInsets.fromLTRB(24, 0, 24, 0),
-   child: !provider.startedRecording
-       ? (provider.isInitialising
-           ? const CircularProgressIndicator(
-               color: Colors.white,
-             )
-           : Column(
-               mainAxisAlignment: MainAxisAlignment.end,
-               children: [
-                 const SizedBox(height: 20),
-                 Container(
-                   padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 0),
-                   decoration: BoxDecoration(
-                     border: const GradientBoxBorder(
-                       gradient: LinearGradient(colors: [
-                         Color.fromARGB(127, 208, 208, 208),
-                         Color.fromARGB(127, 188, 99, 121),
-                         Color.fromARGB(127, 86, 101, 182),
-                         Color.fromARGB(127, 126, 190, 236)
-                       ]),
-                       width: 2,
-                     ),
-                     borderRadius: BorderRadius.circular(12),
-                   ),
-                   child: TextButton(
-                     onPressed: () async {
-                       await stopDeviceRecording();
-                       await provider.initialise(finalizedCallback: restartDeviceRecording);
-                       provider.forceCompletionTimer =
-                           Timer(Duration(seconds: provider.maxDuration), () async {
-                         provider.finalize();
-                       });
-                       provider.updateStartedRecording(true);
-                     },
-                     child: const Text(
-                       'Get Started',
-                       style: TextStyle(color: Colors.white, fontSize: 16),
-                     ),
-                    ),
-                  ),
-                 const SizedBox(height: 10),
-               ],
-             ))
-       : provider.profileCompleted
-           ? Container(
-               margin: const EdgeInsets.only(top: 40),
-               padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 0),
-               decoration: BoxDecoration(
-                 border: const GradientBoxBorder(
-                   gradient: LinearGradient(colors: [
-                     Color.fromARGB(127, 208, 208, 208),
-                     Color.fromARGB(127, 188, 99, 121),
-                     Color.fromARGB(127, 86, 101, 182),
-                     Color.fromARGB(127, 126, 190, 236)
-                   ]),
-                   width: 2,
-                  ),
-                 borderRadius: BorderRadius.circular(12),
-                ),
-               child: TextButton(
-                 onPressed: () {
-                   provider.close();
-                   widget.goNext();
-                 },
-                 child: const Text(
-                   "All done!",
-                   style: TextStyle(color: Colors.white, fontSize: 16),
-                 ),
-                ),
-             )
-           : provider.uploadingProfile
-               ? Padding(
-                   padding: const EdgeInsets.only(top: 40.0),
-                   child: Row(
-                     mainAxisAlignment: MainAxisAlignment.center,
-                     children: [
-                       const SizedBox(
-                         height: 24,
-                         width: 24,
-                         child: Center(
-                           child: CircularProgressIndicator(
-                             valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
-                           ),
-                         ),
-                       ),
-                       const SizedBox(width: 24),
-                       Text(provider.loadingText,
-                           style: const TextStyle(color: Colors.white, fontSize: 18)),
-                     ],
-                   ),
-                 )
-               : Column(
-                   mainAxisSize: MainAxisSize.min,
-                    children: [
-                     const SizedBox(height: 30),
-                     Text(
-                       provider.message,
-                       style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
-                       textAlign: TextAlign.center,
-                     ),
-                     const SizedBox(height: 18),
-                     Padding(
-                       padding: const EdgeInsets.symmetric(horizontal: 32),
-                       child: Stack(
-                         children: [
-                           LinearProgressIndicator(
-                             value: provider.percentageCompleted,
-                             backgroundColor: Colors.grey.shade300,
-                             valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
-                           ),
-                         ],
-                        ),
-                      ),
-                     const SizedBox(height: 12),
-                     Text(
-                       '${(provider.percentageCompleted * 100).toInt()}%',
-                       style: const TextStyle(color: Colors.white),
-                     ),
-                    ],
-                  ),
-                 ),
+ !provider.startedRecording
+     ? (provider.isInitialising
+         ? const CircularProgressIndicator(
+             color: Colors.white,
+           )
+         : Column(
+             mainAxisAlignment: MainAxisAlignment.end,
+             children: [
+               const SizedBox(height: 20),
+               Container(
+                 padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 0),
+                 decoration: BoxDecoration(
+                   border: const GradientBoxBorder(
+                     gradient: LinearGradient(colors: [
+                       Color.fromARGB(127, 208, 208, 208),
+                       Color.fromARGB(127, 188, 99, 121),
+                       Color.fromARGB(127, 86, 101, 182),
+                       Color.fromARGB(127, 126, 190, 236)
+                     ]),
+                     width: 2,
+                    ),
+                   borderRadius: BorderRadius.circular(12),
+                  ),
+                 child: TextButton(
+                   onPressed: () async {
+                     await stopDeviceRecording();
+                     await provider.initialise(finalizedCallback: restartDeviceRecording);
+                     provider.forceCompletionTimer =
+                         Timer(Duration(seconds: provider.maxDuration), () async {
+                       provider.finalize();
+                     });
+                     provider.updateStartedRecording(true);
+                   },
+                   child: const Text(
+                     'Get Started',
+                     style: TextStyle(color: Colors.white, fontSize: 16),
+                   ),
+                  ),
+                ),
+               const SizedBox(height: 10),
+             ],
+           ))
+     : provider.profileCompleted
+         ? Container(
+             margin: const EdgeInsets.only(top: 40),
+             padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 0),
+             decoration: BoxDecoration(
+               border: const GradientBoxBorder(
+                 gradient: LinearGradient(colors: [
+                   Color.fromARGB(127, 208, 208, 208),
+                   Color.fromARGB(127, 188, 99, 121),
+                   Color.fromARGB(127, 86, 101, 182),
+                   Color.fromARGB(127, 126, 190,


<!-- This is an auto-generated comment by OSS Entelligence.AI -->

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between b4a1151 and 489ea45 commits.
Files selected (1)
  • app/lib/pages/onboarding/wrapper.dart (3)
Review comments generated (3)
  • Review: 0
  • LGTM: 3

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between 489ea45 and 8e88769 commits.
Files selected (2)
  • app/lib/pages/onboarding/speech_profile_widget.dart (4)
  • app/lib/pages/speech_profile/page.dart (5)
Files not summarized due to errors (1)
  • app/lib/pages/onboarding/speech_profile_widget.dart (diff tokens exceeds limit)
Files skipped from review due to trivial changes (1)
  • app/lib/pages/speech_profile/page.dart
Review comments generated (4)
  • Review: 3
  • LGTM: 1

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines +142 to +158
} else if (error == "NO_SPEECH") {
showDialog(
context: context,
builder: (c) => getDialog(
context,
() {
Navigator.pop(context);
// Navigator.pop(context);
},
() {},
'Are you there?',
'We could not detect any speech. Please make sure to speak for at least 10 seconds and not more than 3 minutes.',
okButtonText: 'Ok',
singleButton: true,
),
barrierDismissible: false,
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The error handling for "NO_SPEECH" has been improved. The new dialog provides a clearer message to the user about what went wrong and how to fix it. However, consider using a constant or enum for the error string "NO_SPEECH" to avoid potential typos and improve maintainability.

- } else if (error == "NO_SPEECH") {
+ } else if (error == SpeechErrors.NO_SPEECH) {

Comment on lines +169 to +185
padding: EdgeInsets.fromLTRB(40, !provider.startedRecording ? 20 : 0, 40, 20),
child: !provider.startedRecording
? const Text(
'Now, Omi needs to learn your voice to be able to recognise you.',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 20,
height: 1.4,
fontWeight: FontWeight.w400,
),
? const Column(
children: [
Text(
'Omi needs to learn your voice to recognize you',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 20,
height: 1.4,
fontWeight: FontWeight.w400,
),
),
SizedBox(height: 14),
Text("Note: This only works in English", style: TextStyle(color: Colors.white)),
],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The padding and text have been updated to provide more information to the user before they start recording. This is a good change as it improves the user experience by setting clear expectations. However, consider extracting the Column widget into a separate stateless widget for better readability and maintainability.

Comment on lines +227 to +338
padding: const EdgeInsets.only(top: 40.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(
height: 24,
width: 24,
child: Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
),
),
const SizedBox(width: 24),
Text(provider.loadingText,
style: const TextStyle(color: Colors.white, fontSize: 18)),
],
),
)
: Column(
mainAxisSize: MainAxisSize.min,
borderRadius: BorderRadius.circular(12),
),
child: TextButton(
onPressed: () {
widget.goNext();
},
child: const Text(
"All done!",
style: TextStyle(color: Colors.white, fontSize: 16),
),
),
)
: provider.uploadingProfile
? Padding(
padding: const EdgeInsets.only(top: 40.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 30),
Text(
provider.message,
style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
textAlign: TextAlign.center,
),
const SizedBox(height: 18),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Stack(
children: [
LinearProgressIndicator(
value: provider.percentageCompleted,
backgroundColor: Colors.grey.shade300,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.deepPurple),
),
],
const SizedBox(
height: 24,
width: 24,
child: Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
),
),
const SizedBox(height: 12),
Text(
'${(provider.percentageCompleted * 100).toInt()}%',
style: const TextStyle(color: Colors.white),
),
const SizedBox(width: 24),
Text(provider.loadingText,
style: const TextStyle(color: Colors.white, fontSize: 18)),
],
),
),
)
: Column(
mainAxisSize: MainAxisSize.min,
children: [
const SizedBox(height: 20),
provider.percentageCompleted > 0
? const SizedBox()
: const Text(
"Introduce\nyourself",
style: TextStyle(color: Colors.white, fontSize: 24, height: 1.4),
textAlign: TextAlign.center,
),
const SizedBox(height: 12),
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.9,
child: ProgressBarWithPercentage(progressValue: provider.percentageCompleted)),
const SizedBox(height: 14),
Text(
provider.message,
style: TextStyle(color: Colors.grey.shade300, fontSize: 14, height: 1.4),
textAlign: TextAlign.center,
),
],
),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

The logic for displaying different UI elements based on the state of the speech profile provider has been significantly refactored. The changes appear to be mostly related to UI layout and styling, with some minor adjustments to the logic. It's important to ensure that all possible states are handled correctly to avoid unexpected behavior. Consider breaking down this large block of code into smaller, more manageable functions or widgets to improve readability and maintainability.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description Entelligence.AI

Commits Files that changed from the base of the PR and between 8e88769 and 2c8eb42 commits.
Files selected (1)
  • app/lib/pages/onboarding/wrapper.dart (3)
Files skipped from review due to trivial changes (1)
  • app/lib/pages/onboarding/wrapper.dart
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description Entelligence.AI Bot (@Entelligence.AI)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @Entelligence.AI in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @Entelligence.AI: ignore anywhere in the PR description to pause further reviews from the bot.

@josancamon19 josancamon19 merged commit 14ae1d1 into main Oct 8, 2024
1 check passed
@josancamon19 josancamon19 deleted the speech-profile branch October 8, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants