Conversation
teetangh
commented
Sep 7, 2025
- Updated dependencies in pubspec.yaml for improved performance and new features.
- Introduced new Explore functionality documentation detailing expert and program discovery features.
- Added Payments Integration documentation outlining Stripe and Razorpay integration for secure payment processing.
- Created new screens for checkout summary, invoice, payment failure, and Razorpay payment, enhancing user experience during transactions.
- Implemented chat and video call screens for real-time communication between consultants and consultees.
- Refactored existing services and providers to streamline user and payment management, ensuring a cohesive experience across the application.
- Updated dependencies in pubspec.yaml for improved performance and new features. - Introduced new Explore functionality documentation detailing expert and program discovery features. - Added Payments Integration documentation outlining Stripe and Razorpay integration for secure payment processing. - Created new screens for checkout summary, invoice, payment failure, and Razorpay payment, enhancing user experience during transactions. - Implemented chat and video call screens for real-time communication between consultants and consultees. - Refactored existing services and providers to streamline user and payment management, ensuring a cohesive experience across the application.
- Upgraded actions/checkout and actions/setup-java to version 4 for improved performance. - Changed Java version from 12 to 17 to leverage new features and enhancements. - Added caching for Flutter dependencies to speed up build times. - Included steps for installing Flutter dependencies and cleaning the project before building. - Enhanced code analysis step to catch potential issues early in the CI process.
- Replaced stripe_payment with flutter_stripe for improved functionality. - Downgraded fl_chart to version 0.68.0 to maintain compatibility with other dependencies.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a substantial set of features, including new core services for payments, chat, video calls, and user exploration. The changes are extensive, adding new documentation, screens, providers, and services, while also refactoring the existing structure. My review focuses on ensuring the new additions are robust, secure, and maintainable. I've identified several critical issues related to routing and database queries that could lead to runtime crashes, as well as high-severity security concerns with API keys and development tokens. Additionally, there are medium-severity issues regarding code maintainability, UI text, and performance that should be addressed.
| context.push('/payment-method-selection', extra: { | ||
| 'type': 'program', | ||
| 'programId': program['id'], | ||
| 'amount': program['price'] * 100, // Convert to paise/cents | ||
| 'title': program['title'], | ||
| 'instructor': program['instructor'], | ||
| }); |
| context.push('/payment-razorpay', extra: { | ||
| 'appointmentId': widget.appointmentId, | ||
| 'amount': widget.amount, | ||
| 'consultantName': widget.consultantName, | ||
| 'consultationType': widget.consultationType, | ||
| 'appointmentDateTime': widget.appointmentDateTime, | ||
| }); |
|
|
||
| if (userId != null) { | ||
| // You might need to join with appointments table to filter by user | ||
| query = query.eq('userId', userId); |
There was a problem hiding this comment.
| ```dart | ||
| // Razorpay configuration | ||
| const String _razorpayKeyId = 'rzp_test_YOUR_KEY_ID'; | ||
| const String _razorpayKeySecret = 'YOUR_KEY_SECRET'; |
There was a problem hiding this comment.
| path: '/payment-stripe', | ||
| builder: (BuildContext context, GoRouterState state) { | ||
| final extra = state.extra as Map<String, dynamic>; | ||
| return StripePaymentScreen( | ||
| appointmentId: extra['appointmentId'], | ||
| amount: extra['amount'], | ||
| consultantName: extra['consultantName'], | ||
| consultationType: extra['consultationType'], | ||
| appointmentDateTime: extra['appointmentDateTime'], | ||
| ); | ||
| }, |
There was a problem hiding this comment.
Passing complex data objects via GoRouter's extra parameter is not type-safe and can lead to runtime crashes if the data structure is incorrect or missing. Consider using simple identifiers (like appointmentId) as path or query parameters and fetching the full object within the destination screen. This makes navigation more robust and decouples your routes from complex data models.
| CircleAvatar( | ||
| backgroundColor: Theme.of(context).colorScheme.primary.withValues(alpha: 0.1), | ||
| child: Text( | ||
| program['instructor'].split(' ').map((name) => name[0]).take(2).join(), |
There was a problem hiding this comment.
This line can cause a runtime crash if program['instructor'] is null or an empty string. It's safer to add null checks and handle edge cases before calling split().
| program['instructor'].split(' ').map((name) => name[0]).take(2).join(), | |
| child: Text((program['instructor'] ?? 'U K').split(' ').map((name) => name.isNotEmpty ? name[0] : '').take(2).join(), |
| 1. **Search Scope**: Currently limited to name and domain matching | ||
| 2. **Filter Combinations**: Some complex filter combinations not supported | ||
| 3. **Offline Mode**: No offline browsing capability | ||
| 4. **Real-time Updates**: Expert availability not real-time updated |
There was a problem hiding this comment.
| mainAxisSpacing: 12, | ||
| childAspectRatio: 1.5, | ||
| children: [ | ||
| _buildAnalyticsCard('Total Revenue', '�45,230', Icons.currency_rupee, Colors.green), |
There was a problem hiding this comment.
| final processingFee = (isRazorpay | ||
| ? subtotal * 0.02 | ||
| : subtotal * 0.029).toDouble(); | ||
| final gst = (isRazorpay ? processingFee * 0.18 : 0).toDouble(); | ||
| final total = (subtotal + processingFee + gst).toDouble(); |
| if (searchQuery != null && searchQuery.isNotEmpty) { | ||
| query = query.or( | ||
| 'title.ilike.%$searchQuery%,' | ||
| 'description.ilike.%$searchQuery%,' | ||
| 'tags.cs.{$searchQuery}' | ||
| ); | ||
| } |
There was a problem hiding this comment.