Skip to content

thisisouvik/InstaFeed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InstaFeed Logo

📸 InstaFeed — Instagram UI/UX Clone

A pixel-perfect, feature-rich Instagram Home Feed UI/UX replica built with Flutter.

Download App Demo Video


Flutter Dart

A pixel-perfect, feature-rich Instagram Home Feed replica built with Flutter and BLoC pattern. This project demonstrates a production-grade approach to building modern social media UI with smooth animations, infinite scrolling, theme adaptation, and responsive interactions.


🎯 Overview

InstaFeed is a meticulous recreation of Instagram's core home feed experience, focusing on:

  • Exact visual parity with the original app (spacing, typography, colors)
  • Smooth, responsive interactions (double-tap like, pinch-to-zoom, swipeable carousel)
  • Adaptive dark/light theming responding to system preferences
  • Infinite feed pagination with optimized rendering
  • Production-ready architecture using industry-standard patterns

This project reflects what a real Instagram feed implementation looks like under the hood—handling state, animations, and UX polish.


✨ Instagram Features Reflected

100% Implemented Features:

Home Feed Composition

  • Stories tray with gradient ring avatars (seen/unseen states)
  • "Your story" bubble with add badge
  • Feed post cards (header → media → actions → caption)

Post Interactions

  • ❤️ Like toggle with elastic animation
  • 💬 Comment count display
  • 📌 Save bookmark toggle
  • 🔄 Share/send feature hint

Media Handling

  • Single & multi-image posts
  • Pinch-to-zoom gesture on images
  • Carousel navigation (next/prev swipe)
  • Loading skeleton (shimmer effect)
  • Cached image optimization

Double-Tap Like

  • Instagram-style animated heart overlay on media double-tap
  • Auto-like on second tap (if not already liked)
  • Smooth scale & fade animation

Stories Tray

  • Ring-based gradient visualization
  • Live badge indicator
  • Compact spacing mimicking original

Adaptive Theming

  • System dark/light mode detection
  • Theme-aware SVG icons (dark/light icon packs)
  • Seamless background/text color switching

Infinite Scrolling

  • Lazy pagination (loads next batch near bottom)
  • Loading spinner on pagination
  • Smooth scroll physics with bounce

Top App Bar

  • "Instagram" logo (Grand Hotel font)
  • Dropdown menu (Following, Favorites)
  • Notification heart with red dot

Bottom Navigation

  • Home, Search, Create, Reels, Profile tabs
  • Theme-aware SVG icons
  • Selected state handling

Splash Screen

  • System-theme-aware startup screen
  • Instagram logo + Meta branding
  • 2-second showing duration

Placeholder Features (Coming Soon):

  • Comments section
  • DM/Messenger
  • Reels playback
  • Following/Favorites feed switching
  • Profile view
  • Search functionality

🏗️ Tech Stack

Frontend Framework

  • Flutter 3.5+ – Cross-platform mobile UI toolkit
    • Uses Material Design 3 for modern component styling
    • Responsive layout handling via MediaQuery

State Management

  • flutter_bloc 9.1.1 – Event-driven state management
    • FeedBloc handles feed state: loading, pagination, like/save toggles
    • Equatable for state value comparison (prevents unnecessary rebuilds)
    • Predictable unidirectional data flow

UI & Animation

  • google_fonts 6.2.1 – Typography (Inter, Grand Hotel)
  • flutter_svg 2.2.4 – SVG rendering for icons & logos
  • shimmer 3.0.0 – Loading skeleton animations
  • cached_network_image 3.4.1 – Image caching & optimization

Dependency Injection

  • get_it 8.0.3 – Service locator for repositories & BLoC

Navigation

  • go_router 15.1.2 – Modern Flutter routing (future expansion)

Testing & Linting

  • flutter_lints 6.0.0 – Code quality & best practices
  • bloc_test 10.0.0 – BLoC unit testing

Launcher Icons

  • flutter_launcher_icons 0.14.4 – App icon generation

🎭 Architecture & Workflow

Layered Architecture

