├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── swiggy_ui │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── assets ├── icons │ ├── blaze.png │ ├── bread.png │ ├── coffee.png │ ├── courier.png │ ├── delivery.png │ ├── documents.png │ ├── food.png │ ├── home.png │ ├── kawaii-sushi.png │ ├── milkshake.png │ ├── more.png │ ├── natural-food.png │ ├── offer.png │ ├── only-on-swiggy.png │ ├── pocket.png │ ├── spark.png │ ├── thunder.png │ └── world-cup.png └── images │ ├── banner1.jpg │ ├── banner2.jpg │ ├── banner3.jpg │ ├── banner4.jpg │ ├── burger.png │ ├── delivery-boy.png │ ├── delivery-man.png │ ├── food1.jpg │ ├── food10.jpg │ ├── food2.jpg │ ├── food3.jpg │ ├── food4.jpg │ ├── food5.jpg │ ├── food6.jpg │ ├── food7.jpg │ ├── food8.jpg │ ├── food9.jpg │ ├── grocery.png │ ├── meat.png │ ├── pizza-delivery-boy.png │ ├── plate-food.jpg │ ├── plate-food1.jpg │ └── user.jpg ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── 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-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── main.dart ├── models │ ├── all_restaurant.dart │ ├── available_coupon.dart │ ├── genie.dart │ ├── indian_food.dart │ ├── popular_brands.dart │ ├── popular_category.dart │ ├── restaurant_detail.dart │ ├── spotlight_best_top_food.dart │ ├── tab_desktop │ │ ├── menu.dart │ │ └── order_menu.dart │ └── top_picks_food.dart ├── shared │ └── app_theme.dart ├── utils │ ├── app_colors.dart │ └── ui_helper.dart ├── views │ ├── mobile │ │ ├── account │ │ │ └── account_screen.dart │ │ ├── cart │ │ │ └── cart_screen.dart │ │ ├── home_bottom_navigation_screen.dart │ │ ├── mobile_screen.dart │ │ ├── search │ │ │ └── search_screen.dart │ │ └── swiggy │ │ │ ├── all_restaurants │ │ │ └── all_restaurants_screen.dart │ │ │ ├── best_in_safety_view.dart │ │ │ ├── food_groceries_availability_view.dart │ │ │ ├── genie │ │ │ ├── genie_grocery_card_view.dart │ │ │ ├── genie_screen.dart │ │ │ └── genie_view.dart │ │ │ ├── groceries │ │ │ └── grocery_screen.dart │ │ │ ├── in_the_spotlight_view.dart │ │ │ ├── indian_food │ │ │ ├── indian_delight_screen.dart │ │ │ └── indian_food_view.dart │ │ │ ├── meat │ │ │ └── meat_screen.dart │ │ │ ├── offers │ │ │ ├── offer_banner_view.dart │ │ │ └── offer_screen.dart │ │ │ ├── popular_brand_view.dart │ │ │ ├── popular_categories_view.dart │ │ │ ├── restaurants │ │ │ ├── restaurant_detail_screen.dart │ │ │ └── restaurant_vertical_list_view.dart │ │ │ ├── swiggy_safety_banner_view.dart │ │ │ ├── swiggy_screen.dart │ │ │ ├── top_offer_view.dart │ │ │ └── top_picks_for_you_view.dart │ └── tab_desktop │ │ ├── cart_view.dart │ │ ├── desktop_screen.dart │ │ ├── home_view.dart │ │ ├── menu_view.dart │ │ └── tab_screen.dart └── widgets │ ├── custom_divider_view.dart │ ├── dotted_seperator_view.dart │ ├── mobile │ ├── food_list_item_view.dart │ ├── search_food_list_item_view.dart │ └── spotlight_best_top_food_item.dart │ ├── responsive.dart │ └── veg_badge_view.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── screenshots ├── account1.jpg ├── account2.jpg ├── all-restaurant1.jpg ├── all-restaurant2.jpg ├── all-restaurant3.jpg ├── all-restaurant4.jpg ├── cart1.jpg ├── cart2.jpg ├── genie.jpg ├── grocery.jpg ├── indian-food.jpg ├── meat.jpg ├── offers1.jpg ├── offers2.jpg ├── restaurant-detail1.jpg ├── restaurant-detail2.jpg ├── search.jpg ├── swiggy1.jpg ├── swiggy2.jpg ├── swiggy3.jpg ├── swiggy4.jpg ├── swiggy5.jpg ├── swiggy6.jpg ├── swiggy7.jpg ├── swiggy8.jpg ├── swiggy_tablet_ui.png └── swiggy_web_ui.png ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ └── Icon-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── run_loop.cpp ├── run_loop.h ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Exceptions to above rules. 43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 44 | 45 | # Flutter Web 46 | .firebase/ 47 | .firebaserc 48 | firebase.json 49 | -------------------------------------------------------------------------------- /.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 and should not be manually edited. 5 | 6 | version: 7 | revision: 8af6b2f038c1172e61d418869363a28dffec3cb4 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiggyUI 2 | 3 | SwiggyUI App is a UI clone of a famous food ordering app called [Swiggy](https://play.google.com/store/apps/details?id=in.swiggy.android) built using Flutter. Show some ❤️ and star ⭐ the repo if you liked it, it makes me to share more open source flutter projects. 4 | 5 | Web - https://swiggyuiclone.web.app 6 | 7 | ## Screenshots 8 | 9 | ### Web UI 10 | ![](screenshots/swiggy_web_ui.png) 11 | 12 | ### Tablet UI 13 | ![](screenshots/swiggy_tablet_ui.png) 14 | 15 | ### Mobile UI 16 | 17 | - Initial Views 18 | 19 | Screen 1 | Screen 2 | Screen 3 | Screen 4 20 | :-------------------------:|:-------------------------:|:-------------------------:|:-------------------------: 21 | ![](screenshots/swiggy1.jpg)|![](screenshots/swiggy2.jpg)|![](screenshots/swiggy3.jpg)|![](screenshots/swiggy4.jpg)| 22 | 23 | Screen 5 | Screen 6 | Screen 7 | Screen 8 24 | :-------------------------:|:-------------------------:|:-------------------------:|:-------------------------: 25 | ![](screenshots/swiggy5.jpg)|![](screenshots/swiggy6.jpg)|![](screenshots/swiggy7.jpg)|![](screenshots/swiggy8.jpg)| 26 | 27 | Screen 9 | Screen 10 | Screen 11 | Screen 12 28 | :-------------------------:|:-------------------------:|:-------------------------:|:-------------------------: 29 | ![](screenshots/genie.jpg)|![](screenshots/grocery.jpg)|![](screenshots/meat.jpg)|![](screenshots/indian-food.jpg)| 30 | 31 | - All Restaurant Views 32 | 33 | Screen 1 | Screen 2 | Screen 3 | Screen 4 34 | :-------------------------:|:-------------------------:|:-------------------------:|:-------------------------: 35 | ![](screenshots/all-restaurant1.jpg)|![](screenshots/all-restaurant2.jpg)|![](screenshots/all-restaurant3.jpg)|![](screenshots/all-restaurant4.jpg)| 36 | 37 | - Offer Views 38 | 39 | Screen 1 | Screen 2 40 | :-------------------------:|:-------------------------: 41 | ![](screenshots/offers1.jpg)|![](screenshots/offers2.jpg)| 42 | 43 | - Restaurant Detail Views 44 | 45 | Screen 1 | Screen 2 46 | :-------------------------:|:-------------------------: 47 | ![](screenshots/restaurant-detail1.jpg)|![](screenshots/restaurant-detail2.jpg)| 48 | 49 | ### Search 50 | 51 | Screen 1 52 | :-------------------------: 53 | ![](screenshots/search.jpg)| 54 | 55 | ### Cart 56 | 57 | Screen 1 | Screen 2 58 | :-------------------------:|:-------------------------: 59 | ![](screenshots/cart1.jpg)|![](screenshots/cart2.jpg)| 60 | 61 | ### Account 62 | 63 | Screen 1 | Screen 2 64 | :-------------------------:|:-------------------------: 65 | ![](screenshots/account1.jpg)|![](screenshots/account2.jpg)| 66 | 67 |

68 | Credit:- vinothvino42 69 |

70 |

71 | Made With Flutter 💙 72 |

