Skip to content

Cookbook is a Flutter-based Android app that uses the Spoonacular API to help users search for and discover food recipes.

License

Notifications You must be signed in to change notification settings

CrayFish0/cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cookbook

Cookbook is a modern Android application built with Flutter that allows users to search for and receive recommendations for food recipes using the Spoonacular API. The app features a beautiful, minimal design with dark mode by default and a sophisticated glassmorphism UI.

✨ Features

Core Features

  • Search Recipes: Users can search for recipes by entering keywords or ingredients with persistent search state
  • Recipe Recommendations: Daily personalized recipe recommendations based on user preferences
  • Detailed Recipe Information: Each recipe includes detailed information such as ingredients, instructions, nutritional information, and cooking time
  • Save Favorite Recipes: Users can save their favorite recipes for quick access later with local storage
  • Cuisine Categories: Browse recipes by cuisine type with interactive filter pills
  • Theme Toggle: Switch between light and dark modes with a beautiful theme system

UI/UX Improvements

  • Modern Design: Complete UI overhaul with minimal, unique aesthetic
  • Dark Mode Default: Beautiful dark theme with light mode option
  • Glassmorphism Background: Sophisticated background with gradients, patterns, and floating animations
  • Floating Navigation: Minimal pill-style bottom navigation with backdrop blur effects
  • State Persistence: Search state and navigation state preserved across page switches
  • Responsive Layout: Optimized layouts for different screen sizes
  • Visual Feedback: Toast notifications and loading states for better user experience

Performance & Architecture

  • Hive Database: Fast, local NoSQL database for storing favorites
  • Provider State Management: Efficient state management across the app
  • Optimized Navigation: IndexedStack with AutomaticKeepAliveClientMixin for smooth transitions
  • Error Handling: Comprehensive error handling with user-friendly messages

οΏ½ Screenshots

Dark Mode (Default)

Dark Mode Home Screen Dark Mode Search Screen
Dark Mode Favorites Screen Dark Mode Recipe Details

Light Mode

Light Mode Home Screen Light Mode Search Screen
Light Mode Favorites Screen Light Mode Recipe Details

The app showcases a beautiful glassmorphism design with smooth animations and floating elements in both light and dark themes.

οΏ½πŸš€ Installation

  1. Clone the repository:

    git clone https://github.com/CrayFish0/cookbook.git
    cd cookbook
  2. Install dependencies:

    flutter pub get
  3. Generate Hive adapters:

    flutter packages pub run build_runner build --delete-conflicting-outputs
  4. Set up the Spoonacular API key:

    • Obtain an API key from Spoonacular.

    • In the Secrets folder add your api key:

      const spoonacularApi = 'YOUR_API_KEY_HERE';
  5. Run the app:

    flutter run

πŸ“± Usage

  1. Search for Recipes:

    • Enter keywords or ingredients in the search bar to find recipes
    • Search state persists when navigating between pages
  2. Browse by Cuisine:

    • Explore different cuisine categories from the home page
    • Use filter pills to refine your search by cuisine type
  3. View Recipe Details:

    • Tap on a recipe to view detailed information including ingredients, instructions, and summary
    • See nutritional information and cooking time
  4. Save Favorite Recipes:

    • Tap the plus icon on a recipe to save it to your favorites
    • Access saved recipes from the favorites page
    • Remove favorites by tapping the delete icon
  5. Customize Your Experience:

    • Toggle between light and dark mode using the theme button
    • Enjoy the beautiful glassmorphism background and animations
  6. Daily Recommendations:

    • Discover new recipes with daily personalized recommendations on the home page

πŸ› οΈ Dependencies

Core Dependencies

UI/UX Dependencies

Data Storage

Development Tools

🎨 Design System