lib/
├── main.dart                    # App entry point
├── app.dart                     # App root + splash flow
│
├── screens/
│   ├── home/
│   │   └── home_screen.dart    # Feed composition + bottom nav
│   └── splash/
│       └── splash_screen.dart  # Startup splash
│
├── blocs/
│   └── feed/
│       ├── feed_bloc.dart      # State management logic
│       ├── feed_event.dart     # User actions (Like, LoadMore)
│       └── feed_state.dart     # Feed states (Loading, Loaded, Error)
│
├── repositories/
│   ├── post_repository.dart    # Post data source abstraction
│   ├── story_repository.dart   # Story data source abstraction
│   ├── mock_post_repository.dart # Mock implementation
│   └── mock_story_repository.dart
│
├── models/
│   ├── post_model.dart         # Post data class (Equatable)
│   ├── story_model.dart
│   └── user_model.dart
│
├── widgets/
│   ├── app_top_bar.dart        # SliverAppBar with dropdown
│   ├── post/
│   │   ├── post_card.dart      # Card composition
│   │   ├── post_header.dart    # Avatar + username + menu
│   │   ├── post_media.dart     # Image carousel + double-tap
│   │   ├── post_actions.dart   # Like, comment, share, save
│   │   ├── post_caption.dart   # Caption + timestamps
│   │   ├── pinch_to_zoom.dart  # Zoom interaction
│   │   └── carousel_media.dart # Multi-image swiping
│   ├── stories/
│   │   ├── stories_tray.dart   # Horizontal story list
│   │   └── story_bubble.dart   # Single story with ring
│   └── shimmer/
│       └── shimmer_widgets.dart # Loading placeholders
│
├── core/
│   ├── di/
│   │   └── injection.dart      # DI setup (repositories)
│   └── theme/
│       ├── app_theme.dart      # Light/dark theme definitions
│       └── app_colors.dart     # Color palette
│
└── assets/
    ├── icons/
    │   ├── dark/              # Dark theme SVG icons
    │   └── light/             # Light theme SVG icons
    ├── splash/                # Splash screen SVG assets
    └── logos/                 # App logo

Data Flow (BLoC Pattern)

UI (HomeScreen)
    ↓ (dispatches FeedStarted event)
    ↓
FeedBloc (receives event)
    ↓ (maps event to state change)
    ↓
Repository (fetches posts/stories)
    ↓ (returns data or error)
    ↓
FeedBloc (emits new state)
    ↓ (FeedLoaded with posts/stories)
    ↓
UI Rebuilds (only affected widgets)

Interaction Flow Example: Like Toggle

  1. User taps heart or double-taps image
  2. _LikeButton or _PostMediaState dispatches FeedPostLikeToggled(postId) event
  3. FeedBloc._onLikeToggled() updates post isLiked + likeCount
  4. New FeedLoaded state emitted with updated posts list
  5. PostCard rebuilds with new state
  6. Heart animates with elastic curve, color changes to red

🚀 Getting Started

Prerequisites

  • Flutter SDK 3.5+
  • Android SDK / Xcode (for emulator/device)
  • Dart 3.5+

Installation

  1. Clone the repository:

    git clone https://github.com/thisisouvik/instafeed.git
    cd instafeed
  2. Install dependencies:

    flutter pub get
  3. Run the app:

    flutter run
  4. Build APK (Android):

    flutter build apk --release
  5. Build IPA (iOS):

    flutter build ios --release
  • Note: This project uses mock data. Replace repositories with real API calls for production use.

🎨 Design Highlights

  • Pixel-Perfect Spacing: Matches Instagram's exact padding/margins (verified against live app)
  • Typography: Grand Hotel for header, Inter for body text
  • Colors: Material 3 adaptive palette (light mode white, dark mode #000B17)
  • Animations:
    • Elastic heart bounce on like
    • Smooth scale/fade on double-tap overlay
    • Shimmer skeleton during load
    • Smooth scroll bounce physics

📊 Performance

  • Lazy Loading: Posts load on-demand as user scrolls
  • Image Caching: cached_network_image reduces network requests
  • Optimized Rebuilds: RepaintBoundary on post cards + Equatable states
  • Memory Efficient: Mock data kept small; real data would use pagination

🧪 Testing

Run unit tests:

flutter test

Future: Integration tests for critical user flows.


🙏 Acknowledgments

  • Instagram Design Team – for the reference UI/UX
  • Flutter Community – for exceptional documentation and packages
  • BLoC Library – for clean, scalable state management pattern

❓ FAQ

Q: Is this an official Instagram product?
A: No. This is an open-source educational project demonstrating modern Flutter architecture and UI polish.

Q: Can I use this in production?
A: This is a demo. Use it as a reference for your own projects, but integrate real backend APIs for production use.

Q: Why BLoC and not Provider/Riverpod?
A: BLoC provides excellent separation of concerns and is widely used in production Flutter apps. It's scalable and testable.

Q: How do I connect a real backend?
A: Replace the mock repositories in lib/repositories/ with real HTTP calls using http or dio package.


📞 Support

For issues, questions, or suggestions:


Happy coding! 🚀

About

Flutter UI/UX Challenge: The Instagram "Pixel-Perfect" Feed

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors