A full-featured Flutter e-commerce mobile application with Django REST API backend integration. This app provides a complete shopping experience with multiple payment gateways, real-time notifications, and comprehensive order management.
- User Registration with email verification (OTP)
- Login/Logout with JWT authentication
- Remember Me functionality
- Password Reset via email
- Forgot Password flow
- Token Auto-Refresh mechanism
- Account activation via OTP
- Product Listing with pagination
- Category-based Filtering
- Brand Filtering
- Advanced Search functionality
- Multi-criteria Filters (price, rating, gender, newest, popular)
- Product Details with image gallery
- Product Reviews & Ratings (add, edit, view)
- Related Products suggestions
- Shopping Cart with real-time updates
- Optimistic UI Updates for cart operations
- Wishlist Management
- Multiple Address Management
- Set Default Address
- Location Selection
- Order Creation with address validation
- Order History (Pending, Shipped, Delivered, Cancelled)
- Order Details with product breakdown
- Order Tracking
- Multiple Payment Gateways:
- PayStack
- Flutterwave
- Stripe
- WebView Payment Integration
- Payment Verification
- Payment Success/Failure Handling
- Onboarding Screens
- Splash Screen
- Bottom Navigation Bar with badges
- Pull-to-Refresh functionality
- Shimmer Loading Effects
- Image Sliders for promotions
- Category Scroller
- Product Grid/List Views
- Filter Chips
- Responsive Design
- Push Notifications integration
- In-App Notifications
- Notification Badge Counter
- Mark as Read functionality
- User Profile view and edit
- Address Management (add, edit, delete, set default)
- Order History
- Wishlist Access
- Logout
- GetX for state management and dependency injection
- Reactive programming with observables
- Controllers for business logic separation
- Custom
MyRequestclass for API calls - Automatic token refresh on 401 errors
- Error handling with user-friendly messages
- Request timeout management (60 seconds)
- Support for GET, POST, PUT, PATCH, DELETE
- Multipart file upload support
- JWT-based authentication
- Access & Refresh token management
- Token expiry tracking
- Automatic token refresh timer (55 minutes)
- Remember Me with SharedPreferences
- Secure token storage
lib/
βββ auth/
β βββ controllers/
β β βββ login_controller.dart
β β βββ register_controller.dart
β β βββ otp_controller.dart
β β βββ password_controller.dart
β βββ service/
β β βββ auth_service.dart
β βββ views/
β βββ sign_in.dart
β βββ sign_up.dart
β βββ sign_up_otp_code.dart
β βββ forgot_password.dart
β βββ reset_password.dart
β
βββ products/
β βββ controllers/
β β βββ product_controller.dart
β β βββ category_controller.dart
β β βββ review_controller.dart
β βββ models/
β β βββ product_model.dart
β β βββ category_model.dart
β β βββ review_model.dart
β βββ service/
β β βββ product_service.dart
β β βββ review_service.dart
β βββ views/
β βββ product_detail.dart
β βββ product_list_by_category.dart
β βββ product_search_screen.dart
β βββ product_filter.dart
β βββ category_list.dart
β
βββ cart/
β βββ controllers/
β β βββ cart_controller.dart
β β βββ address_controller.dart
β βββ models/
β β βββ cart_model.dart
β β βββ create_cart_model.dart
β β βββ address_model.dart
β βββ views/
β βββ cart_screen.dart
β βββ checkout_screen.dart
β
βββ wishlist/
β βββ controllers/
β β βββ wishlist_controller.dart
β βββ models/
β β βββ wishlist_model.dart
β βββ views/
β βββ wishlist.dart
β
βββ orders/
β βββ controllers/
β β βββ order_controller.dart
β βββ models/
β β βββ order_model.dart
β βββ service/
β β βββ order_service.dart
β βββ views/
β βββ order_screen.dart
β βββ order_detail.dart
β
βββ payment/
β βββ controllers/
β β βββ payment_controller.dart
β βββ models/
β β βββ payment_request_model.dart
β βββ views/
β βββ payment_method_screen.dart
β βββ payment_webview.dart
β βββ payment_success_screen.dart
β
βββ notification/
β βββ controllers/
β β βββ notification_controller.dart
β βββ views/
β βββ notification_screen.dart
β
βββ profile/
β βββ views/
β βββ profile_screen.dart
β
βββ home/
β βββ views/
β βββ home_screen.dart
β βββ location_screen.dart
β
βββ onboarding/
β βββ views/
β βββ splash_screen.dart
β βββ welcome_screen.dart
β
βββ base/
β βββ res/
β β βββ base_url.dart
β β βββ media.dart
β β βββ styles/
β β βββ app_styles.dart
β βββ utils/
β β βββ my_request.dart
β β βββ snackbar.dart
β β βββ token.dart
β βββ widgets/
β βββ app_double_text.dart
β βββ category_scroller.dart
β βββ category_shimmer.dart
β βββ filter_card.dart
β βββ image_sliders.dart
β βββ product_card.dart
β βββ product_shimmer.dart
β
βββ bottom_nav_bar.dart
- Flutter SDK (latest stable version)
- Dart SDK
- Android Studio / VS Code
- Django backend API running
The app requires a Django REST API with the following endpoints:
POST /auth/users/- User registrationPOST /auth/login/- User loginPOST /auth/activate-otp/- OTP verificationPOST /auth/resend-otp/- Resend OTPPOST /auth/jwt/refresh/- Token refreshPOST /auth/jwt/verify/- Token verificationPOST /auth/password/reset/- Password reset requestPOST /auth/password/reset/confirm/- Password reset confirmation
GET /products/- Get all productsGET /products/{id}/- Get product detailsGET /products/category/{id}/- Get products by categoryGET /products/search/- Search products
GET /cart/me/- Get user cartPOST /cart/add/- Add to cartPATCH /cart/update/{id}/- Update cart itemDELETE /cart/delete/{id}/- Remove from cartDELETE /cart/clear/- Clear cart
GET /wishlist/me/- Get user wishlistPOST /wishlist/add/- Add to wishlistDELETE /wishlist/remove/{id}/- Remove from wishlist
POST /orders/add/- Create orderGET /orders/status/{status}/- Get orders by statusGET /orders/{id}/- Get order details
POST /payments/initiate-paystack-payment/- Initiate PayStack paymentGET /payments/verify-paystack-payment/{reference}/- Verify PayStack paymentPOST /payments/initiate-flutterwave-payment/- Initiate Flutterwave paymentGET /payments/verify-flutterwave-payment/{reference}/- Verify Flutterwave paymentPOST /payments/initiate-stripe-payment/- Initiate Stripe paymentGET /payments/verify-stripe-payment/{session_id}/- Verify Stripe payment
GET /address/addresslist/- Get user addressesPOST /address/add/- Add addressPATCH /address/set-default/?id={id}- Set default addressDELETE /address/delete/?id={id}- Delete address
GET /notifications/- Get user notificationsPATCH /notifications/mark-read/{id}/- Mark notification as read
- Clone the repository:
git clone <repository-url>
cd ecom_app- Install dependencies:
flutter pub get-
Configure base URL:
- Navigate to
lib/base/res/base_url.dart - Update the
baseUrlconstant with your Django API URL:
const String baseUrl = 'https://your-api-url.com';
- Navigate to
-
Run the app:
flutter runThe app implements automatic token refresh:
- Tokens are checked every 55 minutes
- On 401 errors, tokens are automatically refreshed
- If refresh fails, user is logged out
- Remember Me option stores refresh token persistently
Cart and wishlist operations use optimistic updates:
- UI updates immediately on user action
- Changes are rolled back if API call fails
- Provides smooth user experience
- User selects payment method (PayStack/Flutterwave/Stripe)
- Order is created on backend
- Payment gateway session is initiated
- User is redirected to WebView for payment
- Payment is verified on callback
- Order status is updated
- User sees success screen with order details
- Network errors show "Check your internet" message
- Timeout errors (60s) show appropriate message
- API errors display server-provided error messages
- Validation errors are shown inline
- Splash Screen
- Onboarding/Welcome Screen
- Sign In
- Sign Up
- OTP Verification
- Forgot Password
- Reset Password
- Home (with categories, products, search)
- Product Details
- Product List (by category/filter)
- Search Results
- Cart
- Checkout
- Wishlist
- Orders (Pending/Delivered/Cancelled)
- Order Details
- Payment Selection
- Payment WebView
- Payment Success
- Notifications
- Profile
- Address Management
- Location Selection
ProductCard- Product display cardCategoryScroller- Horizontal category listFilterCard- Filter chipsAppDoubleText- Section header with "View All"ImageSliders- Banner carousel- Shimmer loading placeholders
- Home
- Wishlist (with badge)
- Cart (with badge)
- Profile
- JWT token authentication
- Secure token storage using SharedPreferences
- Automatic token refresh
- Session expiry handling
- Form validation
- OTP verification for account activation
- Password reset via email
Controllers manage:
- Loading states (
isLoading,isLoad) - Error messages (
errorMessage) - Data lists (products, cart items, orders, etc.)
- Selected items (address, filters)
- Form state (rating, review text)
To test the app:
- Ensure Django backend is running
- Configure correct
baseUrl - Test authentication flow (register β OTP β login)
- Test cart operations with optimistic updates
- Test payment gateways (use test credentials)
- Test token refresh by waiting 55+ minutes
- Test offline behavior
- Payment gateway test credentials required
- Push notifications require Firebase setup
- Image uploads limited to specific formats
- No offline data caching (requires internet)
This project is part of a commercial application. All rights reserved.
Developed by Arinze Timothy