The app features a modern design system with:

  • Color Scheme: Carefully crafted color palette for both light and dark modes
  • Typography: Custom font family (Arial) with consistent text styles
  • Glassmorphism: Sophisticated background with blur effects and gradients
  • Animations: Smooth transitions and floating shape animations
  • Responsive Design: Adaptive layouts for different screen sizes

πŸ“‚ Project Structure

lib/
β”œβ”€β”€ main.dart                 # App entry point
β”œβ”€β”€ model/                    # Data models
β”‚   β”œβ”€β”€ favourite.dart        # Favorite recipe model
β”‚   β”œβ”€β”€ favourite.g.dart      # Generated Hive adapter
β”‚   └── favourite_database.dart # Database operations
β”œβ”€β”€ pages/                    # App screens
β”‚   β”œβ”€β”€ home_page.dart        # Home screen with recommendations
β”‚   β”œβ”€β”€ search_page.dart      # Recipe search screen
β”‚   β”œβ”€β”€ favourite_page.dart   # Saved favorites screen
β”‚   β”œβ”€β”€ cuisine_page.dart     # Cuisine-specific recipes
β”‚   β”œβ”€β”€ information_page.dart # Recipe details screen
β”‚   └── main_page.dart        # Main navigation wrapper
β”œβ”€β”€ theme/                    # Theme and styling
β”‚   └── theme.dart           # Light/dark theme definitions
β”œβ”€β”€ util/                     # Utility widgets and helpers
β”‚   β”œβ”€β”€ background_widget.dart # Glassmorphism background
β”‚   β”œβ”€β”€ bottom_nav_bar.dart   # Custom navigation bar
β”‚   β”œβ”€β”€ favourite_tile.dart   # Favorite recipe tile
β”‚   β”œβ”€β”€ small_tile.dart       # Recipe preview tile
β”‚   β”œβ”€β”€ recommend_tile.dart   # Recommendation tile
β”‚   └── ...                  # Other utility widgets
└── assets/                   # App resources
    β”œβ”€β”€ icon.png             # App icon
    └── Logo.png             # App logo

πŸš€ Technical Improvements

Database Migration

  • Migrated from Isar to Hive: Improved compatibility and build stability
  • Local Storage: Efficient favorite recipe storage with automatic data persistence
  • Type Safety: Generated type adapters for reliable data serialization

State Management

  • Provider Pattern: Clean separation of UI and business logic
  • State Persistence: Navigation and search state preserved across app lifecycle
  • Automatic Keep Alive: Optimized memory usage with selective widget retention

Performance Optimizations

  • Lazy Loading: Efficient image loading with error handling
  • Optimized Layouts: Reduced widget rebuilds and improved scroll performance
  • Memory Management: Proper disposal of resources and listeners

Build System

  • Android Gradle Plugin: Updated to version 7.3.0 for compatibility
  • Kotlin Integration: Proper Kotlin support with version 1.8.22
  • Code Generation: Automated adapter generation with build_runner

🀝 Acknowledgements

We would like to thank the following resources and communities for their invaluable contributions:

  • Spoonacular for providing an extensive food and recipe API
  • The Flutter community for their continuous support and contributions
  • Pub.dev for hosting and maintaining a plethora of Flutter packages
  • The Hive team for creating a fast, local database solution
  • All the contributors who helped improve this project

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“ž Contact

For any questions or concerns, please open an issue or contact us at here.


πŸŽ‰ What's New in v2.0

✨ Complete UI/UX Overhaul: Modern, minimal design with dark mode default
🎨 Glassmorphism Effects: Beautiful background animations and blur effects
πŸ” Enhanced Search: Persistent search state and improved filtering
πŸ’Ύ Better Data Storage: Migrated to Hive for improved performance
πŸš€ Performance Improvements: Optimized navigation and state management
🎯 Better UX: Toast notifications, loading states, and responsive design

Happy cooking with the new and improved Cookbook! 🍳

About

Cookbook is a Flutter-based Android app that uses the Spoonacular API to help users search for and discover food recipes.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published