Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

(feat) core services - #10

Draft
teetangh wants to merge 3 commits into
devfrom
feat/core-services
Draft

teetangh wants to merge 3 commits into
devfrom
feat/core-services

Conversation

@teetangh

@teetangh teetangh commented Sep 7, 2025

Copy link
Copy Markdown
Contributor
  • 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.
@teetangh teetangh self-assigned this Sep 7, 2025
@teetangh teetangh added the enhancement New feature or request label Sep 7, 2025
- 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.
@teetangh

teetangh commented Sep 7, 2025

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment on lines +784 to +790
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'],
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The route /payment-method-selection is not defined in lib/main.dart. This will cause a navigation error at runtime. Please ensure all routes are correctly defined in your GoRouter configuration.

Comment on lines +456 to +462
context.push('/payment-razorpay', extra: {
'appointmentId': widget.appointmentId,
'amount': widget.amount,
'consultantName': widget.consultantName,
'consultationType': widget.consultationType,
'appointmentDateTime': widget.appointmentDateTime,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The route /payment-razorpay is not defined in lib/main.dart. This will cause a navigation error at runtime. Please ensure all routes are correctly defined in your GoRouter configuration.


if (userId != null) {
// You might need to join with appointments table to filter by user
query = query.eq('userId', userId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

This query attempts to filter the payments table by userId, but the table schema does not seem to contain a userId column. This will result in a database error. To filter payments by user, you should join the payments table with the appointments table, which contains consulteeId.

```dart
// Razorpay configuration
const String _razorpayKeyId = 'rzp_test_YOUR_KEY_ID';
const String _razorpayKeySecret = 'YOUR_KEY_SECRET';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Including a placeholder for a secret key (_razorpayKeySecret) in client-side documentation, even as an example, is a security risk. It might encourage developers to hardcode secrets. It's better to remove this line and emphasize that all secret keys must be handled exclusively on the server-side.

Comment thread lib/main.dart
Comment on lines +147 to +157
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'],
);
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

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(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

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().

Suggested change
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The documentation presents conflicting information regarding expert availability. The 'Features' section mentions real-time availability, but the 'Known Limitations' section states that it's not updated in real-time. Please clarify this to avoid confusion for developers maintaining this feature.

mainAxisSpacing: 12,
childAspectRatio: 1.5,
children: [
_buildAnalyticsCard('Total Revenue', '�45,230', Icons.currency_rupee, Colors.green),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The currency symbol appears to be incorrect. It should be the Indian Rupee sign () instead of ``.

Suggested change
_buildAnalyticsCard('Total Revenue', '45,230', Icons.currency_rupee, Colors.green),
_buildAnalyticsCard('Total Revenue', '45,230', Icons.currency_rupee, Colors.green),

Comment on lines +133 to +137
final processingFee = (isRazorpay
? subtotal * 0.02
: subtotal * 0.029).toDouble();
final gst = (isRazorpay ? processingFee * 0.18 : 0).toDouble();
final total = (subtotal + processingFee + gst).toDouble();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Hardcoding business logic like payment processing fees and GST calculations directly in the UI layer makes it difficult to maintain and update. This logic should be moved to a dedicated service or a model to centralize it and keep the UI layer clean.

Comment on lines +28 to +34
if (searchQuery != null && searchQuery.isNotEmpty) {
query = query.or(
'title.ilike.%$searchQuery%,'
'description.ilike.%$searchQuery%,'
'tags.cs.{$searchQuery}'
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using ilike for searching across multiple text fields can be inefficient, especially as the dataset grows. For better performance, consider implementing full-text search using Supabase's textSearch function. This would require creating a tsvector column in your programs table.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant