Skip to content

Fixed calendar bugs and added initialDateTime support#255

Open
dev-2006-prt wants to merge 2 commits into
AOSSIE-Org:mainfrom
dev-2006-prt:Resolving-conflict
Open

Fixed calendar bugs and added initialDateTime support#255
dev-2006-prt wants to merge 2 commits into
AOSSIE-Org:mainfrom
dev-2006-prt:Resolving-conflict

Conversation

@dev-2006-prt

@dev-2006-prt dev-2006-prt commented May 15, 2026

Copy link
Copy Markdown

Description

This PR fixes multiple issues in the calendar module and improves event creation flow.

Changes Made

  • Added "initialDateTime" support in:

    • CreateMeetingScreen
    • CreateTaskScreen
    • CreateTicketScreen
  • Fixed calendar rendering and event loading issues

  • Improved null safety handling

  • Fixed nested "ListView" overflow issues

  • Updated deprecated "withOpacity()"usage

  • Improved cache/event loading stability

  • Added safer ID parsing and mounted checks

Result

Users can now create meetings, tasks, and tickets directly from selected calendar date/time slots without runtime errors.

Summary by CodeRabbit

  • New Features

    • Prefill creation flows with the selected date/time when creating tasks or tickets
    • AI creation opens chat with a formatted initial message for easier event creation
  • Improvements

    • More robust app startup handling to reduce initialization failures
    • Calendar UI: expanded time scale, refined event cards (icon + title) and event-count markers
    • Event loading: validated caching and network fallback for faster, more reliable sync
  • Bug Fixes

    • Lifecycle cleanup on app detach to free resources

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

App bootstrap initializes services and ThemeController and wires routing. CalendarScreen adds SharedPreferences-based event caching with validation, clamps focused/selected dates, reworks the time-scale UI and day markers, simplifies event cards, and navigates to create screens with optional pre-selected DateTime. Create screens accept optional initialDateTime. .env asset is commented out.

Changes

Calendar Event Creation with DateTime Pre-selection and Cache Optimization

Layer / File(s) Summary
App initialization and routing
lib/main.dart
App entry point initializes SupabaseService and AIService with error handling, creates ThemeController asynchronously, and configures MaterialApp with NavigationService keys, route observer, and light/dark theme modes.
Calendar event caching and loading
lib/screens/calendar/calendar_screen.dart
CalendarScreen initializes with clamped focused/selected dates, validates SharedPreferences cache via duration comparison, loads events from cache or network with per-type JSON persistence, and repopulates day-keyed events via normalization.
Calendar UI layout and day markers
lib/screens/calendar/calendar_screen.dart
Calendar layout repositions time scale below calendar in Expanded widget, clamps focusedDay passed to TableCalendar, adds custom day marker with green event-count bubble and theme-dependent opacity, and adjusts per-hour container/list rendering.
Event interaction and creation flow
lib/screens/calendar/calendar_screen.dart
Per-hour event filtering and simplified event cards (icon + title); tapping refreshes events only when navigation returns true; create dialog closes before navigation; AI option formats selected date/time into initial_message for ChatScreen.
Create screen initialDateTime parameters
lib/screens/meetings/create_meeting_screen.dart, lib/screens/tasks/create_task_screen.dart, lib/screens/tickets/create_ticket_screen.dart
CreateMeetingScreen, CreateTaskScreen, and CreateTicketScreen expose optional initialDateTime and accept it via constructor so CalendarScreen can pre-select date/time when navigating.
Asset configuration cleanup
pubspec.yaml
.env asset entry is commented out in pubspec.yaml, excluding it from packaged assets.

Sequence Diagram

sequenceDiagram
  participant initState as initState
  participant loadCurrentUserInfo as _loadCurrentUserInfo
  participant loadEventsWithCache as _loadEventsWithCache
  participant isCacheValid as _isCacheValid
  participant loadFromCache as _loadEventsFromCache
  participant loadFromNetwork as _loadEventsFromNetwork
  participant saveToCache as _saveEventsToCache
  initState->>loadCurrentUserInfo: clamp dates, set _isLoading
  loadCurrentUserInfo->>loadEventsWithCache: request events
  loadEventsWithCache->>isCacheValid: check last-fetch timestamp
  isCacheValid-->>loadEventsWithCache: true/false
  alt cache valid
    loadEventsWithCache->>loadFromCache: decode per-type JSON from SharedPreferences
    loadFromCache-->>loadEventsWithCache: populate day-keyed events
  else cache invalid
    loadEventsWithCache->>loadFromNetwork: parallel fetch tasks/tickets/meetings
    loadFromNetwork-->>loadEventsWithCache: filtered JSON lists
    loadEventsWithCache->>saveToCache: persist last-fetch timestamp
  end
  loadEventsWithCache-->>loadCurrentUserInfo: done, clear _isLoading
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • AOSSIE-Org/Ell-ena#230: Overlaps on calendar date clamping and initialDateTime navigation to create screens.
  • AOSSIE-Org/Ell-ena#29: Overlaps on calendar layout/time-scale placement and AI create navigation using initial_message.
  • AOSSIE-Org/Ell-ena#261: Related changes adding initialDateTime parameters for create screens and calendar-driven navigation.

Suggested labels

Dart/Flutter

Suggested reviewers

  • M4dhav

Poem

🐇 I hopped through calendars, dates in paw,
Cached the events so nothing's raw,
Pre-selected times for meetings and more,
Theme lights the app from shore to shore,
Hooray — the rabbit coded, then did a little roar!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: calendar bug fixes and initialDateTime support for event creation screens.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/main.dart`:
- Line 25: ThemeController.create() is blocking app startup by awaiting
SharedPreferences before runApp; update startup to show the existing splash UI
immediately and perform ThemeController initialization asynchronously after
runApp (or initialize it lazily), e.g., start the app with a splash/root widget
that kicks off ThemeController.create() in initState (or uses a FutureBuilder)
and applies the theme once ready; also move any non-critical awaits out of main
and parallelize independent async work so runApp is called without waiting on
SharedPreferences/ThemeController.create().

In `@lib/screens/calendar/calendar_screen.dart`:
- Around line 509-512: The code uses Color.withValues(alpha: markerOpacity) in
calendar_screen.dart which requires Flutter >=3.27.0; either update the SDK
constraint in pubspec.yaml to require Flutter 3.27.0+ (set sdk constraint to
>=3.27.0) or change each occurrence of Color.withValues(alpha: markerOpacity) to
Color.withOpacity(markerOpacity) (search for "withValues(alpha:" to find the
occurrences in calendar_screen.dart).

In `@lib/screens/meetings/create_meeting_screen.dart`:
- Around line 7-12: The constructor parameter initialDateTime is never applied
to the screen state; update the State's initState to initialize _selectedDate
and _selectedTime from widget.initialDateTime if it's non-null (otherwise fall
back to existing defaults). Locate initState in the CreateMeetingScreen State
implementation and set _selectedDate =
widget.initialDateTime?.toLocal().toUtc()? (or appropriate local conversion) and
_selectedTime = TimeOfDay.fromDateTime(widget.initialDateTime!) when
widget.initialDateTime != null, keeping existing behavior when it is null;
ensure you reference widget.initialDateTime, _selectedDate, and _selectedTime in
that method.

In `@lib/screens/tasks/create_task_screen.dart`:
- Around line 5-10: The CreateTaskScreen constructor accepts an initialDateTime
but it is never applied to the screen state; update the State for
CreateTaskScreen (in its initState) to set the internal _selectedDueDate from
widget.initialDateTime when present. Specifically, inside the State's initState
method check widget.initialDateTime != null and assign _selectedDueDate =
widget.initialDateTime (or convert appropriately if you store only a Date
portion), ensuring CreateTaskScreen's initialDateTime is consumed and the UI
reflects the pre-selected due date.
- Line 29: There is a stray whitespace-only blank line before the initState()
method; remove the blank line so initState() sits directly after the previous
declaration to match project formatting (search for initState in
create_task_screen.dart and delete the whitespace-only line immediately above
it).

In `@lib/screens/tickets/create_ticket_screen.dart`:
- Around line 5-10: The CreateTicketScreen constructor currently accepts an
unused DateTime? initialDateTime; remove this unused parameter to avoid dead API
surface: delete the initialDateTime field and its constructor parameter in
CreateTicketScreen and update any callers (e.g., from calendar_screen.dart) that
pass selectedDateTime so they stop supplying that argument; alternatively, if
you intend to support scheduled tickets later, add a date/time picker UI in
CreateTicketScreen, store the picked value in state (e.g., _scheduledDateTime),
and pass it to SupabaseService.createTicket() after extending that method to
accept a DateTime, but for now remove the unused initialDateTime to keep the
codebase clean.

In `@pubspec.yaml`:
- Line 100: The pubspec change removed the `.env` asset but SupabaseService and
AIService still call dotenv.load() and expect SUPABASE_URL, SUPABASE_ANON_KEY,
OAUTH_REDIRECT_URL and GEMINI_API_KEY at runtime; either restore the `.env`
asset in pubspec.yaml so dotenv.load() can find the file, or remove
flutter_dotenv and refactor SupabaseService and AIService to stop calling
dotenv.load() and instead read credentials from a secure alternative (e.g., Dart
compile-time constants via String.fromEnvironment, Platform.environment, or a
secrets manager). Update the code paths in SupabaseService (the dotenv.load()
call and subsequent getenv uses) and AIService (the dotenv.load() call and
GEMINI_API_KEY usage) to match the chosen approach.
🪄 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: 8d25b37e-9fc1-43c4-917f-0577aaacb2cf

📥 Commits

Reviewing files that changed from the base of the PR and between 1cea2a6 and f365b45.

⛔ Files ignored due to path filters (6)
  • linux/flutter/generated_plugin_registrant.cc is excluded by !**/linux/**
  • linux/flutter/generated_plugins.cmake is excluded by !**/linux/**
  • macos/Flutter/GeneratedPluginRegistrant.swift is excluded by !**/macos/**
  • pubspec.lock is excluded by !**/*.lock
  • windows/flutter/generated_plugin_registrant.cc is excluded by !**/windows/**
  • windows/flutter/generated_plugins.cmake is excluded by !**/windows/**
📒 Files selected for processing (6)
  • lib/main.dart
  • lib/screens/calendar/calendar_screen.dart
  • lib/screens/meetings/create_meeting_screen.dart
  • lib/screens/tasks/create_task_screen.dart
  • lib/screens/tickets/create_ticket_screen.dart
  • pubspec.yaml

Comment thread lib/main.dart
Comment on lines +509 to +512
color: Colors.green
.withValues(
alpha: markerOpacity,
),

@coderabbitai coderabbitai Bot May 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check Flutter SDK version in pubspec.yaml and verify compatibility

# Check Flutter SDK constraint
cat pubspec.yaml | grep -A5 'environment:' | grep 'sdk:'

# Check if withValues is used elsewhere
rg -nP --type=dart '\.withValues\(' -C2

Repository: AOSSIE-Org/Ell-ena

Length of output: 1305


Update pubspec.yaml to require Flutter SDK >=3.27.0 or replace withValues() with withOpacity().

The code uses Color.withValues(alpha:) at lines 510, 649, and 795, which was introduced in Flutter 3.27.0. However, pubspec.yaml currently specifies sdk: '>=2.17.0 <4.0.0', allowing older versions that don't support this API. This will cause compilation failures on Flutter < 3.27.0.

Either update the SDK constraint to >=3.27.0 or replace .withValues(alpha:) with .withOpacity() for backward compatibility with older Flutter versions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/screens/calendar/calendar_screen.dart` around lines 509 - 512, The code
uses Color.withValues(alpha: markerOpacity) in calendar_screen.dart which
requires Flutter >=3.27.0; either update the SDK constraint in pubspec.yaml to
require Flutter 3.27.0+ (set sdk constraint to >=3.27.0) or change each
occurrence of Color.withValues(alpha: markerOpacity) to
Color.withOpacity(markerOpacity) (search for "withValues(alpha:" to find the
occurrences in calendar_screen.dart).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes change color.withValues(alpha: 0.5) to color.withOpacity(0.5)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@dev-2006-prt, here are the three replacements needed in lib/screens/calendar/calendar_screen.dart:

  • Replace all three .withValues(alpha:) calls with .withOpacity() in lib/screens/calendar/calendar_screen.dart

  • 📌 Commit the changes to this branch

Comment thread lib/screens/meetings/create_meeting_screen.dart Outdated
Comment on lines +5 to +10
final DateTime? initialDateTime;

const CreateTaskScreen({
super.key,
this.initialDateTime,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

initialDateTime parameter is never used.

The initialDateTime parameter is accepted in the constructor but never used to initialize _selectedDueDate. Users creating a task from a calendar date/time slot will not see the pre-selected date.

🔧 Proposed fix to initialize due date from initialDateTime

Add initialization in initState:

   `@override`
   void initState() {
- 
     super.initState();
+    if (widget.initialDateTime != null) {
+      _selectedDueDate = widget.initialDateTime;
+    }
     _loadTeamMembers();
   }
📝 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.

Suggested change
final DateTime? initialDateTime;
const CreateTaskScreen({
super.key,
this.initialDateTime,
});
`@override`
void initState() {
super.initState();
if (widget.initialDateTime != null) {
_selectedDueDate = widget.initialDateTime;
}
_loadTeamMembers();
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/screens/tasks/create_task_screen.dart` around lines 5 - 10, The
CreateTaskScreen constructor accepts an initialDateTime but it is never applied
to the screen state; update the State for CreateTaskScreen (in its initState) to
set the internal _selectedDueDate from widget.initialDateTime when present.
Specifically, inside the State's initState method check widget.initialDateTime
!= null and assign _selectedDueDate = widget.initialDateTime (or convert
appropriately if you store only a Date portion), ensuring CreateTaskScreen's
initialDateTime is consumed and the UI reflects the pre-selected due date.


@override
void initState() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | 💤 Low value

Remove stray whitespace.

Line 29 contains a blank line with only whitespace before initState(). This is inconsistent with the rest of the codebase.

🧹 Cleanup
   `@override`
   void initState() {
- 
     super.initState();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/screens/tasks/create_task_screen.dart` at line 29, There is a stray
whitespace-only blank line before the initState() method; remove the blank line
so initState() sits directly after the previous declaration to match project
formatting (search for initState in create_task_screen.dart and delete the
whitespace-only line immediately above it).

Comment on lines +5 to +10
final DateTime? initialDateTime;

const CreateTicketScreen({
super.key,
this.initialDateTime,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check ticket schema and creation flow for date/time fields

# Check SupabaseService.createTicket signature
ast-grep --pattern $'createTicket({
  $$$
}) {
  $$$
}'

# Check ticket table schema comments or documentation
rg -nP --type=dart 'createTicket|ticket.*date' -A5 -B2

Repository: AOSSIE-Org/Ell-ena

Length of output: 9828


🏁 Script executed:

# Read the full CreateTicketScreen to see if initialDateTime is used
wc -l lib/screens/tickets/create_ticket_screen.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 112


🏁 Script executed:

# Read the complete CreateTicketScreen constructor and surrounding code
head -100 lib/screens/tickets/create_ticket_screen.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 2685


🏁 Script executed:

# Read the complete SupabaseService.createTicket() signature
sed -n '1762,1800p' lib/services/supabase_service.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 1084


🏁 Script executed:

# Search for all references to initialDateTime in the entire CreateTicketScreen file
rg -n "initialDateTime" lib/screens/tickets/create_ticket_screen.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 129


🏁 Script executed:

# Search for CreateTicketScreen instantiation to see if any caller passes initialDateTime
rg -n "CreateTicketScreen" --type=dart -B2 -A2 | grep -A2 -B2 "CreateTicketScreen("

Repository: AOSSIE-Org/Ell-ena

Length of output: 1597


Remove the unused initialDateTime parameter.

The initialDateTime parameter is accepted but never used in the implementation. Although calendar_screen.dart passes a selectedDateTime value when navigating to this screen, the parameter is not referenced anywhere in CreateTicketScreen.

SupabaseService.createTicket() does not accept a DateTime parameter, and there is no date/time picker in the UI to utilize the initial value. Either remove this parameter entirely, or implement a date/time picker field and initialize it with initialDateTime if scheduled ticket creation becomes a future requirement.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/screens/tickets/create_ticket_screen.dart` around lines 5 - 10, The
CreateTicketScreen constructor currently accepts an unused DateTime?
initialDateTime; remove this unused parameter to avoid dead API surface: delete
the initialDateTime field and its constructor parameter in CreateTicketScreen
and update any callers (e.g., from calendar_screen.dart) that pass
selectedDateTime so they stop supplying that argument; alternatively, if you
intend to support scheduled tickets later, add a date/time picker UI in
CreateTicketScreen, store the picked value in state (e.g., _scheduledDateTime),
and pass it to SupabaseService.createTicket() after extending that method to
accept a DateTime, but for now remove the unused initialDateTime to keep the
codebase clean.

Comment thread pubspec.yaml
# To add assets to your application, add an assets section, like this:
assets:
- .env
#- .env

@coderabbitai coderabbitai Bot May 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚖️ Poor tradeoff

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for flutter_dotenv usage patterns in the codebase

echo "=== Checking for dotenv imports ==="
rg -n --type=dart "import.*flutter_dotenv" -C2

echo -e "\n=== Checking for dotenv.load() calls ==="
rg -n --type=dart "dotenv\.load\(" -C3

echo -e "\n=== Checking for dotenv.env access ==="
rg -n --type=dart "dotenv\.env\[" -C2

echo -e "\n=== Checking for .env file existence ==="
if [ -f .env ]; then
  echo ".env file exists in repository root"
else
  echo ".env file NOT found in repository root"
fi

echo -e "\n=== Checking .gitignore for .env ==="
if [ -f .gitignore ]; then
  if grep -q "^\.env$" .gitignore || grep -q "^\.env\s" .gitignore; then
    echo ".env is listed in .gitignore (not committed)"
  else
    echo ".env is NOT ignored (might be committed)"
  fi
fi

Repository: AOSSIE-Org/Ell-ena

Length of output: 2904


Comment out .env asset breaks SupabaseService and AIService initialization.

The .env asset is now excluded from packaging, but both core services actively load environment variables at startup:

  • SupabaseService (line 52) calls dotenv.load() and requires SUPABASE_URL, SUPABASE_ANON_KEY, and OAUTH_REDIRECT_URL
  • AIService (line 31) calls dotenv.load() and requires GEMINI_API_KEY

Without the asset included in pubspec.yaml, dotenv.load() will fail to locate the .env file at runtime, preventing services from accessing required credentials. While error handling will catch the exception, the services will initialize without configuration, causing the app to fail at startup.

If the goal is to avoid bundling secrets (a valid security practice), remove the flutter_dotenv dependency and refactor services to use build-time environment variables or a different configuration mechanism instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pubspec.yaml` at line 100, The pubspec change removed the `.env` asset but
SupabaseService and AIService still call dotenv.load() and expect SUPABASE_URL,
SUPABASE_ANON_KEY, OAUTH_REDIRECT_URL and GEMINI_API_KEY at runtime; either
restore the `.env` asset in pubspec.yaml so dotenv.load() can find the file, or
remove flutter_dotenv and refactor SupabaseService and AIService to stop calling
dotenv.load() and instead read credentials from a secure alternative (e.g., Dart
compile-time constants via String.fromEnvironment, Platform.environment, or a
secrets manager). Update the code paths in SupabaseService (the dotenv.load()
call and subsequent getenv uses) and AIService (the dotenv.load() call and
GEMINI_API_KEY usage) to match the chosen approach.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Remove dotenv completely

Replace .env dependency with:

Android

local.properties or build.gradle

iOS

Info.plist / Xcode build configs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
echo "=== SupabaseService ==="
fd -e dart -i "supabase_service" --exec cat {}

echo -e "\n=== AIService ==="
fd -e dart -i "ai_service" --exec cat {}

echo -e "\n=== android/app/build.gradle ==="
fd "build.gradle" --search-path android --exec cat {} | head -120

echo -e "\n=== android/local.properties (structure only) ==="
if [ -f android/local.properties ]; then
  cat android/local.properties
else
  echo "file not found"
fi

echo -e "\n=== ios/Runner/Info.plist (first 80 lines) ==="
fd "Info.plist" --search-path ios --exec head -80 {}

Length of output: 88289



@dev-2006-prt Agreed — removing flutter_dotenv entirely is the right call. For Flutter, the idiomatic cross-platform equivalent to both local.properties and Info.plist secrets is String.fromEnvironment() with --dart-define at build time (or --dart-define-from-file for bulk keys). This works on Android and iOS without platform channels, and secrets are never bundled in the asset tree.

Here is the plan:

  • Remove flutter_dotenv from pubspec.yaml and keep .env commented out in assets
  • Refactor SupabaseService — strip dotenv import/calls, read keys with String.fromEnvironment()
  • Refactor AIService — same treatment for GEMINI_API_KEY
  • Add a README / build-invocation note so developers know how to supply keys

✏️ Learnings added
Learnt from: dev-2006-prt
Repo: AOSSIE-Org/Ell-ena PR: 255
File: pubspec.yaml:100-100
Timestamp: 2026-05-26T07:21:25.705Z
Learning: In the Ell-ena Flutter project (AOSSIE-Org/Ell-ena), secrets (SUPABASE_URL, SUPABASE_ANON_KEY, OAUTH_REDIRECT_URL, GEMINI_API_KEY) should be supplied at build time via `--dart-define` / `String.fromEnvironment()` rather than flutter_dotenv / .env files. The flutter_dotenv package is being removed from the project entirely. Do not suggest restoring flutter_dotenv or .env asset packaging.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: Subham2005x
Repo: AOSSIE-Org/Ell-ena PR: 206
File: pubspec.yaml:71-75
Timestamp: 2026-03-08T08:56:34.450Z
Learning: For Ell-ena's pubspec.yaml, lock notification-related dependencies to the maximum versions compatible with the project's Dart SDK constraint (>=2.17.0 <=3.8.1): flutter_local_notifications ^18.0.1, timezone ^0.9.4, flutter_timezone ^3.0.1. Upgrading flutter_local_notifications to >=19.0.0 requires timezone ^0.10.0 and a higher Dart SDK minimum, which conflicts with the current SDK constraint. Do not propose or apply upgrades to these packages unless the Dart SDK constraint is relaxed first.

Failed to handle agent chat message. Please try again.

@dev-2006-prt

Copy link
Copy Markdown
Author

Hi team 👋

Wanted to follow up on this PR. Here's a quick summary of what was addressed:

✅ Added initialDateTime support across CreateMeetingScreen, CreateTaskScreen, and CreateTicketScreen
✅ Fixed calendar rendering and event loading issues
✅ Resolved nested ListView overflow issues
✅ Improved null safety, mounted checks, and safer ID parsing
✅ Replaced deprecated withOpacity() usage
✅ Improved cache/event loading stability

Users can now create meetings, tasks, and tickets directly from selected calendar date/time slots without runtime errors.

I've tested the changes locally and everything works as expected. Please review this PR !!

@github-actions

Copy link
Copy Markdown

⚠️ This PR has merge conflicts.

Please resolve the merge conflicts before review.

Your PR will only be reviewed by a maintainer after all conflicts have been resolved.

📺 Watch this video to understand why conflicts occur and how to resolve them:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/screens/calendar/calendar_screen.dart (1)

817-862: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restore initialDateTime when pushing the create screens.

Lines 825-831 still compute the selected slot, but Lines 840-861 no longer forward it. That breaks the pre-selection flow this PR is supposed to add, so meeting/task/ticket forms will open without the chosen calendar date/time.

Proposed fix
     switch (type) {
       case EventType.meeting:
         result = await Navigator.push(
           context,
           MaterialPageRoute(
-            builder: (context) =>
-                CreateMeetingScreen(),
+            builder: (context) => CreateMeetingScreen(
+              initialDateTime: selectedDateTime,
+            ),
           ),
         );
         break;

       case EventType.task:
         result = await Navigator.push(
           context,
           MaterialPageRoute(
-            builder: (context) =>
-                CreateTaskScreen(),
+            builder: (context) => CreateTaskScreen(
+              initialDateTime: selectedDateTime,
+            ),
           ),
         );
         break;

       case EventType.ticket:
         result = await Navigator.push(
           context,
           MaterialPageRoute(
-            builder: (context) =>
-                CreateTicketScreen(),
+            builder: (context) => CreateTicketScreen(
+              initialDateTime: selectedDateTime,
+            ),
           ),
         );
         break;
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/screens/calendar/calendar_screen.dart` around lines 817 - 862, The
_handleCreate function computes selectedDateTime but never forwards it to the
create screens; update each Navigator.push call that builds CreateMeetingScreen,
CreateTaskScreen, and CreateTicketScreen to pass the computed selectedDateTime
(e.g., via an initialDateTime or initialDate parameter expected by those
constructors) so the forms open pre-populated with the chosen slot; ensure the
parameter name matches each screen's constructor (CreateMeetingScreen,
CreateTaskScreen, CreateTicketScreen) and keep existing navigation behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@lib/screens/calendar/calendar_screen.dart`:
- Around line 817-862: The _handleCreate function computes selectedDateTime but
never forwards it to the create screens; update each Navigator.push call that
builds CreateMeetingScreen, CreateTaskScreen, and CreateTicketScreen to pass the
computed selectedDateTime (e.g., via an initialDateTime or initialDate parameter
expected by those constructors) so the forms open pre-populated with the chosen
slot; ensure the parameter name matches each screen's constructor
(CreateMeetingScreen, CreateTaskScreen, CreateTicketScreen) and keep existing
navigation behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c796a47a-0597-416f-bea7-67b5d5697c32

📥 Commits

Reviewing files that changed from the base of the PR and between f365b45 and 09accaa.

📒 Files selected for processing (3)
  • lib/main.dart
  • lib/screens/calendar/calendar_screen.dart
  • lib/screens/meetings/create_meeting_screen.dart

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.

1 participant