BasedHardware / omi

AI wearables
https://omi.me
MIT License
3.63k stars 453 forks source link

Migrate memory detail page to use provider #801

Closed mdmohsin7 closed 1 month ago

mdmohsin7 commented 1 month ago

Summary by Entelligence.AI

github-actions[bot] commented 1 month ago

Image description Entelligence.AI

Walkthrough

This pull request introduces a new MemoryDetailProvider class for state management in the memory detail page, enhancing modularity and separation of concerns. It also refactors the deleteMemory method to delete memories by ID and updates various widgets for better encapsulation and efficiency.

Changes

Files Summary
app/lib/main.dart, app/lib/pages/memories/widgets/memory_list_item.dart, app/lib/pages/memory_detail/memory_detail_provider.dart, app/lib/providers/memory_provider.dart Introduced a new MemoryDetailProvider class and integrated it using ChangeNotifierProxyProvider. Updated the MemoryListItem widget to use this provider for state management. Refactored the deleteMemory method in the MemoryProvider class to remove a memory based on its ID instead of index.
app/lib/pages/memory_capturing/page.dart, app/lib/widgets/expandable_text.dart Refactored the MemoryCapturingPage and ExpandableTextWidget constructors for better encapsulation and efficiency.
app/lib/widgets/photos_grid.dart Removed an unnecessary line in the PhotosGridComponent class constructor.

"In the land of code, where logic is king, 🤴
A pull request arrives, changes it brings. 📦
State management improved, with providers galore,
Memory deletion refined, less is more. 🧠
Widgets updated, encapsulation won,
Unnecessary lines? Now there's none! 🚫
Celebrate these changes, for they're quite neat,
Making our codebase incredibly sweet! 🍭"


Uplevel your code reviews with Entelligence.AI Pro ### Entelligence.AI Pro If you like this project, please support us by purchasing the [Pro version](https://Entelligence.AI.ai). 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.