73 | 74 | -------------------------------------------------------------------------------- /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 26 | prefer_single_quotes: true 27 | sort_pub_dependencies: true 28 | 29 | # Additional information about this file can be found at 30 | # https://dart.dev/guides/language/analysis-options -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | compileSdkVersion 30 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.swiggy_ui" 38 | minSdkVersion 16 39 | targetSdkVersion 30 40 | versionCode flutterVersionCode.toInteger() 41 | versionName flutterVersionName 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59 | } 60 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/swiggy_ui/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.swiggy_ui 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /assets/icons/blaze.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/blaze.png -------------------------------------------------------------------------------- /assets/icons/bread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/bread.png -------------------------------------------------------------------------------- /assets/icons/coffee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/coffee.png -------------------------------------------------------------------------------- /assets/icons/courier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/courier.png -------------------------------------------------------------------------------- /assets/icons/delivery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/delivery.png -------------------------------------------------------------------------------- /assets/icons/documents.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/documents.png -------------------------------------------------------------------------------- /assets/icons/food.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/food.png -------------------------------------------------------------------------------- /assets/icons/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/home.png -------------------------------------------------------------------------------- /assets/icons/kawaii-sushi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/kawaii-sushi.png -------------------------------------------------------------------------------- /assets/icons/milkshake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/milkshake.png -------------------------------------------------------------------------------- /assets/icons/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/more.png -------------------------------------------------------------------------------- /assets/icons/natural-food.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/natural-food.png -------------------------------------------------------------------------------- /assets/icons/offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/offer.png -------------------------------------------------------------------------------- /assets/icons/only-on-swiggy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/only-on-swiggy.png -------------------------------------------------------------------------------- /assets/icons/pocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/pocket.png -------------------------------------------------------------------------------- /assets/icons/spark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/spark.png -------------------------------------------------------------------------------- /assets/icons/thunder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/thunder.png -------------------------------------------------------------------------------- /assets/icons/world-cup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/icons/world-cup.png -------------------------------------------------------------------------------- /assets/images/banner1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/banner1.jpg -------------------------------------------------------------------------------- /assets/images/banner2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/banner2.jpg -------------------------------------------------------------------------------- /assets/images/banner3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/banner3.jpg -------------------------------------------------------------------------------- /assets/images/banner4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/banner4.jpg -------------------------------------------------------------------------------- /assets/images/burger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/burger.png -------------------------------------------------------------------------------- /assets/images/delivery-boy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/delivery-boy.png -------------------------------------------------------------------------------- /assets/images/delivery-man.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/delivery-man.png -------------------------------------------------------------------------------- /assets/images/food1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food1.jpg -------------------------------------------------------------------------------- /assets/images/food10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food10.jpg -------------------------------------------------------------------------------- /assets/images/food2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food2.jpg -------------------------------------------------------------------------------- /assets/images/food3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food3.jpg -------------------------------------------------------------------------------- /assets/images/food4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food4.jpg -------------------------------------------------------------------------------- /assets/images/food5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food5.jpg -------------------------------------------------------------------------------- /assets/images/food6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food6.jpg -------------------------------------------------------------------------------- /assets/images/food7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food7.jpg -------------------------------------------------------------------------------- /assets/images/food8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food8.jpg -------------------------------------------------------------------------------- /assets/images/food9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/food9.jpg -------------------------------------------------------------------------------- /assets/images/grocery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/grocery.png -------------------------------------------------------------------------------- /assets/images/meat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/meat.png -------------------------------------------------------------------------------- /assets/images/pizza-delivery-boy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/pizza-delivery-boy.png -------------------------------------------------------------------------------- /assets/images/plate-food.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/plate-food.jpg -------------------------------------------------------------------------------- /assets/images/plate-food1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/plate-food1.jpg -------------------------------------------------------------------------------- /assets/images/user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/assets/images/user.jpg -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/ephemeral/ 22 | Flutter/app.flx 23 | Flutter/app.zip 24 | Flutter/flutter_assets/ 25 | Flutter/flutter_export_environment.sh 26 | ServiceDefinitions.json 27 | Runner/GeneratedPluginRegistrant.* 28 | 29 | # Exceptions to above rules. 30 | !default.mode1v3 31 | !default.mode2v3 32 | !default.pbxuser 33 | !default.perspectivev3 34 | -------------------------------------------------------------------------------- /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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - path_provider (0.0.1): 4 | - Flutter 5 | 6 | DEPENDENCIES: 7 | - Flutter (from `Flutter`) 8 | - path_provider (from `.symlinks/plugins/path_provider/ios`) 9 | 10 | EXTERNAL SOURCES: 11 | Flutter: 12 | :path: Flutter 13 | path_provider: 14 | :path: ".symlinks/plugins/path_provider/ios" 15 | 16 | SPEC CHECKSUMS: 17 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c 18 | path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c 19 | 20 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c 21 | 22 | COCOAPODS: 1.10.1 23 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.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/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/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/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | swiggy_ui 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/views/tab_desktop/tab_screen.dart'; 3 | 4 | import 'shared/app_theme.dart'; 5 | import 'views/tab_desktop/desktop_screen.dart'; 6 | import 'views/mobile/mobile_screen.dart'; 7 | import 'widgets/responsive.dart'; 8 | 9 | void main() { 10 | runApp(const MyApp()); 11 | } 12 | 13 | class MyApp extends StatelessWidget { 14 | const MyApp({Key? key}) : super(key: key); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return MaterialApp( 19 | title: 'SwiggyUI', 20 | debugShowCheckedModeBanner: false, 21 | theme: appPrimaryTheme(), 22 | home: const Responsive( 23 | mobile: MobileScreen(), 24 | tablet: TabScreen(), 25 | desktop: DesktopScreen(), 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/models/available_coupon.dart: -------------------------------------------------------------------------------- 1 | class AvailableCoupon { 2 | const AvailableCoupon({ 3 | required this.coupon, 4 | required this.discount, 5 | required this.desc, 6 | }); 7 | 8 | final String coupon; 9 | final String discount; 10 | final String desc; 11 | 12 | static const availableCoupons = [ 13 | AvailableCoupon( 14 | coupon: '100INDUSIND', 15 | discount: 'Get 20 % discount using Induslnd Bank Credit Cards', 16 | desc: 17 | 'Use code 100INDUSIND & get 20 % discount up to Rs100 on orders above Rs400', 18 | ), 19 | AvailableCoupon( 20 | coupon: 'HSBC500', 21 | discount: 'Get 15 % discount using HSBC Bank Credit Cards', 22 | desc: 23 | 'Use code HSBC500 & get 14 % discount up to Rs125 on orders above Rs500', 24 | ), 25 | AvailableCoupon( 26 | coupon: '100TMB', 27 | discount: 'Get 20 % discount using TMB Bank Credit Cards', 28 | desc: 29 | 'Use code 100TMB & get 20 % discount up to Rs100 on orders above Rs400', 30 | ), 31 | AvailableCoupon( 32 | coupon: 'INDUSIND20', 33 | discount: 'Get 20 % discount using Induslnd Bank Credit Cards', 34 | desc: 35 | 'Use code INDUSIND20 & get 20 % discount up to Rs200 on orders above Rs600', 36 | ), 37 | AvailableCoupon( 38 | coupon: 'HSBC5100', 39 | discount: 'Get 20 % discount using Induslnd Bank Credit Cards', 40 | desc: 41 | 'Use code HSBC5100 & get 20 % discount up to Rs100 on orders above Rs400', 42 | ), 43 | AvailableCoupon( 44 | coupon: '100AXIS', 45 | discount: 'Get 20 % discount using Axis Bank Credit Cards', 46 | desc: 47 | 'Use code 100AXIS & get 20 % discount up to Rs100 on orders above Rs400', 48 | ), 49 | AvailableCoupon( 50 | coupon: '100INDUSIND', 51 | discount: 'Get 20 % discount using Induslnd Bank Credit Cards', 52 | desc: 53 | 'Use code 100INDUSIND & get 20 % discount up to Rs100 on orders above Rs400', 54 | ), 55 | ]; 56 | } 57 | -------------------------------------------------------------------------------- /lib/models/genie.dart: -------------------------------------------------------------------------------- 1 | class Genie { 2 | const Genie({ 3 | required this.image, 4 | required this.title, 5 | }); 6 | 7 | final String image; 8 | final String title; 9 | 10 | static const genieServices = [ 11 | Genie(image: 'assets/icons/home.png', title: 'Home\nFood'), 12 | Genie(image: 'assets/icons/documents.png', title: 'Documents\nBooks'), 13 | Genie(image: 'assets/icons/delivery.png', title: 'Business\nDeliveries'), 14 | Genie(image: 'assets/icons/courier.png', title: 'Courier'), 15 | Genie(image: 'assets/icons/more.png', title: 'Anything\nElse'), 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /lib/models/indian_food.dart: -------------------------------------------------------------------------------- 1 | class IndianFood { 2 | const IndianFood({ 3 | required this.image, 4 | required this.name, 5 | }); 6 | 7 | final String image; 8 | final String name; 9 | 10 | static const indianRestaurants = [ 11 | IndianFood(image: 'assets/images/food3.jpg', name: 'South\nIndian'), 12 | IndianFood(image: 'assets/images/food5.jpg', name: 'Indian\nChai'), 13 | IndianFood(image: 'assets/images/food1.jpg', name: 'North \nIndian'), 14 | IndianFood(image: 'assets/images/food8.jpg', name: 'Indian\nBiryani'), 15 | IndianFood(image: 'assets/images/food9.jpg', name: 'Indian\nDosa'), 16 | IndianFood(image: 'assets/images/food4.jpg', name: 'Indian\nIdly'), 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /lib/models/popular_brands.dart: -------------------------------------------------------------------------------- 1 | class PopularBrands { 2 | const PopularBrands({ 3 | required this.image, 4 | required this.name, 5 | required this.minutes, 6 | }); 7 | 8 | final String image; 9 | final String name; 10 | final String minutes; 11 | 12 | static const popularBrands = [ 13 | PopularBrands( 14 | image: 'assets/images/food5.jpg', 15 | name: 'Sangeetha', 16 | minutes: '42 mins'), 17 | PopularBrands( 18 | image: 'assets/images/food4.jpg', 19 | name: 'Thalappakati', 20 | minutes: '32 mins'), 21 | PopularBrands( 22 | image: 'assets/images/food1.jpg', name: 'Subway', minutes: '26 mins'), 23 | PopularBrands( 24 | image: 'assets/images/food2.jpg', 25 | name: 'Chai Kings', 26 | minutes: '38 mins'), 27 | PopularBrands( 28 | image: 'assets/images/food3.jpg', 29 | name: 'BBQ Nation', 30 | minutes: '53 mins'), 31 | PopularBrands( 32 | image: 'assets/images/food4.jpg', 33 | name: 'A2B Chennai', 34 | minutes: '22 mins'), 35 | PopularBrands( 36 | image: 'assets/images/food6.jpg', name: 'KFC', minutes: '13 mins'), 37 | PopularBrands( 38 | image: 'assets/images/food7.jpg', 39 | name: 'Aasife Biryani', 40 | minutes: '31 mins'), 41 | PopularBrands( 42 | image: 'assets/images/food8.jpg', 43 | name: 'Chennai Biryani', 44 | minutes: '44 mins'), 45 | ]; 46 | } 47 | -------------------------------------------------------------------------------- /lib/models/popular_category.dart: -------------------------------------------------------------------------------- 1 | class PopularCategory { 2 | const PopularCategory({ 3 | required this.image, 4 | required this.name, 5 | }); 6 | 7 | final String image; 8 | final String name; 9 | 10 | static const popularCategories = [ 11 | PopularCategory( 12 | image: 'assets/icons/coffee.png', 13 | name: 'Cold\nBeverages', 14 | ), 15 | PopularCategory( 16 | image: 'assets/icons/natural-food.png', 17 | name: 'Veg only', 18 | ), 19 | PopularCategory( 20 | image: 'assets/icons/only-on-swiggy.png', 21 | name: 'Only on\nSwiggy', 22 | ), 23 | PopularCategory( 24 | image: 'assets/icons/offer.png', 25 | name: 'Offers', 26 | ), 27 | PopularCategory( 28 | image: 'assets/icons/food.png', 29 | name: 'Meals', 30 | ), 31 | PopularCategory( 32 | image: 'assets/icons/milkshake.png', 33 | name: 'Milkshakes', 34 | ), 35 | PopularCategory( 36 | image: 'assets/icons/kawaii-sushi.png', 37 | name: 'Kawaii\n Sushi', 38 | ), 39 | PopularCategory( 40 | image: 'assets/icons/bread.png', 41 | name: 'Bread', 42 | ), 43 | PopularCategory( 44 | image: 'assets/icons/only-on-swiggy.png', 45 | name: 'Only on\nSwiggy', 46 | ), 47 | PopularCategory( 48 | image: 'assets/icons/food.png', 49 | name: 'Meals', 50 | ), 51 | PopularCategory( 52 | image: 'assets/icons/natural-food.png', 53 | name: 'Veg only', 54 | ), 55 | PopularCategory( 56 | image: 'assets/icons/coffee.png', 57 | name: 'Cold\nBeverages', 58 | ), 59 | PopularCategory( 60 | image: 'assets/icons/kawaii-sushi.png', 61 | name: 'Kawaii\n Sushi', 62 | ), 63 | PopularCategory( 64 | image: 'assets/icons/bread.png', 65 | name: 'Bread', 66 | ), 67 | PopularCategory( 68 | image: 'assets/icons/food.png', 69 | name: 'Meals', 70 | ), 71 | PopularCategory( 72 | image: 'assets/icons/milkshake.png', 73 | name: 'Milkshakes', 74 | ), 75 | PopularCategory( 76 | image: 'assets/icons/coffee.png', 77 | name: 'Cold\nBeverages', 78 | ), 79 | PopularCategory( 80 | image: 'assets/icons/natural-food.png', 81 | name: 'Veg only', 82 | ), 83 | ]; 84 | } 85 | -------------------------------------------------------------------------------- /lib/models/restaurant_detail.dart: -------------------------------------------------------------------------------- 1 | class RestaurantDetail { 2 | const RestaurantDetail({ 3 | required this.title, 4 | required this.price, 5 | this.image = '', 6 | this.desc = '', 7 | }); 8 | 9 | final String title; 10 | final String price; 11 | final String image; 12 | final String? desc; 13 | 14 | static const breakfast = [ 15 | RestaurantDetail( 16 | title: 'Idly(2Pcs) (Breakfast)', 17 | price: 'Rs48', 18 | image: 'assets/images/food1.jpg', 19 | desc: 20 | 'A healthy breakfast item and an authentic south indian delicacy! Steamed and fluffy rice cake..more', 21 | ), 22 | RestaurantDetail( 23 | title: 'Sambar Idly (2Pcs)', 24 | image: 'assets/images/food2.jpg', 25 | price: 'Rs70', 26 | ), 27 | RestaurantDetail( 28 | title: 'Ghee Pongal', 29 | image: 'assets/images/food3.jpg', 30 | price: 'Rs85', 31 | desc: 32 | 'Cute, button idlis with authentic. South Indian sambar and coconut chutney gives the per..more', 33 | ), 34 | RestaurantDetail( 35 | title: 'Boori (1Set)', 36 | image: 'assets/images/food4.jpg', 37 | price: 'Rs85', 38 | ), 39 | RestaurantDetail( 40 | title: 'Podi Idly(2Pcs)', 41 | image: 'assets/images/food5.jpg', 42 | price: 'Rs110', 43 | ), 44 | RestaurantDetail( 45 | title: 'Mini Idly with Sambar', 46 | image: 'assets/images/food6.jpg', 47 | price: 'Rs85', 48 | desc: 49 | 'Cute, button idlis with authentic. South Indian sambar and coconut chutney gives the per..more', 50 | ), 51 | ]; 52 | 53 | static const allTimeFavFoods = [ 54 | RestaurantDetail( 55 | title: 'Plain Dosa', 56 | price: 'Rs30', 57 | desc: 'A healthy breakfast item and an authentic south indian delicacy!', 58 | ), 59 | RestaurantDetail( 60 | title: 'Rava Dosa', 61 | price: 'Rs70', 62 | ), 63 | RestaurantDetail( 64 | title: 'Onion Dosa', 65 | price: 'Rs85', 66 | desc: 67 | 'Cute, button dosas with authentic. South Indian sambar and coconut chutney gives the per..more', 68 | ), 69 | RestaurantDetail( 70 | title: 'Onion Uttapam', 71 | price: 'Rs85', 72 | ), 73 | RestaurantDetail( 74 | title: 'Tomato Uttapam', 75 | price: 'Rs110', 76 | ), 77 | RestaurantDetail( 78 | title: 'Onion Dosa & Sambar Vadai', 79 | price: 'Rs85', 80 | ), 81 | ]; 82 | 83 | static const otherDishes = [ 84 | RestaurantDetail( 85 | title: 'Kuzhi Paniyaram Karam (4Pcs)', 86 | price: 'Rs70', 87 | ), 88 | RestaurantDetail( 89 | title: 'Kuzhi Paniyaram Sweet (4Pcs)', 90 | price: 'Rs70', 91 | ), 92 | RestaurantDetail( 93 | title: 'Kuzhi Paniyaram Sweet & Karam (4Pcs)', 94 | price: 'Rs110', 95 | ), 96 | RestaurantDetail( 97 | title: 'Ghee Kuzhi Paniyaram', 98 | price: 'Rs85', 99 | ), 100 | ]; 101 | } 102 | -------------------------------------------------------------------------------- /lib/models/tab_desktop/menu.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Menu { 4 | const Menu({ 5 | required this.icon, 6 | required this.title, 7 | }); 8 | 9 | final IconData icon; 10 | final String title; 11 | 12 | static List getMenus() { 13 | return const [ 14 | Menu(icon: Icons.home_outlined, title: 'Home'), 15 | Menu(icon: Icons.search, title: 'Search'), 16 | Menu(icon: Icons.shopping_bag_outlined, title: 'Orders'), 17 | Menu(icon: Icons.local_offer_outlined, title: 'Offers'), 18 | Menu(icon: Icons.person_outline, title: 'Profile'), 19 | Menu(icon: Icons.more_horiz, title: 'More'), 20 | ]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/models/tab_desktop/order_menu.dart: -------------------------------------------------------------------------------- 1 | class OrderMenu { 2 | const OrderMenu({ 3 | required this.image, 4 | required this.title, 5 | required this.quantity, 6 | required this.price, 7 | }); 8 | 9 | final String image; 10 | final String title; 11 | final int quantity; 12 | final int price; 13 | 14 | static List getCartItems() { 15 | return const [ 16 | OrderMenu( 17 | image: 'assets/images/food1.jpg', 18 | title: 'Breakfast Expresss', 19 | quantity: 3, 20 | price: 140, 21 | ), 22 | OrderMenu( 23 | image: 'assets/images/food2.jpg', 24 | title: 'Pizza Corner', 25 | quantity: 1, 26 | price: 160, 27 | ), 28 | OrderMenu( 29 | image: 'assets/images/food3.jpg', 30 | title: 'BBQ King', 31 | quantity: 2, 32 | price: 230, 33 | ), 34 | OrderMenu( 35 | image: 'assets/images/food4.jpg', 36 | title: 'Sea Emperor', 37 | quantity: 6, 38 | price: 30, 39 | ), 40 | OrderMenu( 41 | image: 'assets/images/food5.jpg', 42 | title: 'Chai Truck', 43 | quantity: 4, 44 | price: 10, 45 | ), 46 | OrderMenu( 47 | image: 'assets/images/food8.jpg', 48 | title: 'Thalappakatti', 49 | quantity: 1, 50 | price: 130, 51 | ), 52 | OrderMenu( 53 | image: 'assets/images/food9.jpg', 54 | title: 'Eat & Meet', 55 | quantity: 6, 56 | price: 200, 57 | ), 58 | OrderMenu( 59 | image: 'assets/images/food6.jpg', 60 | title: 'Anjapar Restaurant', 61 | quantity: 4, 62 | price: 190, 63 | ), 64 | ]; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/models/top_picks_food.dart: -------------------------------------------------------------------------------- 1 | class TopPicksFood { 2 | const TopPicksFood({ 3 | required this.image, 4 | required this.name, 5 | required this.minutes, 6 | }); 7 | 8 | final String image; 9 | final String name; 10 | final String minutes; 11 | 12 | static const topPicksfoods = [ 13 | TopPicksFood( 14 | image: 'assets/images/food5.jpg', 15 | name: 'Murugan Idli Shop', 16 | minutes: '42 mins'), 17 | TopPicksFood( 18 | image: 'assets/images/food4.jpg', 19 | name: 'Thalappakati Biryani Hotel', 20 | minutes: '32 mins'), 21 | TopPicksFood( 22 | image: 'assets/images/food1.jpg', 23 | name: 'Sangeetha', 24 | minutes: '26 mins'), 25 | TopPicksFood( 26 | image: 'assets/images/food2.jpg', 27 | name: 'Hotel Chennai', 28 | minutes: '38 mins'), 29 | TopPicksFood( 30 | image: 'assets/images/food3.jpg', 31 | name: 'Shri Balaajee', 32 | minutes: '53 mins'), 33 | TopPicksFood( 34 | image: 'assets/images/food4.jpg', 35 | name: 'Namma Veedu Vasantha', 36 | minutes: '22 mins'), 37 | TopPicksFood( 38 | image: 'assets/images/food6.jpg', 39 | name: 'SK Parota Stall', 40 | minutes: '13 mins'), 41 | TopPicksFood( 42 | image: 'assets/images/food7.jpg', 43 | name: 'Aasife Biryani', 44 | minutes: '31 mins'), 45 | TopPicksFood( 46 | image: 'assets/images/food8.jpg', 47 | name: 'Jesus Fast Food', 48 | minutes: '44 mins'), 49 | TopPicksFood( 50 | image: 'assets/images/food9.jpg', 51 | name: 'Ananda Bhavan', 52 | minutes: '55 mins'), 53 | ]; 54 | } 55 | -------------------------------------------------------------------------------- /lib/shared/app_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | import 'package:swiggy_ui/utils/app_colors.dart'; 4 | 5 | ThemeData appPrimaryTheme() => ThemeData( 6 | brightness: Brightness.light, 7 | primaryColor: Colors.white, 8 | accentColor: appColor, 9 | scaffoldBackgroundColor: Colors.white, 10 | buttonColor: appColor, 11 | cardColor: Colors.white, 12 | snackBarTheme: const SnackBarThemeData( 13 | backgroundColor: appColor, 14 | contentTextStyle: TextStyle(color: Colors.white), 15 | actionTextColor: Colors.white, 16 | ), 17 | appBarTheme: const AppBarTheme( 18 | brightness: Brightness.light, 19 | elevation: 1.0, 20 | actionsIconTheme: IconThemeData( 21 | color: Colors.black, 22 | ), 23 | ), 24 | dividerColor: Colors.grey[300], 25 | dividerTheme: const DividerThemeData(thickness: 0.5), 26 | tabBarTheme: TabBarTheme( 27 | labelColor: Colors.black, 28 | unselectedLabelColor: Colors.grey, 29 | indicatorSize: TabBarIndicatorSize.tab, 30 | labelStyle: GoogleFonts.montserrat( 31 | fontSize: 12.0, 32 | fontWeight: FontWeight.w700, 33 | ), 34 | unselectedLabelStyle: GoogleFonts.montserrat( 35 | fontSize: 12.0, 36 | fontWeight: FontWeight.w500, 37 | ), 38 | ), 39 | textTheme: TextTheme( 40 | headline3: GoogleFonts.montserrat( 41 | fontSize: 42.0, 42 | fontWeight: FontWeight.bold, 43 | color: Colors.black, 44 | ), 45 | headline4: GoogleFonts.montserrat( 46 | fontSize: 25.0, 47 | fontWeight: FontWeight.bold, 48 | color: Colors.black, 49 | ), 50 | headline5: GoogleFonts.montserrat( 51 | fontSize: 24.0, 52 | fontWeight: FontWeight.w400, 53 | color: Colors.black, 54 | ), 55 | headline6: GoogleFonts.montserrat( 56 | fontSize: 20.0, 57 | fontWeight: FontWeight.w500, 58 | color: Colors.black, 59 | ), 60 | subtitle1: GoogleFonts.montserrat( 61 | fontSize: 16.0, 62 | fontWeight: FontWeight.w400, 63 | color: Colors.black, 64 | ), 65 | subtitle2: GoogleFonts.montserrat( 66 | fontSize: 14.0, 67 | fontWeight: FontWeight.w500, 68 | color: Colors.black, 69 | ), 70 | bodyText1: GoogleFonts.montserrat( 71 | fontSize: 15.0, 72 | fontWeight: FontWeight.w400, 73 | color: Colors.black, 74 | ), 75 | bodyText2: GoogleFonts.montserrat( 76 | fontSize: 12.0, 77 | fontWeight: FontWeight.w400, 78 | color: Colors.black, 79 | ), 80 | button: GoogleFonts.montserrat( 81 | fontSize: 16.0, 82 | fontWeight: FontWeight.w500, 83 | color: Colors.white, 84 | ), 85 | ), 86 | ); 87 | -------------------------------------------------------------------------------- /lib/utils/app_colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const Color appColor = Colors.orange; 4 | Color darkOrange = Colors.deepOrange[800]!; 5 | Color swiggyOrange = Colors.orange[900]!; 6 | -------------------------------------------------------------------------------- /lib/utils/ui_helper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class UIHelper { 4 | static const double _verticalSpaceExtraSmall = 4.0; 5 | static const double _verticalSpaceSmall = 8.0; 6 | static const double _verticalSpaceMedium = 16.0; 7 | static const double _verticalSpaceLarge = 24.0; 8 | static const double _verticalSpaceExtraLarge = 48; 9 | 10 | static const double _horizontalSpaceExtraSmall = 4; 11 | static const double _horizontalSpaceSmall = 8.0; 12 | static const double _horizontalSpaceMedium = 16.0; 13 | static const double _horizontalSpaceLarge = 24.0; 14 | static const double _horizontalSpaceExtraLarge = 48.0; 15 | 16 | static const SizedBox verticalSpaceExtraSmall = 17 | SizedBox(height: _verticalSpaceExtraSmall); 18 | static const SizedBox verticalSpaceSmall = 19 | SizedBox(height: _verticalSpaceSmall); 20 | static const SizedBox verticalSpaceMedium = 21 | SizedBox(height: _verticalSpaceMedium); 22 | static const SizedBox verticalSpaceLarge = 23 | SizedBox(height: _verticalSpaceLarge); 24 | static const SizedBox verticalSpaceExtraLarge = 25 | SizedBox(height: _verticalSpaceExtraLarge); 26 | 27 | static const SizedBox horizontalSpaceExtraSmall = 28 | SizedBox(width: _horizontalSpaceExtraSmall); 29 | static const SizedBox horizontalSpaceSmall = 30 | SizedBox(width: _horizontalSpaceSmall); 31 | static const SizedBox horizontalSpaceMedium = 32 | SizedBox(width: _horizontalSpaceMedium); 33 | static const SizedBox horizontalSpaceLarge = 34 | SizedBox(width: _horizontalSpaceLarge); 35 | static const SizedBox horizontalSpaceExtraLarge = 36 | SizedBox(width: _horizontalSpaceExtraLarge); 37 | } 38 | -------------------------------------------------------------------------------- /lib/views/mobile/home_bottom_navigation_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/views/mobile/search/search_screen.dart'; 3 | import 'package:swiggy_ui/views/mobile/swiggy/swiggy_screen.dart'; 4 | 5 | import '../../utils/app_colors.dart'; 6 | import 'account/account_screen.dart'; 7 | import 'cart/cart_screen.dart'; 8 | 9 | class HomeBottomNavigationScreen extends StatefulWidget { 10 | const HomeBottomNavigationScreen({Key? key}) : super(key: key); 11 | 12 | @override 13 | _HomeBottomNavigationScreenState createState() => 14 | _HomeBottomNavigationScreenState(); 15 | } 16 | 17 | class _HomeBottomNavigationScreenState 18 | extends State { 19 | final List _children = const [ 20 | SwiggyScreen(), 21 | SearchScreen(), 22 | CartScreen(), 23 | AccountScreen(), 24 | ]; 25 | 26 | int selectedIndex = 0; 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | final labelTextStyle = 31 | Theme.of(context).textTheme.subtitle2!.copyWith(fontSize: 8.0); 32 | return Scaffold( 33 | body: _children[selectedIndex], 34 | bottomNavigationBar: SizedBox( 35 | height: 50.0, 36 | child: BottomNavigationBar( 37 | type: BottomNavigationBarType.fixed, 38 | selectedItemColor: darkOrange, 39 | unselectedItemColor: Colors.grey, 40 | currentIndex: selectedIndex, 41 | selectedLabelStyle: labelTextStyle, 42 | unselectedLabelStyle: labelTextStyle, 43 | onTap: (index) { 44 | setState(() { 45 | selectedIndex = index; 46 | }); 47 | }, 48 | items: const [ 49 | BottomNavigationBarItem( 50 | icon: Icon(Icons.home), 51 | label: 'SWIGGY', 52 | ), 53 | BottomNavigationBarItem( 54 | icon: Icon(Icons.search), 55 | label: 'SEARCH', 56 | ), 57 | BottomNavigationBarItem( 58 | icon: Icon(Icons.add_shopping_cart), 59 | label: 'CART', 60 | ), 61 | BottomNavigationBarItem( 62 | icon: Icon(Icons.person_outline), 63 | label: 'ACCOUNT', 64 | ), 65 | ], 66 | ), 67 | ), 68 | ); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/views/mobile/mobile_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/views/mobile/home_bottom_navigation_screen.dart'; 3 | 4 | class MobileScreen extends StatelessWidget { 5 | const MobileScreen({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return const HomeBottomNavigationScreen(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/best_in_safety_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; 3 | import 'package:swiggy_ui/utils/app_colors.dart'; 4 | import 'package:swiggy_ui/utils/ui_helper.dart'; 5 | import 'package:swiggy_ui/widgets/mobile/spotlight_best_top_food_item.dart'; 6 | import 'package:swiggy_ui/widgets/responsive.dart'; 7 | 8 | class BestInSafetyViews extends StatelessWidget { 9 | const BestInSafetyViews({Key? key}) : super(key: key); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | final isTabletDesktop = Responsive.isTabletDesktop(context); 14 | final customWidth = 15 | MediaQuery.of(context).size.width / (isTabletDesktop ? 3.8 : 1.1); 16 | 17 | return Container( 18 | margin: const EdgeInsets.symmetric(vertical: 10.0), 19 | child: Column( 20 | crossAxisAlignment: CrossAxisAlignment.start, 21 | children: [ 22 | Padding( 23 | padding: const EdgeInsets.symmetric(horizontal: 10.0), 24 | child: Column( 25 | crossAxisAlignment: CrossAxisAlignment.start, 26 | children: [ 27 | Row( 28 | children: [ 29 | const Icon(Icons.security), 30 | UIHelper.horizontalSpaceExtraSmall, 31 | Text( 32 | 'Best in Safety', 33 | style: Theme.of(context) 34 | .textTheme 35 | .headline4! 36 | .copyWith(fontSize: 20.0), 37 | ), 38 | const Spacer(), 39 | Row( 40 | children: [ 41 | Text( 42 | 'SEE ALL', 43 | style: Theme.of(context) 44 | .textTheme 45 | .bodyText1! 46 | .copyWith(fontWeight: FontWeight.bold), 47 | ), 48 | UIHelper.horizontalSpaceExtraSmall, 49 | ClipOval( 50 | child: Container( 51 | alignment: Alignment.center, 52 | color: swiggyOrange, 53 | height: 25.0, 54 | width: 25.0, 55 | child: const Icon( 56 | Icons.arrow_forward_ios, 57 | size: 12.0, 58 | color: Colors.white, 59 | ), 60 | ), 61 | ) 62 | ], 63 | ) 64 | ], 65 | ), 66 | UIHelper.verticalSpaceExtraSmall, 67 | Text( 68 | 'Restaurants with best safety standards', 69 | style: Theme.of(context) 70 | .textTheme 71 | .bodyText1! 72 | .copyWith(color: Colors.grey), 73 | ), 74 | ], 75 | ), 76 | ), 77 | UIHelper.verticalSpaceMedium, 78 | LimitedBox( 79 | maxHeight: 270.0, 80 | child: ListView.builder( 81 | shrinkWrap: true, 82 | scrollDirection: Axis.horizontal, 83 | itemCount: SpotlightBestTopFood.bestRestaurants.length, 84 | itemBuilder: (context, index) => SizedBox( 85 | width: customWidth, 86 | child: Column( 87 | mainAxisSize: MainAxisSize.min, 88 | children: [ 89 | SpotlightBestTopFoodItem( 90 | restaurant: SpotlightBestTopFood.bestRestaurants[index] 91 | [0]), 92 | SpotlightBestTopFoodItem( 93 | restaurant: SpotlightBestTopFood.bestRestaurants[index] 94 | [1]) 95 | ], 96 | ), 97 | ), 98 | ), 99 | ) 100 | ], 101 | ), 102 | ); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/genie/genie_grocery_card_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/utils/app_colors.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | 5 | class GenieGroceryCardView extends StatelessWidget { 6 | const GenieGroceryCardView({ 7 | Key? key, 8 | required this.title, 9 | required this.image, 10 | required this.subtitle, 11 | this.onTap, 12 | }) : super(key: key); 13 | 14 | final String title; 15 | final String image; 16 | final String subtitle; 17 | final VoidCallback? onTap; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Expanded( 22 | child: InkWell( 23 | onTap: onTap, 24 | child: Column( 25 | mainAxisAlignment: MainAxisAlignment.end, 26 | children: [ 27 | ClipRRect( 28 | borderRadius: BorderRadius.circular(16.0), 29 | child: Container( 30 | margin: const EdgeInsets.symmetric(horizontal: 4.0), 31 | padding: const EdgeInsets.only(top: 8.0), 32 | height: 120.0, 33 | decoration: BoxDecoration( 34 | color: swiggyOrange, 35 | boxShadow: const [ 36 | BoxShadow( 37 | color: Colors.grey, 38 | blurRadius: 3.0, 39 | offset: Offset(1, 4), 40 | ) 41 | ], 42 | ), 43 | child: Column( 44 | mainAxisAlignment: MainAxisAlignment.end, 45 | crossAxisAlignment: CrossAxisAlignment.stretch, 46 | mainAxisSize: MainAxisSize.min, 47 | children: [ 48 | Text( 49 | title, 50 | textAlign: TextAlign.center, 51 | style: Theme.of(context) 52 | .textTheme 53 | .headline4! 54 | .copyWith(fontSize: 18.0, color: Colors.white), 55 | ), 56 | UIHelper.verticalSpaceSmall, 57 | Expanded( 58 | child: Image.asset( 59 | image, 60 | fit: BoxFit.cover, 61 | ), 62 | ) 63 | ], 64 | ), 65 | ), 66 | ), 67 | UIHelper.verticalSpaceMedium, 68 | Text( 69 | subtitle, 70 | maxLines: 2, 71 | textAlign: TextAlign.center, 72 | style: Theme.of(context) 73 | .textTheme 74 | .bodyText1! 75 | .copyWith(fontSize: 16.0), 76 | ), 77 | ], 78 | ), 79 | ), 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/groceries/grocery_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | import 'package:swiggy_ui/widgets/mobile/search_food_list_item_view.dart'; 5 | import 'package:swiggy_ui/widgets/responsive.dart'; 6 | 7 | class GroceryScreen extends StatelessWidget { 8 | const GroceryScreen({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Scaffold( 13 | body: SingleChildScrollView( 14 | child: Column( 15 | mainAxisSize: MainAxisSize.min, 16 | children: const [ 17 | _GroceryHeaderView(), 18 | UIHelper.verticalSpaceMedium, 19 | GroceryListView( 20 | title: '156 RESTAURANTS NEARBY', 21 | ), 22 | ], 23 | ), 24 | ), 25 | ); 26 | } 27 | } 28 | 29 | class _GroceryHeaderView extends StatelessWidget { 30 | const _GroceryHeaderView({ 31 | Key? key, 32 | }) : super(key: key); 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | final isTabletDesktop = Responsive.isTabletDesktop(context); 37 | 38 | return Stack( 39 | children: [ 40 | Image.asset( 41 | 'assets/images/banner3.jpg', 42 | height: MediaQuery.of(context).size.height / 2.1, 43 | width: double.infinity, 44 | fit: BoxFit.cover, 45 | ), 46 | if (!isTabletDesktop) 47 | Positioned( 48 | top: 40.0, 49 | left: 0.4, 50 | child: IconButton( 51 | icon: const Icon( 52 | Icons.arrow_back, 53 | size: 28.0, 54 | color: Colors.white, 55 | ), 56 | onPressed: () { 57 | Navigator.pop(context); 58 | }, 59 | ), 60 | ) 61 | ], 62 | ); 63 | } 64 | } 65 | 66 | class GroceryListView extends StatelessWidget { 67 | const GroceryListView({ 68 | Key? key, 69 | required this.title, 70 | }) : super(key: key); 71 | 72 | final String title; 73 | 74 | @override 75 | Widget build(BuildContext context) { 76 | const restaurants = SpotlightBestTopFood.topGroceryRestaurants; 77 | 78 | final headerStyle = Theme.of(context) 79 | .textTheme 80 | .bodyText1! 81 | .copyWith(fontWeight: FontWeight.w500, fontSize: 13.0); 82 | 83 | return Container( 84 | padding: const EdgeInsets.all(15.0), 85 | child: Column( 86 | crossAxisAlignment: CrossAxisAlignment.start, 87 | mainAxisSize: MainAxisSize.min, 88 | children: [ 89 | Row( 90 | mainAxisAlignment: MainAxisAlignment.start, 91 | crossAxisAlignment: CrossAxisAlignment.center, 92 | children: [ 93 | Text( 94 | title, 95 | style: headerStyle, 96 | ), 97 | const Spacer(), 98 | const Icon(Icons.filter_list), 99 | UIHelper.horizontalSpaceSmall, 100 | Text('SORT/FILTER', style: headerStyle) 101 | ], 102 | ), 103 | UIHelper.verticalSpaceSmall, 104 | ListView.builder( 105 | shrinkWrap: true, 106 | physics: const NeverScrollableScrollPhysics(), 107 | itemCount: restaurants.length, 108 | itemBuilder: (context, index) => SearchFoodListItemView( 109 | food: restaurants[index], 110 | ), 111 | ) 112 | ], 113 | ), 114 | ); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/in_the_spotlight_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | import 'package:swiggy_ui/widgets/mobile/spotlight_best_top_food_item.dart'; 5 | import 'package:swiggy_ui/widgets/responsive.dart'; 6 | 7 | class InTheSpotlightView extends StatelessWidget { 8 | const InTheSpotlightView({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | const restaurants = SpotlightBestTopFood.spotlightRestaurants; 13 | final isTabletDesktop = Responsive.isTabletDesktop(context); 14 | final customWidth = 15 | MediaQuery.of(context).size.width / (isTabletDesktop ? 3.8 : 1.1); 16 | 17 | return Container( 18 | margin: const EdgeInsets.symmetric(vertical: 15.0), 19 | child: Column( 20 | mainAxisSize: MainAxisSize.min, 21 | children: [ 22 | UIHelper.verticalSpaceSmall, 23 | _buildSpotlightHeaderView(context), 24 | UIHelper.verticalSpaceMedium, 25 | LimitedBox( 26 | maxHeight: 270.0, 27 | child: ListView.builder( 28 | shrinkWrap: true, 29 | scrollDirection: Axis.horizontal, 30 | itemCount: restaurants.length, 31 | itemBuilder: (context, index) => SizedBox( 32 | width: customWidth, 33 | child: Column( 34 | mainAxisSize: MainAxisSize.min, 35 | children: [ 36 | SpotlightBestTopFoodItem(restaurant: restaurants[index][0]), 37 | SpotlightBestTopFoodItem(restaurant: restaurants[index][1]) 38 | ], 39 | ), 40 | ), 41 | ), 42 | ) 43 | ], 44 | ), 45 | ); 46 | } 47 | 48 | Container _buildSpotlightHeaderView(BuildContext context) => Container( 49 | margin: const EdgeInsets.symmetric(horizontal: 10.0), 50 | child: Column( 51 | crossAxisAlignment: CrossAxisAlignment.start, 52 | children: [ 53 | Row( 54 | children: [ 55 | const Icon(Icons.shopping_basket, size: 20.0), 56 | UIHelper.horizontalSpaceSmall, 57 | Text( 58 | 'In the Spotlight!', 59 | style: Theme.of(context) 60 | .textTheme 61 | .headline4! 62 | .copyWith(fontSize: 20.0), 63 | ) 64 | ], 65 | ), 66 | UIHelper.verticalSpaceExtraSmall, 67 | Text( 68 | 'Explore sponsored partner brands', 69 | style: Theme.of(context) 70 | .textTheme 71 | .bodyText1! 72 | .copyWith(color: Colors.grey), 73 | ), 74 | ], 75 | ), 76 | ); 77 | } 78 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/indian_food/indian_delight_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/utils/ui_helper.dart'; 3 | 4 | import '../groceries/grocery_screen.dart'; 5 | 6 | class IndianDelightScreen extends StatelessWidget { 7 | const IndianDelightScreen({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | body: Stack( 13 | children: [ 14 | Positioned.fill( 15 | child: SingleChildScrollView( 16 | child: Column( 17 | mainAxisSize: MainAxisSize.min, 18 | children: [ 19 | Image.asset( 20 | 'assets/images/banner3.jpg', 21 | height: MediaQuery.of(context).size.height / 5.0, 22 | width: double.infinity, 23 | fit: BoxFit.cover, 24 | ), 25 | UIHelper.verticalSpaceMedium, 26 | Container( 27 | padding: const EdgeInsets.symmetric(horizontal: 10.0), 28 | child: Column( 29 | crossAxisAlignment: CrossAxisAlignment.start, 30 | children: [ 31 | Text( 32 | 'SOUTH INDIAN DELIGHTS', 33 | style: Theme.of(context) 34 | .textTheme 35 | .subtitle2! 36 | .copyWith(fontSize: 19.0), 37 | ), 38 | UIHelper.verticalSpaceSmall, 39 | const Text( 40 | 'Feast on authentic South Indian fare from top restaurants near you'), 41 | UIHelper.verticalSpaceSmall, 42 | const Divider(), 43 | ], 44 | ), 45 | ), 46 | const GroceryListView( 47 | title: 'SEE ALL RESTAURANTS', 48 | ), 49 | ], 50 | ), 51 | ), 52 | ), 53 | Positioned( 54 | top: 10.0, 55 | left: 2.4, 56 | child: IconButton( 57 | icon: const Icon( 58 | Icons.arrow_back, 59 | size: 28.0, 60 | color: Colors.white, 61 | ), 62 | onPressed: () { 63 | Navigator.pop(context); 64 | }, 65 | ), 66 | ), 67 | ], 68 | ), 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/indian_food/indian_food_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/indian_food.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | 5 | import 'indian_delight_screen.dart'; 6 | 7 | class IndianFoodView extends StatelessWidget { 8 | const IndianFoodView({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | const restaurants = IndianFood.indianRestaurants; 13 | 14 | return Container( 15 | margin: const EdgeInsets.all(15.0), 16 | height: 150.0, 17 | child: ListView.builder( 18 | shrinkWrap: true, 19 | scrollDirection: Axis.horizontal, 20 | itemCount: restaurants.length, 21 | itemBuilder: (context, index) => InkWell( 22 | child: Container( 23 | margin: const EdgeInsets.symmetric(horizontal: 12.0), 24 | child: Column( 25 | mainAxisSize: MainAxisSize.min, 26 | mainAxisAlignment: MainAxisAlignment.center, 27 | children: [ 28 | ClipOval( 29 | child: Image.asset( 30 | restaurants[index].image, 31 | height: 80.0, 32 | width: 80.0, 33 | fit: BoxFit.cover, 34 | ), 35 | ), 36 | UIHelper.verticalSpaceExtraSmall, 37 | Text( 38 | restaurants[index].name, 39 | style: Theme.of(context) 40 | .textTheme 41 | .subtitle2! 42 | .copyWith(color: Colors.grey[700]), 43 | ) 44 | ], 45 | ), 46 | ), 47 | onTap: () { 48 | Navigator.push( 49 | context, 50 | MaterialPageRoute( 51 | builder: (context) => const IndianDelightScreen(), 52 | ), 53 | ); 54 | }, 55 | ), 56 | ), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/offers/offer_banner_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:card_swiper/card_swiper.dart'; 3 | import 'package:swiggy_ui/widgets/responsive.dart'; 4 | 5 | import '../groceries/grocery_screen.dart'; 6 | 7 | class OfferBannerView extends StatelessWidget { 8 | const OfferBannerView({Key? key}) : super(key: key); 9 | 10 | static const List images = [ 11 | 'assets/images/banner1.jpg', 12 | 'assets/images/banner2.jpg', 13 | 'assets/images/banner3.jpg', 14 | 'assets/images/banner4.jpg', 15 | ]; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | final isTabletDesktop = Responsive.isTabletDesktop(context); 20 | 21 | return InkWell( 22 | child: Container( 23 | margin: const EdgeInsets.symmetric(vertical: 15.0), 24 | height: isTabletDesktop ? 260.0 : 180.0, 25 | decoration: BoxDecoration( 26 | borderRadius: BorderRadius.circular(isTabletDesktop ? 13.0 : 10.0), 27 | ), 28 | child: Swiper( 29 | itemHeight: 100, 30 | duration: 500, 31 | itemWidth: double.infinity, 32 | pagination: const SwiperPagination(), 33 | itemCount: images.length, 34 | itemBuilder: (BuildContext context, int index) => Image.asset( 35 | images[index], 36 | fit: BoxFit.cover, 37 | ), 38 | autoplay: true, 39 | viewportFraction: 1.0, 40 | scale: 0.9, 41 | ), 42 | ), 43 | onTap: () { 44 | Navigator.push( 45 | context, 46 | MaterialPageRoute( 47 | builder: (context) => const GroceryScreen(), 48 | ), 49 | ); 50 | }, 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/popular_brand_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/popular_brands.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | import 'package:swiggy_ui/views/mobile/swiggy/restaurants/restaurant_detail_screen.dart'; 5 | import 'package:swiggy_ui/widgets/responsive.dart'; 6 | 7 | class PopularBrandsView extends StatelessWidget { 8 | const PopularBrandsView({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | const brands = PopularBrands.popularBrands; 13 | final isTabletDesktop = Responsive.isTabletDesktop(context); 14 | 15 | return Container( 16 | margin: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 10.0), 17 | child: Column( 18 | mainAxisSize: MainAxisSize.min, 19 | children: [ 20 | UIHelper.verticalSpaceSmall, 21 | _buildPopularHeader(context), 22 | LimitedBox( 23 | maxHeight: 170.0, 24 | child: Padding( 25 | padding: const EdgeInsets.symmetric(vertical: 20.0), 26 | child: ListView.builder( 27 | shrinkWrap: true, 28 | scrollDirection: Axis.horizontal, 29 | itemCount: brands.length, 30 | itemBuilder: (context, index) => InkWell( 31 | onTap: isTabletDesktop 32 | ? () {} 33 | : () { 34 | Navigator.push( 35 | context, 36 | MaterialPageRoute( 37 | builder: (context) => 38 | const RestaurantDetailScreen(), 39 | ), 40 | ); 41 | }, 42 | child: Container( 43 | margin: const EdgeInsets.only(right: 15.0), 44 | child: Column( 45 | mainAxisSize: MainAxisSize.min, 46 | children: [ 47 | Container( 48 | decoration: BoxDecoration( 49 | border: Border.all( 50 | color: Colors.grey[300]!, 51 | width: 3.0, 52 | ), 53 | borderRadius: BorderRadius.circular(40.0), 54 | ), 55 | child: ClipOval( 56 | child: Image.asset( 57 | brands[index].image, 58 | height: 80.0, 59 | width: 80.0, 60 | fit: BoxFit.cover, 61 | ), 62 | ), 63 | ), 64 | UIHelper.verticalSpaceSmall, 65 | Text( 66 | brands[index].name, 67 | style: Theme.of(context) 68 | .textTheme 69 | .subtitle2! 70 | .copyWith(fontWeight: FontWeight.w500), 71 | ), 72 | const SizedBox(height: 2.0), 73 | Text( 74 | brands[index].minutes, 75 | style: Theme.of(context) 76 | .textTheme 77 | .bodyText1! 78 | .copyWith(color: Colors.grey, fontSize: 13.0), 79 | ) 80 | ], 81 | ), 82 | ), 83 | ), 84 | ), 85 | ), 86 | ) 87 | ], 88 | ), 89 | ); 90 | } 91 | 92 | Widget _buildPopularHeader(BuildContext context) => Column( 93 | crossAxisAlignment: CrossAxisAlignment.stretch, 94 | children: [ 95 | Text( 96 | 'Popular Brands', 97 | style: 98 | Theme.of(context).textTheme.headline4!.copyWith(fontSize: 20.0), 99 | ), 100 | UIHelper.verticalSpaceExtraSmall, 101 | Text( 102 | 'Most ordered from around your locality', 103 | style: Theme.of(context) 104 | .textTheme 105 | .bodyText1! 106 | .copyWith(color: Colors.grey), 107 | ), 108 | ], 109 | ); 110 | } 111 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/popular_categories_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/popular_category.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | 5 | class PopularCategoriesView extends StatelessWidget { 6 | const PopularCategoriesView({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | const categories = PopularCategory.popularCategories; 11 | return Container( 12 | alignment: Alignment.topLeft, 13 | margin: const EdgeInsets.all(10.0), 14 | child: Column( 15 | mainAxisSize: MainAxisSize.min, 16 | crossAxisAlignment: CrossAxisAlignment.start, 17 | children: [ 18 | Text( 19 | 'Popular Categories', 20 | style: 21 | Theme.of(context).textTheme.headline4!.copyWith(fontSize: 20.0), 22 | ), 23 | UIHelper.verticalSpaceMedium, 24 | LimitedBox( 25 | maxHeight: 124.0, 26 | child: ListView.builder( 27 | shrinkWrap: true, 28 | scrollDirection: Axis.horizontal, 29 | itemCount: categories.length, 30 | itemBuilder: (context, index) => Container( 31 | margin: const EdgeInsets.all(10.0), 32 | width: 70.0, 33 | child: Stack( 34 | alignment: Alignment.topCenter, 35 | children: [ 36 | ClipRRect( 37 | borderRadius: BorderRadius.circular(5.0), 38 | child: Container( 39 | height: 50.0, 40 | color: Colors.grey[200], 41 | ), 42 | ), 43 | Positioned( 44 | top: 20.0, 45 | child: Column( 46 | mainAxisSize: MainAxisSize.min, 47 | children: [ 48 | Image.asset( 49 | categories[index].image, 50 | height: 40.0, 51 | width: 40.0, 52 | fit: BoxFit.cover, 53 | ), 54 | UIHelper.verticalSpaceSmall, 55 | Text( 56 | categories[index].name, 57 | maxLines: 2, 58 | textAlign: TextAlign.center, 59 | ) 60 | ], 61 | ), 62 | ), 63 | ], 64 | )), 65 | ), 66 | ) 67 | ], 68 | ), 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/restaurants/restaurant_vertical_list_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | import 'package:swiggy_ui/widgets/mobile/food_list_item_view.dart'; 5 | import 'package:swiggy_ui/widgets/responsive.dart'; 6 | 7 | import 'restaurant_detail_screen.dart'; 8 | 9 | class RestaurantVerticalListView extends StatelessWidget { 10 | final String title; 11 | final List restaurants; 12 | final bool isAllRestaurantNearby; 13 | 14 | const RestaurantVerticalListView({ 15 | Key? key, 16 | required this.title, 17 | required this.restaurants, 18 | this.isAllRestaurantNearby = false, 19 | }) : assert(title != ''), 20 | super(key: key); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | final isTabletDesktop = Responsive.isTabletDesktop(context); 25 | 26 | return Container( 27 | margin: const EdgeInsets.all(10.0), 28 | child: Column( 29 | mainAxisSize: MainAxisSize.min, 30 | crossAxisAlignment: CrossAxisAlignment.start, 31 | children: [ 32 | Text( 33 | title, 34 | style: 35 | Theme.of(context).textTheme.headline4!.copyWith(fontSize: 20.0), 36 | ), 37 | isAllRestaurantNearby 38 | ? Column( 39 | crossAxisAlignment: CrossAxisAlignment.start, 40 | children: [ 41 | UIHelper.verticalSpaceExtraSmall, 42 | Text( 43 | 'Discover unique tastes near you', 44 | style: Theme.of(context) 45 | .textTheme 46 | .bodyText1! 47 | .copyWith(fontSize: 14.0), 48 | ), 49 | ], 50 | ) 51 | : const SizedBox(), 52 | UIHelper.verticalSpaceMedium, 53 | ListView.builder( 54 | shrinkWrap: true, 55 | physics: const NeverScrollableScrollPhysics(), 56 | itemCount: restaurants.length, 57 | itemBuilder: (context, index) => InkWell( 58 | onTap: isTabletDesktop 59 | ? () {} 60 | : () { 61 | Navigator.push( 62 | context, 63 | MaterialPageRoute( 64 | builder: (context) => const RestaurantDetailScreen(), 65 | ), 66 | ); 67 | }, 68 | child: FoodListItemView( 69 | restaurant: restaurants[index], 70 | ), 71 | ), 72 | ), 73 | ], 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/top_offer_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; 3 | import 'package:swiggy_ui/utils/app_colors.dart'; 4 | import 'package:swiggy_ui/utils/ui_helper.dart'; 5 | import 'package:swiggy_ui/widgets/mobile/spotlight_best_top_food_item.dart'; 6 | 7 | class TopOffersViews extends StatelessWidget { 8 | const TopOffersViews({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | margin: const EdgeInsets.symmetric(vertical: 10.0), 14 | child: Column( 15 | crossAxisAlignment: CrossAxisAlignment.start, 16 | children: [ 17 | Padding( 18 | padding: const EdgeInsets.symmetric(horizontal: 10.0), 19 | child: Column( 20 | crossAxisAlignment: CrossAxisAlignment.start, 21 | children: [ 22 | Row( 23 | children: [ 24 | const Icon(Icons.security), 25 | UIHelper.horizontalSpaceExtraSmall, 26 | Text( 27 | 'Top Offers', 28 | style: Theme.of(context) 29 | .textTheme 30 | .headline4! 31 | .copyWith(fontSize: 20.0), 32 | ), 33 | const Spacer(), 34 | Row( 35 | children: [ 36 | Text( 37 | 'SEE ALL', 38 | style: Theme.of(context) 39 | .textTheme 40 | .bodyText1! 41 | .copyWith(fontWeight: FontWeight.bold), 42 | ), 43 | UIHelper.horizontalSpaceExtraSmall, 44 | ClipOval( 45 | child: Container( 46 | alignment: Alignment.center, 47 | color: swiggyOrange, 48 | height: 25.0, 49 | width: 25.0, 50 | child: const Icon( 51 | Icons.arrow_forward_ios, 52 | size: 12.0, 53 | color: Colors.white, 54 | ), 55 | ), 56 | ) 57 | ], 58 | ) 59 | ], 60 | ), 61 | UIHelper.verticalSpaceExtraSmall, 62 | Text( 63 | 'Get 20-50% Off', 64 | style: Theme.of(context) 65 | .textTheme 66 | .bodyText1! 67 | .copyWith(color: Colors.grey), 68 | ), 69 | ], 70 | ), 71 | ), 72 | UIHelper.verticalSpaceMedium, 73 | LimitedBox( 74 | maxHeight: 270.0, 75 | child: ListView.builder( 76 | shrinkWrap: true, 77 | scrollDirection: Axis.horizontal, 78 | itemCount: SpotlightBestTopFood.topRestaurants.length, 79 | itemBuilder: (context, index) => SizedBox( 80 | width: MediaQuery.of(context).size.width / 1.1, 81 | child: Column( 82 | mainAxisSize: MainAxisSize.min, 83 | children: [ 84 | SpotlightBestTopFoodItem( 85 | restaurant: SpotlightBestTopFood.topRestaurants[index] 86 | [0]), 87 | SpotlightBestTopFoodItem( 88 | restaurant: SpotlightBestTopFood.topRestaurants[index] 89 | [1]) 90 | ], 91 | ), 92 | ), 93 | ), 94 | ) 95 | ], 96 | ), 97 | ); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /lib/views/mobile/swiggy/top_picks_for_you_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/top_picks_food.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | import 'package:swiggy_ui/views/mobile/swiggy/restaurants/restaurant_detail_screen.dart'; 5 | 6 | class TopPicksForYouView extends StatelessWidget { 7 | const TopPicksForYouView({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | const foods = TopPicksFood.topPicksfoods; 12 | 13 | return Container( 14 | margin: const EdgeInsets.all(15.0), 15 | child: Column( 16 | children: [ 17 | Row( 18 | children: [ 19 | const Icon(Icons.thumb_up, size: 20.0), 20 | UIHelper.horizontalSpaceSmall, 21 | Text( 22 | 'Top Picks For You', 23 | style: Theme.of(context) 24 | .textTheme 25 | .headline4! 26 | .copyWith(fontSize: 20.0), 27 | ) 28 | ], 29 | ), 30 | UIHelper.verticalSpaceLarge, 31 | LimitedBox( 32 | maxHeight: 188.0, 33 | child: ListView.builder( 34 | shrinkWrap: true, 35 | scrollDirection: Axis.horizontal, 36 | itemCount: foods.length, 37 | itemBuilder: (context, index) => InkWell( 38 | onTap: () { 39 | Navigator.push( 40 | context, 41 | MaterialPageRoute( 42 | builder: (context) => const RestaurantDetailScreen(), 43 | ), 44 | ); 45 | }, 46 | child: Container( 47 | margin: const EdgeInsets.all(10.0), 48 | width: 100.0, 49 | child: Column( 50 | mainAxisSize: MainAxisSize.min, 51 | crossAxisAlignment: CrossAxisAlignment.start, 52 | children: [ 53 | Container( 54 | decoration: BoxDecoration( 55 | borderRadius: BorderRadius.circular(10.0), 56 | boxShadow: const [ 57 | BoxShadow( 58 | color: Colors.grey, 59 | blurRadius: 2.0, 60 | ) 61 | ], 62 | ), 63 | child: Image.asset( 64 | foods[index].image, 65 | width: 100.0, 66 | height: 100.0, 67 | fit: BoxFit.cover, 68 | ), 69 | ), 70 | UIHelper.verticalSpaceSmall, 71 | Flexible( 72 | child: Text( 73 | foods[index].name, 74 | maxLines: 2, 75 | style: 76 | Theme.of(context).textTheme.subtitle2!.copyWith( 77 | fontSize: 14.0, 78 | fontWeight: FontWeight.w600, 79 | ), 80 | ), 81 | ), 82 | UIHelper.verticalSpaceExtraSmall, 83 | Text( 84 | foods[index].minutes, 85 | maxLines: 1, 86 | style: Theme.of(context).textTheme.bodyText1!.copyWith( 87 | color: Colors.grey[700], 88 | fontSize: 13.0, 89 | ), 90 | ) 91 | ], 92 | ), 93 | ), 94 | ), 95 | ), 96 | ) 97 | ], 98 | ), 99 | ); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /lib/views/tab_desktop/desktop_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'cart_view.dart'; 4 | import 'home_view.dart'; 5 | import 'menu_view.dart'; 6 | 7 | class DesktopScreen extends StatelessWidget { 8 | const DesktopScreen({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Scaffold( 13 | body: Row( 14 | crossAxisAlignment: CrossAxisAlignment.start, 15 | children: const [ 16 | MenuView(), 17 | HomeView(), 18 | CartView(), 19 | ], 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/views/tab_desktop/home_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | import 'package:swiggy_ui/views/mobile/swiggy/best_in_safety_view.dart'; 5 | import 'package:swiggy_ui/views/mobile/swiggy/food_groceries_availability_view.dart'; 6 | import 'package:swiggy_ui/views/mobile/swiggy/in_the_spotlight_view.dart'; 7 | import 'package:swiggy_ui/views/mobile/swiggy/offers/offer_banner_view.dart'; 8 | import 'package:swiggy_ui/views/mobile/swiggy/popular_brand_view.dart'; 9 | import 'package:swiggy_ui/views/mobile/swiggy/popular_categories_view.dart'; 10 | import 'package:swiggy_ui/views/mobile/swiggy/restaurants/restaurant_vertical_list_view.dart'; 11 | import 'package:swiggy_ui/views/mobile/swiggy/swiggy_safety_banner_view.dart'; 12 | import 'package:swiggy_ui/views/mobile/swiggy/swiggy_screen.dart'; 13 | import 'package:swiggy_ui/views/mobile/swiggy/top_offer_view.dart'; 14 | import 'package:swiggy_ui/widgets/custom_divider_view.dart'; 15 | 16 | class HomeView extends StatelessWidget { 17 | const HomeView({Key? key, this.expandFlex = 4}) : super(key: key); 18 | 19 | final int expandFlex; 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Expanded( 24 | flex: expandFlex, 25 | child: Container( 26 | padding: const EdgeInsets.only(top: 40.0, bottom: 20.0), 27 | color: Colors.grey[50], 28 | child: Column( 29 | crossAxisAlignment: CrossAxisAlignment.start, 30 | children: [ 31 | _Search(), 32 | _Body(), 33 | ], 34 | ), 35 | ), 36 | ); 37 | } 38 | } 39 | 40 | class _Body extends StatelessWidget { 41 | @override 42 | Widget build(BuildContext context) { 43 | return Expanded( 44 | child: SingleChildScrollView( 45 | child: Column( 46 | crossAxisAlignment: CrossAxisAlignment.start, 47 | children: const [ 48 | OfferBannerView(), 49 | PopularBrandsView(), 50 | CustomDividerView(), 51 | InTheSpotlightView(), 52 | CustomDividerView(), 53 | PopularCategoriesView(), 54 | CustomDividerView(), 55 | SwiggySafetyBannerView(), 56 | BestInSafetyViews(), 57 | CustomDividerView(), 58 | TopOffersViews(), 59 | CustomDividerView(), 60 | FoodGroceriesAvailabilityView(), 61 | CustomDividerView(), 62 | RestaurantVerticalListView( 63 | title: 'Popular Restaurants', 64 | restaurants: SpotlightBestTopFood.popularAllRestaurants, 65 | ), 66 | CustomDividerView(), 67 | RestaurantVerticalListView( 68 | title: 'All Restaurants Nearby', 69 | restaurants: SpotlightBestTopFood.popularAllRestaurants, 70 | isAllRestaurantNearby: true, 71 | ), 72 | SeeAllRestaurantBtn(), 73 | LiveForFoodView() 74 | ], 75 | ), 76 | ), 77 | ); 78 | } 79 | } 80 | 81 | class _Search extends StatelessWidget { 82 | @override 83 | Widget build(BuildContext context) { 84 | return Container( 85 | margin: const EdgeInsets.symmetric(vertical: 20.0, horizontal: 40.0), 86 | padding: const EdgeInsets.symmetric(vertical: 17.0, horizontal: 20.0), 87 | decoration: BoxDecoration( 88 | color: Colors.white, 89 | borderRadius: BorderRadius.circular(13.0), 90 | boxShadow: [ 91 | BoxShadow( 92 | color: Colors.grey[300]!, 93 | blurRadius: 2.0, 94 | spreadRadius: 0.0, 95 | offset: const Offset(2.0, 2.0), 96 | ) 97 | ], 98 | ), 99 | child: Row( 100 | children: [ 101 | const Icon(Icons.search_outlined), 102 | UIHelper.horizontalSpaceMedium, 103 | Expanded( 104 | child: Text( 105 | 'What would you like to eat?', 106 | style: Theme.of(context).textTheme.subtitle1!.copyWith( 107 | color: Colors.grey[700], 108 | fontWeight: FontWeight.bold, 109 | ), 110 | ), 111 | ), 112 | UIHelper.horizontalSpaceMedium, 113 | const Icon(Icons.filter_list_outlined) 114 | ], 115 | ), 116 | ); 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /lib/views/tab_desktop/tab_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'home_view.dart'; 4 | import 'menu_view.dart'; 5 | 6 | class TabScreen extends StatelessWidget { 7 | const TabScreen({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | body: Row( 13 | crossAxisAlignment: CrossAxisAlignment.start, 14 | children: const [ 15 | MenuView(isTab: true, expandFlex: 1), 16 | HomeView(expandFlex: 5), 17 | ], 18 | ), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/widgets/custom_divider_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomDividerView extends StatelessWidget { 4 | final double dividerHeight; 5 | final Color? color; 6 | 7 | const CustomDividerView({ 8 | Key? key, 9 | this.dividerHeight = 10.0, 10 | this.color, 11 | }) : assert(dividerHeight != 0.0), 12 | super(key: key); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Container( 17 | height: dividerHeight, 18 | width: double.infinity, 19 | color: color ?? Colors.grey[200], 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/widgets/dotted_seperator_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DottedSeperatorView extends StatelessWidget { 4 | const DottedSeperatorView({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return SizedBox( 9 | height: 8.0, 10 | child: ListView.builder( 11 | shrinkWrap: true, 12 | scrollDirection: Axis.horizontal, 13 | itemCount: 400, 14 | itemBuilder: (context, index) => ClipOval( 15 | child: Container( 16 | margin: const EdgeInsets.all(3.0), 17 | width: 2.0, 18 | color: Colors.grey, 19 | ), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/widgets/mobile/food_list_item_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../../models/spotlight_best_top_food.dart'; 4 | import '../../utils/ui_helper.dart'; 5 | 6 | class FoodListItemView extends StatelessWidget { 7 | final SpotlightBestTopFood restaurant; 8 | 9 | const FoodListItemView({ 10 | Key? key, 11 | required this.restaurant, 12 | }) : super(key: key); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Container( 17 | margin: const EdgeInsets.all(10.0), 18 | child: Row( 19 | children: [ 20 | Container( 21 | decoration: BoxDecoration( 22 | borderRadius: BorderRadius.circular(10.0), 23 | color: Colors.white, 24 | boxShadow: const [ 25 | BoxShadow( 26 | color: Colors.grey, 27 | blurRadius: 2.0, 28 | ) 29 | ], 30 | ), 31 | child: Image.asset( 32 | restaurant.image, 33 | height: 80.0, 34 | width: 80.0, 35 | fit: BoxFit.fill, 36 | ), 37 | ), 38 | UIHelper.horizontalSpaceMedium, 39 | Column( 40 | mainAxisAlignment: MainAxisAlignment.start, 41 | crossAxisAlignment: CrossAxisAlignment.start, 42 | children: [ 43 | Text( 44 | restaurant.name, 45 | style: Theme.of(context) 46 | .textTheme 47 | .subtitle2! 48 | .copyWith(fontSize: 18.0), 49 | ), 50 | Text(restaurant.desc, 51 | style: Theme.of(context) 52 | .textTheme 53 | .bodyText1! 54 | .copyWith(color: Colors.grey[800], fontSize: 13.5)), 55 | UIHelper.verticalSpaceExtraSmall, 56 | Text( 57 | restaurant.coupon, 58 | style: Theme.of(context) 59 | .textTheme 60 | .bodyText1! 61 | .copyWith(color: Colors.red[900], fontSize: 13.0), 62 | ), 63 | UIHelper.verticalSpaceSmall, 64 | Row( 65 | children: [ 66 | Icon( 67 | Icons.star, 68 | size: 14.0, 69 | color: Colors.grey[600], 70 | ), 71 | Text(restaurant.ratingTimePrice) 72 | ], 73 | ) 74 | ], 75 | ) 76 | ], 77 | ), 78 | ); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /lib/widgets/mobile/search_food_list_item_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | 5 | class SearchFoodListItemView extends StatelessWidget { 6 | const SearchFoodListItemView({ 7 | Key? key, 8 | required this.food, 9 | }) : super(key: key); 10 | 11 | final SpotlightBestTopFood food; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Container( 16 | margin: const EdgeInsets.all(10.0), 17 | child: Row( 18 | crossAxisAlignment: CrossAxisAlignment.start, 19 | children: [ 20 | Container( 21 | decoration: BoxDecoration( 22 | borderRadius: BorderRadius.circular(10.0), 23 | color: Colors.white, 24 | boxShadow: const [ 25 | BoxShadow( 26 | color: Colors.grey, 27 | blurRadius: 2.0, 28 | ) 29 | ], 30 | ), 31 | child: Image.asset( 32 | food.image, 33 | height: 80.0, 34 | width: 80.0, 35 | fit: BoxFit.fill, 36 | ), 37 | ), 38 | UIHelper.horizontalSpaceSmall, 39 | Expanded( 40 | child: Column( 41 | mainAxisAlignment: MainAxisAlignment.start, 42 | crossAxisAlignment: CrossAxisAlignment.start, 43 | children: [ 44 | Text( 45 | food.name, 46 | style: Theme.of(context) 47 | .textTheme 48 | .subtitle2! 49 | .copyWith(fontSize: 15.0), 50 | ), 51 | Text(food.desc, 52 | style: Theme.of(context) 53 | .textTheme 54 | .bodyText1! 55 | .copyWith(color: Colors.grey[600], fontSize: 13.5)), 56 | UIHelper.verticalSpaceSmall, 57 | Row( 58 | children: [ 59 | Icon( 60 | Icons.star, 61 | size: 14.0, 62 | color: Colors.grey[600], 63 | ), 64 | Text(food.ratingTimePrice) 65 | ], 66 | ) 67 | ], 68 | ), 69 | ) 70 | ], 71 | ), 72 | ); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /lib/widgets/mobile/spotlight_best_top_food_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:swiggy_ui/models/spotlight_best_top_food.dart'; 3 | import 'package:swiggy_ui/utils/ui_helper.dart'; 4 | import 'package:swiggy_ui/views/mobile/swiggy/restaurants/restaurant_detail_screen.dart'; 5 | import 'package:swiggy_ui/widgets/responsive.dart'; 6 | 7 | class SpotlightBestTopFoodItem extends StatelessWidget { 8 | const SpotlightBestTopFoodItem({ 9 | Key? key, 10 | required this.restaurant, 11 | }) : super(key: key); 12 | 13 | final SpotlightBestTopFood restaurant; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | final isTabletDesktop = Responsive.isTabletDesktop(context); 18 | 19 | return InkWell( 20 | onTap: isTabletDesktop 21 | ? () {} 22 | : () { 23 | Navigator.push( 24 | context, 25 | MaterialPageRoute( 26 | builder: (context) => const RestaurantDetailScreen(), 27 | ), 28 | ); 29 | }, 30 | child: Container( 31 | margin: const EdgeInsets.all(15.0), 32 | child: Row( 33 | children: [ 34 | Container( 35 | decoration: BoxDecoration( 36 | borderRadius: BorderRadius.circular(10.0), 37 | color: Colors.white, 38 | boxShadow: const [ 39 | BoxShadow( 40 | color: Colors.grey, 41 | blurRadius: 2.0, 42 | ) 43 | ], 44 | ), 45 | child: Image.asset( 46 | restaurant.image, 47 | height: 100.0, 48 | width: 100.0, 49 | fit: BoxFit.cover, 50 | ), 51 | ), 52 | UIHelper.horizontalSpaceSmall, 53 | Expanded( 54 | child: Column( 55 | mainAxisSize: MainAxisSize.min, 56 | mainAxisAlignment: MainAxisAlignment.start, 57 | crossAxisAlignment: CrossAxisAlignment.start, 58 | children: [ 59 | Text( 60 | restaurant.name, 61 | maxLines: 1, 62 | style: Theme.of(context) 63 | .textTheme 64 | .subtitle2! 65 | .copyWith(fontSize: 18.0), 66 | ), 67 | Text( 68 | restaurant.desc, 69 | maxLines: 2, 70 | style: Theme.of(context) 71 | .textTheme 72 | .bodyText1! 73 | .copyWith(color: Colors.grey[800], fontSize: 13.5), 74 | ), 75 | UIHelper.verticalSpaceSmall, 76 | Text( 77 | restaurant.coupon, 78 | style: Theme.of(context) 79 | .textTheme 80 | .bodyText1! 81 | .copyWith(color: Colors.red[900], fontSize: 13.0), 82 | ), 83 | const Divider(), 84 | FittedBox( 85 | child: Row( 86 | children: [ 87 | Icon( 88 | Icons.star, 89 | size: 14.0, 90 | color: Colors.grey[600], 91 | ), 92 | Text(restaurant.ratingTimePrice, 93 | style: const TextStyle(fontSize: 12.0)) 94 | ], 95 | ), 96 | ) 97 | ], 98 | ), 99 | ) 100 | ], 101 | ), 102 | ), 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /lib/widgets/responsive.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class Responsive extends StatelessWidget { 4 | const Responsive({ 5 | Key? key, 6 | required this.mobile, 7 | required this.tablet, 8 | required this.desktop, 9 | }) : super(key: key); 10 | 11 | final Widget mobile; 12 | final Widget tablet; 13 | final Widget desktop; 14 | 15 | static bool isMobile(BuildContext context) { 16 | return MediaQuery.of(context).size.width < 650; 17 | } 18 | 19 | static bool isTablet(BuildContext context) { 20 | return MediaQuery.of(context).size.width >= 650 && MediaQuery.of(context).size.width < 1100; 21 | } 22 | 23 | static bool isDesktop(BuildContext context) { 24 | return MediaQuery.of(context).size.width >= 1100; 25 | } 26 | 27 | static bool isTabletDesktop(BuildContext context) { 28 | return MediaQuery.of(context).size.width >= 650; 29 | } 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | return LayoutBuilder( 34 | builder: (context, constraints) { 35 | if (constraints.maxWidth >= 1100) { 36 | return desktop; 37 | } else if (constraints.maxWidth >= 650) { 38 | return tablet; 39 | } else { 40 | return mobile; 41 | } 42 | }, 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/widgets/veg_badge_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class VegBadgeView extends StatelessWidget { 4 | const VegBadgeView({Key? key}) : super(key: key); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return Container( 9 | padding: const EdgeInsets.all(2.0), 10 | height: 15.0, 11 | width: 15.0, 12 | decoration: BoxDecoration( 13 | border: Border.all(color: Colors.green[800]!), 14 | ), 15 | child: ClipOval( 16 | child: Container( 17 | height: 5.0, 18 | width: 5.0, 19 | color: Colors.green[800], 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(runner LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "swiggy_ui") 5 | set(APPLICATION_ID "com.example.swiggy_ui") 6 | 7 | cmake_policy(SET CMP0063 NEW) 8 | 9 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 10 | 11 | # Root filesystem for cross-building. 12 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 13 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 14 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 15 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 16 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 17 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 18 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 19 | endif() 20 | 21 | # Configure build options. 22 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 23 | set(CMAKE_BUILD_TYPE "Debug" CACHE 24 | STRING "Flutter build mode" FORCE) 25 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 26 | "Debug" "Profile" "Release") 27 | endif() 28 | 29 | # Compilation settings that should be applied to most targets. 30 | function(APPLY_STANDARD_SETTINGS TARGET) 31 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 32 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 33 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 34 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 35 | endfunction() 36 | 37 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 38 | 39 | # Flutter library and tool build rules. 40 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 41 | 42 | # System-level dependencies. 43 | find_package(PkgConfig REQUIRED) 44 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 45 | 46 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 47 | 48 | # Application build 49 | add_executable(${BINARY_NAME} 50 | "main.cc" 51 | "my_application.cc" 52 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 53 | ) 54 | apply_standard_settings(${BINARY_NAME}) 55 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 56 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 57 | add_dependencies(${BINARY_NAME} flutter_assemble) 58 | # Only the install-generated bundle's copy of the executable will launch 59 | # correctly, since the resources must in the right relative locations. To avoid 60 | # people trying to run the unbundled copy, put it in a subdirectory instead of 61 | # the default top-level location. 62 | set_target_properties(${BINARY_NAME} 63 | PROPERTIES 64 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 65 | ) 66 | 67 | # Generated plugin build rules, which manage building the plugins and adding 68 | # them to the application. 69 | include(flutter/generated_plugins.cmake) 70 | 71 | 72 | # === Installation === 73 | # By default, "installing" just makes a relocatable bundle in the build 74 | # directory. 75 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 76 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 77 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 78 | endif() 79 | 80 | # Start with a clean build bundle directory every time. 81 | install(CODE " 82 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 83 | " COMPONENT Runtime) 84 | 85 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 86 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 87 | 88 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 89 | COMPONENT Runtime) 90 | 91 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 92 | COMPONENT Runtime) 93 | 94 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 95 | COMPONENT Runtime) 96 | 97 | if(PLUGIN_BUNDLED_LIBRARIES) 98 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 99 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 100 | COMPONENT Runtime) 101 | endif() 102 | 103 | # Fully re-copy the assets directory on each build to avoid having stale files 104 | # from a previous install. 105 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 106 | install(CODE " 107 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 108 | " COMPONENT Runtime) 109 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 110 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 111 | 112 | # Install the AOT library on non-Debug builds only. 113 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 114 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 115 | COMPONENT Runtime) 116 | endif() 117 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | 11 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 12 | # which isn't available in 3.10. 13 | function(list_prepend LIST_NAME PREFIX) 14 | set(NEW_LIST "") 15 | foreach(element ${${LIST_NAME}}) 16 | list(APPEND NEW_LIST "${PREFIX}${element}") 17 | endforeach(element) 18 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 19 | endfunction() 20 | 21 | # === Flutter Library === 22 | # System-level dependencies. 23 | find_package(PkgConfig REQUIRED) 24 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 25 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 26 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 27 | 28 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 29 | 30 | # Published to parent scope for install step. 31 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 32 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 33 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 34 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 35 | 36 | list(APPEND FLUTTER_LIBRARY_HEADERS 37 | "fl_basic_message_channel.h" 38 | "fl_binary_codec.h" 39 | "fl_binary_messenger.h" 40 | "fl_dart_project.h" 41 | "fl_engine.h" 42 | "fl_json_message_codec.h" 43 | "fl_json_method_codec.h" 44 | "fl_message_codec.h" 45 | "fl_method_call.h" 46 | "fl_method_channel.h" 47 | "fl_method_codec.h" 48 | "fl_method_response.h" 49 | "fl_plugin_registrar.h" 50 | "fl_plugin_registry.h" 51 | "fl_standard_message_codec.h" 52 | "fl_standard_method_codec.h" 53 | "fl_string_codec.h" 54 | "fl_value.h" 55 | "fl_view.h" 56 | "flutter_linux.h" 57 | ) 58 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 59 | add_library(flutter INTERFACE) 60 | target_include_directories(flutter INTERFACE 61 | "${EPHEMERAL_DIR}" 62 | ) 63 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 64 | target_link_libraries(flutter INTERFACE 65 | PkgConfig::GTK 66 | PkgConfig::GLIB 67 | PkgConfig::GIO 68 | ) 69 | add_dependencies(flutter flutter_assemble) 70 | 71 | # === Flutter tool backend === 72 | # _phony_ is a non-existent file to force this command to run every time, 73 | # since currently there's no way to get a full input/output list from the 74 | # flutter tool. 75 | add_custom_command( 76 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 77 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 78 | COMMAND ${CMAKE_COMMAND} -E env 79 | ${FLUTTER_TOOL_ENVIRONMENT} 80 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 81 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 82 | VERBATIM 83 | ) 84 | add_custom_target(flutter_assemble DEPENDS 85 | "${FLUTTER_LIBRARY}" 86 | ${FLUTTER_LIBRARY_HEADERS} 87 | ) 88 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #include "generated_plugin_registrant.h" 6 | 7 | 8 | void fl_register_plugins(FlPluginRegistry* registry) { 9 | } 10 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 6 | #define GENERATED_PLUGIN_REGISTRANT_ 7 | 8 | #include 9 | 10 | // Registers Flutter plugins. 11 | void fl_register_plugins(FlPluginRegistry* registry); 12 | 13 | #endif // GENERATED_PLUGIN_REGISTRANT_ 14 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | set(PLUGIN_BUNDLED_LIBRARIES) 9 | 10 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 15 | endforeach(plugin) 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen *screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "swiggy_ui"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } 47 | else { 48 | gtk_window_set_title(window, "swiggy_ui"); 49 | } 50 | 51 | gtk_window_set_default_size(window, 1280, 720); 52 | gtk_widget_show(GTK_WIDGET(window)); 53 | 54 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 55 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 56 | 57 | FlView* view = fl_view_new(project); 58 | gtk_widget_show(GTK_WIDGET(view)); 59 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 60 | 61 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 62 | 63 | gtk_widget_grab_focus(GTK_WIDGET(view)); 64 | } 65 | 66 | // Implements GApplication::local_command_line. 67 | static gboolean my_application_local_command_line(GApplication* application, gchar ***arguments, int *exit_status) { 68 | MyApplication* self = MY_APPLICATION(application); 69 | // Strip out the first argument as it is the binary name. 70 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 71 | 72 | g_autoptr(GError) error = nullptr; 73 | if (!g_application_register(application, nullptr, &error)) { 74 | g_warning("Failed to register: %s", error->message); 75 | *exit_status = 1; 76 | return TRUE; 77 | } 78 | 79 | g_application_activate(application); 80 | *exit_status = 0; 81 | 82 | return TRUE; 83 | } 84 | 85 | // Implements GObject::dispose. 86 | static void my_application_dispose(GObject *object) { 87 | MyApplication* self = MY_APPLICATION(object); 88 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 89 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 90 | } 91 | 92 | static void my_application_class_init(MyApplicationClass* klass) { 93 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 94 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 95 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 96 | } 97 | 98 | static void my_application_init(MyApplication* self) {} 99 | 100 | MyApplication* my_application_new() { 101 | return MY_APPLICATION(g_object_new(my_application_get_type(), 102 | "application-id", APPLICATION_ID, 103 | "flags", G_APPLICATION_NON_UNIQUE, 104 | nullptr)); 105 | } 106 | -------------------------------------------------------------------------------- /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/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/xcuserdata/ 7 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import path_provider_macos 9 | 10 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 11 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 12 | } 13 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.11' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /macos/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FlutterMacOS (1.0.0) 3 | - path_provider_macos (0.0.1): 4 | - FlutterMacOS 5 | 6 | DEPENDENCIES: 7 | - FlutterMacOS (from `Flutter/ephemeral`) 8 | - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`) 9 | 10 | EXTERNAL SOURCES: 11 | FlutterMacOS: 12 | :path: Flutter/ephemeral 13 | path_provider_macos: 14 | :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos 15 | 16 | SPEC CHECKSUMS: 17 | FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 18 | path_provider_macos: 160cab0d5461f0c0e02995469a98f24bdb9a3f1f 19 | 20 | PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c 21 | 22 | COCOAPODS: 1.10.1 23 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 64 | 65 | 71 | 73 | 79 | 80 | 81 | 82 | 84 | 85 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /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 = swiggy_ui 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.swiggyUi 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2021 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 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 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: swiggy_ui 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: "none" # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 2.0.1+1 19 | 20 | environment: 21 | sdk: '>=2.12.0 <3.0.0' 22 | 23 | dependencies: 24 | card_swiper: ^1.0.2 25 | cupertino_icons: ^1.0.3 26 | flutter: 27 | sdk: flutter 28 | flutter_lints: ^1.0.4 29 | flutter_rating_bar: ^4.0.0 30 | google_fonts: ^2.1.0 31 | shimmer: ^2.0.0 32 | 33 | dev_dependencies: 34 | flutter_test: 35 | sdk: flutter 36 | 37 | # For information on the generic Dart part of this file, see the 38 | # following page: https://dart.dev/tools/pub/pubspec 39 | # The following section is specific to Flutter. 40 | flutter: 41 | # The following line ensures that the Material Icons font is 42 | # included with your application, so that you can use the icons in 43 | # the material Icons class. 44 | uses-material-design: true 45 | 46 | # To add assets to your application, add an assets section, like this: 47 | assets: 48 | - assets/images/ 49 | - assets/icons/ 50 | # - images/a_dot_ham.jpeg 51 | # An image asset can refer to one or more resolution-specific "variants", see 52 | # https://flutter.dev/assets-and-images/#resolution-aware. 53 | # For details regarding adding assets from package dependencies, see 54 | # https://flutter.dev/assets-and-images/#from-packages 55 | # To add custom fonts to your application, add a fonts section here, 56 | # in this "flutter" section. Each entry in this list should have a 57 | # "family" key with the font family name, and a "fonts" key with a 58 | # list giving the asset and other descriptors for the font. For 59 | # example: 60 | # fonts: 61 | # - family: Schyler 62 | # fonts: 63 | # - asset: fonts/Schyler-Regular.ttf 64 | # - asset: fonts/Schyler-Italic.ttf 65 | # style: italic 66 | # - family: Trajan Pro 67 | # fonts: 68 | # - asset: fonts/TrajanPro.ttf 69 | # - asset: fonts/TrajanPro_Bold.ttf 70 | # weight: 700 71 | # 72 | # For details regarding fonts from package dependencies, 73 | # see https://flutter.dev/custom-fonts/#from-packages 74 | -------------------------------------------------------------------------------- /screenshots/account1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/account1.jpg -------------------------------------------------------------------------------- /screenshots/account2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/account2.jpg -------------------------------------------------------------------------------- /screenshots/all-restaurant1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/all-restaurant1.jpg -------------------------------------------------------------------------------- /screenshots/all-restaurant2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/all-restaurant2.jpg -------------------------------------------------------------------------------- /screenshots/all-restaurant3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/all-restaurant3.jpg -------------------------------------------------------------------------------- /screenshots/all-restaurant4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/all-restaurant4.jpg -------------------------------------------------------------------------------- /screenshots/cart1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/cart1.jpg -------------------------------------------------------------------------------- /screenshots/cart2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/cart2.jpg -------------------------------------------------------------------------------- /screenshots/genie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/genie.jpg -------------------------------------------------------------------------------- /screenshots/grocery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/grocery.jpg -------------------------------------------------------------------------------- /screenshots/indian-food.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/indian-food.jpg -------------------------------------------------------------------------------- /screenshots/meat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/meat.jpg -------------------------------------------------------------------------------- /screenshots/offers1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/offers1.jpg -------------------------------------------------------------------------------- /screenshots/offers2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/offers2.jpg -------------------------------------------------------------------------------- /screenshots/restaurant-detail1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/restaurant-detail1.jpg -------------------------------------------------------------------------------- /screenshots/restaurant-detail2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/restaurant-detail2.jpg -------------------------------------------------------------------------------- /screenshots/search.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/search.jpg -------------------------------------------------------------------------------- /screenshots/swiggy1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy1.jpg -------------------------------------------------------------------------------- /screenshots/swiggy2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy2.jpg -------------------------------------------------------------------------------- /screenshots/swiggy3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy3.jpg -------------------------------------------------------------------------------- /screenshots/swiggy4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy4.jpg -------------------------------------------------------------------------------- /screenshots/swiggy5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy5.jpg -------------------------------------------------------------------------------- /screenshots/swiggy6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy6.jpg -------------------------------------------------------------------------------- /screenshots/swiggy7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy7.jpg -------------------------------------------------------------------------------- /screenshots/swiggy8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy8.jpg -------------------------------------------------------------------------------- /screenshots/swiggy_tablet_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy_tablet_ui.png -------------------------------------------------------------------------------- /screenshots/swiggy_web_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/screenshots/swiggy_web_ui.png -------------------------------------------------------------------------------- /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 that Flutter provides. 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:swiggy_ui/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 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | swiggy_ui 27 | 28 | 29 | 30 | 33 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "swiggy_ui", 3 | "short_name": "swiggy_ui", 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 | } 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(swiggy_ui LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "swiggy_ui") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #include "generated_plugin_registrant.h" 6 | 7 | 8 | void RegisterPlugins(flutter::PluginRegistry* registry) { 9 | } 10 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 6 | #define GENERATED_PLUGIN_REGISTRANT_ 7 | 8 | #include 9 | 10 | // Registers Flutter plugins. 11 | void RegisterPlugins(flutter::PluginRegistry* registry); 12 | 13 | #endif // GENERATED_PLUGIN_REGISTRANT_ 14 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | set(PLUGIN_BUNDLED_LIBRARIES) 9 | 10 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 15 | endforeach(plugin) 16 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "run_loop.cpp" 8 | "utils.cpp" 9 | "win32_window.cpp" 10 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 11 | "Runner.rc" 12 | "runner.exe.manifest" 13 | ) 14 | apply_standard_settings(${BINARY_NAME}) 15 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 16 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 17 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 18 | add_dependencies(${BINARY_NAME} flutter_assemble) 19 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "A new Flutter project." "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "swiggy_ui" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2021 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "swiggy_ui.exe" "\0" 98 | VALUE "ProductName", "swiggy_ui" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /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(RunLoop* run_loop, 8 | const flutter::DartProject& project) 9 | : run_loop_(run_loop), project_(project) {} 10 | 11 | FlutterWindow::~FlutterWindow() {} 12 | 13 | bool FlutterWindow::OnCreate() { 14 | if (!Win32Window::OnCreate()) { 15 | return false; 16 | } 17 | 18 | RECT frame = GetClientArea(); 19 | 20 | // The size here must match the window dimensions to avoid unnecessary surface 21 | // creation / destruction in the startup path. 22 | flutter_controller_ = std::make_unique( 23 | frame.right - frame.left, frame.bottom - frame.top, project_); 24 | // Ensure that basic setup of the controller was successful. 25 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 26 | return false; 27 | } 28 | RegisterPlugins(flutter_controller_->engine()); 29 | run_loop_->RegisterFlutterInstance(flutter_controller_->engine()); 30 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 31 | return true; 32 | } 33 | 34 | void FlutterWindow::OnDestroy() { 35 | if (flutter_controller_) { 36 | run_loop_->UnregisterFlutterInstance(flutter_controller_->engine()); 37 | flutter_controller_ = nullptr; 38 | } 39 | 40 | Win32Window::OnDestroy(); 41 | } 42 | 43 | LRESULT 44 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 45 | WPARAM const wparam, 46 | LPARAM const lparam) noexcept { 47 | // Give Flutter, including plugins, an opportunity to handle window messages. 48 | if (flutter_controller_) { 49 | std::optional result = 50 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 51 | lparam); 52 | if (result) { 53 | return *result; 54 | } 55 | } 56 | 57 | switch (message) { 58 | case WM_FONTCHANGE: 59 | flutter_controller_->engine()->ReloadSystemFonts(); 60 | break; 61 | } 62 | 63 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 64 | } 65 | -------------------------------------------------------------------------------- /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 "run_loop.h" 10 | #include "win32_window.h" 11 | 12 | // A window that does nothing but host a Flutter view. 13 | class FlutterWindow : public Win32Window { 14 | public: 15 | // Creates a new FlutterWindow driven by the |run_loop|, hosting a 16 | // Flutter view running |project|. 17 | explicit FlutterWindow(RunLoop* run_loop, 18 | const flutter::DartProject& project); 19 | virtual ~FlutterWindow(); 20 | 21 | protected: 22 | // Win32Window: 23 | bool OnCreate() override; 24 | void OnDestroy() override; 25 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 26 | LPARAM const lparam) noexcept override; 27 | 28 | private: 29 | // The run loop driving events for this window. 30 | RunLoop* run_loop_; 31 | 32 | // The project to run. 33 | flutter::DartProject project_; 34 | 35 | // The Flutter instance hosted by this window. 36 | std::unique_ptr flutter_controller_; 37 | }; 38 | 39 | #endif // RUNNER_FLUTTER_WINDOW_H_ 40 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "run_loop.h" 7 | #include "utils.h" 8 | 9 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 10 | _In_ wchar_t *command_line, _In_ int show_command) { 11 | // Attach to console when present (e.g., 'flutter run') or create a 12 | // new console when running with a debugger. 13 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 14 | CreateAndAttachConsole(); 15 | } 16 | 17 | // Initialize COM, so that it is available for use in the library and/or 18 | // plugins. 19 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 20 | 21 | RunLoop run_loop; 22 | 23 | flutter::DartProject project(L"data"); 24 | 25 | std::vector command_line_arguments = 26 | GetCommandLineArguments(); 27 | 28 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 29 | 30 | FlutterWindow window(&run_loop, project); 31 | Win32Window::Point origin(10, 10); 32 | Win32Window::Size size(1280, 720); 33 | if (!window.CreateAndShow(L"swiggy_ui", origin, size)) { 34 | return EXIT_FAILURE; 35 | } 36 | window.SetQuitOnClose(true); 37 | 38 | run_loop.Run(); 39 | 40 | ::CoUninitialize(); 41 | return EXIT_SUCCESS; 42 | } 43 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RudreshNarwal/flutter-swiggy-clone/8fa7e053036863a25a4924f2c482df0296650a3f/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/run_loop.cpp: -------------------------------------------------------------------------------- 1 | #include "run_loop.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | RunLoop::RunLoop() {} 8 | 9 | RunLoop::~RunLoop() {} 10 | 11 | void RunLoop::Run() { 12 | bool keep_running = true; 13 | TimePoint next_flutter_event_time = TimePoint::clock::now(); 14 | while (keep_running) { 15 | std::chrono::nanoseconds wait_duration = 16 | std::max(std::chrono::nanoseconds(0), 17 | next_flutter_event_time - TimePoint::clock::now()); 18 | ::MsgWaitForMultipleObjects( 19 | 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000), 20 | QS_ALLINPUT); 21 | bool processed_events = false; 22 | MSG message; 23 | // All pending Windows messages must be processed; MsgWaitForMultipleObjects 24 | // won't return again for items left in the queue after PeekMessage. 25 | while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { 26 | processed_events = true; 27 | if (message.message == WM_QUIT) { 28 | keep_running = false; 29 | break; 30 | } 31 | ::TranslateMessage(&message); 32 | ::DispatchMessage(&message); 33 | // Allow Flutter to process messages each time a Windows message is 34 | // processed, to prevent starvation. 35 | next_flutter_event_time = 36 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 37 | } 38 | // If the PeekMessage loop didn't run, process Flutter messages. 39 | if (!processed_events) { 40 | next_flutter_event_time = 41 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 42 | } 43 | } 44 | } 45 | 46 | void RunLoop::RegisterFlutterInstance( 47 | flutter::FlutterEngine* flutter_instance) { 48 | flutter_instances_.insert(flutter_instance); 49 | } 50 | 51 | void RunLoop::UnregisterFlutterInstance( 52 | flutter::FlutterEngine* flutter_instance) { 53 | flutter_instances_.erase(flutter_instance); 54 | } 55 | 56 | RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { 57 | TimePoint next_event_time = TimePoint::max(); 58 | for (auto instance : flutter_instances_) { 59 | std::chrono::nanoseconds wait_duration = instance->ProcessMessages(); 60 | if (wait_duration != std::chrono::nanoseconds::max()) { 61 | next_event_time = 62 | std::min(next_event_time, TimePoint::clock::now() + wait_duration); 63 | } 64 | } 65 | return next_event_time; 66 | } 67 | -------------------------------------------------------------------------------- /windows/runner/run_loop.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_RUN_LOOP_H_ 2 | #define RUNNER_RUN_LOOP_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // A runloop that will service events for Flutter instances as well 10 | // as native messages. 11 | class RunLoop { 12 | public: 13 | RunLoop(); 14 | ~RunLoop(); 15 | 16 | // Prevent copying 17 | RunLoop(RunLoop const&) = delete; 18 | RunLoop& operator=(RunLoop const&) = delete; 19 | 20 | // Runs the run loop until the application quits. 21 | void Run(); 22 | 23 | // Registers the given Flutter instance for event servicing. 24 | void RegisterFlutterInstance( 25 | flutter::FlutterEngine* flutter_instance); 26 | 27 | // Unregisters the given Flutter instance from event servicing. 28 | void UnregisterFlutterInstance( 29 | flutter::FlutterEngine* flutter_instance); 30 | 31 | private: 32 | using TimePoint = std::chrono::steady_clock::time_point; 33 | 34 | // Processes all currently pending messages for registered Flutter instances. 35 | TimePoint ProcessFlutterMessages(); 36 | 37 | std::set flutter_instances_; 38 | }; 39 | 40 | #endif // RUNNER_RUN_LOOP_H_ 41 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | --------------------------------------------------------------------------------