├── devtools_options.yaml ├── linux ├── .gitignore ├── main.cc ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ ├── generated_plugins.cmake │ └── CMakeLists.txt └── my_application.h ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-50x50@1x.png │ │ │ ├── Icon-App-50x50@2x.png │ │ │ ├── Icon-App-57x57@1x.png │ │ │ ├── Icon-App-57x57@2x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-72x72@1x.png │ │ │ ├── Icon-App-72x72@2x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcodeproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist ├── RunnerTests │ └── RunnerTests.swift └── .gitignore ├── macos ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_64.png │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_512.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Release.entitlements │ ├── DebugProfile.entitlements │ ├── MainFlutterWindow.swift │ └── Info.plist ├── .gitignore ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner.xcodeproj │ └── project.xcworkspace │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── RunnerTests │ └── RunnerTests.swift ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── manifest.json └── index.html ├── assets ├── images │ ├── minitv.png │ ├── amazon_in.png │ ├── app_icon.png │ ├── empty_cart.png │ ├── info_icon.png │ ├── amazon_in_alt.png │ ├── amazon_black_logo.png │ ├── bottom_nav_bar │ │ ├── cart.png │ │ ├── home.png │ │ ├── menu.png │ │ ├── more.png │ │ └── you.png │ ├── bottom_offers │ │ ├── bestBuys.png │ │ ├── topPicks.png │ │ ├── amazon_pay.png │ │ ├── budgetBuys.png │ │ ├── superBuys.png │ │ ├── amazon_bills.png │ │ ├── amazon_recharge.png │ │ └── amazon_rewards.png │ ├── category_images │ │ ├── books.jpeg │ │ ├── deals.jpeg │ │ ├── home.jpeg │ │ ├── beauty.jpeg │ │ ├── fashion.jpeg │ │ ├── grocery.jpeg │ │ ├── minitv.jpeg │ │ ├── mobiles.jpeg │ │ ├── appliances.jpeg │ │ ├── essentials.jpeg │ │ └── electronics.jpeg │ ├── cart_screen_icons │ │ ├── pay_calender.png │ │ ├── delivered_alt.png │ │ └── secure_payment.png │ └── product_quality_icons │ │ ├── warranty.png │ │ ├── delivered.png │ │ ├── top_brand.png │ │ ├── free_delivery.png │ │ ├── replacement.png │ │ └── pay_on_delivery.png ├── fonts │ └── amazon_ember │ │ ├── AmazonEmber_Bd.ttf │ │ ├── AmazonEmber_He.ttf │ │ ├── AmazonEmber_Lt.ttf │ │ ├── AmazonEmber_Rg.ttf │ │ ├── AmazonEmber_Th.ttf │ │ └── AmazonEmber_Medium.ttf ├── applepay.json └── gpay.json ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launcher_icon.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launcher_icon.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launcher_icon.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launcher_icon.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ └── launcher_icon.png │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── amazon_clone_flutter │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── build.gradle └── amazon_clone_flutter_android.iml ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── utils.h │ ├── runner.exe.manifest │ ├── flutter_window.h │ ├── main.cpp │ ├── CMakeLists.txt │ ├── utils.cpp │ └── flutter_window.cpp ├── flutter │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake └── .gitignore ├── .idea ├── runConfigurations │ └── main_dart.xml ├── modules.xml ├── libraries │ ├── KotlinJavaRuntime.xml │ └── Dart_SDK.xml └── workspace.xml ├── lib ├── features │ ├── admin │ │ ├── models │ │ │ └── sales.dart │ │ └── widgets │ │ │ └── custom_floating_action_button.dart │ ├── menu │ │ └── widgets │ │ │ └── container_clipper.dart │ ├── account │ │ ├── widgets │ │ │ ├── single_product.dart │ │ │ ├── account_screen_app_bar.dart │ │ │ ├── name_bar.dart │ │ │ ├── account_button.dart │ │ │ └── top_buttons.dart │ │ └── screens │ │ │ ├── wish_list_screen.dart │ │ │ └── search_orders_screen.dart │ ├── product_details │ │ └── widgets │ │ │ ├── product_features.dart │ │ │ ├── divider_with_sizedbox.dart │ │ │ ├── customer_ratings.dart │ │ │ ├── product_quality_icons.dart │ │ │ └── you_might_also_like.dart │ ├── cart │ │ └── widgets │ │ │ ├── cart_icon.dart │ │ │ ├── swipe_container.dart │ │ │ ├── cart_subtotal.dart │ │ │ ├── custom_icon_button.dart │ │ │ ├── custom_text_button.dart │ │ │ └── amazon_pay_bannar_ad.dart │ ├── home │ │ ├── widgets │ │ │ ├── background_white_gradient.dart │ │ │ ├── single_top_category_item.dart │ │ │ ├── top_categories.dart │ │ │ ├── single_bottom_offer.dart │ │ │ ├── address_bar.dart │ │ │ ├── carousel_image.dart │ │ │ ├── search_text_form_field.dart │ │ │ ├── single_image_offer.dart │ │ │ ├── bottom_offers.dart │ │ │ ├── custom_carousel_slider.dart │ │ │ └── dots_indicator.dart │ │ ├── services │ │ │ └── home_services.dart │ │ └── screens │ │ │ └── category_deals_screen.dart │ ├── order_details │ │ └── widgets │ │ │ ├── order_summary_total.dart.dart │ │ │ ├── order_summary_row.dart │ │ │ ├── standard_delivery_container.dart │ │ │ ├── track_update_shipment.dart │ │ │ ├── shipping_address_block.dart │ │ │ ├── shipment_details.dart │ │ │ ├── you_might_also_like_block.dart │ │ │ ├── order_summary_block.dart │ │ │ └── ordered_products.dart │ ├── search │ │ ├── services │ │ │ └── search_services.dart │ │ └── widgets │ │ │ └── searched_product.dart │ ├── more │ │ ├── widgets │ │ │ └── pay_containers.dart │ │ └── screens │ │ │ └── more_screen.dart │ └── splash_screen │ │ └── splash_screen.dart ├── providers │ ├── cart_offers_provider.dart │ ├── screen_number_provider.dart │ └── user_provider.dart ├── models │ ├── rating.dart │ ├── product.dart │ ├── order.dart │ └── user.dart ├── constants │ ├── error_handling.dart │ └── app_theme.dart ├── common │ └── widgets │ │ ├── stars.dart │ │ ├── custom_app_bar.dart │ │ ├── custom_textfield.dart │ │ ├── custom_elevated_button.dart │ │ └── you_might_also_like_single.dart └── main.dart ├── server ├── model │ ├── rating.js │ ├── order.js │ ├── product.js │ └── user.js ├── package.json ├── middlewares │ ├── auth.js │ └── admin.js ├── index.js └── routes │ └── auth.js ├── .gitignore ├── amazon_clone_flutter.iml ├── LICENSE ├── test └── widget_test.dart ├── analysis_options.yaml └── .metadata /devtools_options.yaml: -------------------------------------------------------------------------------- 1 | extensions: 2 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /assets/images/minitv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/minitv.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /assets/images/amazon_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/amazon_in.png -------------------------------------------------------------------------------- /assets/images/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/app_icon.png -------------------------------------------------------------------------------- /assets/images/empty_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/empty_cart.png -------------------------------------------------------------------------------- /assets/images/info_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/info_icon.png -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /assets/images/amazon_in_alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/amazon_in_alt.png -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /assets/images/amazon_black_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/amazon_black_logo.png -------------------------------------------------------------------------------- /assets/images/bottom_nav_bar/cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_nav_bar/cart.png -------------------------------------------------------------------------------- /assets/images/bottom_nav_bar/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_nav_bar/home.png -------------------------------------------------------------------------------- /assets/images/bottom_nav_bar/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_nav_bar/menu.png -------------------------------------------------------------------------------- /assets/images/bottom_nav_bar/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_nav_bar/more.png -------------------------------------------------------------------------------- /assets/images/bottom_nav_bar/you.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_nav_bar/you.png -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /assets/images/bottom_offers/bestBuys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_offers/bestBuys.png -------------------------------------------------------------------------------- /assets/images/bottom_offers/topPicks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_offers/topPicks.png -------------------------------------------------------------------------------- /assets/images/category_images/books.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/books.jpeg -------------------------------------------------------------------------------- /assets/images/category_images/deals.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/deals.jpeg -------------------------------------------------------------------------------- /assets/images/category_images/home.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/home.jpeg -------------------------------------------------------------------------------- /assets/images/bottom_offers/amazon_pay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_offers/amazon_pay.png -------------------------------------------------------------------------------- /assets/images/bottom_offers/budgetBuys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_offers/budgetBuys.png -------------------------------------------------------------------------------- /assets/images/bottom_offers/superBuys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_offers/superBuys.png -------------------------------------------------------------------------------- /assets/images/category_images/beauty.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/beauty.jpeg -------------------------------------------------------------------------------- /assets/images/category_images/fashion.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/fashion.jpeg -------------------------------------------------------------------------------- /assets/images/category_images/grocery.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/grocery.jpeg -------------------------------------------------------------------------------- /assets/images/category_images/minitv.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/minitv.jpeg -------------------------------------------------------------------------------- /assets/images/category_images/mobiles.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/mobiles.jpeg -------------------------------------------------------------------------------- /assets/fonts/amazon_ember/AmazonEmber_Bd.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/fonts/amazon_ember/AmazonEmber_Bd.ttf -------------------------------------------------------------------------------- /assets/fonts/amazon_ember/AmazonEmber_He.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/fonts/amazon_ember/AmazonEmber_He.ttf -------------------------------------------------------------------------------- /assets/fonts/amazon_ember/AmazonEmber_Lt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/fonts/amazon_ember/AmazonEmber_Lt.ttf -------------------------------------------------------------------------------- /assets/fonts/amazon_ember/AmazonEmber_Rg.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/fonts/amazon_ember/AmazonEmber_Rg.ttf -------------------------------------------------------------------------------- /assets/fonts/amazon_ember/AmazonEmber_Th.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/fonts/amazon_ember/AmazonEmber_Th.ttf -------------------------------------------------------------------------------- /assets/images/bottom_offers/amazon_bills.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_offers/amazon_bills.png -------------------------------------------------------------------------------- /assets/images/category_images/appliances.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/appliances.jpeg -------------------------------------------------------------------------------- /assets/images/category_images/essentials.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/essentials.jpeg -------------------------------------------------------------------------------- /assets/fonts/amazon_ember/AmazonEmber_Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/fonts/amazon_ember/AmazonEmber_Medium.ttf -------------------------------------------------------------------------------- /assets/images/bottom_offers/amazon_recharge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_offers/amazon_recharge.png -------------------------------------------------------------------------------- /assets/images/bottom_offers/amazon_rewards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/bottom_offers/amazon_rewards.png -------------------------------------------------------------------------------- /assets/images/cart_screen_icons/pay_calender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/cart_screen_icons/pay_calender.png -------------------------------------------------------------------------------- /assets/images/category_images/electronics.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/category_images/electronics.jpeg -------------------------------------------------------------------------------- /assets/images/product_quality_icons/warranty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/product_quality_icons/warranty.png -------------------------------------------------------------------------------- /assets/images/cart_screen_icons/delivered_alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/cart_screen_icons/delivered_alt.png -------------------------------------------------------------------------------- /assets/images/cart_screen_icons/secure_payment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/cart_screen_icons/secure_payment.png -------------------------------------------------------------------------------- /assets/images/product_quality_icons/delivered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/product_quality_icons/delivered.png -------------------------------------------------------------------------------- /assets/images/product_quality_icons/top_brand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/product_quality_icons/top_brand.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /assets/images/product_quality_icons/free_delivery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/product_quality_icons/free_delivery.png -------------------------------------------------------------------------------- /assets/images/product_quality_icons/replacement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/product_quality_icons/replacement.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-hdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-mdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /assets/images/product_quality_icons/pay_on_delivery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/assets/images/product_quality_icons/pay_on_delivery.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tejasbadone/flutterzon_provider/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/amazon_clone_flutter/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.amazon_clone_flutter 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations/main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/features/admin/models/sales.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/global_variables.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class Sales { 5 | final String label; 6 | final int earning; 7 | final Color pointColor = GlobalVariables.secondaryColor; 8 | 9 | Sales(this.label, this.earning); 10 | } 11 | -------------------------------------------------------------------------------- /lib/providers/cart_offers_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CartOfferProvider extends ChangeNotifier { 4 | String _category1 = ''; 5 | 6 | String get category1 => _category1; 7 | 8 | void setCategory1(String category) { 9 | _category1 = category; 10 | notifyListeners(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | import Cocoa 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /server/model/rating.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const ratingSchema = mongoose.Schema({ 4 | userId : { 5 | type: String, 6 | required : true 7 | }, 8 | rating : { 9 | type : Number, 10 | required : true 11 | }, 12 | }); 13 | 14 | const Rating = mongoose.model("Rating", ratingSchema); 15 | module.exports = ratingSchema; -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /lib/providers/screen_number_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ScreenNumberProvider extends ChangeNotifier { 4 | int _screenNumber = 0; 5 | static bool _isOpen = false; 6 | 7 | int get screenNumber => _screenNumber; 8 | 9 | bool get isOpen => _isOpen; 10 | 11 | void setScreenNumber(int number) { 12 | _screenNumber = number; 13 | notifyListeners(); 14 | } 15 | 16 | void setIsOpen(bool isOpen) { 17 | _isOpen = isOpen; 18 | notifyListeners(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node ./index.js", 8 | "dev": "nodemon ./index.js" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "bcryptjs": "^2.4.3", 14 | "dotenv": "^16.3.1", 15 | "express": "^4.18.2", 16 | "http": "^0.0.1-security", 17 | "jsonwebtoken": "^9.0.2", 18 | "mongoose": "^7.6.2" 19 | }, 20 | "devDependencies": { 21 | "nodemon": "^3.0.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import path_provider_foundation 9 | import shared_preferences_foundation 10 | import sqflite 11 | 12 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 13 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 14 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 15 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 16 | } 17 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /lib/models/rating.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class Rating { 4 | final String userId; 5 | final double rating; 6 | 7 | Rating({required this.userId, required this.rating}); 8 | 9 | Map toMap() { 10 | return { 11 | 'userId': userId, 12 | 'rating': rating, 13 | }; 14 | } 15 | 16 | factory Rating.fromMap(Map map) { 17 | return Rating( 18 | userId: map['userId'] ?? '', 19 | rating: map['rating']?.toDouble() ?? 0.0, 20 | ); 21 | } 22 | 23 | String toJson() => json.encode(toMap()); 24 | 25 | factory Rating.fromJson(String source) => Rating.fromMap(json.decode(source)); 26 | } 27 | -------------------------------------------------------------------------------- /.idea/libraries/KotlinJavaRuntime.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/features/menu/widgets/container_clipper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ContainerClipper extends CustomClipper { 4 | @override 5 | Path getClip(Size size) { 6 | double width = size.width; 7 | double height = size.height; 8 | 9 | final path = Path(); 10 | 11 | path.moveTo(0, 100); 12 | 13 | path.lineTo(0, height); 14 | path.lineTo(width, height); 15 | path.lineTo(width, 100); 16 | path.quadraticBezierTo(width * 0.5, 70, 0, 100); 17 | 18 | path.close(); 19 | 20 | return path; 21 | } 22 | 23 | @override 24 | bool shouldReclip(covariant CustomClipper oldClipper) { 25 | return false; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = amazon_clone_flutter 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.amazonCloneFlutter 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /lib/providers/user_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/models/user.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class UserProvider extends ChangeNotifier { 5 | User _user = User( 6 | id: '', 7 | name: '', 8 | email: '', 9 | password: '', 10 | address: '', 11 | type: '', 12 | token: '', 13 | cart: [], 14 | saveForLater: [], 15 | keepShoppingFor: [], 16 | wishList: [], 17 | ); 18 | 19 | User get user => _user; 20 | 21 | void setUser(String user) { 22 | _user = User.fromJson(user); 23 | notifyListeners(); 24 | } 25 | 26 | void setUserFromModel(User user) { 27 | _user = user; 28 | notifyListeners(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/constants/error_handling.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:amazon_clone_flutter/constants/utils.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:http/http.dart' as http; 6 | 7 | void httpErrorHandle({ 8 | required http.Response response, 9 | required BuildContext context, 10 | required VoidCallback onSuccess, 11 | }) { 12 | switch (response.statusCode) { 13 | case 200: 14 | onSuccess(); 15 | break; 16 | case 400: 17 | showSnackBar(context, jsonDecode(response.body)['msg']); 18 | case 500: 19 | showSnackBar(context, jsonDecode(response.body)['error']); 20 | default: 21 | showSnackBar(context, response.body); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.3.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /lib/features/account/widgets/single_product.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class SingleProduct extends StatelessWidget { 5 | const SingleProduct({super.key, required this.image}); 6 | 7 | final String image; 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Container( 12 | margin: const EdgeInsets.symmetric(horizontal: 8), 13 | decoration: BoxDecoration( 14 | borderRadius: BorderRadius.circular(5), 15 | color: Colors.white, 16 | ), 17 | child: Container( 18 | padding: const EdgeInsets.all(8), 19 | child: CachedNetworkImage(imageUrl: image)), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/features/product_details/widgets/product_features.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../models/product.dart'; 4 | 5 | class ProductFeatures extends StatelessWidget { 6 | const ProductFeatures({ 7 | super.key, 8 | required this.product, 9 | }); 10 | 11 | final Product product; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Column( 16 | crossAxisAlignment: CrossAxisAlignment.start, 17 | children: [ 18 | const Text( 19 | 'Features', 20 | style: TextStyle( 21 | fontSize: 18, fontWeight: FontWeight.bold, color: Colors.black87), 22 | ), 23 | Text(product.description), 24 | ], 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/features/product_details/widgets/divider_with_sizedbox.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DividerWithSizedBox extends StatelessWidget { 4 | const DividerWithSizedBox({ 5 | super.key, 6 | this.sB1Height = 8, 7 | this.sB2Height = 8, 8 | this.thickness = 2, 9 | }); 10 | 11 | final double sB1Height; 12 | final double sB2Height; 13 | final double thickness; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Column( 18 | children: [ 19 | SizedBox(height: sB1Height), 20 | Divider( 21 | color: const Color(0xffD5D9DA), 22 | thickness: thickness, 23 | ), 24 | SizedBox(height: sB2Height), 25 | ], 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /lib/common/widgets/stars.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/global_variables.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_rating_bar/flutter_rating_bar.dart'; 4 | 5 | class Stars extends StatelessWidget { 6 | final double rating; 7 | final double size; 8 | const Stars({super.key, required this.rating, this.size = 15}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return RatingBarIndicator( 13 | direction: Axis.horizontal, 14 | itemCount: 5, 15 | rating: rating, 16 | itemSize: size, 17 | itemBuilder: (context, _) => const Icon( 18 | Icons.star, 19 | color: GlobalVariables.secondaryColor, 20 | )); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /server/middlewares/auth.js: -------------------------------------------------------------------------------- 1 | const jwt = require("jsonwebtoken"); 2 | 3 | const auth = async (req, res , next) => { 4 | try { 5 | const token = req.header('x-auth-token'); 6 | if(!token) 7 | return res.status(401).json({msg: "No auth token, access denied!"}); 8 | 9 | const isverified = jwt.verify(token, "passwordKey"); 10 | if(!isverified) 11 | return res.status(401).json({msg: "Token verification failed, Authorization denied!"}); 12 | 13 | // extracting id from payload 14 | req.user = isverified.id; 15 | req.token = token; 16 | 17 | next(); 18 | 19 | } catch (err) { 20 | res.status(500).json({error : err.message}); 21 | } 22 | } 23 | 24 | module.exports = auth; -------------------------------------------------------------------------------- /server/model/order.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const { productSchema } = require("./product"); 3 | 4 | const orderSchema = mongoose.Schema({ 5 | products: [ 6 | { 7 | product: productSchema, 8 | quantity: { 9 | type: Number, 10 | required: true, 11 | }, 12 | }, 13 | ], 14 | totalPrice: { 15 | type: Number, 16 | required: true, 17 | }, 18 | address: { 19 | type: String, 20 | required: true, 21 | }, 22 | userId: { 23 | required: true, 24 | type: String, 25 | }, 26 | orderedAt: { 27 | type: Number, 28 | required: true, 29 | }, 30 | status: { 31 | type: Number, 32 | default: 0, 33 | }, 34 | }); 35 | 36 | const Order = mongoose.model("Order", orderSchema); 37 | module.exports = Order; -------------------------------------------------------------------------------- /lib/features/admin/widgets/custom_floating_action_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../../constants/global_variables.dart'; 3 | import '../screens/add_product_screen.dart'; 4 | 5 | class CustomFloatingActionButton extends StatelessWidget { 6 | const CustomFloatingActionButton({ 7 | super.key, 8 | }); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return FloatingActionButton( 13 | onPressed: () { 14 | Navigator.pushNamed(context, AddProductScreen.routeName); 15 | }, 16 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)), 17 | backgroundColor: GlobalVariables.selectedNavBarColor, 18 | tooltip: 'Add a product', 19 | child: const Icon(Icons.add), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/constants/app_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/global_variables.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class AppTheme { 5 | static ThemeData get light { 6 | return ThemeData( 7 | fontFamily: 'AmazonEmber', 8 | scaffoldBackgroundColor: GlobalVariables.backgroundColor, 9 | bottomSheetTheme: const BottomSheetThemeData( 10 | surfaceTintColor: Colors.white, 11 | backgroundColor: Colors.white, 12 | modalBackgroundColor: Colors.white), 13 | colorScheme: 14 | const ColorScheme.light(primary: GlobalVariables.secondaryColor), 15 | appBarTheme: const AppBarTheme( 16 | elevation: 0, iconTheme: IconThemeData(color: Colors.black)), 17 | useMaterial3: true, 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/common/widgets/custom_app_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../constants/global_variables.dart'; 4 | import '../../features/home/widgets/search_text_form_field.dart'; 5 | import '../../features/search/screens/search_screen.dart'; 6 | 7 | class CustomAppBar extends StatelessWidget { 8 | const CustomAppBar({ 9 | super.key, 10 | }); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return AppBar( 15 | flexibleSpace: Container( 16 | decoration: 17 | const BoxDecoration(gradient: GlobalVariables.appBarGradient), 18 | ), 19 | title: SearchTextFormField(onTapSearchField: (String query) { 20 | Navigator.pushNamed(context, SearchScreen.routeName, arguments: query); 21 | }), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/features/cart/widgets/cart_icon.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../constants/global_variables.dart'; 4 | 5 | class CartIcon extends StatelessWidget { 6 | const CartIcon({ 7 | super.key, 8 | required this.iconName, 9 | required this.title, 10 | }); 11 | final String iconName; 12 | final String title; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Column( 17 | children: [ 18 | Image.asset( 19 | 'assets/images/cart_screen_icons/$iconName', 20 | height: 55, 21 | width: 55, 22 | ), 23 | Text( 24 | title, 25 | style: TextStyle( 26 | fontSize: 14, color: GlobalVariables.selectedNavBarColor), 27 | ) 28 | ], 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /lib/features/home/widgets/background_white_gradient.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class BackgroundWhiteGradient extends StatelessWidget { 4 | const BackgroundWhiteGradient({ 5 | super.key, 6 | }); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | height: 180, 12 | width: MediaQuery.sizeOf(context).width, 13 | decoration: BoxDecoration( 14 | gradient: LinearGradient( 15 | begin: Alignment.topCenter, 16 | end: Alignment.bottomCenter, 17 | colors: [ 18 | Colors.white.withOpacity(0.1), 19 | Colors.white.withOpacity(0.3), 20 | Colors.white.withOpacity(0.95), 21 | Colors.white, 22 | ], 23 | stops: const [0, 0.1, 0.4, 0.6], 24 | ), 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://www.dartlang.org/guides/libraries/private-files 2 | 3 | 4 | 5 | package-lock.json 6 | node_modules/ 7 | 8 | 9 | 10 | # Files and directories created by pub 11 | .dart_tool/ 12 | .packages 13 | build/ 14 | # If you're building an application, you may want to check-in your pubspec.lock 15 | pubspec.lock 16 | 17 | 18 | # Directory created by dartdoc 19 | # If you don't generate documentation locally you can remove this line. 20 | doc/api/ 21 | 22 | # dotenv environment variables file 23 | .env* 24 | config.env* 25 | 26 | # Avoid committing generated Javascript files: 27 | *.dart.js 28 | *.info.json # Produced by the --dump-info flag. 29 | *.js # When generated by dart2js. Don't specify *.js if your 30 | # project includes source files written in JavaScript. 31 | *.js_ 32 | *.js.deps 33 | *.js.map 34 | 35 | .flutter-plugins 36 | .flutter-plugins-dependencies 37 | -------------------------------------------------------------------------------- /amazon_clone_flutter.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /server/model/product.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const ratingSchema = require("./rating"); 3 | 4 | const productSchema = mongoose.Schema({ 5 | name: { 6 | type: String, 7 | required : true, 8 | trim : true, 9 | }, 10 | description: { 11 | type: String, 12 | required : true, 13 | trim: true, 14 | }, 15 | images : [ 16 | { 17 | type: String, 18 | required : true, 19 | } 20 | ], 21 | quantity : { 22 | type: Number, 23 | required : true, 24 | }, 25 | price : { 26 | type: Number, 27 | required : true, 28 | }, 29 | category : { 30 | type: String, 31 | required : true, 32 | }, 33 | 34 | ratings : [ratingSchema], 35 | 36 | }); 37 | 38 | 39 | const Product = mongoose.model("Product", productSchema); 40 | module.exports = {Product, productSchema}; -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /lib/features/cart/widgets/swipe_container.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SwipeContainer extends StatelessWidget { 4 | const SwipeContainer({ 5 | super.key, 6 | required this.isDelete, 7 | required this.secondaryBackgroundText, 8 | }); 9 | 10 | final bool isDelete; 11 | final String secondaryBackgroundText; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Container( 16 | color: isDelete ? const Color(0xffC40202) : const Color(0xffE3E5E4), 17 | child: Row( 18 | children: [ 19 | SizedBox( 20 | width: isDelete ? 50 : 250, 21 | ), 22 | Text( 23 | isDelete ? 'Delete' : secondaryBackgroundText, 24 | style: TextStyle( 25 | fontSize: 16, 26 | fontWeight: FontWeight.w400, 27 | color: isDelete ? Colors.white : Colors.black87), 28 | ), 29 | ], 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /server/middlewares/admin.js: -------------------------------------------------------------------------------- 1 | 2 | const jwt = require("jsonwebtoken"); 3 | const User = require("../model/user"); 4 | 5 | const admin = async (req, res, next) => { 6 | try { 7 | const token = req.header("x-auth-token"); 8 | if(!token) 9 | return res.status(401).json({msg: 'No auth token, access denied!'}); 10 | 11 | 12 | const isVerified = jwt.verify(token, "passwordKey"); 13 | 14 | if(!isVerified) 15 | return res.status(401).json({msg: "Token verification failed, access denied!"}); 16 | 17 | 18 | const user = await User.findById(isVerified.id); 19 | 20 | if(user.type == "user" || user.type == "seller"){ 21 | return res.status(401).json({msg : 'you are not an admin!'}); 22 | } 23 | 24 | req.user = isVerified.id; 25 | req.token = token; 26 | next(); 27 | 28 | 29 | } catch (err) { 30 | res.status(500).json({error : err.message}); 31 | } 32 | } 33 | 34 | module.exports = admin; 35 | 36 | -------------------------------------------------------------------------------- /lib/features/order_details/widgets/order_summary_total.dart.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../constants/global_variables.dart'; 4 | import '../screens/order_details.dart'; 5 | 6 | class OrderSummaryTotal extends StatelessWidget { 7 | const OrderSummaryTotal({ 8 | super.key, 9 | required this.firstText, 10 | required this.secondText, 11 | required this.headingTextSyle, 12 | required this.widget, 13 | }); 14 | 15 | final TextStyle headingTextSyle; 16 | final String firstText; 17 | final String secondText; 18 | final OrderDetailsScreen widget; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Row( 23 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 24 | children: [ 25 | Text( 26 | firstText, 27 | style: headingTextSyle, 28 | ), 29 | Text( 30 | secondText, 31 | style: headingTextSyle.copyWith( 32 | color: GlobalVariables.redColor, 33 | ), 34 | ) 35 | ], 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amazon_clone_flutter", 3 | "short_name": "amazon_clone_flutter", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/features/home/widgets/single_top_category_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SingleTopCategoryItem extends StatelessWidget { 4 | const SingleTopCategoryItem( 5 | {super.key, 6 | required this.image, 7 | required this.title, 8 | this.isBottomOffer = false}); 9 | 10 | final String image; 11 | final String title; 12 | final bool isBottomOffer; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Padding( 17 | padding: EdgeInsets.symmetric( 18 | horizontal: isBottomOffer ? 0 : 10, 19 | ), 20 | child: Column( 21 | mainAxisAlignment: MainAxisAlignment.center, 22 | children: [ 23 | Image.asset( 24 | image, 25 | height: 50, 26 | width: 50, 27 | fit: BoxFit.cover, 28 | ), 29 | Text( 30 | title, 31 | style: isBottomOffer 32 | ? const TextStyle(fontSize: 11) 33 | : const TextStyle(), 34 | ), 35 | ], 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Tejas Badone 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /lib/features/order_details/widgets/order_summary_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../screens/order_details.dart'; 4 | 5 | class OrderSummaryRow extends StatelessWidget { 6 | const OrderSummaryRow({ 7 | super.key, 8 | required this.firstText, 9 | required this.secondText, 10 | required this.textSyle, 11 | required this.widget, 12 | }); 13 | 14 | final TextStyle textSyle; 15 | final String firstText; 16 | final String secondText; 17 | final OrderDetailsScreen widget; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Row( 22 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 23 | children: [ 24 | Text( 25 | firstText, 26 | style: textSyle.copyWith( 27 | color: Colors.black87, 28 | fontWeight: FontWeight.normal, 29 | ), 30 | ), 31 | Text( 32 | secondText, 33 | style: textSyle.copyWith( 34 | color: Colors.black87, 35 | fontWeight: FontWeight.normal, 36 | ), 37 | ) 38 | ], 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /assets/applepay.json: -------------------------------------------------------------------------------- 1 | { 2 | "provider": "apple_pay", 3 | "data": { 4 | "merchantIdentifier": "merchant.com.sams.fish", 5 | "displayName": "Sam's Fish", 6 | "merchantCapabilities": ["3DS", "debit", "credit"], 7 | "supportedNetworks": ["amex", "visa", "discover", "masterCard"], 8 | "countryCode": "US", 9 | "currencyCode": "USD", 10 | "requiredBillingContactFields": ["post"], 11 | "requiredShippingContactFields": ["post", "phone", "email", "name"], 12 | "shippingMethods": [ 13 | { 14 | "amount": "0.00", 15 | "detail": "Available within an hour", 16 | "identifier": "in_store_pickup", 17 | "label": "In-Store Pickup" 18 | }, 19 | { 20 | "amount": "4.99", 21 | "detail": "5-8 Business Days", 22 | "identifier": "flat_rate_shipping_id_2", 23 | "label": "UPS Ground" 24 | }, 25 | { 26 | "amount": "29.99", 27 | "detail": "1-3 Business Days", 28 | "identifier": "flat_rate_shipping_id_1", 29 | "label": "FedEx Priority Mail" 30 | } 31 | ] 32 | } 33 | } -------------------------------------------------------------------------------- /assets/gpay.json: -------------------------------------------------------------------------------- 1 | { 2 | "provider": "google_pay", 3 | "data": { 4 | "environment": "TEST", 5 | "apiVersion": 2, 6 | "apiVersionMinor": 0, 7 | "allowedPaymentMethods": [ 8 | { 9 | "type": "CARD", 10 | "tokenizationSpecification": { 11 | "type": "PAYMENT_GATEWAY", 12 | "parameters": { 13 | "gateway": "example", 14 | "gatewayMerchantId": "gatewayMerchantId" 15 | } 16 | }, 17 | "parameters": { 18 | "allowedCardNetworks": ["VISA", "MASTERCARD"], 19 | "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], 20 | "billingAddressRequired": true, 21 | "billingAddressParameters": { 22 | "format": "FULL", 23 | "phoneNumberRequired": true 24 | } 25 | } 26 | } 27 | ], 28 | "merchantInfo": { 29 | "merchantId": "01234567890123456789", 30 | "merchantName": "Example Merchant Name" 31 | }, 32 | "transactionInfo": { 33 | "countryCode": "US", 34 | "currencyCode": "USD" 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:amazon_clone_flutter/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /server/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const path = require('path'); 3 | require('dotenv').config({ path: path.join(__dirname, '..', 'config.env') }) 4 | const mongoose = require("mongoose"); 5 | 6 | const authRouter = require('./routes/auth'); 7 | const adminRouter = require('./routes/admin'); 8 | const productRouter = require('./routes/product'); 9 | const userRouter = require('./routes/user'); 10 | const PORT = process.env.PORT || 3000; 11 | const app = express(); 12 | const userName = process.env.DB_USERNAME; 13 | const password = encodeURIComponent(process.env.DB_PASSWORD); 14 | 15 | 16 | const DB = `mongodb+srv://${userName}:${password}@cluster0.uznlvfp.mongodb.net/?retryWrites=true&w=majority`; 17 | 18 | // middleware 19 | app.use(express.json()); 20 | app.use(authRouter); 21 | app.use(adminRouter); 22 | app.use(productRouter); 23 | app.use(userRouter); 24 | 25 | mongoose.connect(DB).then(()=>{ 26 | console.log('Mongoose connected successfully'); 27 | }).catch((e) => { 28 | console.log(e); 29 | }) 30 | 31 | app.get("/flutterzon" , (req, res) => { 32 | res.send("Welcome to Flutterzon!"); 33 | }) 34 | 35 | app.listen(PORT, "0.0.0.0", () => { 36 | console.log(`connected at port: ${PORT}`) 37 | }); 38 | 39 | 40 | -------------------------------------------------------------------------------- /lib/features/home/widgets/top_categories.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/global_variables.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../../../constants/utils.dart'; 5 | import 'single_top_category_item.dart'; 6 | 7 | class TopCategories extends StatelessWidget { 8 | const TopCategories({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | height: 90, 14 | decoration: const BoxDecoration(gradient: GlobalVariables.goldenGradient), 15 | child: Center( 16 | child: ListView.builder( 17 | scrollDirection: Axis.horizontal, 18 | itemCount: GlobalVariables.categoryImages.length, 19 | itemBuilder: (context, index) { 20 | return GestureDetector( 21 | onTap: () => navigateToCategoryPage( 22 | context, GlobalVariables.categoryImages[index]['title']!), 23 | child: SingleTopCategoryItem( 24 | title: GlobalVariables.categoryImages[index]['title']!, 25 | image: GlobalVariables.categoryImages[index]['image']!, 26 | ), 27 | ); 28 | }), 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/features/account/widgets/account_screen_app_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../constants/global_variables.dart'; 4 | 5 | class AccuntScreenAppBar extends StatelessWidget { 6 | const AccuntScreenAppBar({ 7 | super.key, 8 | }); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return AppBar( 13 | flexibleSpace: Container( 14 | decoration: 15 | const BoxDecoration(gradient: GlobalVariables.appBarGradient), 16 | ), 17 | title: Row( 18 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 19 | children: [ 20 | Container( 21 | height: 45, 22 | width: 120, 23 | alignment: Alignment.centerLeft, 24 | child: Image.asset('assets/images/amazon_black_logo.png'), 25 | ), 26 | Row( 27 | children: [ 28 | IconButton( 29 | icon: const Icon(Icons.notifications_outlined), 30 | onPressed: () {}, 31 | ), 32 | IconButton( 33 | icon: const Icon(Icons.search), 34 | onPressed: () {}, 35 | ), 36 | ], 37 | ) 38 | ], 39 | ), 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/features/order_details/widgets/standard_delivery_container.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class StandardDeliveryContainer extends StatelessWidget { 4 | const StandardDeliveryContainer({ 5 | super.key, 6 | required this.containerDecoration, 7 | required this.textSyle, 8 | }); 9 | 10 | final BoxDecoration containerDecoration; 11 | final TextStyle textSyle; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Container( 16 | width: MediaQuery.sizeOf(context).width, 17 | padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12), 18 | alignment: Alignment.centerLeft, 19 | decoration: containerDecoration.copyWith( 20 | border: const Border( 21 | left: BorderSide(color: Colors.black12, width: 1), 22 | right: BorderSide(color: Colors.black12, width: 1), 23 | top: BorderSide(color: Colors.black12, width: 1), 24 | // bottom: BorderSide(color: Colors.black12, width: 0) 25 | ), 26 | borderRadius: const BorderRadius.only( 27 | topLeft: Radius.circular(5), topRight: Radius.circular(5)), 28 | ), 29 | child: Text( 30 | 'Standard Delivery', 31 | style: textSyle, 32 | textAlign: TextAlign.justify, 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib/common/widgets/custom_textfield.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomTextfield extends StatelessWidget { 4 | final TextEditingController controller; 5 | final String hintText; 6 | final int maxLines; 7 | const CustomTextfield( 8 | {super.key, 9 | required this.controller, 10 | required this.hintText, 11 | this.maxLines = 1}); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Padding( 16 | padding: const EdgeInsets.all(5), 17 | child: TextFormField( 18 | controller: controller, 19 | maxLines: maxLines, 20 | decoration: InputDecoration( 21 | // constraints: const BoxConstraints(minHeight: 70, maxHeight: 70), 22 | hintText: hintText, 23 | hintStyle: const TextStyle(fontWeight: FontWeight.w400), 24 | border: const OutlineInputBorder( 25 | borderSide: BorderSide(color: Colors.black38), 26 | ), 27 | enabledBorder: const OutlineInputBorder( 28 | borderSide: BorderSide(color: Colors.black38), 29 | ), 30 | ), 31 | validator: (val) { 32 | if (val == null || val.isEmpty) { 33 | return 'This field cannot be empty'; 34 | } 35 | return null; 36 | }, 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/features/cart/widgets/cart_subtotal.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/utils.dart'; 2 | import 'package:amazon_clone_flutter/providers/user_provider.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class CartSubtotal extends StatelessWidget { 7 | const CartSubtotal({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | final userProvider = context.watch().user; 12 | int sum = 0; 13 | 14 | userProvider.cart 15 | .map((e) => sum += e['quantity'] * e['product']['price'] as int) 16 | .toList(); 17 | 18 | return Row( 19 | crossAxisAlignment: CrossAxisAlignment.center, 20 | children: [ 21 | const Text( 22 | 'SubTotal ', 23 | style: TextStyle( 24 | fontSize: 20, 25 | fontWeight: FontWeight.normal, 26 | color: Colors.black87), 27 | ), 28 | const Text( 29 | '₹', 30 | style: TextStyle( 31 | fontSize: 18, color: Colors.black87, fontWeight: FontWeight.w400), 32 | ), 33 | Text( 34 | formatPriceWithDecimal(sum), 35 | style: const TextStyle( 36 | fontSize: 22, fontWeight: FontWeight.bold, color: Colors.black87), 37 | ), 38 | ], 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/features/home/widgets/single_bottom_offer.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/features/home/widgets/single_top_category_item.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../../../constants/global_variables.dart'; 5 | 6 | class SingleBottomOffer extends StatelessWidget { 7 | const SingleBottomOffer({ 8 | super.key, 9 | required this.mapName, 10 | }); 11 | 12 | final dynamic mapName; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Container( 17 | margin: const EdgeInsets.only(left: 4, right: 4), 18 | padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 4), 19 | width: 150, 20 | decoration: BoxDecoration( 21 | gradient: GlobalVariables.goldenGradient, 22 | borderRadius: BorderRadius.circular(4), 23 | ), 24 | child: GridView.builder( 25 | physics: const NeverScrollableScrollPhysics(), 26 | itemCount: 4, 27 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( 28 | mainAxisExtent: 85, crossAxisCount: 2), 29 | itemBuilder: (context, index) { 30 | return SingleTopCategoryItem( 31 | image: mapName[index]['image']!, 32 | title: mapName[index]['title']!, 33 | isBottomOffer: true, 34 | ); 35 | }, 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/common/widgets/custom_elevated_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../constants/global_variables.dart'; 4 | 5 | class CustomElevatedButton extends StatelessWidget { 6 | const CustomElevatedButton( 7 | {super.key, 8 | required this.buttonText, 9 | required this.onPressed, 10 | this.isRectangle = false, 11 | this.color = GlobalVariables.yellowColor}); 12 | 13 | final String buttonText; 14 | final Function()? onPressed; 15 | final Color color; 16 | final bool isRectangle; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return ElevatedButton( 21 | onPressed: onPressed, 22 | style: ButtonStyle( 23 | backgroundColor: MaterialStatePropertyAll(color), 24 | elevation: const MaterialStatePropertyAll(0), 25 | shape: MaterialStatePropertyAll(RoundedRectangleBorder( 26 | borderRadius: isRectangle 27 | ? const BorderRadius.all(Radius.circular(8)) 28 | : const BorderRadius.all(Radius.circular(25)))), 29 | fixedSize: MaterialStatePropertyAll( 30 | Size(MediaQuery.sizeOf(context).width, 45))), 31 | child: Text( 32 | buttonText, 33 | style: const TextStyle( 34 | color: Colors.black87, fontWeight: FontWeight.w400, fontSize: 16), 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"amazon_clone_flutter", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /lib/features/home/widgets/address_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/global_variables.dart'; 2 | import 'package:amazon_clone_flutter/constants/utils.dart'; 3 | import 'package:amazon_clone_flutter/providers/user_provider.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | 7 | class AddressBar extends StatelessWidget { 8 | const AddressBar({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | final user = Provider.of(context).user; 13 | 14 | return Container( 15 | padding: const EdgeInsets.symmetric(horizontal: 12), 16 | height: 40, 17 | decoration: 18 | const BoxDecoration(gradient: GlobalVariables.addressBarGradient), 19 | child: Row( 20 | children: [ 21 | const Icon( 22 | Icons.location_on_outlined, 23 | size: 20, 24 | ), 25 | const SizedBox( 26 | width: 10, 27 | ), 28 | Expanded( 29 | child: Text( 30 | 'Deliver to ${capitalizeFirstLetter(string: user.name)} - ${user.address}', 31 | overflow: TextOverflow.ellipsis, 32 | style: const TextStyle(fontWeight: FontWeight.normal), 33 | ), 34 | ), 35 | const Icon( 36 | Icons.expand_more, 37 | size: 20, 38 | ), 39 | ], 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/features/account/widgets/name_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/utils.dart'; 2 | import 'package:amazon_clone_flutter/providers/user_provider.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class NameBar extends StatelessWidget { 7 | const NameBar({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | final user = Provider.of(context).user.name; 12 | 13 | return Container( 14 | height: 120, 15 | padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 10), 16 | width: MediaQuery.sizeOf(context).width, 17 | decoration: const BoxDecoration( 18 | gradient: LinearGradient( 19 | begin: Alignment.topLeft, 20 | end: Alignment.bottomRight, 21 | colors: [ 22 | Color(0xff92DDE6), 23 | Color(0xffA6E6CE), 24 | ]), 25 | ), 26 | child: Row( 27 | crossAxisAlignment: CrossAxisAlignment.start, 28 | children: [ 29 | const Text( 30 | 'Hello, ', 31 | style: TextStyle(fontSize: 22, fontWeight: FontWeight.w400), 32 | ), 33 | Text( 34 | capitalizeFirstLetter(string: user), 35 | style: const TextStyle(fontSize: 22, fontWeight: FontWeight.bold), 36 | ), 37 | ], 38 | )); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/features/cart/widgets/custom_icon_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomIconbutton extends StatelessWidget { 4 | const CustomIconbutton({ 5 | super.key, 6 | required this.iconName, 7 | required this.isRight, 8 | }); 9 | 10 | final IconData iconName; 11 | final bool isRight; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Container( 16 | width: 35, 17 | height: 30, 18 | alignment: Alignment.center, 19 | decoration: BoxDecoration( 20 | border: Border.all(color: Colors.grey, width: 0.5), 21 | borderRadius: isRight 22 | ? const BorderRadius.only( 23 | topRight: Radius.circular(8), bottomRight: Radius.circular(8)) 24 | : const BorderRadius.only( 25 | topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)), 26 | boxShadow: [ 27 | BoxShadow( 28 | color: Colors.grey.shade200, 29 | blurRadius: 8, 30 | offset: const Offset(0, 2), 31 | ), 32 | ], 33 | gradient: const LinearGradient( 34 | begin: Alignment.topCenter, 35 | end: Alignment.bottomCenter, 36 | colors: [Color(0xffF7F8FA), Color(0xffE8E9ED)], 37 | stops: [0.2, 1]), 38 | ), 39 | child: Icon( 40 | iconName, 41 | size: 18, 42 | color: Colors.black, 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/features/order_details/widgets/track_update_shipment.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../constants/global_variables.dart'; 4 | import '../../../models/user.dart'; 5 | import '../screens/order_details.dart'; 6 | import '../screens/tracking_details_sceen.dart'; 7 | 8 | class TrackUpdateShipment extends StatelessWidget { 9 | const TrackUpdateShipment({ 10 | super.key, 11 | required this.widget, 12 | required this.user, 13 | required this.textSyle, 14 | }); 15 | 16 | final OrderDetailsScreen widget; 17 | final User user; 18 | final TextStyle textSyle; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Column( 23 | children: [ 24 | ListTile( 25 | onTap: () { 26 | Navigator.pushNamed(context, TrackingDetailsScreen.routeName, 27 | arguments: widget.order); 28 | }, 29 | title: Text( 30 | user.type == 'user' ? 'Track shipment' : 'Update shipment (admin)', 31 | style: user.type == 'user' 32 | ? textSyle 33 | : textSyle.copyWith(color: GlobalVariables.greenColor), 34 | ), 35 | style: ListTileStyle.list, 36 | trailing: Icon( 37 | Icons.chevron_right_rounded, 38 | color: user.type == 'user' 39 | ? Colors.black87 40 | : GlobalVariables.greenColor, 41 | ), 42 | ), 43 | ], 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/features/account/widgets/account_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../constants/global_variables.dart'; 4 | 5 | class AccountButton extends StatelessWidget { 6 | const AccountButton( 7 | {super.key, required this.buttonName, required this.onPressed}); 8 | 9 | final String buttonName; 10 | final VoidCallback onPressed; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Expanded( 15 | child: Container( 16 | height: 45, 17 | decoration: BoxDecoration( 18 | border: Border.all(color: Colors.grey.shade400, width: 0.5), 19 | borderRadius: BorderRadius.circular(50), 20 | color: Colors.white), 21 | child: OutlinedButton( 22 | onPressed: onPressed, 23 | style: ButtonStyle( 24 | splashFactory: NoSplash.splashFactory, 25 | overlayColor: MaterialStatePropertyAll(Colors.grey.shade100), 26 | backgroundColor: MaterialStatePropertyAll( 27 | Colors.grey.shade100.withOpacity(0.40)), 28 | side: const MaterialStatePropertyAll( 29 | BorderSide(color: GlobalVariables.greyBackgroundColor))), 30 | child: Text( 31 | buttonName, 32 | style: const TextStyle( 33 | fontWeight: FontWeight.normal, 34 | color: Colors.black, 35 | fontSize: 15), 36 | )), 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/app_theme.dart'; 2 | import 'package:amazon_clone_flutter/features/splash_screen/splash_screen.dart'; 3 | import 'package:amazon_clone_flutter/providers/cart_offers_provider.dart'; 4 | import 'package:amazon_clone_flutter/providers/screen_number_provider.dart'; 5 | import 'package:amazon_clone_flutter/providers/user_provider.dart'; 6 | import 'package:amazon_clone_flutter/router.dart'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter/services.dart'; 9 | 10 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 11 | import 'package:provider/provider.dart'; 12 | import 'constants/utils.dart'; 13 | 14 | Future main() async { 15 | await dotenv.load(fileName: "config.env"); 16 | await SystemChrome.setPreferredOrientations([ 17 | DeviceOrientation.portraitUp, 18 | ]); 19 | runApp(MultiProvider(providers: [ 20 | ChangeNotifierProvider(create: (context) => UserProvider()), 21 | ChangeNotifierProvider(create: (context) => ScreenNumberProvider()), 22 | ChangeNotifierProvider(create: (context) => CartOfferProvider()), 23 | ], child: const MyApp())); 24 | } 25 | 26 | class MyApp extends StatelessWidget { 27 | const MyApp({super.key}); 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | precacheAllImage(context); 32 | 33 | return MaterialApp( 34 | debugShowCheckedModeBanner: false, 35 | theme: AppTheme.light, 36 | onGenerateRoute: (settings) => generateRoute(settings), 37 | home: const SplashScreen()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /lib/features/cart/widgets/custom_text_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomTextButton extends StatelessWidget { 4 | const CustomTextButton( 5 | {super.key, 6 | required this.buttonText, 7 | required this.onPressed, 8 | this.isMenuScreenButton = false}); 9 | 10 | final String buttonText; 11 | final VoidCallback onPressed; 12 | final bool isMenuScreenButton; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return InkWell( 17 | onTap: onPressed, 18 | child: Container( 19 | margin: const EdgeInsets.all(4), 20 | padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), 21 | decoration: BoxDecoration( 22 | color: Colors.white, 23 | border: Border.all( 24 | color: const Color(0xffD5D9DA), 25 | ), 26 | borderRadius: BorderRadius.circular(8), 27 | boxShadow: [ 28 | isMenuScreenButton 29 | ? const BoxShadow() 30 | : BoxShadow( 31 | color: Colors.grey.shade200, 32 | blurRadius: 8, 33 | offset: const Offset(0, 2), 34 | ), 35 | ], 36 | ), 37 | child: Text( 38 | buttonText, 39 | textAlign: TextAlign.center, 40 | style: TextStyle( 41 | fontSize: isMenuScreenButton ? 14 : 13, 42 | fontWeight: FontWeight.w400, 43 | color: Colors.black87), 44 | ), 45 | ), 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /lib/features/home/widgets/carousel_image.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/global_variables.dart'; 2 | import 'package:carousel_slider/carousel_slider.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | import 'background_white_gradient.dart'; 6 | import 'bottom_offers.dart'; 7 | import 'custom_carousel_slider.dart'; 8 | import 'dots_indicator.dart'; 9 | 10 | class CarouselImage extends StatefulWidget { 11 | const CarouselImage({super.key}); 12 | 13 | @override 14 | State createState() => _CarouselImageState(); 15 | } 16 | 17 | class _CarouselImageState extends State { 18 | int _current = 0; 19 | final CarouselController _controller = CarouselController(); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Stack( 24 | children: [ 25 | CustomCarouselSliderMap( 26 | sliderImages: GlobalVariables.carouselImages, 27 | onPageChanged: (index, reason) { 28 | setState(() { 29 | _current = index; 30 | }); 31 | }), 32 | Positioned( 33 | top: 245, 34 | left: MediaQuery.sizeOf(context).width / 3.3, 35 | child: DotsIndicatorMap( 36 | controller: _controller, 37 | current: _current, 38 | sliderImages: GlobalVariables.carouselImages, 39 | ), 40 | ), 41 | const Positioned( 42 | bottom: 0, 43 | child: BackgroundWhiteGradient(), 44 | ), 45 | const Positioned( 46 | bottom: 0, 47 | child: BottomOffers(), 48 | ), 49 | ], 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/features/search/services/search_services.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:flutter/cupertino.dart'; 3 | import 'package:provider/provider.dart'; 4 | import 'package:http/http.dart' as http; 5 | import '../../../constants/error_handling.dart'; 6 | import '../../../constants/global_variables.dart'; 7 | import '../../../constants/utils.dart'; 8 | import '../../../models/product.dart'; 9 | import '../../../providers/user_provider.dart'; 10 | 11 | class SearchServices { 12 | Future> fetchSearchedProducts( 13 | {required BuildContext context, required String searchQuery}) async { 14 | final userProvider = Provider.of(context, listen: false); 15 | List productList = []; 16 | try { 17 | http.Response res = await http 18 | .get(Uri.parse('$uri/api/products/search/$searchQuery'), headers: { 19 | 'Content-Type': 'application/json; charset=UTF-8', 20 | 'x-auth-token': userProvider.user.token, 21 | }); 22 | 23 | if (context.mounted) { 24 | httpErrorHandle( 25 | response: res, 26 | context: context, 27 | onSuccess: () { 28 | for (int i = 0; i < jsonDecode(res.body).length; i++) { 29 | productList.add( 30 | Product.fromJson( 31 | jsonEncode( 32 | jsonDecode(res.body)[i], 33 | ), 34 | ), 35 | ); 36 | } 37 | }); 38 | } 39 | } catch (e) { 40 | if (context.mounted) { 41 | showSnackBar(context, e.toString()); 42 | } 43 | } 44 | 45 | return productList; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/features/order_details/widgets/shipping_address_block.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/utils.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../../../models/user.dart'; 5 | 6 | class ShippingAddressBlock extends StatelessWidget { 7 | const ShippingAddressBlock({ 8 | super.key, 9 | required this.headingTextSyle, 10 | required this.containerDecoration, 11 | required this.user, 12 | required this.textSyle, 13 | }); 14 | 15 | final TextStyle headingTextSyle; 16 | final BoxDecoration containerDecoration; 17 | final User user; 18 | final TextStyle textSyle; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Column( 23 | crossAxisAlignment: CrossAxisAlignment.start, 24 | children: [ 25 | Text('Shipping Address', style: headingTextSyle), 26 | const SizedBox(height: 6), 27 | Container( 28 | padding: const EdgeInsets.all(12), 29 | width: double.infinity, 30 | decoration: containerDecoration, 31 | child: 32 | Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ 33 | Text( 34 | capitalizeFirstLetter(string: user.name), 35 | style: textSyle.copyWith( 36 | color: Colors.black87, 37 | fontWeight: FontWeight.normal, 38 | ), 39 | ), 40 | Text( 41 | user.address, 42 | style: textSyle.copyWith( 43 | color: Colors.black87, 44 | fontWeight: FontWeight.normal, 45 | ), 46 | ) 47 | ]), 48 | ), 49 | ], 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/features/product_details/widgets/customer_ratings.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../common/widgets/stars.dart'; 4 | import '../../../models/product.dart'; 5 | 6 | class CustomerReviews extends StatelessWidget { 7 | const CustomerReviews({ 8 | super.key, 9 | required this.averageRating, 10 | required this.product, 11 | }); 12 | 13 | final double averageRating; 14 | final Product product; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Column( 19 | crossAxisAlignment: CrossAxisAlignment.start, 20 | children: [ 21 | const Text( 22 | 'Customer ratings', 23 | style: TextStyle( 24 | fontSize: 18, fontWeight: FontWeight.bold, color: Colors.black87), 25 | ), 26 | const SizedBox(height: 6), 27 | Row( 28 | children: [ 29 | Stars( 30 | rating: averageRating, 31 | size: 22, 32 | ), 33 | const SizedBox(width: 5), 34 | Text('${averageRating.toStringAsFixed(1)} out of 5', 35 | style: const TextStyle( 36 | fontSize: 16, 37 | fontWeight: FontWeight.w400, 38 | color: Colors.black87)), 39 | const SizedBox(width: 6), 40 | ], 41 | ), 42 | const SizedBox(height: 6), 43 | Text( 44 | '${product.rating!.length.toString()} global ratings', 45 | style: const TextStyle( 46 | color: Colors.black54, 47 | fontSize: 16, 48 | fontWeight: FontWeight.w500, 49 | ), 50 | ), 51 | ], 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /android/amazon_clone_flutter_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /lib/models/product.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:amazon_clone_flutter/models/rating.dart'; 3 | 4 | class Product { 5 | final String name; 6 | final String description; 7 | final int quantity; 8 | final List images; 9 | final String category; 10 | final double price; 11 | final String? id; 12 | final List? rating; 13 | 14 | Product( 15 | {required this.name, 16 | required this.description, 17 | required this.quantity, 18 | required this.images, 19 | required this.category, 20 | required this.price, 21 | this.id, 22 | this.rating}); 23 | 24 | Map toMap() { 25 | return { 26 | 'name': name, 27 | 'description': description, 28 | 'quantity': quantity, 29 | 'images': images, 30 | 'category': category, 31 | 'price': price, 32 | 'id': id, 33 | 'rating': rating, 34 | }; 35 | } 36 | 37 | factory Product.fromMap(Map map) { 38 | return Product( 39 | name: map['name'] ?? '', 40 | description: map['description'] ?? '', 41 | quantity: map['quantity']?.toInt() ?? 0, 42 | images: List.from(map['images']), 43 | category: map['category'] ?? '', 44 | price: map['price']?.toDouble() ?? 0.0, 45 | id: map['_id'], 46 | rating: map['ratings'] != null 47 | ? List.from( 48 | map['ratings']?.map( 49 | (x) => Rating.fromMap(x), 50 | ), 51 | ) 52 | : null); 53 | } 54 | 55 | String toJson() => json.encode(toMap()); 56 | 57 | factory Product.fromJson(String source) => 58 | Product.fromMap(json.decode(source)); 59 | } 60 | -------------------------------------------------------------------------------- /lib/models/order.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:amazon_clone_flutter/models/product.dart'; 3 | 4 | class Order { 5 | final String id; 6 | final List products; 7 | final List quantity; 8 | final String address; 9 | final String userId; 10 | final int orderedAt; 11 | final int status; 12 | final double totalPrice; 13 | Order({ 14 | required this.id, 15 | required this.products, 16 | required this.quantity, 17 | required this.address, 18 | required this.userId, 19 | required this.orderedAt, 20 | required this.status, 21 | required this.totalPrice, 22 | }); 23 | 24 | Map toMap() { 25 | return { 26 | 'id': id, 27 | 'products': products.map((x) => x.toMap()).toList(), 28 | 'quantity': quantity, 29 | 'address': address, 30 | 'userId': userId, 31 | 'orderedAt': orderedAt, 32 | 'status': status, 33 | 'totalPrice': totalPrice, 34 | }; 35 | } 36 | 37 | factory Order.fromMap(Map map) { 38 | return Order( 39 | id: map['_id'] ?? '', 40 | products: List.from( 41 | map['products']?.map((x) => Product.fromMap(x['product']))), 42 | quantity: List.from( 43 | map['products']?.map( 44 | (x) => x['quantity'], 45 | ), 46 | ), 47 | address: map['address'] ?? '', 48 | userId: map['userId'] ?? '', 49 | orderedAt: map['orderedAt']?.toInt() ?? 0, 50 | status: map['status']?.toInt() ?? 0, 51 | totalPrice: map['totalPrice']?.toDouble() ?? 0.0, 52 | ); 53 | } 54 | 55 | String toJson() => json.encode(toMap()); 56 | 57 | factory Order.fromJson(String source) => Order.fromMap(json.decode(source)); 58 | } 59 | -------------------------------------------------------------------------------- /lib/features/account/widgets/top_buttons.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/features/account/screens/wish_list_screen.dart'; 2 | import 'package:amazon_clone_flutter/features/account/services/account_services.dart'; 3 | import 'package:amazon_clone_flutter/features/account/widgets/account_button.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | import '../screens/your_orders.dart'; 7 | 8 | class TopButtons extends StatelessWidget { 9 | const TopButtons({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Column( 14 | children: [ 15 | Row( 16 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 17 | children: [ 18 | AccountButton( 19 | buttonName: 'Your Orders', 20 | onPressed: () => 21 | Navigator.pushNamed(context, YourOrders.routeName)), 22 | const SizedBox( 23 | width: 10, 24 | ), 25 | AccountButton(buttonName: 'Buy Again', onPressed: () {}), 26 | ], 27 | ), 28 | const SizedBox( 29 | height: 10, 30 | ), 31 | Row( 32 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 33 | children: [ 34 | AccountButton( 35 | buttonName: 'Log Out', 36 | onPressed: () => AccountServices().logOut(context)), 37 | const SizedBox( 38 | width: 10, 39 | ), 40 | AccountButton( 41 | buttonName: 'Wish List', 42 | onPressed: () { 43 | Navigator.pushNamed(context, WishListScreen.routeName); 44 | }), 45 | ], 46 | ), 47 | ], 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /server/model/user.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | const {productSchema} = require("./product"); 3 | 4 | const userSchema = mongoose.Schema({ 5 | name:{ 6 | require: true, 7 | type: String, 8 | trim: true, 9 | }, 10 | email : { 11 | require: true, 12 | type: String, 13 | trim: true, 14 | validate : { 15 | validator : (value) => { 16 | const re = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i; 17 | return value.match(re); 18 | }, 19 | message : 'Please enter a valid email address', 20 | } 21 | }, 22 | password : { 23 | require : true, 24 | type : String, 25 | validate : { 26 | validator : (value) => { 27 | if(value.length < 6){ 28 | return 'Password must have at least 6 characters from model'; 29 | } 30 | }, 31 | } 32 | 33 | }, 34 | address : { 35 | type : String, 36 | default : '', 37 | }, 38 | type : { 39 | type: String, 40 | default : 'user', 41 | }, 42 | cart : [{ 43 | 44 | product : productSchema, 45 | quantity : { 46 | type: Number, 47 | required : true, 48 | } 49 | 50 | 51 | }], 52 | saveForLater : [{ 53 | 54 | product : productSchema, 55 | }], 56 | 57 | keepShoppingFor : [{ 58 | product : productSchema, 59 | }], 60 | wishList : [{ 61 | product : productSchema, 62 | }] 63 | 64 | }) 65 | 66 | const User = mongoose.model("User", userSchema); 67 | 68 | module.exports = User; 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 17 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 18 | - platform: android 19 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 20 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 21 | - platform: ios 22 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 23 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 24 | - platform: linux 25 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 26 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 27 | - platform: macos 28 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 29 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 30 | - platform: web 31 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 32 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 33 | - platform: windows 34 | create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 35 | base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /lib/features/product_details/widgets/product_quality_icons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../constants/global_variables.dart'; 4 | 5 | class ProductQualityIcons extends StatelessWidget { 6 | const ProductQualityIcons({ 7 | super.key, 8 | }); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return SizedBox( 13 | height: 100, 14 | child: ListView.builder( 15 | itemCount: GlobalVariables.productQualityDetails.length, 16 | scrollDirection: Axis.horizontal, 17 | itemBuilder: ((context, index) { 18 | final iconMapPath = 19 | GlobalVariables.productQualityDetails[index]['iconName']!; 20 | final titleMapPath = 21 | GlobalVariables.productQualityDetails[index]['title']!; 22 | return SizedBox( 23 | width: 100, 24 | child: Column( 25 | mainAxisAlignment: MainAxisAlignment.start, 26 | crossAxisAlignment: CrossAxisAlignment.center, 27 | children: [ 28 | Image.asset( 29 | 'assets/images/product_quality_icons/$iconMapPath', 30 | height: 45, 31 | width: 45, 32 | ), 33 | Text( 34 | titleMapPath, 35 | textAlign: TextAlign.center, 36 | overflow: TextOverflow.ellipsis, 37 | maxLines: 3, 38 | style: TextStyle( 39 | letterSpacing: 0, 40 | height: 0, 41 | wordSpacing: 0, 42 | color: GlobalVariables.selectedNavBarColor, 43 | fontSize: 14), 44 | ) 45 | ], 46 | ), 47 | ); 48 | })), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Flutterzon 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Flutterzon 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /lib/features/home/widgets/search_text_form_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../constants/global_variables.dart'; 4 | 5 | class SearchTextFormField extends StatelessWidget { 6 | SearchTextFormField({super.key, required this.onTapSearchField}); 7 | 8 | final Function(String)? onTapSearchField; 9 | 10 | final OutlineInputBorder textFieldStyle = OutlineInputBorder( 11 | borderRadius: BorderRadius.circular(8), 12 | borderSide: const BorderSide(color: Colors.grey)); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return TextFormField( 17 | onFieldSubmitted: onTapSearchField, 18 | style: 19 | const TextStyle(fontWeight: FontWeight.normal, color: Colors.black), 20 | cursorColor: GlobalVariables.selectedNavBarColor, 21 | decoration: InputDecoration( 22 | filled: true, 23 | fillColor: Colors.white, 24 | hintText: 'Search Amazon.in', 25 | hintStyle: const TextStyle( 26 | color: Colors.black45, fontWeight: FontWeight.normal), 27 | constraints: const BoxConstraints(maxHeight: 45, minHeight: 45), 28 | prefixIcon: const Icon(Icons.search), 29 | focusedBorder: textFieldStyle, 30 | enabledBorder: textFieldStyle, 31 | border: textFieldStyle, 32 | contentPadding: const EdgeInsets.only(top: 3), 33 | suffixIcon: const SizedBox( 34 | width: 75, 35 | child: Row( 36 | children: [ 37 | Icon( 38 | Icons.center_focus_strong_outlined, 39 | color: Colors.grey, 40 | ), 41 | Spacer(), 42 | Icon( 43 | Icons.mic_outlined, 44 | color: Colors.grey, 45 | ), 46 | SizedBox( 47 | width: 10, 48 | ) 49 | ], 50 | ), 51 | ), 52 | ), 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/features/order_details/widgets/shipment_details.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../constants/global_variables.dart'; 4 | 5 | class ShipmentStatus extends StatelessWidget { 6 | const ShipmentStatus({ 7 | super.key, 8 | required this.currentStep, 9 | required this.textSyle, 10 | }); 11 | 12 | final int currentStep; 13 | final TextStyle textSyle; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Column( 18 | crossAxisAlignment: CrossAxisAlignment.start, 19 | children: [ 20 | currentStep == 1 || currentStep == 0 21 | ? Text( 22 | 'Received', 23 | style: textSyle.copyWith( 24 | fontSize: 18, 25 | fontWeight: FontWeight.bold, 26 | color: GlobalVariables.greenColor), 27 | ) 28 | : currentStep == 2 29 | ? Text( 30 | 'Dispatched', 31 | style: textSyle.copyWith( 32 | fontSize: 18, 33 | fontWeight: FontWeight.bold, 34 | color: GlobalVariables.greenColor), 35 | ) 36 | : currentStep == 3 37 | ? Text( 38 | 'In Transit', 39 | style: textSyle.copyWith( 40 | fontSize: 18, 41 | fontWeight: FontWeight.bold, 42 | color: GlobalVariables.greenColor), 43 | ) 44 | : Text( 45 | 'Delivered', 46 | style: textSyle.copyWith( 47 | fontSize: 18, 48 | fontWeight: FontWeight.bold, 49 | color: GlobalVariables.greenColor), 50 | ), 51 | ], 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /lib/features/more/widgets/pay_containers.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/utils.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class PayContainers extends StatelessWidget { 5 | const PayContainers({ 6 | super.key, 7 | required this.imagepath, 8 | required this.belowText, 9 | required this.onPressedString, 10 | }); 11 | 12 | final String imagepath; 13 | final String belowText; 14 | final String onPressedString; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Expanded( 19 | child: GestureDetector( 20 | onTap: () { 21 | if (context.mounted) { 22 | showSnackBar(context, '$onPressedString coming soon!'); 23 | } 24 | }, 25 | child: Container( 26 | padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 14), 27 | decoration: BoxDecoration( 28 | boxShadow: const [ 29 | BoxShadow( 30 | color: Colors.grey, 31 | offset: Offset(0, 3), // Adjust shadow offset 32 | blurRadius: 3, // Adjust blur radius 33 | spreadRadius: 0, // Adjust spread radius 34 | ), 35 | ], 36 | color: const Color(0xffF6FAFB), 37 | border: Border.all(color: const Color(0xffD6DADB), width: 0.5), 38 | borderRadius: BorderRadius.circular(8), 39 | ), 40 | child: Column( 41 | children: [ 42 | Image.asset(imagepath, height: 45), 43 | const SizedBox( 44 | height: 10, 45 | ), 46 | Text( 47 | belowText, 48 | textAlign: TextAlign.center, 49 | style: const TextStyle( 50 | fontSize: 14, 51 | fontWeight: FontWeight.normal, 52 | color: Colors.black87), 53 | ) 54 | ], 55 | ), 56 | ), 57 | ), 58 | ); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length <= 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /lib/features/splash_screen/splash_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/common/widgets/bottom_bar.dart'; 2 | import 'package:amazon_clone_flutter/features/admin/screens/bottom_bar.dart'; 3 | import 'package:amazon_clone_flutter/features/auth/screens/auth_screen.dart'; 4 | import 'package:amazon_clone_flutter/features/auth/services/auth_service.dart'; 5 | import 'package:amazon_clone_flutter/models/user.dart'; 6 | import 'package:flutter/material.dart'; 7 | 8 | class SplashScreen extends StatelessWidget { 9 | const SplashScreen({ 10 | super.key, 11 | }); 12 | 13 | // @override 14 | @override 15 | Widget build(BuildContext context) { 16 | return Scaffold( 17 | body: FutureBuilder( 18 | future: AuthService().getUserData(context), 19 | builder: (context, snapshot) { 20 | if (snapshot.hasData) { 21 | Future.delayed(Duration.zero, () { 22 | if (snapshot.data!.type == 'admin') { 23 | Navigator.pushReplacement( 24 | context, 25 | MaterialPageRoute( 26 | builder: (context) => const AdminScreen())); 27 | } else if (snapshot.data!.type == 'user') { 28 | Navigator.pushReplacement(context, 29 | MaterialPageRoute(builder: (context) => const BottomBar())); 30 | } else { 31 | Navigator.pushReplacement( 32 | context, 33 | MaterialPageRoute( 34 | builder: (context) => const AuthScreen())); 35 | } 36 | }); 37 | 38 | return Center( 39 | child: Image.asset( 40 | 'assets/images/amazon_in_alt.png', 41 | height: 52, 42 | )); 43 | } else { 44 | return Center( 45 | child: Image.asset( 46 | 'assets/images/amazon_in_alt.png', 47 | height: 52, 48 | )); 49 | } 50 | }, 51 | ), 52 | ); 53 | } 54 | } 55 | 56 | late final User user; 57 | -------------------------------------------------------------------------------- /lib/features/product_details/widgets/you_might_also_like.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../common/widgets/you_might_also_like_single.dart'; 4 | import '../../../models/product.dart'; 5 | import '../screens/product_details_screen.dart'; 6 | 7 | class YouMightAlsoLike extends StatelessWidget { 8 | const YouMightAlsoLike({ 9 | super.key, 10 | required this.categoryProductList, 11 | required this.deliveryDate, 12 | }); 13 | 14 | final List? categoryProductList; 15 | final String deliveryDate; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Column( 20 | crossAxisAlignment: CrossAxisAlignment.start, 21 | children: [ 22 | const Text( 23 | 'You might also like', 24 | style: TextStyle( 25 | fontSize: 20, fontWeight: FontWeight.bold, color: Colors.black87), 26 | ), 27 | const SizedBox(height: 8), 28 | categoryProductList == null 29 | ? const Center( 30 | child: CircularProgressIndicator(), 31 | ) 32 | : SizedBox( 33 | height: 250, 34 | child: ListView.builder( 35 | scrollDirection: Axis.horizontal, 36 | itemCount: categoryProductList!.length, 37 | itemBuilder: ((context, index) { 38 | Product productData = categoryProductList![index]; 39 | 40 | return GestureDetector( 41 | onTap: () { 42 | Navigator.pushNamed( 43 | context, ProductDetailsScreen.routeName, 44 | arguments: { 45 | 'product': productData, 46 | 'deliveryDate': deliveryDate, 47 | }); 48 | }, 49 | child: YouMightAlsoLikeSingle(product: productData)); 50 | })), 51 | ), 52 | ], 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | amazon_clone_flutter 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /lib/features/order_details/widgets/you_might_also_like_block.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/utils.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../../../common/widgets/you_might_also_like_single.dart'; 5 | import '../../../models/product.dart'; 6 | 7 | class YouMightAlsoLikeBlock extends StatelessWidget { 8 | const YouMightAlsoLikeBlock({ 9 | super.key, 10 | required this.headingTextSyle, 11 | required this.categoryProductList, 12 | }); 13 | 14 | final TextStyle headingTextSyle; 15 | final List? categoryProductList; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Column( 20 | crossAxisAlignment: CrossAxisAlignment.start, 21 | children: [ 22 | Text( 23 | 'You might also like', 24 | style: headingTextSyle, 25 | ), 26 | const SizedBox( 27 | height: 10, 28 | ), 29 | categoryProductList == null 30 | ? const Center(child: CircularProgressIndicator()) 31 | : SizedBox( 32 | height: 250, 33 | child: ListView.builder( 34 | itemCount: categoryProductList!.length, 35 | scrollDirection: Axis.horizontal, 36 | itemBuilder: ((context, index) { 37 | Product productData = categoryProductList![index]; 38 | return categoryProductList == null 39 | ? const Center(child: CircularProgressIndicator()) 40 | : InkWell( 41 | onTap: () { 42 | navigateToProductDetails( 43 | context: context, 44 | product: productData, 45 | deliveryDate: 'Null for now'); 46 | }, 47 | child: 48 | YouMightAlsoLikeSingle(product: productData)); 49 | })), 50 | ) 51 | ], 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | return true; 35 | } 36 | 37 | void FlutterWindow::OnDestroy() { 38 | if (flutter_controller_) { 39 | flutter_controller_ = nullptr; 40 | } 41 | 42 | Win32Window::OnDestroy(); 43 | } 44 | 45 | LRESULT 46 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 47 | WPARAM const wparam, 48 | LPARAM const lparam) noexcept { 49 | // Give Flutter, including plugins, an opportunity to handle window messages. 50 | if (flutter_controller_) { 51 | std::optional result = 52 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 53 | lparam); 54 | if (result) { 55 | return *result; 56 | } 57 | } 58 | 59 | switch (message) { 60 | case WM_FONTCHANGE: 61 | flutter_controller_->engine()->ReloadSystemFonts(); 62 | break; 63 | } 64 | 65 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 66 | } 67 | -------------------------------------------------------------------------------- /lib/features/home/widgets/single_image_offer.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../screens/category_deals_screen.dart'; 5 | 6 | class SingleImageOffer extends StatelessWidget { 7 | const SingleImageOffer({ 8 | super.key, 9 | required this.headTitle, 10 | required this.subTitle, 11 | required this.productCategory, 12 | required this.image, 13 | }); 14 | 15 | final String headTitle; 16 | final String subTitle; 17 | final String image; 18 | final String productCategory; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | void goToCateogryDealsScreen() { 23 | Navigator.pushNamed(context, CategoryDealsScreen.routeName, 24 | arguments: productCategory); 25 | } 26 | 27 | return Column( 28 | crossAxisAlignment: CrossAxisAlignment.start, 29 | children: [ 30 | const SizedBox( 31 | height: 12, 32 | ), 33 | Text( 34 | headTitle, 35 | style: const TextStyle(fontWeight: FontWeight.w600, fontSize: 16), 36 | ), 37 | Text( 38 | subTitle, 39 | style: const TextStyle(fontWeight: FontWeight.normal, fontSize: 14), 40 | ), 41 | const SizedBox( 42 | height: 12, 43 | ), 44 | Container( 45 | decoration: BoxDecoration( 46 | color: Colors.transparent, 47 | borderRadius: BorderRadius.circular(20), 48 | ), 49 | child: InkWell( 50 | onTap: () => goToCateogryDealsScreen(), 51 | child: ClipRRect( 52 | borderRadius: BorderRadius.circular(5), 53 | child: CachedNetworkImage( 54 | fit: BoxFit.fill, 55 | imageUrl: image, 56 | placeholder: (context, url) => 57 | const CircularProgressIndicator(), 58 | errorWidget: (context, url, error) => const Icon(Icons.error), 59 | ), 60 | ), 61 | ), 62 | ), 63 | const SizedBox( 64 | height: 10, 65 | ), 66 | ], 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/features/home/widgets/bottom_offers.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/constants/utils.dart'; 2 | import 'package:amazon_clone_flutter/features/home/screens/category_deals_screen.dart'; 3 | import 'package:cached_network_image/cached_network_image.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | import '../../../constants/global_variables.dart'; 7 | 8 | class BottomOffers extends StatelessWidget { 9 | const BottomOffers({ 10 | super.key, 11 | }); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return SizedBox( 16 | height: 180, 17 | width: MediaQuery.sizeOf(context).width, 18 | child: ListView.builder( 19 | padding: const EdgeInsets.only(left: 4, right: 0), 20 | itemCount: GlobalVariables.bottomOfferImages.length, 21 | scrollDirection: Axis.horizontal, 22 | itemBuilder: ((context, index) { 23 | // if (index == 0) { 24 | // return const Row( 25 | // children: [ 26 | // SingleBottomOffer( 27 | // mapName: GlobalVariables.bottomOffersAmazonPay, 28 | // ), 29 | // ], 30 | // ); 31 | // } else { 32 | return Container( 33 | padding: const EdgeInsets.symmetric(horizontal: 4), 34 | child: InkWell( 35 | onTap: () { 36 | if (GlobalVariables.bottomOfferImages[index]['category'] == 37 | 'AmazonPay') { 38 | if (context.mounted) { 39 | showSnackBar(context, 'Amazon Pay coming soon!'); 40 | } 41 | } else { 42 | Navigator.pushNamed(context, CategoryDealsScreen.routeName, 43 | arguments: GlobalVariables.bottomOfferImages[index] 44 | ['category']); 45 | } 46 | }, 47 | child: CachedNetworkImage( 48 | imageUrl: GlobalVariables.bottomOfferImages[index]['image']!, 49 | placeholder: (context, url) => const SizedBox(), 50 | errorWidget: (context, url, error) => const Icon(Icons.error), 51 | ), 52 | ), 53 | ); 54 | // } 55 | }), 56 | ), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/features/order_details/widgets/order_summary_block.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../../constants/utils.dart'; 4 | import '../screens/order_details.dart'; 5 | import 'order_summary_row.dart'; 6 | import 'order_summary_total.dart.dart'; 7 | 8 | class OrderSummaryBlock extends StatelessWidget { 9 | const OrderSummaryBlock({ 10 | super.key, 11 | required this.headingTextSyle, 12 | required this.containerDecoration, 13 | required this.totalQuantity, 14 | required this.textSyle, 15 | required this.widget, 16 | }); 17 | 18 | final TextStyle headingTextSyle; 19 | final BoxDecoration containerDecoration; 20 | final int totalQuantity; 21 | final TextStyle textSyle; 22 | final OrderDetailsScreen widget; 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Column( 27 | crossAxisAlignment: CrossAxisAlignment.start, 28 | children: [ 29 | Text('Order Summary', style: headingTextSyle), 30 | const SizedBox(height: 6), 31 | Container( 32 | padding: const EdgeInsets.all(12), 33 | width: double.infinity, 34 | decoration: containerDecoration, 35 | child: 36 | Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ 37 | OrderSummaryRow( 38 | firstText: 'Items:', 39 | secondText: totalQuantity.toString(), 40 | textSyle: textSyle, 41 | widget: widget), 42 | OrderSummaryRow( 43 | firstText: 'Postage & Packing:', 44 | secondText: '₹0', 45 | textSyle: textSyle, 46 | widget: widget), 47 | OrderSummaryRow( 48 | firstText: 'Sub total:', 49 | secondText: 50 | '₹${formatPriceWithDecimal(widget.order.totalPrice)}', 51 | textSyle: textSyle, 52 | widget: widget), 53 | OrderSummaryTotal( 54 | firstText: 'Order Total:', 55 | secondText: 56 | '₹${formatPriceWithDecimal(widget.order.totalPrice)}', 57 | headingTextSyle: headingTextSyle, 58 | widget: widget), 59 | ]), 60 | ), 61 | ], 62 | ); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /lib/features/order_details/widgets/ordered_products.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../../constants/utils.dart'; 3 | import '../screens/order_details.dart'; 4 | 5 | class OrderedProducts extends StatelessWidget { 6 | const OrderedProducts({ 7 | super.key, 8 | required this.widget, 9 | required this.textSyle, 10 | }); 11 | 12 | final OrderDetailsScreen widget; 13 | final TextStyle textSyle; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Column( 18 | children: [ 19 | for (int i = 0; i < widget.order.products.length; i++) 20 | Padding( 21 | padding: const EdgeInsets.all(8.0), 22 | child: GestureDetector( 23 | onTap: () { 24 | navigateToProductDetails( 25 | context: context, 26 | product: widget.order.products[i], 27 | deliveryDate: getDeliveryDate()); 28 | }, 29 | child: Row( 30 | children: [ 31 | Image.network( 32 | widget.order.products[i].images[0], 33 | height: 110, 34 | width: 100, 35 | fit: BoxFit.contain, 36 | // width: 120, 37 | ), 38 | const SizedBox(width: 20), 39 | Expanded( 40 | child: Column( 41 | crossAxisAlignment: CrossAxisAlignment.start, 42 | children: [ 43 | Text( 44 | widget.order.products[i].name, 45 | maxLines: 2, 46 | overflow: TextOverflow.ellipsis, 47 | style: const TextStyle( 48 | fontSize: 16, fontWeight: FontWeight.bold), 49 | ), 50 | const SizedBox( 51 | height: 8, 52 | ), 53 | Text('Qty. ${widget.order.quantity[i]}'), 54 | ], 55 | ), 56 | ), 57 | const SizedBox(width: 20), 58 | Text( 59 | '₹${formatPrice(widget.order.products[i].price)}', 60 | style: textSyle.copyWith(fontSize: 16), 61 | ), 62 | ], 63 | ), 64 | ), 65 | ), 66 | ], 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | namespace "com.example.amazon_clone_flutter" 30 | compileSdkVersion flutter.compileSdkVersion 31 | ndkVersion flutter.ndkVersion 32 | 33 | compileOptions { 34 | sourceCompatibility JavaVersion.VERSION_1_8 35 | targetCompatibility JavaVersion.VERSION_1_8 36 | } 37 | 38 | kotlinOptions { 39 | jvmTarget = '1.8' 40 | } 41 | 42 | sourceSets { 43 | main.java.srcDirs += 'src/main/kotlin' 44 | } 45 | 46 | defaultConfig { 47 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 48 | applicationId "com.tejasbadone.flutterzon_provider" 49 | // You can update the following values to match your application needs. 50 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 51 | minSdkVersion 21 52 | targetSdkVersion flutter.targetSdkVersion 53 | versionCode flutterVersionCode.toInteger() 54 | versionName flutterVersionName 55 | } 56 | 57 | buildTypes { 58 | release { 59 | // TODO: Add your own signing config for the release build. 60 | // Signing with the debug keys for now, so `flutter run --release` works. 61 | signingConfig signingConfigs.debug 62 | } 63 | } 64 | } 65 | 66 | flutter { 67 | source '../..' 68 | } 69 | 70 | dependencies { 71 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 72 | } 73 | -------------------------------------------------------------------------------- /lib/features/account/screens/wish_list_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | 4 | import '../../../common/widgets/custom_app_bar.dart'; 5 | import '../../../constants/utils.dart'; 6 | import '../../../models/product.dart'; 7 | import '../../../providers/user_provider.dart'; 8 | import '../widgets/single_wish_list_product.dart'; 9 | 10 | class WishListScreen extends StatefulWidget { 11 | static const String routeName = '/wish-list-screen'; 12 | 13 | const WishListScreen({super.key}); 14 | 15 | @override 16 | State createState() => _WishListScreenState(); 17 | } 18 | 19 | class _WishListScreenState extends State { 20 | @override 21 | Widget build(BuildContext context) { 22 | final userProvider = Provider.of(context); 23 | return Scaffold( 24 | appBar: const PreferredSize( 25 | preferredSize: Size.fromHeight(60), 26 | child: CustomAppBar(), 27 | ), 28 | body: SingleChildScrollView( 29 | child: Padding( 30 | padding: const EdgeInsets.all(12), 31 | child: Column( 32 | crossAxisAlignment: CrossAxisAlignment.start, 33 | children: [ 34 | const Text( 35 | 'Your Wish List', 36 | style: TextStyle( 37 | fontSize: 20, 38 | fontWeight: FontWeight.w500, 39 | color: Colors.black87), 40 | ), 41 | const SizedBox(height: 10), 42 | userProvider.user.wishList.isEmpty 43 | ? const Center( 44 | child: Text( 45 | 'Your wishlist is empty.', 46 | style: TextStyle(fontSize: 14, color: Colors.black87), 47 | ), 48 | ) 49 | : ListView.builder( 50 | shrinkWrap: true, 51 | physics: const NeverScrollableScrollPhysics(), 52 | itemCount: userProvider.user.wishList.length, 53 | itemBuilder: ((context, index) { 54 | Product product = Product.fromMap( 55 | userProvider.user.wishList[index]['product']); 56 | 57 | return SingleWishListProduct( 58 | product: product, deliveryDate: getDeliveryDate()); 59 | })), 60 | ], 61 | ), 62 | ), 63 | ), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/features/home/widgets/custom_carousel_slider.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/features/home/screens/category_deals_screen.dart'; 2 | import 'package:cached_network_image/cached_network_image.dart'; 3 | import 'package:carousel_slider/carousel_slider.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class CustomCarouselSliderMap extends StatelessWidget { 7 | const CustomCarouselSliderMap( 8 | {super.key, required this.onPageChanged, required this.sliderImages}); 9 | 10 | final List> sliderImages; 11 | 12 | final Function(int p1, CarouselPageChangedReason p2) onPageChanged; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return CarouselSlider( 17 | items: sliderImages.map((i) { 18 | return Builder(builder: (context) { 19 | return GestureDetector( 20 | onTap: () { 21 | Navigator.pushNamed(context, CategoryDealsScreen.routeName, 22 | arguments: i['category']); 23 | }, 24 | child: CachedNetworkImage( 25 | imageUrl: i['image']!, 26 | fit: BoxFit.contain, 27 | alignment: Alignment.topCenter, 28 | placeholder: (context, url) => const SizedBox(), 29 | errorWidget: (context, url, error) => const Icon(Icons.error), 30 | ), 31 | ); 32 | }); 33 | }).toList(), 34 | options: CarouselOptions( 35 | height: 450, viewportFraction: 1, onPageChanged: onPageChanged), 36 | ); 37 | } 38 | } 39 | 40 | class CustomCarouselSliderList extends StatelessWidget { 41 | const CustomCarouselSliderList({ 42 | super.key, 43 | required this.sliderImages, 44 | required this.onPageChanged, 45 | }); 46 | 47 | final List sliderImages; 48 | final Function(int p1, CarouselPageChangedReason p2) onPageChanged; 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | return CarouselSlider( 53 | items: sliderImages.map((i) { 54 | return Builder(builder: (context) { 55 | return CachedNetworkImage( 56 | imageUrl: i, 57 | fit: BoxFit.contain, 58 | alignment: Alignment.topCenter, 59 | placeholder: (context, url) => const SizedBox(), 60 | errorWidget: (context, url, error) => const Icon(Icons.error), 61 | ); 62 | }); 63 | }).toList(), 64 | options: CarouselOptions( 65 | height: 450, viewportFraction: 1, onPageChanged: onPageChanged), 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/features/home/widgets/dots_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:carousel_slider/carousel_controller.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | import '../../../constants/global_variables.dart'; 5 | 6 | class DotsIndicatorMap extends StatelessWidget { 7 | const DotsIndicatorMap({ 8 | super.key, 9 | required this.controller, 10 | required this.current, 11 | required this.sliderImages, 12 | }); 13 | 14 | final CarouselController controller; 15 | final int current; 16 | final List> sliderImages; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Row( 21 | mainAxisAlignment: MainAxisAlignment.center, 22 | children: sliderImages.asMap().entries.map((entry) { 23 | return GestureDetector( 24 | onTap: () => controller.animateToPage(entry.key), 25 | child: Container( 26 | width: 9.0, 27 | height: 9.0, 28 | margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0), 29 | decoration: BoxDecoration( 30 | border: Border.all(color: Colors.grey), 31 | shape: BoxShape.circle, 32 | color: current == entry.key 33 | ? GlobalVariables.selectedNavBarColor 34 | : Colors.white), 35 | ), 36 | ); 37 | }).toList(), 38 | ); 39 | } 40 | } 41 | 42 | class DotsIndicatorList extends StatelessWidget { 43 | const DotsIndicatorList({ 44 | super.key, 45 | required this.controller, 46 | required this.current, 47 | required this.sliderImages, 48 | }); 49 | 50 | final CarouselController controller; 51 | final int current; 52 | final List sliderImages; 53 | 54 | @override 55 | Widget build(BuildContext context) { 56 | return Row( 57 | mainAxisAlignment: MainAxisAlignment.center, 58 | children: sliderImages.asMap().entries.map((entry) { 59 | return GestureDetector( 60 | onTap: () => controller.animateToPage(entry.key), 61 | child: Container( 62 | width: 9.0, 63 | height: 9.0, 64 | margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0), 65 | decoration: BoxDecoration( 66 | border: Border.all(color: Colors.grey), 67 | shape: BoxShape.circle, 68 | color: current == entry.key 69 | ? GlobalVariables.selectedNavBarColor 70 | : Colors.white), 71 | ), 72 | ); 73 | }).toList(), 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/features/account/screens/search_orders_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/common/widgets/custom_app_bar.dart'; 2 | import 'package:amazon_clone_flutter/features/account/services/account_services.dart'; 3 | import 'package:amazon_clone_flutter/features/account/widgets/order_list_single.dart'; 4 | import 'package:amazon_clone_flutter/models/order.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class SearchOrderScreeen extends StatefulWidget { 8 | static const String routeName = '/search-order-screen'; 9 | const SearchOrderScreeen({super.key, required this.orderQuery}); 10 | 11 | final String orderQuery; 12 | 13 | @override 14 | State createState() => _SearchOrderScreeenState(); 15 | } 16 | 17 | class _SearchOrderScreeenState extends State { 18 | final AccountServices accountServices = AccountServices(); 19 | List? ordersList; 20 | 21 | fetchOrderedProducts() async { 22 | ordersList = await accountServices.searchOrder( 23 | context: context, searchQuery: widget.orderQuery); 24 | 25 | setState(() {}); 26 | } 27 | 28 | @override 29 | void initState() { 30 | super.initState(); 31 | fetchOrderedProducts(); 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return Scaffold( 37 | appBar: const PreferredSize( 38 | preferredSize: Size.fromHeight(60), 39 | child: CustomAppBar(), 40 | ), 41 | body: SingleChildScrollView( 42 | child: Padding( 43 | padding: const EdgeInsets.all(12.0), 44 | child: ordersList == null || ordersList!.isEmpty 45 | ? const Center( 46 | child: CircularProgressIndicator(), 47 | ) 48 | : Column( 49 | crossAxisAlignment: CrossAxisAlignment.start, 50 | children: [ 51 | Text( 52 | '${ordersList!.length} order(s) matching "${widget.orderQuery}"', 53 | style: const TextStyle(fontSize: 16), 54 | ), 55 | const SizedBox(height: 10), 56 | ListView.builder( 57 | itemCount: ordersList!.length, 58 | shrinkWrap: true, 59 | physics: const NeverScrollableScrollPhysics(), 60 | itemBuilder: ((context, index) { 61 | return OrderListSingle(order: ordersList![index]); 62 | }), 63 | ), 64 | ], 65 | ), 66 | ), 67 | ), 68 | ); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/features/cart/widgets/amazon_pay_bannar_ad.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AmazonPayBannarAd extends StatelessWidget { 4 | const AmazonPayBannarAd({ 5 | super.key, 6 | }); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | height: 70, 12 | width: double.infinity, 13 | decoration: BoxDecoration( 14 | color: const Color(0xffFFF1E4), 15 | border: Border.all(color: Colors.grey, width: 0.5)), 16 | child: Row( 17 | mainAxisAlignment: MainAxisAlignment.spaceAround, 18 | crossAxisAlignment: CrossAxisAlignment.center, 19 | children: [ 20 | Image.asset( 21 | 'assets/images/cart_screen_icons/pay_calender.png', 22 | height: 50, 23 | width: 50, 24 | ), 25 | SizedBox( 26 | width: 300, 27 | child: Column( 28 | crossAxisAlignment: CrossAxisAlignment.start, 29 | mainAxisAlignment: MainAxisAlignment.center, 30 | children: [ 31 | const Text( 32 | 'Amazon Pay Later | Get instant credit up to ₹60,000', 33 | maxLines: 2, 34 | overflow: TextOverflow.ellipsis, 35 | style: TextStyle( 36 | fontSize: 14, 37 | ), 38 | ), 39 | RichText( 40 | text: const TextSpan( 41 | text: 'Activate & get rewards of ', 42 | style: TextStyle( 43 | fontSize: 14, 44 | color: Colors.black87, 45 | fontWeight: FontWeight.bold), 46 | children: [ 47 | TextSpan( 48 | text: '₹600', 49 | style: TextStyle( 50 | fontSize: 14, 51 | color: Color(0xffC40202), 52 | fontWeight: FontWeight.bold)), 53 | TextSpan( 54 | text: '>', 55 | style: TextStyle( 56 | fontSize: 14, 57 | color: Colors.black87, 58 | fontWeight: FontWeight.bold)) 59 | ], 60 | ), 61 | ), 62 | const SizedBox(height: 10), 63 | ], 64 | ), 65 | ) 66 | ]), 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/common/widgets/you_might_also_like_single.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/common/widgets/stars.dart'; 2 | import 'package:flutter/material.dart'; 3 | import '../../constants/global_variables.dart'; 4 | import '../../constants/utils.dart'; 5 | import '../../models/product.dart'; 6 | 7 | class YouMightAlsoLikeSingle extends StatefulWidget { 8 | const YouMightAlsoLikeSingle({ 9 | super.key, 10 | required this.product, 11 | }); 12 | 13 | final Product product; 14 | 15 | @override 16 | State createState() => _YouMightAlsoLikeSingleState(); 17 | } 18 | 19 | String? price; 20 | 21 | class _YouMightAlsoLikeSingleState extends State { 22 | @override 23 | void initState() { 24 | super.initState(); 25 | price = formatPrice(widget.product.price); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | double totalRating = 0; 31 | for (int i = 0; i < widget.product.rating!.length; i++) { 32 | totalRating += widget.product.rating![i].rating; 33 | } 34 | 35 | double averageRating = 0; 36 | if (totalRating != 0) { 37 | averageRating = totalRating / widget.product.rating!.length; 38 | } 39 | 40 | return Container( 41 | margin: const EdgeInsets.symmetric(horizontal: 6), 42 | padding: const EdgeInsets.symmetric(horizontal: 4), 43 | width: 130, 44 | child: Column( 45 | crossAxisAlignment: CrossAxisAlignment.start, 46 | children: [ 47 | Center( 48 | child: Image.network( 49 | widget.product.images[0], 50 | height: 130, 51 | ), 52 | ), 53 | Text( 54 | widget.product.name, 55 | maxLines: 2, 56 | style: TextStyle( 57 | fontSize: 16, 58 | color: GlobalVariables.selectedNavBarColor, 59 | overflow: TextOverflow.ellipsis), 60 | ), 61 | Stars( 62 | rating: averageRating, 63 | size: 18, 64 | ), 65 | Text( 66 | '${widget.product.rating!.length.toString()} reviews', 67 | style: const TextStyle( 68 | color: Colors.black54, 69 | fontSize: 14, 70 | fontWeight: FontWeight.normal, 71 | ), 72 | ), 73 | Text( 74 | '₹$price.00', 75 | maxLines: 2, 76 | style: const TextStyle( 77 | fontSize: 16, 78 | color: Color(0xffB12704), 79 | fontWeight: FontWeight.w500, 80 | overflow: TextOverflow.ellipsis), 81 | ), 82 | ], 83 | ), 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/features/home/services/home_services.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:amazon_clone_flutter/providers/user_provider.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | import 'package:http/http.dart' as http; 7 | import '../../../constants/error_handling.dart'; 8 | import '../../../constants/global_variables.dart'; 9 | import '../../../constants/utils.dart'; 10 | import '../../../models/product.dart'; 11 | 12 | class HomeServices { 13 | Future> fetchCategoryProducts( 14 | {required BuildContext context, required String category}) async { 15 | final userProvider = Provider.of(context, listen: false); 16 | List productList = []; 17 | try { 18 | http.Response res = await http 19 | .get(Uri.parse('$uri/api/products?category=$category'), headers: { 20 | 'Content-Type': 'application/json; charset=UTF-8', 21 | 'x-auth-token': userProvider.user.token, 22 | }); 23 | 24 | if (context.mounted) { 25 | httpErrorHandle( 26 | response: res, 27 | context: context, 28 | onSuccess: () { 29 | for (int i = 0; i < jsonDecode(res.body).length; i++) { 30 | productList.add( 31 | Product.fromJson( 32 | jsonEncode( 33 | jsonDecode(res.body)[i], 34 | ), 35 | ), 36 | ); 37 | } 38 | }); 39 | } 40 | } catch (e) { 41 | if (context.mounted) { 42 | showSnackBar(context, e.toString()); 43 | } 44 | } 45 | 46 | return productList; 47 | } 48 | 49 | Future fetchDealOfTheDay({required BuildContext context}) async { 50 | final userProvider = Provider.of(context, listen: false); 51 | 52 | Product product = Product( 53 | name: '', 54 | description: '', 55 | quantity: 0, 56 | images: [], 57 | category: '', 58 | price: 0); 59 | 60 | try { 61 | http.Response res = 62 | await http.get(Uri.parse("$uri/api/deal-of-the-day"), headers: { 63 | 'Content-Type': 'application/json; charset=UTF-8', 64 | 'x-auth-token': userProvider.user.token, 65 | }); 66 | 67 | if (context.mounted) { 68 | httpErrorHandle( 69 | response: res, 70 | context: context, 71 | onSuccess: () { 72 | product = Product.fromJson(res.body); 73 | }); 74 | } 75 | } catch (e) { 76 | if (context.mounted) { 77 | showSnackBar(context, e.toString()); 78 | } 79 | } 80 | 81 | return product; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /server/routes/auth.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const User = require("../model/user"); 3 | const bcrypt = require("bcryptjs"); 4 | const jwt = require("jsonwebtoken"); 5 | const auth = require("../middlewares/auth"); 6 | 7 | const authRouter = express.Router(); 8 | 9 | 10 | 11 | 12 | // Sign Up Route 13 | authRouter.post("/api/signup", async (req, res) => { 14 | try { 15 | let {name, email, password} = req.body; 16 | 17 | email = email.toLowerCase(); 18 | 19 | const existingUser = await User.findOne({email}); 20 | if(existingUser){ 21 | return res.status(400).json({msg: "User with same email already exists"}); 22 | } 23 | 24 | if(password.length < 6){ 25 | return res.status(400).json({msg : "Password must have at least 6 characters"}); 26 | } 27 | 28 | const hashedPassword = await bcrypt.hash(password, 8); 29 | 30 | let user = User({ 31 | email, password : hashedPassword, name, 32 | }) 33 | 34 | user = await user.save(); 35 | res.json(user); 36 | 37 | } catch (e) { 38 | res.status(500).json({error : e.message}); 39 | } 40 | 41 | }) 42 | 43 | 44 | // Sign in Route 45 | authRouter.post('/api/signin', async (req, res ) => { 46 | try { 47 | let {email, password} = req.body; 48 | 49 | email = email.toLowerCase(); 50 | 51 | const user = await User.findOne({email}); 52 | if(!user){ 53 | return res.status(400).json({msg : "User does not exist!"}); 54 | } 55 | 56 | const isMatch = await bcrypt.compare(password, user.password); 57 | if(!isMatch){ 58 | return res.status(400).json({msg : "Incorrect password!"}) 59 | } 60 | 61 | // passing user id obj for the payload 62 | const token = jwt.sign({id: user._id}, "passwordKey"); 63 | res.json({token, ...user._doc}); 64 | 65 | 66 | 67 | } catch (e) { 68 | res.status(500).json({error: e.message}); 69 | } 70 | }) 71 | 72 | authRouter.post('/tokenIsValid', async (req, res) => { 73 | try { 74 | const token = req.header('x-auth-token'); 75 | 76 | if(!token) return res.json(false); 77 | const isVerified = jwt.verify(token, 'passwordKey'); 78 | if(!isVerified) return res.json(false); 79 | 80 | const user = await User.findById(isVerified.id); 81 | if(!user) return res.json(false); 82 | 83 | res.json(true); 84 | 85 | } catch (e) { 86 | res.status(500).json({error : e.message}) 87 | } 88 | }) 89 | 90 | 91 | authRouter.get('/', auth, async (req, res) => { 92 | const user = await User.findById(req.user); 93 | res.json({...user._doc, token: req.token}); 94 | }) 95 | 96 | 97 | module.exports = authRouter; 98 | -------------------------------------------------------------------------------- /lib/features/home/screens/category_deals_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/features/home/services/home_services.dart'; 2 | import 'package:flutter/material.dart'; 3 | import '../../../common/widgets/custom_app_bar.dart'; 4 | import '../../../constants/utils.dart'; 5 | import '../../../models/product.dart'; 6 | import '../../../common/widgets/single_listing_product.dart'; 7 | 8 | class CategoryDealsScreen extends StatefulWidget { 9 | static const String routeName = '/category-deals'; 10 | 11 | final String category; 12 | const CategoryDealsScreen({super.key, required this.category}); 13 | 14 | @override 15 | State createState() => _CategoryDealsScreenState(); 16 | } 17 | 18 | class _CategoryDealsScreenState extends State { 19 | List? productList; 20 | final HomeServices homeServices = HomeServices(); 21 | 22 | @override 23 | void initState() { 24 | super.initState(); 25 | fetchCategoryProducts(); 26 | } 27 | 28 | fetchCategoryProducts() async { 29 | productList = await homeServices.fetchCategoryProducts( 30 | context: context, category: widget.category); 31 | productList!.shuffle(); 32 | setState(() {}); 33 | } 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return Scaffold( 38 | backgroundColor: Colors.white, 39 | appBar: const PreferredSize( 40 | preferredSize: Size.fromHeight(60), child: CustomAppBar()), 41 | body: productList == null 42 | ? const Center(child: CircularProgressIndicator()) 43 | : Column( 44 | children: [ 45 | Container( 46 | width: double.infinity, 47 | padding: const EdgeInsets.all(8), 48 | margin: const EdgeInsets.symmetric(vertical: 4), 49 | decoration: BoxDecoration( 50 | border: 51 | Border.all(color: Colors.grey.shade400, width: 0.4)), 52 | child: Text( 53 | 'Over ${productList!.length} Results in ${widget.category}', 54 | style: const TextStyle( 55 | fontSize: 16, fontWeight: FontWeight.w300), 56 | ), 57 | ), 58 | Expanded( 59 | child: ListView.builder( 60 | itemCount: productList!.length, 61 | scrollDirection: Axis.vertical, 62 | itemBuilder: (context, index) { 63 | final product = productList![index]; 64 | final deliveryDate = getDeliveryDate(); 65 | 66 | return SingleListingProduct( 67 | product: product, 68 | deliveryDate: deliveryDate, 69 | ); 70 | }), 71 | ), 72 | ], 73 | ), 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/features/more/screens/more_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/features/account/screens/account_screen.dart'; 2 | import 'package:amazon_clone_flutter/features/home/screens/home_screen.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | import '../../../providers/screen_number_provider.dart'; 7 | import '../../cart/screens/cart_screen.dart'; 8 | import '../widgets/custom_bottom_sheet.dart'; 9 | 10 | class MoreScreen extends StatefulWidget { 11 | const MoreScreen({ 12 | super.key, 13 | }); 14 | 15 | @override 16 | State createState() => _MoreScreenState(); 17 | } 18 | 19 | class _MoreScreenState extends State { 20 | @override 21 | Widget build(BuildContext context) { 22 | final screenNumberProvider = 23 | Provider.of(context, listen: false); 24 | 25 | Widget getScreen({ 26 | required int screenNumber, 27 | }) { 28 | if (screenNumber == 0) { 29 | return const HomeScreen(); 30 | } else if (screenNumber == 1) { 31 | return const AccountScreen(); 32 | } else if (screenNumber == 3) { 33 | return const CartScreen(); 34 | } else if (screenNumber == 4) { 35 | return const Scaffold( 36 | body: Center( 37 | child: Text('Menu Screen'), 38 | ), 39 | ); 40 | } 41 | return const HomeScreen(); 42 | } 43 | 44 | return Scaffold(body: 45 | Consumer(builder: (context, provider, child) { 46 | final isOpen = provider.isOpen; 47 | return isOpen == true 48 | ? Stack( 49 | children: [ 50 | getScreen(screenNumber: screenNumberProvider.screenNumber), 51 | Container( 52 | height: double.infinity, 53 | width: double.infinity, 54 | color: Colors.black.withOpacity(0.5), 55 | ), 56 | ], 57 | ) 58 | : getScreen(screenNumber: screenNumberProvider.screenNumber); 59 | }), 60 | // : getScreen(screenNumber: screenNumberProvider), 61 | bottomSheet: Consumer( 62 | builder: ((context, provider, child) { 63 | final isOpen = provider.isOpen; 64 | 65 | return isOpen == true 66 | ? BottomSheet( 67 | backgroundColor: const Color(0xffffffff), 68 | shadowColor: Colors.white, 69 | dragHandleColor: const Color(0xffDDDDDD), 70 | dragHandleSize: const Size(50, 4), 71 | enableDrag: false, 72 | showDragHandle: true, 73 | constraints: const BoxConstraints(minHeight: 400, maxHeight: 400), 74 | onClosing: () {}, 75 | builder: (context) { 76 | return const CustomBottomSheet(); 77 | }, 78 | ) 79 | : const SizedBox(); 80 | }))); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/features/search/widgets/searched_product.dart: -------------------------------------------------------------------------------- 1 | import 'package:amazon_clone_flutter/common/widgets/stars.dart'; 2 | import 'package:amazon_clone_flutter/models/product.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class SearchedProduct extends StatelessWidget { 6 | const SearchedProduct({super.key, required this.product}); 7 | 8 | final Product product; 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | double totalRating = 0; 13 | for (int i = 0; i < product.rating!.length; i++) { 14 | totalRating += product.rating![i].rating; 15 | } 16 | 17 | double averageRating = 0; 18 | if (totalRating != 0) { 19 | averageRating = totalRating / product.rating!.length; 20 | } 21 | 22 | return Column( 23 | mainAxisAlignment: MainAxisAlignment.center, 24 | children: [ 25 | Container( 26 | margin: const EdgeInsets.symmetric(horizontal: 10), 27 | child: Row(children: [ 28 | Image.network( 29 | product.images[0], 30 | fit: BoxFit.contain, 31 | height: 135, 32 | width: 135, 33 | ), 34 | Column( 35 | children: [ 36 | Container( 37 | width: 235, 38 | padding: const EdgeInsets.symmetric(horizontal: 10), 39 | child: Text( 40 | product.name, 41 | maxLines: 2, 42 | style: const TextStyle( 43 | fontSize: 16, overflow: TextOverflow.ellipsis), 44 | ), 45 | ), 46 | Container( 47 | width: 235, 48 | padding: const EdgeInsets.symmetric(horizontal: 10), 49 | child: Stars(rating: averageRating), 50 | ), 51 | Container( 52 | width: 235, 53 | padding: const EdgeInsets.symmetric(horizontal: 10), 54 | child: const Text('Eligible for FREE shipping'), 55 | ), 56 | Container( 57 | width: 235, 58 | padding: const EdgeInsets.only(top: 5, left: 10), 59 | child: Text( 60 | '\$${product.price}', 61 | style: const TextStyle( 62 | fontSize: 20, fontWeight: FontWeight.bold), 63 | maxLines: 2, 64 | ), 65 | ), 66 | Container( 67 | width: 235, 68 | padding: const EdgeInsets.only(top: 5, left: 10), 69 | child: const Text( 70 | 'In Stock', 71 | style: TextStyle( 72 | color: Colors.teal, 73 | ), 74 | maxLines: 2, 75 | ), 76 | ), 77 | ], 78 | ) 79 | ]), 80 | ) 81 | ], 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/models/user.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class User { 4 | final String id; 5 | final String name; 6 | final String email; 7 | final String password; 8 | final String address; 9 | final String type; 10 | final String token; 11 | final List cart; 12 | final List saveForLater; 13 | final List keepShoppingFor; 14 | final List wishList; 15 | 16 | User({ 17 | required this.id, 18 | required this.name, 19 | required this.email, 20 | required this.password, 21 | required this.address, 22 | required this.type, 23 | required this.token, 24 | required this.cart, 25 | required this.saveForLater, 26 | required this.keepShoppingFor, 27 | required this.wishList, 28 | }); 29 | 30 | Map toMap() { 31 | return { 32 | 'id': id, 33 | 'name': name, 34 | 'email': email, 35 | 'password': password, 36 | 'address': address, 37 | 'type': type, 38 | 'token': token, 39 | 'cart': cart, 40 | 'saveForLater': saveForLater, 41 | 'keepShoppingFor': keepShoppingFor, 42 | 'wishList': wishList, 43 | }; 44 | } 45 | 46 | factory User.fromMap(Map map) { 47 | return User( 48 | id: map['_id'] ?? '', 49 | name: map['name'] ?? '', 50 | email: map['email'] ?? '', 51 | password: map['password'] ?? '', 52 | address: map['address'] ?? '', 53 | type: map['type'] ?? '', 54 | token: map['token'] ?? '', 55 | cart: List>.from( 56 | map['cart']?.map( 57 | (x) => Map.from(x), 58 | ), 59 | ), 60 | saveForLater: List>.from( 61 | map['saveForLater']?.map( 62 | (x) => Map.from(x), 63 | ), 64 | ), 65 | keepShoppingFor: List>.from( 66 | map['keepShoppingFor']?.map( 67 | (x) => Map.from(x), 68 | ), 69 | ), 70 | wishList: List>.from( 71 | map['wishList']?.map( 72 | (x) => Map.from(x), 73 | ), 74 | ), 75 | ); 76 | } 77 | 78 | String toJson() => json.encode(toMap()); 79 | factory User.fromJson(String source) => User.fromMap(json.decode(source)); 80 | 81 | User copyWith({ 82 | String? id, 83 | String? name, 84 | String? email, 85 | String? password, 86 | String? address, 87 | String? type, 88 | String? token, 89 | List? cart, 90 | List? saveForLater, 91 | List? keepShoppingFor, 92 | List? wishList, 93 | }) { 94 | return User( 95 | id: id ?? this.id, 96 | name: name ?? this.name, 97 | email: email ?? this.email, 98 | password: password ?? this.password, 99 | address: address ?? this.address, 100 | type: type ?? this.type, 101 | token: token ?? this.token, 102 | cart: cart ?? this.cart, 103 | saveForLater: saveForLater ?? this.saveForLater, 104 | keepShoppingFor: keepShoppingFor ?? this.keepShoppingFor, 105 | wishList: wishList ?? this.wishList, 106 | ); 107 | } 108 | } 109 | --------------------------------------------------------------------------------