Add CONTRIBUTING.md with setup guide and troubleshooting steps#247
Add CONTRIBUTING.md with setup guide and troubleshooting steps#247Satyanarayana001 wants to merge 2 commits into
Conversation
…unused variables in calendar_screen.dart
WalkthroughRestructures app startup by moving Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi 👋, this PR adds a structured CONTRIBUTING.md covering setup, environment configuration, and common issues faced by contributors. Please let me know if any additional sections or improvements are needed. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/screens/chat/chat_screen.dart`:
- Around line 1161-1164: The onResult callback passed to _speech.listen is empty
so recognized speech never reaches the composer; update it to write the
interim/final transcript into _messageController by assigning
result.recognizedWords (from the SpeechRecognitionResult) to
_messageController.text and update the text selection to the end (e.g.,
_messageController.selection = TextSelection.fromPosition(TextPosition(offset:
_messageController.text.length))); also call setState if the UI depends on any
listening/transcription state variables so the composer updates immediately.
In `@pubspec.yaml`:
- Around line 55-58: The pubspec is missing the root-level flutter:
configuration causing assets and material icons not to be bundled; restore a
flutter: block that sets uses-material-design: true and lists the splash asset
(ELL-ena-logo/png/logo-removed-bg-cropped.png) under assets so
lib/screens/splash_screen.dart (reference: splash image load at line ~101) can
find the logo at runtime and Material icons (e.g., Icons.task_alt, Icons.add)
are included.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 95d9354e-a02c-48fb-bd08-43ed8079b7e8
⛔ Files ignored due to path filters (6)
linux/flutter/generated_plugin_registrant.ccis excluded by!**/linux/**linux/flutter/generated_plugins.cmakeis excluded by!**/linux/**macos/Flutter/GeneratedPluginRegistrant.swiftis excluded by!**/macos/**pubspec.lockis excluded by!**/*.lockwindows/flutter/generated_plugin_registrant.ccis excluded by!**/windows/**windows/flutter/generated_plugins.cmakeis excluded by!**/windows/**
📒 Files selected for processing (20)
CONTRIBUTING.mdlib/main.dartlib/screens/auth/team_selection_dialog.dartlib/screens/calendar/calendar_screen.dartlib/screens/chat/chat_screen.dartlib/screens/home/dashboard_screen.dartlib/screens/meetings/meeting_detail_screen.dartlib/screens/meetings/meeting_screen.dartlib/screens/onboarding/onboarding_screen.dartlib/screens/profile/edit_profile_screen.dartlib/screens/profile/profile_screen.dartlib/screens/profile/team_members_screen.dartlib/screens/splash_screen.dartlib/screens/tasks/task_detail_screen.dartlib/screens/tasks/task_screen.dartlib/screens/tickets/create_ticket_screen.dartlib/screens/tickets/ticket_detail_screen.dartlib/screens/tickets/ticket_screen.dartlib/widgets/custom_widgets.dartpubspec.yaml
| await _speech.listen( | ||
| onResult: (result) { | ||
| // logic | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that _toggleListening() no longer writes speech results into the composer.
sed -n '1129,1168p' lib/screens/chat/chat_screen.dart
rg -n "_messageController\\.text\\s*=|recognizedWords" lib/screens/chat/chat_screen.dartRepository: AOSSIE-Org/Ell-ena
Length of output: 993
Restore transcript update in the onResult callback.
The onResult callback at line 1162 contains only a comment placeholder (// logic), which means recognized speech is never written to _messageController. This breaks voice dictation entirely—the microphone listens but the transcript never reaches the message composer.
Proposed fix
await _speech.listen(
onResult: (result) {
- // logic
+ if (!mounted) return;
+ _messageController
+ ..text = result.recognizedWords
+ ..selection = TextSelection.collapsed(
+ offset: result.recognizedWords.length,
+ );
},
listenMode: stt.ListenMode.dictation,
partialResults: true,
cancelOnError: true,
);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/screens/chat/chat_screen.dart` around lines 1161 - 1164, The onResult
callback passed to _speech.listen is empty so recognized speech never reaches
the composer; update it to write the interim/final transcript into
_messageController by assigning result.recognizedWords (from the
SpeechRecognitionResult) to _messageController.text and update the text
selection to the end (e.g., _messageController.selection =
TextSelection.fromPosition(TextPosition(offset:
_messageController.text.length))); also call setState if the UI depends on any
listening/transcription state variables so the composer updates immediately.
| dev_dependencies: | ||
| flutter_test: | ||
| sdk: flutter | ||
|
|
||
| # Launcher icons | ||
| flutter_launcher_icons: ^0.13.1 | ||
|
|
||
| # The "flutter_lints" package below contains a set of recommended lints to | ||
| # encourage good coding practices. The lint set provided by the package is | ||
| # activated in the `analysis_options.yaml` file located at the root of your | ||
| # package. See that file for information about deactivating specific lint | ||
| # rules and activating additional ones. | ||
| flutter_lints: ^5.0.0 | ||
|
|
||
| # For information on the generic Dart part of this file, see the | ||
| # following page: https://dart.dev/tools/pub/pubspec | ||
|
|
||
| # The following section is specific to Flutter packages. | ||
| flutter: | ||
| # The following line ensures that the Material Icons font is | ||
| # included with your application, so that you can use the icons in | ||
| # the material Icons class. | ||
| uses-material-design: true | ||
|
|
||
| # To add assets to your application, add an assets section, like this: | ||
| assets: | ||
| - .env | ||
| - ELL-ena-logo/png/ | ||
| - ELL-ena-logo/svg/ | ||
| # assets: | ||
| # - images/a_dot_burr.jpeg | ||
| # - images/a_dot_ham.jpeg | ||
|
|
||
| # An image asset can refer to one or more resolution-specific "variants", see | ||
| # https://flutter.dev/to/resolution-aware-images | ||
|
|
||
| # For details regarding adding assets from package dependencies, see | ||
| # https://flutter.dev/to/asset-from-package | ||
|
|
||
| # To add custom fonts to your application, add a fonts section here, | ||
| # in this "flutter" section. Each entry in this list should have a | ||
| # "family" key with the font family name, and a "fonts" key with a | ||
| # list giving the asset and other descriptors for the font. For | ||
| # example: | ||
| # fonts: | ||
| # - family: Schyler | ||
| # fonts: | ||
| # - asset: fonts/Schyler-Regular.ttf | ||
| # - asset: fonts/Schyler-Italic.ttf | ||
| # style: italic | ||
| # - family: Trajan Pro | ||
| # fonts: | ||
| # - asset: fonts/TrajanPro.ttf | ||
| # - asset: fonts/TrajanPro_Bold.ttf | ||
| # weight: 700 | ||
| # | ||
| # For details regarding fonts from package dependencies, | ||
| # see https://flutter.dev/to/font-from-package | ||
|
|
||
| # Flutter Launcher Icons configuration | ||
| flutter_launcher_icons: | ||
| android: true | ||
| ios: true | ||
| image_path: "ELL-ena-logo/png/logo-removed-bg-bigger.png" | ||
| adaptive_icon_background: "#1A1A1A" | ||
| adaptive_icon_foreground: "ELL-ena-logo/png/logo-removed-bg-bigger.png" | ||
| flutter_lints: ^5.0.0 No newline at end of file |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Flutter manifest entries in pubspec.yaml:\n'
rg -n '^(flutter:| uses-material-design:| assets:| - )' pubspec.yaml || true
printf '\nAsset references in lib/:\n'
rg -n 'Image\.asset\(|AssetImage\(' lib
printf '\nSample Material icon usage:\n'
rg -n 'Icons\.' lib | head -n 20Repository: AOSSIE-Org/Ell-ena
Length of output: 2268
🏁 Script executed:
# Check lines around 101-105 in splash_screen.dart to see exact asset path
sed -n '95,110p' lib/screens/splash_screen.dartRepository: AOSSIE-Org/Ell-ena
Length of output: 739
🏁 Script executed:
# Search for the asset file mentioned in the review
find . -name "logo-removed-bg-cropped.png" -o -name "*logo*" -type f | head -20Repository: AOSSIE-Org/Ell-ena
Length of output: 584
🏁 Script executed:
# Check if the full asset path structure exists
find . -path "*/ELL-ena-logo/png/*" -type fRepository: AOSSIE-Org/Ell-ena
Length of output: 496
🏁 Script executed:
# Read the complete pubspec.yaml to verify the full state
cat -n pubspec.yamlRepository: AOSSIE-Org/Ell-ena
Length of output: 1388
🏁 Script executed:
# Verify if there's any flutter configuration anywhere
rg -i 'flutter' pubspec.yamlRepository: AOSSIE-Org/Ell-ena
Length of output: 268
Restore the root-level flutter: section.
The manifest lacks the entire flutter: configuration block. Without it, ELL-ena-logo/png/logo-removed-bg-cropped.png won't be bundled, causing the splash screen (lib/screens/splash_screen.dart, line 101) to fail on every launch and show the error fallback instead of the branded logo. Additionally, Material icons used throughout the app (Icons.task_alt, Icons.add, etc.) require uses-material-design: true to ensure proper bundling.
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
+
+flutter:
+ uses-material-design: true
+ assets:
+ - ELL-ena-logo/png/logo-removed-bg-cropped.png📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| dev_dependencies: | |
| flutter_test: | |
| sdk: flutter | |
| # Launcher icons | |
| flutter_launcher_icons: ^0.13.1 | |
| # The "flutter_lints" package below contains a set of recommended lints to | |
| # encourage good coding practices. The lint set provided by the package is | |
| # activated in the `analysis_options.yaml` file located at the root of your | |
| # package. See that file for information about deactivating specific lint | |
| # rules and activating additional ones. | |
| flutter_lints: ^5.0.0 | |
| # For information on the generic Dart part of this file, see the | |
| # following page: https://dart.dev/tools/pub/pubspec | |
| # The following section is specific to Flutter packages. | |
| flutter: | |
| # The following line ensures that the Material Icons font is | |
| # included with your application, so that you can use the icons in | |
| # the material Icons class. | |
| uses-material-design: true | |
| # To add assets to your application, add an assets section, like this: | |
| assets: | |
| - .env | |
| - ELL-ena-logo/png/ | |
| - ELL-ena-logo/svg/ | |
| # assets: | |
| # - images/a_dot_burr.jpeg | |
| # - images/a_dot_ham.jpeg | |
| # An image asset can refer to one or more resolution-specific "variants", see | |
| # https://flutter.dev/to/resolution-aware-images | |
| # For details regarding adding assets from package dependencies, see | |
| # https://flutter.dev/to/asset-from-package | |
| # To add custom fonts to your application, add a fonts section here, | |
| # in this "flutter" section. Each entry in this list should have a | |
| # "family" key with the font family name, and a "fonts" key with a | |
| # list giving the asset and other descriptors for the font. For | |
| # example: | |
| # fonts: | |
| # - family: Schyler | |
| # fonts: | |
| # - asset: fonts/Schyler-Regular.ttf | |
| # - asset: fonts/Schyler-Italic.ttf | |
| # style: italic | |
| # - family: Trajan Pro | |
| # fonts: | |
| # - asset: fonts/TrajanPro.ttf | |
| # - asset: fonts/TrajanPro_Bold.ttf | |
| # weight: 700 | |
| # | |
| # For details regarding fonts from package dependencies, | |
| # see https://flutter.dev/to/font-from-package | |
| # Flutter Launcher Icons configuration | |
| flutter_launcher_icons: | |
| android: true | |
| ios: true | |
| image_path: "ELL-ena-logo/png/logo-removed-bg-bigger.png" | |
| adaptive_icon_background: "#1A1A1A" | |
| adaptive_icon_foreground: "ELL-ena-logo/png/logo-removed-bg-bigger.png" | |
| flutter_lints: ^5.0.0 | |
| dev_dependencies: | |
| flutter_test: | |
| sdk: flutter | |
| flutter_lints: ^5.0.0 | |
| flutter: | |
| uses-material-design: true | |
| assets: | |
| - ELL-ena-logo/png/logo-removed-bg-cropped.png |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pubspec.yaml` around lines 55 - 58, The pubspec is missing the root-level
flutter: configuration causing assets and material icons not to be bundled;
restore a flutter: block that sets uses-material-design: true and lists the
splash asset (ELL-ena-logo/png/logo-removed-bg-cropped.png) under assets so
lib/screens/splash_screen.dart (reference: splash image load at line ~101) can
find the logo at runtime and Material icons (e.g., Icons.task_alt, Icons.add)
are included.
a6d4ece to
44b0e58
Compare
|
Hi 👋, I’ve cleaned up the PR to include only the CONTRIBUTING.md documentation as intended. Please let me know if any improvements are needed. Thanks! |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (2)
pubspec.yaml (1)
55-58:⚠️ Potential issue | 🟠 MajorRestore the root-level
flutter:section.The file now ends at Line 58, so the splash asset referenced by
lib/screens/splash_screen.dartwill not be bundled, and Material icons will no longer be enabled for the app. Add the root-levelflutter:block back withuses-material-design: trueand the logo asset declaration.Proposed fix
dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^5.0.0 + +flutter: + uses-material-design: true + assets: + - ELL-ena-logo/png/logo-removed-bg-cropped.png#!/bin/bash set -euo pipefail printf 'Root-level flutter config in pubspec.yaml:\n' rg -n '^(flutter:| uses-material-design:| assets:| - ELL-ena-logo/png/logo-removed-bg-cropped\.png)' pubspec.yaml || true printf '\nReferenced splash asset:\n' rg -n 'ELL-ena-logo/png/logo-removed-bg-cropped\.png' lib/screens/splash_screen.dart🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pubspec.yaml` around lines 55 - 58, Restore the root-level flutter section in pubspec.yaml by adding a top-level "flutter:" block containing "uses-material-design: true" and an "assets:" list that includes the splash/logo asset referenced by lib/screens/splash_screen.dart (ELL-ena-logo/png/logo-removed-bg-cropped.png); ensure indentation matches YAML (two-space indent for child keys) so the asset is bundled and Material icons remain enabled.lib/screens/chat/chat_screen.dart (1)
1161-1164:⚠️ Potential issue | 🔴 CriticalWrite recognized speech back into
_messageController.Line 1162 is now just a placeholder, so voice dictation never reaches the composer. The mic flow runs, but users still have nothing to send.
Proposed fix
await _speech.listen( onResult: (result) { - // logic + if (!mounted) return; + _messageController + ..text = result.recognizedWords + ..selection = TextSelection.collapsed( + offset: result.recognizedWords.length, + ); }, listenMode: stt.ListenMode.dictation, partialResults: true, cancelOnError: true, );#!/bin/bash set -euo pipefail sed -n '1159,1168p' lib/screens/chat/chat_screen.dart printf '\nTranscript writes in chat_screen.dart:\n' rg -n 'recognizedWords|_messageController\.\.text|_messageController\.text\s*=' lib/screens/chat/chat_screen.dart🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/screens/chat/chat_screen.dart` around lines 1161 - 1164, The onResult callback passed to _speech.listen is not writing recognized speech into the composer, so dictation never populates _messageController; update the onResult handler inside _speech.listen to set _messageController.text (and update its selection/cursor) with result.recognizedWords (or result.bestTranscription depending on API) and call setState if needed so the UI updates; locate the _speech.listen call and modify its onResult closure to assign the recognized transcript into _messageController.text and place the cursor at the end.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/main.dart`:
- Around line 107-109: The lifecycle handler didChangeAppLifecycleState must not
call SupabaseService().dispose() when state == AppLifecycleState.detached
because that permanently sets _disposed and makes the singleton unrecoverable;
remove the SupabaseService().dispose() call from didChangeAppLifecycleState, and
if you need to release transient resources implement and call a non-terminal
method (e.g., SupabaseService().suspendStreams() or similar) instead of dispose;
ensure dispose() remains reserved for true app termination or test teardown and
that initialize() can still be called after a detach without failing due to a
permanent _disposed flag.
In `@lib/screens/tasks/task_screen.dart`:
- Around line 413-421: The onAcceptWithDetails callback uses data['id']
(dynamic) but _updateTaskStatus requires a String; add an explicit cast/guard to
ensure a String is passed: inside the onAcceptWithDetails handler (the block
referencing status['id'] and data), validate or cast data['id'] to String (e.g.,
check for null and type, or call as String after confirming) and only call
_updateTaskStatus when taskId is a non-null String; keep the existing check
comparing data['status'] to newStatus and mirror the explicit cast style used
for status['id'].
---
Duplicate comments:
In `@lib/screens/chat/chat_screen.dart`:
- Around line 1161-1164: The onResult callback passed to _speech.listen is not
writing recognized speech into the composer, so dictation never populates
_messageController; update the onResult handler inside _speech.listen to set
_messageController.text (and update its selection/cursor) with
result.recognizedWords (or result.bestTranscription depending on API) and call
setState if needed so the UI updates; locate the _speech.listen call and modify
its onResult closure to assign the recognized transcript into
_messageController.text and place the cursor at the end.
In `@pubspec.yaml`:
- Around line 55-58: Restore the root-level flutter section in pubspec.yaml by
adding a top-level "flutter:" block containing "uses-material-design: true" and
an "assets:" list that includes the splash/logo asset referenced by
lib/screens/splash_screen.dart (ELL-ena-logo/png/logo-removed-bg-cropped.png);
ensure indentation matches YAML (two-space indent for child keys) so the asset
is bundled and Material icons remain enabled.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 095fdcc7-2182-4a28-849a-612cdc8b8aa0
⛔ Files ignored due to path filters (6)
linux/flutter/generated_plugin_registrant.ccis excluded by!**/linux/**linux/flutter/generated_plugins.cmakeis excluded by!**/linux/**macos/Flutter/GeneratedPluginRegistrant.swiftis excluded by!**/macos/**pubspec.lockis excluded by!**/*.lockwindows/flutter/generated_plugin_registrant.ccis excluded by!**/windows/**windows/flutter/generated_plugins.cmakeis excluded by!**/windows/**
📒 Files selected for processing (19)
CONTRIBUTING.mdlib/main.dartlib/screens/auth/team_selection_dialog.dartlib/screens/chat/chat_screen.dartlib/screens/home/dashboard_screen.dartlib/screens/meetings/meeting_detail_screen.dartlib/screens/meetings/meeting_screen.dartlib/screens/onboarding/onboarding_screen.dartlib/screens/profile/edit_profile_screen.dartlib/screens/profile/profile_screen.dartlib/screens/profile/team_members_screen.dartlib/screens/splash_screen.dartlib/screens/tasks/task_detail_screen.dartlib/screens/tasks/task_screen.dartlib/screens/tickets/create_ticket_screen.dartlib/screens/tickets/ticket_detail_screen.dartlib/screens/tickets/ticket_screen.dartlib/widgets/custom_widgets.dartpubspec.yaml
| void didChangeAppLifecycleState(AppLifecycleState state) { | ||
| if (state == AppLifecycleState.detached) { | ||
| SupabaseService().dispose(); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Lifecycle hook in lib/main.dart:\n'
sed -n '106,110p' lib/main.dart
printf '\nSupabaseService disposal behavior:\n'
rg -n -C2 'void dispose\(|_disposed' lib/services/supabase_service.dartRepository: AOSSIE-Org/Ell-ena
Length of output: 876
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Check SupabaseService singleton/factory pattern
printf 'SupabaseService instantiation pattern:\n'
rg -n 'class SupabaseService|static.*SupabaseService|factory SupabaseService' lib/services/supabase_service.dart | head -20
# Check for reinitialization or reset logic
printf '\nChecking for reset/reinitialization methods:\n'
rg -n 'reset|reinit|initialize' lib/services/supabase_service.dart
# Check if _disposed can be reset
printf '\nChecking _disposed variable usage:\n'
rg -n '_disposed' lib/services/supabase_service.dartRepository: AOSSIE-Org/Ell-ena
Length of output: 2065
Avoid disposing the shared SupabaseService on detached.
Line 109 disposes a singleton whose dispose() closes stream controllers and permanently sets _disposed = true. AppLifecycleState.detached is not a terminal state—the app can reattach—leaving Supabase unusable for the remainder of the session. The _disposed flag is never reset, so the service cannot recover even if initialize() is called again.
Safer fix
`@override`
void didChangeAppLifecycleState(AppLifecycleState state) {
- if (state == AppLifecycleState.detached) {
- SupabaseService().dispose();
- }
+ // Avoid disposing shared singletons here. If explicit teardown is needed,
+ // add a matching reinitialization path before the service is reused.
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| void didChangeAppLifecycleState(AppLifecycleState state) { | |
| if (state == AppLifecycleState.detached) { | |
| SupabaseService().dispose(); | |
| void didChangeAppLifecycleState(AppLifecycleState state) { | |
| // Avoid disposing shared singletons here. If explicit teardown is needed, | |
| // add a matching reinitialization path before the service is reused. | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/main.dart` around lines 107 - 109, The lifecycle handler
didChangeAppLifecycleState must not call SupabaseService().dispose() when state
== AppLifecycleState.detached because that permanently sets _disposed and makes
the singleton unrecoverable; remove the SupabaseService().dispose() call from
didChangeAppLifecycleState, and if you need to release transient resources
implement and call a non-terminal method (e.g.,
SupabaseService().suspendStreams() or similar) instead of dispose; ensure
dispose() remains reserved for true app termination or test teardown and that
initialize() can still be called after a detach without failing due to a
permanent _disposed flag.
| onAcceptWithDetails: (details) { | ||
| final data = details.data; | ||
| final newStatus = status['id'] as String; | ||
| if (task['status'] != newStatus) { | ||
| _updateTaskStatus(task['id'], newStatus); | ||
|
|
||
| if (data['status'] != newStatus) { | ||
| _updateTaskStatus(data['id'], newStatus); | ||
| } | ||
| }, | ||
| onWillAccept: (data) => data != null, | ||
| }, | ||
| onWillAcceptWithDetails: (details) => details.data != null, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify task-id type flow from UI drag payload to service method signature.
set -e
rg -nP "Future<.*updateTaskStatus\\(|required String taskId" lib/services/supabase_service.dart -C2
rg -nP "_updateTaskStatus\\(|onAcceptWithDetails|details\\.data|\\['id'\\]" lib/screens/tasks/task_screen.dart -C3Repository: AOSSIE-Org/Ell-ena
Length of output: 3858
🏁 Script executed:
# Search for filteredTasks definition and task data source
rg -nP "filteredTasks\s*=|List<.*Task|fetchTasks|getTasks" lib/screens/tasks/task_screen.dart -C3
# Check task structure/model definition
fd -e dart . lib | xargs grep -l "class Task" | head -5Repository: AOSSIE-Org/Ell-ena
Length of output: 538
🏁 Script executed:
# Find _tasks field declaration and its type
rg -nP "_tasks\s*[:=]|List<.*tasks" lib/screens/tasks/task_screen.dart | head -10
# Check getTasks return type in supabase_service.dart
rg -nP "Future<.*getTasks|Future<.*List.*dynamic|return.*\[" lib/services/supabase_service.dart -A5 | grep -A5 "getTasks"Repository: AOSSIE-Org/Ell-ena
Length of output: 356
🏁 Script executed:
# Check getTasks implementation for actual data structure
rg -nP "getTasks.*async.*\{" lib/services/supabase_service.dart -A30 | head -50
# Search for other _updateTaskStatus calls to see how taskId is passed
rg -nP "_updateTaskStatus\(" lib/screens/tasks/task_screen.dart -B2 -A2Repository: AOSSIE-Org/Ell-ena
Length of output: 378
🏁 Script executed:
# Get the full getTasks implementation to see data structure
sed -n '1154,1200p' lib/services/supabase_service.dartRepository: AOSSIE-Org/Ell-ena
Length of output: 1222
🏁 Script executed:
# Get the rest of _doGetTasks implementation
sed -n '1185,1250p' lib/services/supabase_service.dartRepository: AOSSIE-Org/Ell-ena
Length of output: 2214
🏁 Script executed:
# Get more of _doGetTasks to see how tasks are processed
sed -n '1250,1300p' lib/services/supabase_service.dartRepository: AOSSIE-Org/Ell-ena
Length of output: 1367
Add explicit cast/guard for data['id'] to match String parameter requirement.
At line 418, data['id'] is dynamic from Map<String, dynamic> but _updateTaskStatus requires String taskId. Inconsistent with line 415 where status['id'] is explicitly cast as String in the same callback. This creates a type safety gap that should be protected against payload changes.
Suggested fix
onAcceptWithDetails: (details) {
final data = details.data;
final newStatus = status['id'] as String;
+ final taskId = data['id'] is String ? data['id'] as String : data['id']?.toString();
- if (data['status'] != newStatus) {
- _updateTaskStatus(data['id'], newStatus);
+ if (taskId != null && taskId.isNotEmpty && data['status'] != newStatus) {
+ _updateTaskStatus(taskId, newStatus);
}
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| onAcceptWithDetails: (details) { | |
| final data = details.data; | |
| final newStatus = status['id'] as String; | |
| if (task['status'] != newStatus) { | |
| _updateTaskStatus(task['id'], newStatus); | |
| if (data['status'] != newStatus) { | |
| _updateTaskStatus(data['id'], newStatus); | |
| } | |
| }, | |
| onWillAccept: (data) => data != null, | |
| }, | |
| onWillAcceptWithDetails: (details) => details.data != null, | |
| onAcceptWithDetails: (details) { | |
| final data = details.data; | |
| final newStatus = status['id'] as String; | |
| final taskId = data['id'] is String ? data['id'] as String : data['id']?.toString(); | |
| if (taskId != null && taskId.isNotEmpty && data['status'] != newStatus) { | |
| _updateTaskStatus(taskId, newStatus); | |
| } | |
| }, | |
| onWillAcceptWithDetails: (details) => details.data != null, |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/screens/tasks/task_screen.dart` around lines 413 - 421, The
onAcceptWithDetails callback uses data['id'] (dynamic) but _updateTaskStatus
requires a String; add an explicit cast/guard to ensure a String is passed:
inside the onAcceptWithDetails handler (the block referencing status['id'] and
data), validate or cast data['id'] to String (e.g., check for null and type, or
call as String after confirming) and only call _updateTaskStatus when taskId is
a non-null String; keep the existing check comparing data['status'] to newStatus
and mirror the explicit cast style used for status['id'].
|
Closing this PR as I have created a cleaner version in #248 focusing only on CONTRIBUTING.md. |
📘 Add CONTRIBUTING.md
🧩 Problem
Many contributors face difficulties while setting up Ell-ena locally, especially with environment configuration and running the app successfully.
✅ Solution
Added a comprehensive
CONTRIBUTING.mdthat includes:.envflutter analyze)🚀 Impact
💡 Additional Notes
This guide is designed to help contributors quickly get the project running and start contributing without confusion.
✨ Happy Contributing!
Summary by CodeRabbit
Refactor
Chores