├── .gitignore ├── .metadata ├── .vscode └── settings.json ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle.kts │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── cookethflow │ │ │ │ └── cookethflow │ │ │ │ └── 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.kts ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle.kts ├── assets ├── fonts │ ├── Frederik-Black-BF645d9bff26630.otf │ ├── Frederik-BlackItalic-BF645d9bffac1de.otf │ ├── Frederik-Bold-BF645d9bff85e69.otf │ ├── Frederik-BoldItalic-BF645d9bff9bf5e.otf │ ├── Frederik-DemiBold-BF645d9bff7b6ff.otf │ ├── Frederik-DemiBoldItalic-BF645d9bff9aca4.otf │ ├── Frederik-ExtraBold-BF645d9bffc1a5a.otf │ ├── Frederik-ExtraBoldItalic-BF645d9bffa90f8.otf │ ├── Frederik-Heavy-BF645d9bffbbbdd.otf │ ├── Frederik-HeavyItalic-BF645d9bffd6fec.otf │ ├── Frederik-Light-BF645d9bffbac92.otf │ ├── Frederik-LightItalic-BF645d9bffa496e.otf │ ├── Frederik-Medium-BF645d9bffbc329.otf │ ├── Frederik-MediumItalic-BF645d9bff71c45.otf │ ├── Frederik-Regular-BF645d9bffaa893.otf │ ├── Frederik-RegularItalic-BF645d9bffb230a.otf │ ├── Frederik-Thin-BF645d9bffb3edf.otf │ ├── Frederik-ThinItalic-BF645d9bff5ad07.otf │ ├── Frederik-UltraLight-BF645d9bffae149.otf │ └── Frederik-UltraLightItalic-BF645d9bff6ec22.otf └── images │ ├── Frame 400.png │ ├── Frame 401.png │ ├── Frame 402.png │ └── pfp.png ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── 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 └── RunnerTests │ └── RunnerTests.swift ├── lib ├── app.dart ├── core │ ├── helpers │ │ ├── date_time_helper.dart │ │ ├── input_validators.dart │ │ ├── responsive_layout.helper.dart │ │ └── ui_helper.dart │ ├── providers │ │ └── supabase_provider.dart │ ├── router │ │ ├── app_route_config.dart │ │ └── app_route_const.dart │ ├── theme │ │ ├── app_theme.dart │ │ └── colors.dart │ └── utils │ │ ├── consts.dart │ │ ├── enums.dart │ │ └── state_handler.dart ├── features │ ├── auth │ │ ├── pages │ │ │ ├── desktop │ │ │ │ ├── login_desktop.dart │ │ │ │ └── signup_desktop.dart │ │ │ ├── login.dart │ │ │ ├── mobile │ │ │ │ ├── login_mobile.dart │ │ │ │ └── signup_mobile.dart │ │ │ ├── signup.dart │ │ │ └── tablet │ │ │ │ ├── login_tablet.dart │ │ │ │ └── signup_tablet.dart │ │ ├── providers │ │ │ └── auth_provider.dart │ │ └── widgets │ │ │ ├── login_form.dart │ │ │ ├── signup_form.dart │ │ │ └── slider.dart │ ├── dashboard │ │ ├── pages │ │ │ ├── dashboard.dart │ │ │ ├── desktop │ │ │ │ └── dashboard_desktop.dart │ │ │ └── mobile │ │ │ │ └── dashboard_mobile.dart │ │ ├── providers │ │ │ └── dashboard_provider.dart │ │ ├── services │ │ │ ├── file_service.dart │ │ │ └── platform_file_service.dart │ │ └── widgets │ │ │ ├── add_project_dialogue.dart │ │ │ ├── build_project.dart │ │ │ ├── dashboard_drawer.dart │ │ │ ├── delete_account.dart │ │ │ ├── edit_profile.dart │ │ │ ├── project_card.dart │ │ │ ├── start_project.dart │ │ │ └── upgrade_plan.dart │ ├── models │ │ ├── canvas_models │ │ │ ├── canvas_object.dart │ │ │ ├── canvas_painter.dart │ │ │ ├── objects │ │ │ │ ├── circle_object.dart │ │ │ │ ├── cylinder_object.dart │ │ │ │ ├── diamond_object.dart │ │ │ │ ├── inverted_triangle_object.dart │ │ │ │ ├── parallelogram_object.dart │ │ │ │ ├── rectangle_object.dart │ │ │ │ ├── rounded_square_object.dart │ │ │ │ ├── square_object.dart │ │ │ │ └── triangle_object.dart │ │ │ ├── synced_object.dart │ │ │ └── user_cursor.dart │ │ ├── connection_model.dart │ │ ├── node_model.dart │ │ ├── user_model.dart │ │ └── workspace_model.dart │ └── workspace │ │ ├── pages │ │ ├── canvas_page.dart │ │ ├── desktop │ │ │ └── workspace_desktop.dart │ │ ├── mobile │ │ │ └── workspace_mobile.dart │ │ ├── tablet │ │ │ └── workspace_tablet.dart │ │ └── workspace.dart │ │ ├── providers │ │ └── workspace_provider.dart │ │ ├── services │ │ └── export_serice.dart │ │ └── widgets │ │ ├── colour_picker_bg.dart │ │ ├── connector_customizer.dart │ │ ├── demo_color_picker.dart │ │ ├── export_project_button.dart │ │ ├── icons_widget.dart │ │ ├── node_colour.dart │ │ ├── node_picker.dart │ │ ├── sticky_notes.dart │ │ ├── toolbar.dart │ │ ├── undo_redo_button.dart │ │ ├── vertical_divider.dart │ │ ├── workspace_drawer.dart │ │ └── zoom_control_button.dart └── main.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake └── runner │ ├── CMakeLists.txt │ ├── main.cc │ ├── my_application.cc │ └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── 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 └── RunnerTests │ └── RunnerTests.swift ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-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 ├── 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 | .build/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | .swiftpm/ 13 | migrate_working_dir/ 14 | 15 | # IntelliJ related 16 | *.iml 17 | *.ipr 18 | *.iws 19 | .idea/ 20 | 21 | # The .vscode folder contains launch configuration and tasks you configure in 22 | # VS Code which you may wish to be included in version control, so this line 23 | # is commented out by default. 24 | #.vscode/ 25 | 26 | # Flutter/Dart/Pub related 27 | **/doc/api/ 28 | **/ios/Flutter/.last_build_id 29 | .dart_tool/ 30 | .flutter-plugins 31 | .flutter-plugins-dependencies 32 | .pub-cache/ 33 | .pub/ 34 | /build/ 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Android Studio will place build artifacts here 43 | /android/app/debug 44 | /android/app/profile 45 | /android/app/release 46 | run.sh 47 | run.ps1 48 | run-release.sh 49 | run-release.ps1 -------------------------------------------------------------------------------- /.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: "c23637390482d4cf9598c3ce3f2be31aa7332daf" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 17 | base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 18 | - platform: android 19 | create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 20 | base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 21 | - platform: ios 22 | create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 23 | base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 24 | - platform: linux 25 | create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 26 | base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 27 | - platform: macos 28 | create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 29 | base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 30 | - platform: web 31 | create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 32 | base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 33 | - platform: windows 34 | create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 35 | base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.sourceDirectory": "/home/teewrath/work/Flutter/cookethflow/linux" 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cookethflow 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started ifthis is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /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 https://dart.dev/lints. 17 | # 18 | # Instead of disabling a lint rule for the entire project in the 19 | # section below, it can also be suppressed for a single line of code 20 | # or a specific dart file by using the `// ignore: name_of_lint` and 21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 22 | # producing the lint. 23 | rules: 24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 26 | 27 | # Additional information about this file can be found at 28 | # https://dart.dev/guides/language/analysis-options 29 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | .cxx/ 9 | 10 | # Remember to never publicly share your keystore. 11 | # See https://flutter.dev/to/reference-keystore 12 | key.properties 13 | **/*.keystore 14 | **/*.jks 15 | -------------------------------------------------------------------------------- /android/app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.application") 3 | id("kotlin-android") 4 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. 5 | id("dev.flutter.flutter-gradle-plugin") 6 | } 7 | 8 | android { 9 | namespace = "com.cookethflow.cookethflow" 10 | compileSdk = flutter.compileSdkVersion 11 | ndkVersion = flutter.ndkVersion 12 | 13 | compileOptions { 14 | sourceCompatibility = JavaVersion.VERSION_11 15 | targetCompatibility = JavaVersion.VERSION_11 16 | } 17 | 18 | kotlinOptions { 19 | jvmTarget = JavaVersion.VERSION_11.toString() 20 | } 21 | 22 | defaultConfig { 23 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 24 | applicationId = "com.cookethflow.cookethflow" 25 | // You can update the following values to match your application needs. 26 | // For more information, see: https://flutter.dev/to/review-gradle-config. 27 | minSdk = flutter.minSdkVersion 28 | targetSdk = flutter.targetSdkVersion 29 | versionCode = flutter.versionCode 30 | versionName = flutter.versionName 31 | } 32 | 33 | buildTypes { 34 | release { 35 | // TODO: Add your own signing config for the release build. 36 | // Signing with the debug keys for now, so `flutter run --release` works. 37 | signingConfig = signingConfigs.getByName("debug") 38 | } 39 | } 40 | } 41 | 42 | flutter { 43 | source = "../.." 44 | } 45 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/cookethflow/cookethflow/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.cookethflow.cookethflow 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity : FlutterActivity() 6 | -------------------------------------------------------------------------------- /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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle.kts: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() 9 | rootProject.layout.buildDirectory.value(newBuildDir) 10 | 11 | subprojects { 12 | val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) 13 | project.layout.buildDirectory.value(newSubprojectBuildDir) 14 | } 15 | subprojects { 16 | project.evaluationDependsOn(":app") 17 | } 18 | 19 | tasks.register("clean") { 20 | delete(rootProject.layout.buildDirectory) 21 | } 22 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | val flutterSdkPath = run { 3 | val properties = java.util.Properties() 4 | file("local.properties").inputStream().use { properties.load(it) } 5 | val flutterSdkPath = properties.getProperty("flutter.sdk") 6 | require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } 7 | flutterSdkPath 8 | } 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id("dev.flutter.flutter-plugin-loader") version "1.0.0" 21 | id("com.android.application") version "8.7.0" apply false 22 | id("org.jetbrains.kotlin.android") version "1.8.22" apply false 23 | } 24 | 25 | include(":app") 26 | -------------------------------------------------------------------------------- /assets/fonts/Frederik-Black-BF645d9bff26630.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-Black-BF645d9bff26630.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-BlackItalic-BF645d9bffac1de.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-BlackItalic-BF645d9bffac1de.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-Bold-BF645d9bff85e69.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-Bold-BF645d9bff85e69.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-BoldItalic-BF645d9bff9bf5e.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-BoldItalic-BF645d9bff9bf5e.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-DemiBold-BF645d9bff7b6ff.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-DemiBold-BF645d9bff7b6ff.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-DemiBoldItalic-BF645d9bff9aca4.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-DemiBoldItalic-BF645d9bff9aca4.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-ExtraBold-BF645d9bffc1a5a.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-ExtraBold-BF645d9bffc1a5a.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-ExtraBoldItalic-BF645d9bffa90f8.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-ExtraBoldItalic-BF645d9bffa90f8.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-Heavy-BF645d9bffbbbdd.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-Heavy-BF645d9bffbbbdd.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-HeavyItalic-BF645d9bffd6fec.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-HeavyItalic-BF645d9bffd6fec.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-Light-BF645d9bffbac92.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-Light-BF645d9bffbac92.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-LightItalic-BF645d9bffa496e.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-LightItalic-BF645d9bffa496e.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-Medium-BF645d9bffbc329.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-Medium-BF645d9bffbc329.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-MediumItalic-BF645d9bff71c45.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-MediumItalic-BF645d9bff71c45.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-Regular-BF645d9bffaa893.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-Regular-BF645d9bffaa893.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-RegularItalic-BF645d9bffb230a.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-RegularItalic-BF645d9bffb230a.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-Thin-BF645d9bffb3edf.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-Thin-BF645d9bffb3edf.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-ThinItalic-BF645d9bff5ad07.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-ThinItalic-BF645d9bff5ad07.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-UltraLight-BF645d9bffae149.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-UltraLight-BF645d9bffae149.otf -------------------------------------------------------------------------------- /assets/fonts/Frederik-UltraLightItalic-BF645d9bff6ec22.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/fonts/Frederik-UltraLightItalic-BF645d9bff6ec22.otf -------------------------------------------------------------------------------- /assets/images/Frame 400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/images/Frame 400.png -------------------------------------------------------------------------------- /assets/images/Frame 401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/images/Frame 401.png -------------------------------------------------------------------------------- /assets/images/Frame 402.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/images/Frame 402.png -------------------------------------------------------------------------------- /assets/images/pfp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/assets/images/pfp.png -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /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 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /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 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 64 | 66 | 72 | 73 | 74 | 75 | 81 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 Flutter 2 | import UIKit 3 | 4 | @main 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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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 | CFBundleDisplayName 8 | Cookethflow 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | cookethflow 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | CADisableMinimumFrameDurationOnPhone 45 | 46 | UIApplicationSupportsIndirectInputEvents 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /lib/app.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/providers/supabase_provider.dart'; 2 | import 'package:cookethflow/core/router/app_route_config.dart'; 3 | import 'package:cookethflow/core/theme/app_theme.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 6 | import 'package:provider/provider.dart'; 7 | 8 | class MyApp extends StatelessWidget { 9 | const MyApp({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return ScreenUtilInit( 14 | designSize: const Size(1920, 1080), 15 | minTextAdapt: true, 16 | splitScreenMode: true, 17 | child: Consumer( 18 | builder: (context, themeProvider, _) { 19 | return MaterialApp.router( 20 | theme: AppTheme.light(), 21 | darkTheme: AppTheme.dark(), 22 | themeMode: themeProvider.isDark ? ThemeMode.dark : ThemeMode.light, 23 | debugShowCheckedModeBanner: false, 24 | routerConfig: AppRouteConfig.returnRouter(), 25 | ); 26 | }, 27 | ), 28 | ); 29 | } 30 | } -------------------------------------------------------------------------------- /lib/core/helpers/date_time_helper.dart: -------------------------------------------------------------------------------- 1 | class DateTimeHelper { 2 | String formatLastEdited(DateTime? lastEdited) { 3 | if (lastEdited == null) return "Edited Just Now"; 4 | final now = DateTime.now(); 5 | final difference = now.difference(lastEdited); 6 | 7 | if (difference.inDays > 0) { 8 | return 'Edited ${difference.inDays} day${difference.inDays == 1 ? '' : 's'} ago'; 9 | } else if (difference.inHours > 0) { 10 | return 'Edited ${difference.inHours} hour${difference.inHours == 1 ? '' : 's'} ago'; 11 | } else if (difference.inMinutes > 0) { 12 | return 'Edited ${difference.inMinutes} minute${difference.inMinutes == 1 ? '' : 's'} ago'; 13 | } else { 14 | return 'Edited just now'; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/core/helpers/input_validators.dart: -------------------------------------------------------------------------------- 1 | final RegExp _usernamePattern = RegExp( 2 | r'^[a-zA-Z][a-zA-Z0-9_.]{2,19}$', 3 | ); // Username: starts with letter, 3-20 chars 4 | 5 | final RegExp _emailPattern = RegExp( 6 | r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$', 7 | caseSensitive: false, 8 | ); 9 | 10 | String? validateUserName(String? value) { 11 | if (value == null || value.isEmpty) { 12 | return "Username is required."; 13 | } 14 | 15 | if (value.length < 3) { 16 | return "Username must be at least 3 characters"; 17 | } 18 | 19 | if (value.length > 20) { 20 | return "Username cannot exceed 20 characters"; 21 | } 22 | 23 | if (!_usernamePattern.hasMatch(value)) { 24 | return 'Username must:\n' 25 | '• Start with a letter (a-z, A-Z)\n' 26 | '• Contain only letters, numbers, _ or .\n' 27 | '• Be 3-20 characters long'; 28 | } 29 | return null; 30 | } 31 | 32 | String? validatePassword(String? value) { 33 | if (value == null || value.isEmpty) { 34 | return "Password is required."; 35 | } 36 | 37 | if (value.length < 8) { 38 | return 'Password must be at least 8 characters'; 39 | } 40 | 41 | if (!value.contains(RegExp(r'[A-Z]'))) { 42 | return 'Password must contain at least one uppercase letter'; 43 | } 44 | 45 | if (!value.contains(RegExp(r'[a-z]'))) { 46 | return 'Password must contain at least one lowercase letter'; 47 | } 48 | 49 | if (!value.contains(RegExp(r'[0-9]'))) { 50 | return 'Password must contain at least one number (0-9)'; 51 | } 52 | 53 | if (!value.contains(RegExp(r'[._#]'))) { 54 | return 'Password must contain at least one special character (., _, or #)'; 55 | } 56 | 57 | // Optional: Check for common weak passwords 58 | if (value.contains(RegExp(r'(123456|password|qwerty|abc123)'))) { 59 | return 'Password is too common or weak'; 60 | } 61 | 62 | return null; 63 | } 64 | 65 | String? validateEmail(String? value) { 66 | if (value == null || value.isEmpty) { 67 | return 'Email is required'; 68 | } 69 | 70 | if (!_emailPattern.hasMatch(value)) { 71 | return 'Please enter a valid email address\n' 72 | 'Example: yourname@example.com'; 73 | } 74 | 75 | // Optional: Disallow disposable emails 76 | if (value.endsWith('@tempmail.com') || 77 | value.endsWith('@mailinator.com')) { 78 | return 'Disposable email addresses are not allowed'; 79 | } 80 | 81 | return null; 82 | } -------------------------------------------------------------------------------- /lib/core/helpers/responsive_layout.helper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | enum DeviceType { mobile, tab, desktop } 4 | 5 | class ResponsiveLayoutHelper { 6 | static const int mobileMaxWidth = 375; 7 | static const int tabletMaxWidth = 768; 8 | static const int desktopMaxWidth = 1024; 9 | 10 | static DeviceType getDeviceType(BuildContext context) { 11 | final deviceSize = MediaQuery.sizeOf(context); 12 | final deviceWidth = deviceSize.width; 13 | if (deviceWidth > ResponsiveLayoutHelper.desktopMaxWidth) { 14 | return DeviceType.desktop; 15 | } 16 | 17 | if (deviceWidth > ResponsiveLayoutHelper.tabletMaxWidth) { 18 | return DeviceType.tab; 19 | } 20 | 21 | return DeviceType.mobile; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/core/helpers/ui_helper.dart: -------------------------------------------------------------------------------- 1 | double canvasDimension = 5.0; -------------------------------------------------------------------------------- /lib/core/router/app_route_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/router/app_route_const.dart'; 2 | import 'package:cookethflow/features/auth/pages/login.dart'; 3 | import 'package:cookethflow/features/auth/pages/signup.dart'; 4 | import 'package:cookethflow/features/dashboard/pages/dashboard.dart'; 5 | import 'package:cookethflow/features/workspace/pages/canvas_page.dart'; 6 | import 'package:cookethflow/features/workspace/pages/workspace.dart'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:go_router/go_router.dart'; 9 | 10 | class AppRouteConfig { 11 | static GoRouter returnRouter() { 12 | return GoRouter( 13 | // observers: [ 14 | // (route)=> debugPrint('Route Changed: $(route)'), 15 | // ], 16 | initialLocation: RoutesPath.loginScreen, 17 | routes: [ 18 | GoRoute( 19 | path: RoutesPath.loginScreen, 20 | name: RouteName.loginScreen, 21 | pageBuilder: (context, state) => NoTransitionPage(child: LoginPage()), 22 | ), 23 | GoRoute( 24 | path: RoutesPath.signUpScreen, 25 | name: RouteName.signUpScreen, 26 | pageBuilder: 27 | (context, state) => NoTransitionPage(child: SignupPage()), 28 | ), 29 | GoRoute( 30 | path: RoutesPath.dashboard, 31 | name: RouteName.dashboard, 32 | pageBuilder: 33 | (context, state) => NoTransitionPage(child: DashboardPage()), 34 | ), 35 | GoRoute( 36 | path: RoutesPath.workspace, 37 | name: RouteName.workspace, 38 | pageBuilder: 39 | (context, state) => NoTransitionPage(child: WorkspacePage()), 40 | ), 41 | GoRoute( 42 | path: RoutesPath.canvasPage, 43 | name: RouteName.canvasPage, 44 | pageBuilder: (context, state) { 45 | return NoTransitionPage(child: CanvasPage()); 46 | }, 47 | ), 48 | ], 49 | redirect: (BuildContext context, GoRouterState state) { 50 | // Add your authentication logic here if needed 51 | return null; 52 | }, 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/core/router/app_route_const.dart: -------------------------------------------------------------------------------- 1 | class RoutesPath { 2 | // static const String splashScreen = "/"; 3 | static const String signUpScreen = "/signup"; 4 | static const String loginScreen = "/"; 5 | static const String dashboard = "/dashboard"; 6 | static const String workspace = "/workspace"; 7 | static const String canvasPage = "/canvas"; 8 | } 9 | 10 | class RouteName { 11 | static const String splashScreen = "splash"; 12 | static const String signUpScreen = "signup"; 13 | static const String loginScreen = "login"; 14 | static const String dashboard = "dashboard"; 15 | static const String workspace = "workspace"; 16 | static const String canvasPage = "canvas"; 17 | } 18 | -------------------------------------------------------------------------------- /lib/core/theme/app_theme.dart: -------------------------------------------------------------------------------- 1 | import "package:cookethflow/core/theme/colors.dart"; 2 | import "package:flutter/cupertino.dart"; 3 | import "package:flutter/material.dart"; 4 | import "package:flutter_screenutil/flutter_screenutil.dart"; 5 | 6 | class AppTheme { 7 | static ThemeData light() { 8 | return ThemeData(useMaterial3: false, fontFamily: 'Frederik').copyWith( 9 | scaffoldBackgroundColor: scaffoldColor, 10 | primaryColorDark: primaryColor, 11 | primaryColor: primaryColor, 12 | primaryColorLight: primaryColor, 13 | colorScheme: const ColorScheme.light().copyWith( 14 | primary: primaryColor, 15 | secondary: secondaryColors[0], // Using green as secondary color 16 | ), 17 | 18 | textTheme: TextTheme( 19 | displayLarge: TextStyle( 20 | fontSize: 50.sp, 21 | fontWeight: FontWeight.w500, 22 | color: Colors.black, 23 | ), 24 | displayMedium: TextStyle( 25 | fontSize: 35.sp, 26 | fontWeight: FontWeight.w600, 27 | color: Colors.black, 28 | ), 29 | displaySmall: TextStyle( 30 | fontSize: 18, 31 | fontWeight: FontWeight.w600, 32 | color: Colors.black, 33 | ), 34 | headlineMedium: TextStyle(fontSize: 14, color: Colors.black), 35 | headlineSmall: TextStyle(fontSize: 12, color: Colors.black), 36 | titleLarge: TextStyle(fontSize: 10, color: Colors.black), 37 | bodyLarge: TextStyle(fontSize: 14, color: Colors.black), 38 | bodyMedium: TextStyle(fontSize: 12, color: Colors.black), 39 | bodySmall: TextStyle(fontSize: 10, color: Colors.black), 40 | ), 41 | ); 42 | } 43 | 44 | static ThemeData dark() { 45 | return ThemeData( 46 | useMaterial3: false, 47 | fontFamily: 'Frederik', 48 | brightness: Brightness.dark, 49 | ).copyWith( 50 | scaffoldBackgroundColor: scaffoldDarkColor, 51 | primaryColorDark: primaryColor, 52 | primaryColor: primaryColor, 53 | primaryColorLight: primaryColor, 54 | colorScheme: const ColorScheme.dark().copyWith( 55 | primary: primaryColor, 56 | secondary: 57 | secondaryColors[4], // Using cyan as secondary color for dark mode 58 | ), 59 | 60 | textTheme: TextTheme( 61 | displayLarge: TextStyle( 62 | fontSize: 50.sp, 63 | fontWeight: FontWeight.w500, 64 | color: Colors.white, 65 | ), 66 | displayMedium: TextStyle( 67 | fontSize: 35.sp, 68 | fontWeight: FontWeight.w600, 69 | color: Colors.white, 70 | ), 71 | displaySmall: TextStyle( 72 | fontSize: 18, 73 | fontWeight: FontWeight.w600, 74 | color: Colors.white, 75 | ), 76 | headlineMedium: TextStyle(fontSize: 14, color: Colors.white), 77 | headlineSmall: TextStyle(fontSize: 12, color: Colors.white), 78 | titleLarge: TextStyle(fontSize: 10, color: Colors.white), 79 | bodyLarge: TextStyle(fontSize: 14, color: Colors.white), 80 | bodyMedium: TextStyle(fontSize: 12, color: Colors.white), 81 | bodySmall: TextStyle(fontSize: 10, color: Colors.white), 82 | ), 83 | 84 | // Custom dark theme components 85 | cardTheme: CardTheme(color: scaffoldDarkColor, surfaceTintColor: scaffoldDarkColor), 86 | dividerTheme: DividerThemeData(color: tabBorderDarkColor), 87 | appBarTheme: AppBarTheme( 88 | backgroundColor: scaffoldDarkColor, 89 | surfaceTintColor: scaffoldDarkColor, 90 | ), 91 | bottomNavigationBarTheme: BottomNavigationBarThemeData( 92 | backgroundColor: scaffoldDarkColor, 93 | ), 94 | ); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/core/theme/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | // Primary color- light version 4 | const primaryColor = Color(0xFFED6325); 5 | // const deleteButton 6 | const scaffoldColor = Color.fromRGBO(248, 248, 248, 1); 7 | const tabColor = Colors.white; 8 | const tabBorderColor = Color.fromARGB(255, 217, 217, 217); 9 | 10 | // dark version alterings, rest colors are same for both versions 11 | const scaffoldDarkColor = Color.fromARGB(255, 30, 30, 30); 12 | const tabDarkColor = Color.fromARGB(255, 48, 48, 48); 13 | const tabBorderDarkColor = Color.fromARGB(255, 75, 75, 75); 14 | 15 | // List of secondary colors 16 | const List secondaryColors = [ 17 | Color(0xFF30C66F), // [0] Green 18 | Color(0xFFFF6B6B), // [1] Coral Red 19 | Color(0xFFF59E0B), // [2] Amber 20 | Color(0xFFA259FF), // [3] Purple 21 | Color(0xFF1CC8C0), // [4] Cyan 22 | Color(0xFFF53F5F), // [5] Pink Red 23 | Color(0xFF3B82F6), // [6] Blue 24 | Color(0xFFED6325), // [7] Orange 25 | Color(0xFF737492), // [8] Slate Gray 26 | Color(0xFF000000), // [9] Black 27 | ]; 28 | 29 | // List of tertiary colors 30 | const List tertiaryColors = [ 31 | Color(0xFFB9F5CC), // [0] Light Green 32 | Color(0xFFFFC4BC), // [1] Light Coral 33 | Color(0xFFFAD7A0), // [2] Light Amber 34 | Color(0xFFD4B6F5), // [3] Light Purple 35 | Color(0xFFB9E8FF), // [4] Light Cyan 36 | Color(0xFFF8B6BF), // [5] Light Pink 37 | Color(0xFFB3D4FC), // [6] Light Blue 38 | Color(0xFFFFB89E), // [7] Peach 39 | Color(0xFFC8C9E1), // [8] Light Slate 40 | Color(0xFFC9C9C9), // [9] Light Gray 41 | ]; 42 | -------------------------------------------------------------------------------- /lib/core/utils/consts.dart: -------------------------------------------------------------------------------- 1 | abstract class Constants { 2 | // Name of the Realtime channel 3 | static const String channelName = 'canvas'; 4 | 5 | // Name of the broadcast event 6 | static const String broadcastEventName = 'canvas'; 7 | } 8 | -------------------------------------------------------------------------------- /lib/core/utils/enums.dart: -------------------------------------------------------------------------------- 1 | enum ProviderState { inital, empty, loading, loaded, success, error } 2 | 3 | enum NodeType { 4 | note, 5 | rectangle, 6 | square, 7 | diamond, 8 | roundedSquare, 9 | parallelogram, 10 | cylinder, 11 | circle, 12 | triangle, 13 | invertedTriangle, 14 | } 15 | 16 | enum ConnectionPoint { up, down, left, right } 17 | 18 | enum ConnectionType { solid, dotted, dashed } 19 | 20 | // Enum to define the different shapes 21 | enum ShapeType { 22 | square, 23 | diamond, 24 | roundedSquare, 25 | parallelogram, 26 | cylinder, 27 | circle, 28 | triangle, 29 | invertedTriangle, 30 | } 31 | -------------------------------------------------------------------------------- /lib/core/utils/state_handler.dart: -------------------------------------------------------------------------------- 1 | import "dart:io"; 2 | 3 | import "package:cookethflow/core/utils/enums.dart"; 4 | import "package:flutter/material.dart"; 5 | 6 | 7 | class StateHandler extends ChangeNotifier { 8 | ProviderState state = ProviderState.inital; 9 | Failure errorMessage = Failure(""); 10 | 11 | StateHandler([ProviderState? intialState]) 12 | : state = intialState ?? ProviderState.inital; 13 | 14 | void handleLoading() { 15 | state = ProviderState.loading; 16 | errorMessage.clear(); 17 | notifyListeners(); 18 | } 19 | 20 | void handleEmpty() { 21 | state = ProviderState.empty; 22 | errorMessage.clear(); 23 | notifyListeners(); 24 | } 25 | 26 | void handleLoaded() { 27 | state = ProviderState.loaded; 28 | errorMessage.clear(); 29 | notifyListeners(); 30 | } 31 | 32 | void handleSuccess() { 33 | state = ProviderState.success; 34 | errorMessage.clear(); 35 | notifyListeners(); 36 | } 37 | 38 | void handleError(String msg) { 39 | state = ProviderState.error; 40 | errorMessage = Failure(msg); 41 | 42 | notifyListeners(); 43 | } 44 | 45 | ///For handling errors 46 | Future asyncHandler( 47 | Future task, { 48 | String socketError = "No Internet Connection", 49 | String formatError = "Format Exception while parsing data", 50 | String unknownError = "Something went Wrong", 51 | ProviderState? afterState, 52 | }) async { 53 | try { 54 | final T temp = await task as T; 55 | 56 | if (afterState != null) { 57 | state = afterState; 58 | notifyListeners(); 59 | } 60 | 61 | return temp; 62 | } on SocketException catch (e) { 63 | debugPrint("SocketException: $e"); 64 | 65 | handleError(socketError); 66 | } on FormatException catch (e) { 67 | debugPrint("FormatException : $e"); 68 | 69 | handleError(formatError); 70 | } catch (e) { 71 | debugPrint("Unknown Error: $e"); 72 | 73 | handleError(unknownError); 74 | } 75 | return null; 76 | } 77 | } 78 | 79 | class Failure { 80 | String message; 81 | 82 | String? code; 83 | 84 | Failure(this.message, [this.code]); 85 | 86 | void clear() { 87 | message = ""; 88 | code = ""; 89 | } 90 | } -------------------------------------------------------------------------------- /lib/features/auth/pages/desktop/login_desktop.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/auth/widgets/login_form.dart'; 2 | import 'package:cookethflow/features/auth/widgets/slider.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class LoginDesktop extends StatelessWidget { 6 | const LoginDesktop({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Row( 11 | children: [ 12 | Expanded( 13 | flex: 1, 14 | child: SingleChildScrollView( 15 | child: Padding( 16 | padding: EdgeInsets.symmetric( 17 | horizontal: MediaQuery.of(context).size.width * 0.05, 18 | vertical: 32, 19 | ), 20 | child: ConstrainedBox( 21 | constraints: BoxConstraints( 22 | minHeight: MediaQuery.of(context).size.height - 64, 23 | ), 24 | child: LoginForm(), 25 | ), 26 | ), 27 | ), 28 | ), 29 | Expanded(flex: 1, child: SliderStart()), 30 | ], 31 | ); 32 | } 33 | } -------------------------------------------------------------------------------- /lib/features/auth/pages/desktop/signup_desktop.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/auth/widgets/signup_form.dart'; 2 | import 'package:cookethflow/features/auth/widgets/slider.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class SignupDesktop extends StatelessWidget { 6 | const SignupDesktop({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Row( 11 | children: [ 12 | Expanded( 13 | flex: 1, 14 | child: SingleChildScrollView( 15 | child: Padding( 16 | padding: EdgeInsets.symmetric( 17 | horizontal: MediaQuery.of(context).size.width * 0.05, 18 | vertical: 32, 19 | ), 20 | child: ConstrainedBox( 21 | constraints: BoxConstraints( 22 | minHeight: MediaQuery.of(context).size.height - 64, 23 | ), 24 | child: SignUpForm(), 25 | ), 26 | ), 27 | ), 28 | ), 29 | Expanded(flex: 1, child: SliderStart()), 30 | ], 31 | ); 32 | } 33 | } -------------------------------------------------------------------------------- /lib/features/auth/pages/login.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart'; 2 | import 'package:cookethflow/features/auth/pages/desktop/login_desktop.dart'; 3 | import 'package:cookethflow/features/auth/pages/mobile/login_mobile.dart'; 4 | import 'package:cookethflow/features/auth/pages/tablet/login_tablet.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class LoginPage extends StatelessWidget { 8 | const LoginPage({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | Widget loginWidget; 13 | switch (ResponsiveLayoutHelper.getDeviceType(context)) { 14 | case DeviceType.desktop: 15 | loginWidget = LoginDesktop(); 16 | break; 17 | case DeviceType.tab: 18 | loginWidget = LoginTablet(); 19 | break; 20 | case DeviceType.mobile: 21 | loginWidget = LoginMobile(); 22 | break; 23 | } 24 | return Scaffold(backgroundColor: Color(0XFFF8F8F8), body: loginWidget); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/features/auth/pages/mobile/login_mobile.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/auth/widgets/login_form.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class LoginMobile extends StatelessWidget { 5 | const LoginMobile({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return SingleChildScrollView( 10 | child: 11 | Padding( 12 | padding: const EdgeInsets.symmetric( 13 | horizontal: 24.0, 14 | vertical: 16.0, 15 | ), 16 | child: LoginForm(), 17 | ), 18 | ); 19 | } 20 | } -------------------------------------------------------------------------------- /lib/features/auth/pages/mobile/signup_mobile.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/auth/widgets/signup_form.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class SignupMobile extends StatelessWidget { 5 | const SignupMobile({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return SingleChildScrollView( 10 | child: Padding( 11 | padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), 12 | child: SignUpForm(), 13 | ), 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/features/auth/pages/signup.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart'; 2 | import 'package:cookethflow/features/auth/pages/desktop/signup_desktop.dart'; 3 | import 'package:cookethflow/features/auth/pages/mobile/signup_mobile.dart'; 4 | import 'package:cookethflow/features/auth/pages/tablet/signup_tablet.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class SignupPage extends StatelessWidget { 8 | const SignupPage({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | Widget signupWidget; 13 | switch (ResponsiveLayoutHelper.getDeviceType(context)) { 14 | case DeviceType.desktop: 15 | signupWidget = const SignupDesktop(); 16 | break; 17 | case DeviceType.tab: 18 | signupWidget = const SignupTablet(); // Or a tablet-specific widget 19 | break; 20 | case DeviceType.mobile: 21 | signupWidget = const SignupMobile(); 22 | break; 23 | } 24 | return Scaffold(backgroundColor: Color(0XFFF8F8F8), body: signupWidget); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/features/auth/pages/tablet/login_tablet.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/auth/widgets/login_form.dart'; 2 | import 'package:cookethflow/features/auth/widgets/slider.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class LoginTablet extends StatelessWidget { 6 | const LoginTablet({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Row( 11 | children: [ 12 | Expanded( 13 | flex: 1, 14 | child: SingleChildScrollView( 15 | child: Padding( 16 | padding: EdgeInsets.symmetric( 17 | horizontal: MediaQuery.of(context).size.width * 0.05, 18 | vertical: 32, 19 | ), 20 | child: ConstrainedBox( 21 | constraints: BoxConstraints( 22 | minHeight: MediaQuery.of(context).size.height - 64, 23 | ), 24 | child: LoginForm(), 25 | ), 26 | ), 27 | ), 28 | ), 29 | Expanded(flex: 1, child: SliderStart()), 30 | ], 31 | ); 32 | } 33 | } -------------------------------------------------------------------------------- /lib/features/auth/pages/tablet/signup_tablet.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/auth/widgets/signup_form.dart'; 2 | import 'package:cookethflow/features/auth/widgets/slider.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class SignupTablet extends StatelessWidget { 6 | const SignupTablet({super.key}); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Row( 11 | children: [ 12 | Expanded( 13 | flex: 1, 14 | child: SingleChildScrollView( 15 | child: Padding( 16 | padding: EdgeInsets.symmetric( 17 | horizontal: MediaQuery.of(context).size.width * 0.05, 18 | vertical: 32, 19 | ), 20 | child: ConstrainedBox( 21 | constraints: BoxConstraints( 22 | minHeight: MediaQuery.of(context).size.height - 64, 23 | ), 24 | child: SignUpForm(), 25 | ), 26 | ), 27 | ), 28 | ), 29 | Expanded(flex: 1, child: SliderStart()), 30 | ], 31 | ); 32 | } 33 | } -------------------------------------------------------------------------------- /lib/features/auth/widgets/slider.dart: -------------------------------------------------------------------------------- 1 | import 'package:carousel_slider/carousel_slider.dart'; 2 | import 'package:cookethflow/core/theme/colors.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | 6 | class SliderStart extends StatelessWidget { 7 | final List images = [ 8 | 'assets/images/Frame 400.png', 9 | 'assets/images/Frame 401.png', 10 | 'assets/images/Frame 402.png', 11 | ]; 12 | 13 | SliderStart({super.key}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | final ValueNotifier currentIndex = ValueNotifier(0); 18 | 19 | return MaterialApp( 20 | debugShowCheckedModeBanner: false, 21 | home: Scaffold( 22 | backgroundColor: const Color(0xFFFDE2CF), 23 | body: Center( 24 | child: Column( 25 | mainAxisAlignment: MainAxisAlignment.center, 26 | children: [ 27 | SizedBox( 28 | height: 0.8.sh, // 640 29 | child: CarouselSlider( 30 | options: CarouselOptions( 31 | autoPlay: true, 32 | autoPlayInterval: const Duration(milliseconds: 2500), 33 | viewportFraction: 1.0, 34 | enableInfiniteScroll: true, 35 | scrollPhysics: const NeverScrollableScrollPhysics(), 36 | onPageChanged: (index, reason) { 37 | currentIndex.value = index; 38 | }, 39 | ), 40 | items: images.map((image) { 41 | return Image.asset( 42 | image, 43 | fit: BoxFit.cover, 44 | ); 45 | }).toList(), 46 | ), 47 | ), 48 | SizedBox(height: 10.h), 49 | ValueListenableBuilder( 50 | valueListenable: currentIndex, 51 | builder: (context, index, child) { 52 | return Row( 53 | mainAxisAlignment: MainAxisAlignment.center, 54 | children: List.generate( 55 | 3, 56 | (i) => Container( 57 | margin: EdgeInsets.symmetric(horizontal: 4.w), 58 | width: 12.w, 59 | height: 12.h, 60 | decoration: BoxDecoration( 61 | shape: BoxShape.circle, 62 | color: i == index 63 | ? primaryColor 64 | : Colors.white, 65 | ), 66 | ), 67 | ), 68 | ); 69 | }, 70 | ), 71 | ], 72 | ), 73 | ), 74 | ), 75 | ); 76 | } 77 | } -------------------------------------------------------------------------------- /lib/features/dashboard/pages/dashboard.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' 2 | as responsive_helper; 3 | import 'package:cookethflow/core/providers/supabase_provider.dart'; 4 | import 'package:cookethflow/features/dashboard/pages/desktop/dashboard_desktop.dart'; 5 | import 'package:cookethflow/features/dashboard/pages/mobile/dashboard_mobile.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 8 | import 'package:provider/provider.dart'; 9 | 10 | class DashboardPage extends StatelessWidget { 11 | const DashboardPage({super.key}); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | Widget dashboardScreen; 16 | switch (responsive_helper.ResponsiveLayoutHelper.getDeviceType(context)) { 17 | case responsive_helper.DeviceType.desktop: 18 | dashboardScreen = DashboardDesktop(); 19 | break; 20 | case responsive_helper.DeviceType.tab: 21 | dashboardScreen = DashboardDesktop(); 22 | break; 23 | case responsive_helper.DeviceType.mobile: 24 | dashboardScreen = DashboardMobile(); 25 | break; 26 | } 27 | return Consumer( 28 | builder: (context, supa, child) { 29 | return Scaffold( 30 | backgroundColor: Color.fromRGBO(248, 248, 248, 1), 31 | // backgroundColor: Colors.black, 32 | body: Padding( 33 | padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 50.h), 34 | child: dashboardScreen, 35 | ), 36 | ); 37 | }, 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/features/dashboard/pages/desktop/dashboard_desktop.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/theme/colors.dart'; 2 | import 'package:cookethflow/features/dashboard/providers/dashboard_provider.dart'; 3 | import 'package:cookethflow/features/dashboard/widgets/dashboard_drawer.dart'; 4 | import 'package:cookethflow/features/dashboard/widgets/project_card.dart'; 5 | import 'package:cookethflow/features/dashboard/widgets/start_project.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 8 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 9 | import 'package:provider/provider.dart'; 10 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' as rh; 11 | 12 | class DashboardDesktop extends StatelessWidget { 13 | const DashboardDesktop({super.key}); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | rh.DeviceType deviceType = rh.ResponsiveLayoutHelper.getDeviceType(context); 18 | return Consumer( 19 | builder: (context, provider, child) { 20 | return LayoutBuilder( 21 | builder: 22 | (context, constraints) => Row( 23 | crossAxisAlignment: CrossAxisAlignment.start, 24 | children: [ 25 | AnimatedContainer( 26 | curve: Curves.easeInOut, 27 | duration: Duration(milliseconds: 500), 28 | height: 29 | provider.isDrawerOpen 30 | ? constraints.maxHeight 31 | : 0.185.sh, 32 | width: deviceType == rh.DeviceType.desktop ? 400.w : 600.w, 33 | child: DashboardDrawer(), 34 | ), 35 | 36 | Expanded( 37 | child: Padding( 38 | padding: EdgeInsets.symmetric( 39 | horizontal: 30.w, 40 | vertical: 20.h, 41 | ), 42 | child: Column( 43 | crossAxisAlignment: CrossAxisAlignment.end, 44 | children: [ 45 | Padding( 46 | padding: EdgeInsets.only(bottom: 20.h), 47 | child: StartProject(), 48 | ), 49 | SizedBox(height: 32), 50 | Expanded( 51 | child: GridView.builder( 52 | shrinkWrap: true, 53 | itemCount: provider.workspaceList.length, 54 | gridDelegate: 55 | SliverGridDelegateWithFixedCrossAxisCount( 56 | crossAxisCount: 3, 57 | crossAxisSpacing: 20.w, 58 | mainAxisSpacing: 20.h, 59 | childAspectRatio: 4.5 / 3, 60 | ), 61 | itemBuilder: (context, index) { 62 | return ProjectCard(idx: index); 63 | }, 64 | ), 65 | ), 66 | ], 67 | ), 68 | ), 69 | ), 70 | ], 71 | ), 72 | ); 73 | }, 74 | ); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /lib/features/dashboard/pages/mobile/dashboard_mobile.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/dashboard/providers/dashboard_provider.dart'; 2 | import 'package:cookethflow/features/dashboard/widgets/dashboard_drawer.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class DashboardMobile extends StatelessWidget { 7 | const DashboardMobile({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Consumer(builder: (context, provider, child) => 12 | Scaffold(drawer: DashboardDrawer(),appBar: AppBar(),body: Container(),),); 13 | } 14 | } -------------------------------------------------------------------------------- /lib/features/dashboard/providers/dashboard_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/providers/supabase_provider.dart'; 2 | import 'package:cookethflow/core/utils/state_handler.dart'; 3 | import 'package:cookethflow/features/models/workspace_model.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 6 | import 'package:supabase_flutter/supabase_flutter.dart'; 7 | import 'package:uuid/uuid.dart'; 8 | 9 | class DashboardProvider extends StateHandler { 10 | late SupabaseClient? supabase; 11 | late SupabaseService supabaseService; 12 | DashboardProvider(this.supabase, this.supabaseService) : super() { 13 | initialize(); 14 | } 15 | 16 | // properties 17 | bool _isDrawerOpen = true; 18 | int _tabIndex = 0; 19 | bool _isLoading = false; 20 | bool _isInitialized = false; 21 | List _workspaceList = []; 22 | 23 | // getters 24 | bool get isDrawerOpen => _isDrawerOpen; 25 | int get tabIndex => _tabIndex; 26 | bool get isLoading => _isLoading; 27 | bool get isInitialized => _isInitialized; 28 | List get workspaceList => _workspaceList; 29 | 30 | List> tabItems = [ 31 | {"label": "All", "icon": Icon(PhosphorIcons.cardsThree())}, 32 | {"label": "Starred", "icon": Icon(PhosphorIcons.star())}, 33 | {"label": "Trash", "icon": Icon(PhosphorIcons.trashSimple())}, 34 | {"label": "About us", "icon": Icon(PhosphorIcons.info())}, 35 | ]; 36 | 37 | void toggleDrawer() { 38 | _isDrawerOpen = !_isDrawerOpen; 39 | notifyListeners(); 40 | } 41 | 42 | void toggleTab(int idx) { 43 | if (_tabIndex != idx) { 44 | _tabIndex = idx; 45 | notifyListeners(); 46 | } 47 | } 48 | 49 | Future initialize() async { 50 | if (!_isInitialized) { 51 | await _initializeUser(); 52 | print("function called"); 53 | _isInitialized = true; 54 | notifyListeners(); 55 | } 56 | } 57 | 58 | Future refreshDashboard() async { 59 | await _initializeUser(); 60 | } 61 | 62 | Future _initializeUser() async { 63 | _isLoading = true; 64 | try { 65 | var res = supabase?.auth.currentUser; 66 | if (res == null) { 67 | print("No Authenticated user found during initialization."); 68 | _isLoading = false; 69 | notifyListeners(); 70 | return; 71 | } 72 | 73 | // print(res.id); 74 | try { 75 | List _dbWorkspace = await supabase! 76 | .from('workspace') 77 | .select() 78 | .eq('owner', res.id); 79 | print(_dbWorkspace); 80 | _workspaceList.clear(); 81 | for (var workspace in _dbWorkspace) { 82 | WorkspaceModel newWorkspace = WorkspaceModel( 83 | id: workspace["id"], 84 | owner: workspace["owner"], 85 | name: workspace["name"], 86 | editorIdList: workspace["editorId"] ?? [], 87 | viewerIdList: workspace["viewerId"] ?? [], 88 | lastEdited: workspace["last edited"] != null ? DateTime.parse(workspace["last edited"]) : DateTime.now(), 89 | ); 90 | // print(workspace); 91 | _workspaceList.add(newWorkspace); 92 | } 93 | } catch (e) { 94 | print("Error parsing workspaces: $e"); 95 | } 96 | } catch (e) { 97 | print("Error initialising user: $e"); 98 | } finally { 99 | _isLoading = false; 100 | notifyListeners(); 101 | } 102 | } 103 | 104 | Future createNewProject(BuildContext context) async { 105 | _isLoading = true; 106 | try { 107 | var res = supabase?.auth.currentUser; 108 | if (res == null) { 109 | _isLoading = false; 110 | print("User not found"); 111 | notifyListeners(); 112 | } 113 | Map newWorkspace = { 114 | "id" : Uuid().v4(), 115 | "owner": res!.id, 116 | "name": "New Project", 117 | "editorId": null, 118 | "viewerId":null, 119 | }; 120 | 121 | await supabase!.from('workspace').insert(newWorkspace); 122 | 123 | refreshDashboard(); 124 | } catch (e) { 125 | print("Error creating new project: $e"); 126 | } finally { 127 | _isLoading = false; 128 | notifyListeners(); 129 | } 130 | } 131 | 132 | void importExistingProject(BuildContext context) {} 133 | } 134 | -------------------------------------------------------------------------------- /lib/features/dashboard/services/file_service.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/lib/features/dashboard/services/file_service.dart -------------------------------------------------------------------------------- /lib/features/dashboard/services/platform_file_service.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | import 'dart:typed_data'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:flutter_document_picker/flutter_document_picker.dart'; 6 | import 'package:universal_html/html.dart' as html; 7 | 8 | class PlatformFileService { 9 | static Future?> pickJSONFile() async { 10 | try { 11 | if (kIsWeb) { 12 | return await _pickFileWeb(); 13 | } else { 14 | return await _pickFileNative(); 15 | } 16 | } catch (e) { 17 | print("Error picking file: $e"); 18 | return null; 19 | } 20 | } 21 | 22 | static Future?> _pickFileNative() async { 23 | try { 24 | final path = await FlutterDocumentPicker.openDocument( 25 | params: FlutterDocumentPickerParams( 26 | allowedFileExtensions: ['json'], 27 | invalidFileNameSymbols: ['/'], 28 | ), 29 | ); 30 | 31 | if (path == null) return null; 32 | 33 | final fileName = path.split('/').last; 34 | final File file = File(path); 35 | final bytes = await file.readAsBytes(); 36 | 37 | return { 38 | 'name': fileName, 39 | 'bytes': bytes, 40 | }; 41 | } catch (e) { 42 | print("Native file picking error: $e"); 43 | return null; 44 | } 45 | } 46 | 47 | static Future?> _pickFileWeb() async { 48 | try { 49 | final input = html.FileUploadInputElement()..accept = '.json'; 50 | input.click(); 51 | 52 | await input.onChange.first; 53 | final files = input.files; 54 | if (files == null || files.isEmpty) return null; 55 | 56 | final file = files[0]; 57 | final reader = html.FileReader(); 58 | reader.readAsArrayBuffer(file); 59 | 60 | await reader.onLoad.first; 61 | final bytes = Uint8List.fromList(reader.result as List); 62 | final fileName = file.name; 63 | 64 | return { 65 | 'name': fileName, 66 | 'bytes': bytes, 67 | }; 68 | } catch (e) { 69 | print("Web file picking error: $e"); 70 | return null; 71 | } 72 | } 73 | 74 | static Future?> parseJSONFile(Uint8List bytes) async { 75 | try { 76 | final String content = utf8.decode(bytes); 77 | final Map jsonData = jsonDecode(content); 78 | return jsonData; 79 | } catch (e) { 80 | print("Error parsing JSON: $e"); 81 | return null; 82 | } 83 | } 84 | } -------------------------------------------------------------------------------- /lib/features/dashboard/widgets/add_project_dialogue.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/dashboard/providers/dashboard_provider.dart'; 2 | import 'package:cookethflow/features/dashboard/widgets/build_project.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | import 'package:go_router/go_router.dart'; 6 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 7 | import 'package:provider/provider.dart'; 8 | 9 | class AddProject extends StatelessWidget { 10 | const AddProject({super.key}); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return Consumer(builder: (context, provider, child) { 15 | return AlertDialog( 16 | shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), 17 | title: Text( 18 | 'Create Project', 19 | style: TextStyle(fontFamily: 'Frederik',fontSize: 28.sp ,fontWeight: FontWeight.bold), 20 | ), 21 | content: Column( 22 | mainAxisSize: MainAxisSize.min, 23 | children: [ 24 | BuildProject( 25 | icon: PhosphorIconsRegular.plus, 26 | label: 'Start Blank Project', 27 | onTap: () async { 28 | context.pop(); 29 | provider.createNewProject(context); 30 | }, 31 | ), 32 | SizedBox(height: 16), 33 | BuildProject( 34 | icon: PhosphorIconsRegular.fileArrowDown, 35 | label: 'Import Existing Project', 36 | onTap: () async { 37 | context.pop(); 38 | provider.importExistingProject(context); 39 | }, 40 | ), 41 | ], 42 | ), 43 | ); 44 | }); 45 | } 46 | } -------------------------------------------------------------------------------- /lib/features/dashboard/widgets/build_project.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class BuildProject extends StatelessWidget { 4 | final IconData icon; 5 | final String label; 6 | final VoidCallback onTap; 7 | const BuildProject({ 8 | super.key, 9 | required this.icon, 10 | required this.label, 11 | required this.onTap, 12 | }); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return InkWell( 17 | onTap: onTap, 18 | borderRadius: BorderRadius.circular(8), 19 | child: Container( 20 | padding: EdgeInsets.symmetric(vertical: 16, horizontal: 16), 21 | decoration: BoxDecoration( 22 | border: Border.all(color: Colors.black, width: 1), 23 | borderRadius: BorderRadius.circular(8), 24 | ), 25 | child: Row( 26 | children: [ 27 | Icon(icon, size: 24), 28 | SizedBox(width: 16), 29 | Text( 30 | label, 31 | style: TextStyle( 32 | fontFamily: 'Frederik', 33 | fontSize: 16, 34 | ), 35 | ), 36 | ], 37 | ), 38 | ), 39 | ); 40 | } 41 | } -------------------------------------------------------------------------------- /lib/features/dashboard/widgets/start_project.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/theme/colors.dart'; 2 | import 'package:cookethflow/features/dashboard/widgets/add_project_dialogue.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 6 | import 'package:provider/provider.dart'; 7 | 8 | class StartProject extends StatelessWidget { 9 | const StartProject({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Consumer( 14 | builder: (context, value, child) { 15 | return ElevatedButton( 16 | onPressed: () { 17 | showDialog(context: context, builder: (context) => AddProject(),); 18 | }, 19 | style: ElevatedButton.styleFrom( 20 | elevation: 0, 21 | backgroundColor: primaryColor, 22 | padding: EdgeInsets.symmetric(vertical: 32.h, horizontal: 24.w), 23 | shape: RoundedRectangleBorder( 24 | borderRadius: BorderRadius.circular(12.r), 25 | ), 26 | ), 27 | child: Row( 28 | mainAxisSize: MainAxisSize.min, 29 | children: [ 30 | Text( 31 | 'Start a New Project', 32 | style: TextStyle( 33 | fontFamily: 'Fredrik', 34 | fontSize: 18.sp, 35 | color: Colors.white, 36 | fontWeight: FontWeight.w500, 37 | ), 38 | ), 39 | SizedBox(width: 16.w), 40 | Icon(PhosphorIconsRegular.plus, color: Colors.white, size: 24.sp), 41 | ], 42 | ), 43 | ); 44 | }, 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/features/dashboard/widgets/upgrade_plan.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' as rh; 2 | import 'package:cookethflow/core/theme/colors.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 6 | 7 | class UpgradeCard extends StatelessWidget { 8 | const UpgradeCard({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | rh.DeviceType device = rh.ResponsiveLayoutHelper.getDeviceType(context); 13 | 14 | return Container( 15 | margin: EdgeInsets.only(top: 20.h), 16 | padding: EdgeInsets.symmetric(horizontal: device == rh.DeviceType.desktop ? 24.w : 20.w, vertical: device == rh.DeviceType.desktop ? 20.w : 20.w), 17 | decoration: BoxDecoration( 18 | color: Colors.white, 19 | borderRadius: BorderRadius.circular(12.r), 20 | border: Border.all( 21 | color: const Color(0xFFD9D9D9), 22 | width: 1.2, 23 | ), 24 | ), 25 | child: Column( 26 | crossAxisAlignment: CrossAxisAlignment.start, 27 | mainAxisSize: MainAxisSize.min, 28 | children: [ 29 | Row( 30 | children: [ 31 | Icon( 32 | PhosphorIconsRegular.sparkle, 33 | color: Colors.black, 34 | size: device == rh.DeviceType.desktop ? 24.sp : 20.sp, 35 | ), 36 | SizedBox(width: 8.w), 37 | Text( 38 | 'Upgrade your Plan', 39 | style: TextStyle( 40 | fontFamily: 'Fredrik', 41 | fontSize: device == rh.DeviceType.desktop ? 20.sp : 16.sp, 42 | fontWeight: FontWeight.w600, 43 | color: Colors.black, 44 | ), 45 | ), 46 | ], 47 | ), 48 | SizedBox(height: 16.h), 49 | Text( 50 | 'Get more with CookethFlow Pro – Access exclusive features like [feature 1], [feature 2], and [feature 3]. Cancel anytime, no strings attached.', 51 | style: TextStyle( 52 | fontFamily: 'Fredrik', 53 | fontSize: device == rh.DeviceType.desktop ? 16.sp : 15.sp, 54 | color: const Color(0xFF4B4B4B), 55 | height: 2, 56 | ), 57 | ), 58 | SizedBox(height: 16.h), 59 | SizedBox( 60 | width: double.infinity, 61 | child: ElevatedButton( 62 | onPressed: () { 63 | // Add upgrade logic here 64 | }, 65 | style: ElevatedButton.styleFrom( 66 | backgroundColor: primaryColor, 67 | foregroundColor: Colors.white, 68 | padding: EdgeInsets.symmetric( 69 | vertical: device == rh.DeviceType.desktop ? 12.h : 14.h, 70 | ), 71 | shape: RoundedRectangleBorder( 72 | borderRadius: BorderRadius.circular(8.r), 73 | ), 74 | elevation: 0, 75 | ), 76 | child: Text( 77 | 'Explore', 78 | style: TextStyle( 79 | fontFamily: 'Fredrik', 80 | fontSize: device == rh.DeviceType.desktop ? 14.sp : 16.sp, 81 | fontWeight: FontWeight.w500, 82 | color: Colors.white, 83 | ), 84 | ), 85 | ), 86 | ), 87 | ], 88 | ), 89 | ); 90 | } 91 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/canvas_object.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:math'; 3 | import 'package:cookethflow/features/models/canvas_models/objects/circle_object.dart'; 4 | import 'package:cookethflow/features/models/canvas_models/objects/cylinder_object.dart'; 5 | import 'package:cookethflow/features/models/canvas_models/objects/diamond_object.dart'; 6 | import 'package:cookethflow/features/models/canvas_models/objects/inverted_triangle_object.dart'; 7 | import 'package:cookethflow/features/models/canvas_models/objects/parallelogram_object.dart'; 8 | import 'package:cookethflow/features/models/canvas_models/objects/rectangle_object.dart'; 9 | import 'package:cookethflow/features/models/canvas_models/objects/rounded_square_object.dart'; 10 | import 'package:cookethflow/features/models/canvas_models/objects/square_object.dart'; 11 | import 'package:cookethflow/features/models/canvas_models/objects/triangle_object.dart'; 12 | import 'package:cookethflow/features/models/canvas_models/synced_object.dart'; 13 | import 'package:flutter/material.dart'; 14 | 15 | extension RandomColor on Color { 16 | static Color getRandom() { 17 | return Color((Random().nextDouble() * 0xFFFFFF).toInt()).withOpacity(1.0); 18 | } 19 | 20 | static Color getRandomFromUserId(String id) { 21 | final seed = utf8.encode(id).reduce((value, element) => value + element); 22 | return Color((Random(seed).nextDouble() * 0xFFFFFF).toInt()).withOpacity(1.0); 23 | } 24 | } 25 | 26 | abstract class CanvasObject extends SyncedObject { 27 | final Color color; 28 | 29 | CanvasObject({required super.id, required this.color}); 30 | 31 | factory CanvasObject.fromJson(Map json) { 32 | final objectType = json['object_type']; 33 | switch (objectType) { 34 | case Circle.type: 35 | return Circle.fromJson(json); 36 | case Rectangle.type: 37 | return Rectangle.fromJson(json); 38 | case Square.type: 39 | return Square.fromJson(json); 40 | case Diamond.type: 41 | return Diamond.fromJson(json); 42 | case RoundedSquare.type: 43 | return RoundedSquare.fromJson(json); 44 | case Parallelogram.type: 45 | return Parallelogram.fromJson(json); 46 | case Cylinder.type: 47 | return Cylinder.fromJson(json); 48 | case Triangle.type: 49 | return Triangle.fromJson(json); 50 | case InvertedTriangle.type: 51 | return InvertedTriangle.fromJson(json); 52 | default: 53 | throw UnimplementedError('Unknown object_type: $objectType'); 54 | } 55 | } 56 | 57 | bool intersectsWith(Offset point); 58 | CanvasObject copyWith(); 59 | CanvasObject move(Offset delta); 60 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/objects/circle_object.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 4 | import 'package:uuid/uuid.dart'; 5 | 6 | /// Circle displayed on the canvas. 7 | class Circle extends CanvasObject { 8 | static const String type = 'circle'; 9 | 10 | final Offset center; 11 | final double radius; 12 | 13 | Circle({ 14 | required super.id, 15 | required super.color, 16 | required this.radius, 17 | required this.center, 18 | }); 19 | 20 | Circle.fromJson(Map json) 21 | : radius = json['radius'], 22 | center = Offset(json['center']['x'], json['center']['y']), 23 | super(id: json['id'], color: Color(json['color'])); 24 | 25 | /// Constructor to be used when first starting to draw the object on the canvas 26 | Circle.createNew(this.center) 27 | : radius = 0, 28 | super(id: const Uuid().v4(), color: RandomColor.getRandom()); 29 | 30 | @override 31 | Map toJson() { 32 | return { 33 | 'object_type': type, 34 | 'id': id, 35 | 'color': color.value, 36 | 'center': {'x': center.dx, 'y': center.dy}, 37 | 'radius': radius, 38 | }; 39 | } 40 | 41 | @override 42 | Circle copyWith({double? radius, Offset? center, Color? color}) { 43 | return Circle( 44 | radius: radius ?? this.radius, 45 | center: center ?? this.center, 46 | id: id, 47 | color: color ?? this.color, 48 | ); 49 | } 50 | 51 | @override 52 | bool intersectsWith(Offset point) { 53 | final centerToPointerDistance = (point - center).distance; 54 | return radius > centerToPointerDistance; 55 | } 56 | 57 | @override 58 | Circle move(Offset delta) { 59 | return copyWith(center: center + delta); 60 | } 61 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/objects/cylinder_object.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:uuid/uuid.dart'; 5 | 6 | class Cylinder extends CanvasObject { 7 | static const String type = 'cylinder'; 8 | final Offset topLeft; 9 | final Offset bottomRight; 10 | 11 | Cylinder({ 12 | required super.id, 13 | required super.color, 14 | required this.topLeft, 15 | required this.bottomRight, 16 | }); 17 | 18 | Cylinder.fromJson(Map json) 19 | : bottomRight = Offset(json['bottom_right']['x'], json['bottom_right']['y']), 20 | topLeft = Offset(json['top_left']['x'], json['top_left']['y']), 21 | super(id: json['id'], color: Color(json['color'])); 22 | 23 | Cylinder.createNew(Offset startingPoint) 24 | : topLeft = startingPoint, 25 | bottomRight = startingPoint, 26 | super(color: RandomColor.getRandom(), id: const Uuid().v4()); 27 | 28 | @override 29 | Map toJson() { 30 | return { 31 | 'object_type': type, 32 | 'id': id, 33 | 'color': color.value, 34 | 'top_left': {'x': topLeft.dx, 'y': topLeft.dy}, 35 | 'bottom_right': {'x': bottomRight.dx, 'y': bottomRight.dy}, 36 | }; 37 | } 38 | 39 | @override 40 | Cylinder copyWith({Offset? topLeft, Offset? bottomRight, Color? color}) { 41 | return Cylinder( 42 | topLeft: topLeft ?? this.topLeft, 43 | id: id, 44 | bottomRight: bottomRight ?? this.bottomRight, 45 | color: color ?? this.color, 46 | ); 47 | } 48 | 49 | @override 50 | bool intersectsWith(Offset point) { 51 | final rect = Rect.fromPoints(topLeft, bottomRight); 52 | return rect.contains(point); 53 | } 54 | 55 | @override 56 | Cylinder move(Offset delta) { 57 | return copyWith(topLeft: topLeft + delta, bottomRight: bottomRight + delta); 58 | } 59 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/objects/diamond_object.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:uuid/uuid.dart'; 4 | 5 | class Diamond extends CanvasObject { 6 | static const String type = 'diamond'; 7 | final Offset topLeft; 8 | final Offset bottomRight; 9 | 10 | Diamond({ 11 | required super.id, 12 | required super.color, 13 | required this.topLeft, 14 | required this.bottomRight, 15 | }); 16 | 17 | Diamond.fromJson(Map json) 18 | : bottomRight = Offset(json['bottom_right']['x'], json['bottom_right']['y']), 19 | topLeft = Offset(json['top_left']['x'], json['top_left']['y']), 20 | super(id: json['id'], color: Color(json['color'])); 21 | 22 | Diamond.createNew(Offset startingPoint) 23 | : topLeft = startingPoint, 24 | bottomRight = startingPoint, 25 | super(color: RandomColor.getRandom(), id: const Uuid().v4()); 26 | 27 | @override 28 | Map toJson() { 29 | return { 30 | 'object_type': type, 31 | 'id': id, 32 | 'color': color.value, 33 | 'top_left': {'x': topLeft.dx, 'y': topLeft.dy}, 34 | 'bottom_right': {'x': bottomRight.dx, 'y': bottomRight.dy}, 35 | }; 36 | } 37 | 38 | @override 39 | Diamond copyWith({Offset? topLeft, Offset? bottomRight, Color? color}) { 40 | return Diamond( 41 | topLeft: topLeft ?? this.topLeft, 42 | id: id, 43 | bottomRight: bottomRight ?? this.bottomRight, 44 | color: color ?? this.color, 45 | ); 46 | } 47 | 48 | @override 49 | bool intersectsWith(Offset point) { 50 | final rect = Rect.fromPoints(topLeft, bottomRight); 51 | return rect.contains(point); 52 | } 53 | 54 | @override 55 | Diamond move(Offset delta) { 56 | return copyWith(topLeft: topLeft + delta, bottomRight: bottomRight + delta); 57 | } 58 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/objects/inverted_triangle_object.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:uuid/uuid.dart'; 5 | 6 | class InvertedTriangle extends CanvasObject { 7 | static const String type = 'inverted_triangle'; 8 | final Offset topLeft; 9 | final Offset bottomRight; 10 | 11 | InvertedTriangle({ 12 | required super.id, 13 | required super.color, 14 | required this.topLeft, 15 | required this.bottomRight, 16 | }); 17 | 18 | InvertedTriangle.fromJson(Map json) 19 | : bottomRight = Offset(json['bottom_right']['x'], json['bottom_right']['y']), 20 | topLeft = Offset(json['top_left']['x'], json['top_left']['y']), 21 | super(id: json['id'], color: Color(json['color'])); 22 | 23 | InvertedTriangle.createNew(Offset startingPoint) 24 | : topLeft = startingPoint, 25 | bottomRight = startingPoint, 26 | super(color: RandomColor.getRandom(), id: const Uuid().v4()); 27 | 28 | @override 29 | Map toJson() { 30 | return { 31 | 'object_type': type, 32 | 'id': id, 33 | 'color': color.value, 34 | 'top_left': {'x': topLeft.dx, 'y': topLeft.dy}, 35 | 'bottom_right': {'x': bottomRight.dx, 'y': bottomRight.dy}, 36 | }; 37 | } 38 | 39 | @override 40 | InvertedTriangle copyWith({Offset? topLeft, Offset? bottomRight, Color? color}) { 41 | return InvertedTriangle( 42 | topLeft: topLeft ?? this.topLeft, 43 | id: id, 44 | bottomRight: bottomRight ?? this.bottomRight, 45 | color: color ?? this.color, 46 | ); 47 | } 48 | 49 | @override 50 | bool intersectsWith(Offset point) { 51 | final rect = Rect.fromPoints(topLeft, bottomRight); 52 | return rect.contains(point); 53 | } 54 | 55 | @override 56 | InvertedTriangle move(Offset delta) { 57 | return copyWith(topLeft: topLeft + delta, bottomRight: bottomRight + delta); 58 | } 59 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/objects/parallelogram_object.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:uuid/uuid.dart'; 5 | 6 | class Parallelogram extends CanvasObject { 7 | static const String type = 'parallelogram'; 8 | final Offset topLeft; 9 | final Offset bottomRight; 10 | 11 | Parallelogram({ 12 | required super.id, 13 | required super.color, 14 | required this.topLeft, 15 | required this.bottomRight, 16 | }); 17 | 18 | Parallelogram.fromJson(Map json) 19 | : bottomRight = Offset(json['bottom_right']['x'], json['bottom_right']['y']), 20 | topLeft = Offset(json['top_left']['x'], json['top_left']['y']), 21 | super(id: json['id'], color: Color(json['color'])); 22 | 23 | Parallelogram.createNew(Offset startingPoint) 24 | : topLeft = startingPoint, 25 | bottomRight = startingPoint, 26 | super(color: RandomColor.getRandom(), id: const Uuid().v4()); 27 | 28 | @override 29 | Map toJson() { 30 | return { 31 | 'object_type': type, 32 | 'id': id, 33 | 'color': color.value, 34 | 'top_left': {'x': topLeft.dx, 'y': topLeft.dy}, 35 | 'bottom_right': {'x': bottomRight.dx, 'y': bottomRight.dy}, 36 | }; 37 | } 38 | 39 | @override 40 | Parallelogram copyWith({Offset? topLeft, Offset? bottomRight, Color? color}) { 41 | return Parallelogram( 42 | topLeft: topLeft ?? this.topLeft, 43 | id: id, 44 | bottomRight: bottomRight ?? this.bottomRight, 45 | color: color ?? this.color, 46 | ); 47 | } 48 | 49 | @override 50 | bool intersectsWith(Offset point) { 51 | final rect = Rect.fromPoints(topLeft, bottomRight); 52 | return rect.contains(point); 53 | } 54 | 55 | @override 56 | Parallelogram move(Offset delta) { 57 | return copyWith(topLeft: topLeft + delta, bottomRight: bottomRight + delta); 58 | } 59 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/objects/rectangle_object.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'dart:ui'; 3 | 4 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 5 | import 'package:uuid/uuid.dart'; 6 | 7 | /// Rectangle displayed on the canvas. 8 | class Rectangle extends CanvasObject { 9 | static const String type = 'rectangle'; 10 | 11 | final Offset topLeft; 12 | final Offset bottomRight; 13 | 14 | Rectangle({ 15 | required super.id, 16 | required super.color, 17 | required this.topLeft, 18 | required this.bottomRight, 19 | }); 20 | 21 | Rectangle.fromJson(Map json) 22 | : bottomRight = Offset( 23 | json['bottom_right']['x'], 24 | json['bottom_right']['y'], 25 | ), 26 | topLeft = Offset(json['top_left']['x'], json['top_left']['y']), 27 | super(id: json['id'], color: Color(json['color'])); 28 | 29 | /// Constructor to be used when first starting to draw the object on the canvas 30 | Rectangle.createNew(Offset startingPoint) 31 | : topLeft = startingPoint, 32 | bottomRight = startingPoint, 33 | super(color: RandomColor.getRandom(), id: const Uuid().v4()); 34 | 35 | @override 36 | Map toJson() { 37 | return { 38 | 'object_type': type, 39 | 'id': id, 40 | 'color': color.value, 41 | 'top_left': {'x': topLeft.dx, 'y': topLeft.dy}, 42 | 'bottom_right': {'x': bottomRight.dx, 'y': bottomRight.dy}, 43 | }; 44 | } 45 | 46 | @override 47 | Rectangle copyWith({Offset? topLeft, Offset? bottomRight, Color? color}) { 48 | return Rectangle( 49 | topLeft: topLeft ?? this.topLeft, 50 | id: id, 51 | bottomRight: bottomRight ?? this.bottomRight, 52 | color: color ?? this.color, 53 | ); 54 | } 55 | 56 | @override 57 | bool intersectsWith(Offset point) { 58 | final minX = min(topLeft.dx, bottomRight.dx); 59 | final maxX = max(topLeft.dx, bottomRight.dx); 60 | final minY = min(topLeft.dy, bottomRight.dy); 61 | final maxY = max(topLeft.dy, bottomRight.dy); 62 | return minX < point.dx && 63 | point.dx < maxX && 64 | minY < point.dy && 65 | point.dy < maxY; 66 | } 67 | 68 | @override 69 | Rectangle move(Offset delta) { 70 | return copyWith(topLeft: topLeft + delta, bottomRight: bottomRight + delta); 71 | } 72 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/objects/rounded_square_object.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:uuid/uuid.dart'; 5 | 6 | class RoundedSquare extends CanvasObject { 7 | static const String type = 'rounded_square'; 8 | final Offset topLeft; 9 | final Offset bottomRight; 10 | final double cornerRadius; 11 | 12 | RoundedSquare({ 13 | required super.id, 14 | required super.color, 15 | required this.topLeft, 16 | required this.bottomRight, 17 | this.cornerRadius = 10.0, 18 | }); 19 | 20 | RoundedSquare.fromJson(Map json) 21 | : bottomRight = Offset(json['bottom_right']['x'], json['bottom_right']['y']), 22 | topLeft = Offset(json['top_left']['x'], json['top_left']['y']), 23 | cornerRadius = json['corner_radius'] ?? 10.0, 24 | super(id: json['id'], color: Color(json['color'])); 25 | 26 | RoundedSquare.createNew(Offset startingPoint) 27 | : topLeft = startingPoint, 28 | bottomRight = startingPoint, 29 | cornerRadius = 10.0, 30 | super(color: RandomColor.getRandom(), id: const Uuid().v4()); 31 | 32 | @override 33 | Map toJson() { 34 | return { 35 | 'object_type': type, 36 | 'id': id, 37 | 'color': color.value, 38 | 'top_left': {'x': topLeft.dx, 'y': topLeft.dy}, 39 | 'bottom_right': {'x': bottomRight.dx, 'y': bottomRight.dy}, 40 | 'corner_radius': cornerRadius, 41 | }; 42 | } 43 | 44 | @override 45 | RoundedSquare copyWith({Offset? topLeft, Offset? bottomRight, Color? color}) { 46 | return RoundedSquare( 47 | topLeft: topLeft ?? this.topLeft, 48 | id: id, 49 | bottomRight: bottomRight ?? this.bottomRight, 50 | color: color ?? this.color, 51 | cornerRadius: cornerRadius, 52 | ); 53 | } 54 | 55 | @override 56 | bool intersectsWith(Offset point) { 57 | final rect = Rect.fromPoints(topLeft, bottomRight); 58 | return rect.contains(point); 59 | } 60 | 61 | @override 62 | RoundedSquare move(Offset delta) { 63 | return copyWith(topLeft: topLeft + delta, bottomRight: bottomRight + delta); 64 | } 65 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/objects/square_object.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:uuid/uuid.dart'; 6 | 7 | class Square extends CanvasObject { 8 | static const String type = 'square'; 9 | final Offset topLeft; 10 | final Offset bottomRight; 11 | 12 | Square._({ 13 | required super.id, 14 | required super.color, 15 | required this.bottomRight, 16 | required this.topLeft, 17 | }); 18 | 19 | factory Square({ 20 | required String id, 21 | required Color color, 22 | required Offset topLeft, 23 | required Offset bottomRight, 24 | }) { 25 | final dx = bottomRight.dx - topLeft.dx; 26 | final dy = bottomRight.dy - topLeft.dy; 27 | // The side length is the maximum of the horizontal or vertical distance. 28 | final side = max(dx.abs(), dy.abs()); 29 | 30 | // Adjust the `bottomRight` point to make the shape a perfect square. 31 | // The `sign` property ensures the square is drawn in the correct quadrant 32 | // relative to the starting point. 33 | final adjustedBottomRight = Offset( 34 | topLeft.dx + side * dx.sign, 35 | topLeft.dy + side * dy.sign, 36 | ); 37 | 38 | return Square._( 39 | id: id, 40 | color: color, 41 | topLeft: topLeft, 42 | bottomRight: adjustedBottomRight, 43 | ); 44 | } 45 | 46 | Square.fromJson(Map json) 47 | : bottomRight = Offset( 48 | json['bottom_right']['x'], 49 | json['bottom_right']['y'], 50 | ), 51 | topLeft = Offset(json['top_left']['x'], json['top_left']['y']), 52 | super(id: json['id'], color: Color(json['color'])); 53 | 54 | Square.createNew(Offset startingPoint) 55 | : topLeft = startingPoint, 56 | bottomRight = startingPoint, 57 | super(id: const Uuid().v4(), color: RandomColor.getRandom()); 58 | 59 | @override 60 | Map toJson() { 61 | return { 62 | 'object_type': type, 63 | 'id': id, 64 | 'color': color.value, 65 | 'top_left': {'x': topLeft.dx, 'y': topLeft.dy}, 66 | 'bottom_right': {'x': bottomRight.dx, 'y': bottomRight.dy}, 67 | }; 68 | } 69 | 70 | @override 71 | Square copyWith({Offset? topLeft, Offset? bottomRight, Color? color}) { 72 | return Square( 73 | id: id, 74 | color: color ?? this.color, 75 | bottomRight: bottomRight ?? this.bottomRight, 76 | topLeft: topLeft ?? this.topLeft, 77 | ); 78 | } 79 | 80 | @override 81 | bool intersectsWith(Offset point) { 82 | final minX = min(topLeft.dx, bottomRight.dx); 83 | final maxX = max(topLeft.dx, bottomRight.dx); 84 | final minY = min(topLeft.dy, bottomRight.dy); 85 | final maxY = max(topLeft.dy, bottomRight.dy); 86 | return minX < point.dx && 87 | point.dx < maxX && 88 | minY < point.dy && 89 | point.dy < maxY; 90 | } 91 | 92 | @override 93 | Square move(Offset delta) { 94 | return copyWith(topLeft: topLeft + delta, bottomRight: bottomRight + delta); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/features/models/canvas_models/objects/triangle_object.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:uuid/uuid.dart'; 5 | 6 | class Triangle extends CanvasObject { 7 | static const String type = 'triangle'; 8 | final Offset topLeft; 9 | final Offset bottomRight; 10 | 11 | Triangle({ 12 | required super.id, 13 | required super.color, 14 | required this.topLeft, 15 | required this.bottomRight, 16 | }); 17 | 18 | Triangle.fromJson(Map json) 19 | : bottomRight = Offset(json['bottom_right']['x'], json['bottom_right']['y']), 20 | topLeft = Offset(json['top_left']['x'], json['top_left']['y']), 21 | super(id: json['id'], color: Color(json['color'])); 22 | 23 | Triangle.createNew(Offset startingPoint) 24 | : topLeft = startingPoint, 25 | bottomRight = startingPoint, 26 | super(color: RandomColor.getRandom(), id: const Uuid().v4()); 27 | 28 | @override 29 | Map toJson() { 30 | return { 31 | 'object_type': type, 32 | 'id': id, 33 | 'color': color.value, 34 | 'top_left': {'x': topLeft.dx, 'y': topLeft.dy}, 35 | 'bottom_right': {'x': bottomRight.dx, 'y': bottomRight.dy}, 36 | }; 37 | } 38 | 39 | @override 40 | Triangle copyWith({Offset? topLeft, Offset? bottomRight, Color? color}) { 41 | return Triangle( 42 | topLeft: topLeft ?? this.topLeft, 43 | id: id, 44 | bottomRight: bottomRight ?? this.bottomRight, 45 | color: color ?? this.color, 46 | ); 47 | } 48 | 49 | @override 50 | bool intersectsWith(Offset point) { 51 | final rect = Rect.fromPoints(topLeft, bottomRight); 52 | return rect.contains(point); 53 | } 54 | 55 | @override 56 | Triangle move(Offset delta) { 57 | return copyWith(topLeft: topLeft + delta, bottomRight: bottomRight + delta); 58 | } 59 | } -------------------------------------------------------------------------------- /lib/features/models/canvas_models/synced_object.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 2 | import 'package:cookethflow/features/models/canvas_models/user_cursor.dart'; 3 | 4 | abstract class SyncedObject { 5 | final String id; 6 | factory SyncedObject.fromJson(Map json) { 7 | final objectType = json["object_type"]; 8 | if (objectType == UserCursor.type) { 9 | return UserCursor.fromJson(json); 10 | } else { 11 | return CanvasObject.fromJson(json); 12 | } 13 | } 14 | 15 | SyncedObject({required this.id}); 16 | 17 | Map toJson(); 18 | } 19 | -------------------------------------------------------------------------------- /lib/features/models/canvas_models/user_cursor.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:cookethflow/features/models/canvas_models/canvas_object.dart'; 4 | import 'package:cookethflow/features/models/canvas_models/synced_object.dart'; 5 | 6 | /// Data model for the cursors displayed on the canvas. 7 | class UserCursor extends SyncedObject { 8 | static String type = 'cursor'; 9 | 10 | final Offset position; 11 | final Color color; 12 | 13 | UserCursor({ 14 | required super.id, 15 | required this.position, 16 | }) : color = RandomColor.getRandomFromUserId(id); 17 | 18 | UserCursor.fromJson(Map json) 19 | : position = Offset(json['position']['x'], json['position']['y']), 20 | color = RandomColor.getRandomFromUserId(json['id']), 21 | super(id: json['id']); 22 | 23 | @override 24 | Map toJson() { 25 | return { 26 | 'object_type': type, 27 | 'id': id, 28 | 'position': { 29 | 'x': position.dx, 30 | 'y': position.dy, 31 | } 32 | }; 33 | } 34 | } -------------------------------------------------------------------------------- /lib/features/models/connection_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/utils/enums.dart'; 2 | 3 | class Connection { 4 | String nodeId; 5 | ConnectionPoint point; 6 | String? connectionContent; 7 | Connection({ 8 | required this.nodeId, 9 | required this.point, 10 | this.connectionContent, 11 | }); 12 | } 13 | 14 | class ConnectionModel { 15 | String id; 16 | List targetConnections; // data about target nodes 17 | String sourceNodeId; 18 | ConnectionPoint sourcePoint; 19 | double thickness; 20 | ConnectionType type; 21 | 22 | ConnectionModel({ 23 | required this.id, 24 | required this.sourceNodeId, 25 | required this.sourcePoint, 26 | this.thickness = 1, 27 | this.type = ConnectionType.solid, 28 | }) : targetConnections = []; 29 | 30 | ConnectionModel copyWith() { 31 | ConnectionModel newCon = ConnectionModel( 32 | id: id, 33 | sourceNodeId: sourceNodeId, 34 | thickness: thickness, 35 | type: type, 36 | sourcePoint: sourcePoint, 37 | ); 38 | newCon.targetConnections = targetConnections; 39 | return newCon; 40 | } 41 | 42 | Map toJson() { 43 | return { 44 | "id": id, 45 | "sourceNodeId": sourceNodeId, 46 | "sourcePoint": sourcePoint.index, 47 | "thickness": thickness, 48 | "type": type.index, 49 | "targetConnections": 50 | targetConnections 51 | .map( 52 | (conn) => { 53 | "nodeId": conn.nodeId, 54 | "point": conn.point.index, 55 | if (conn.connectionContent != null) 56 | "content": conn.connectionContent, 57 | }, 58 | ) 59 | .toList(), 60 | }; 61 | } 62 | 63 | factory ConnectionModel.fromJson(Map json) { 64 | final model = ConnectionModel( 65 | id: json["id"] as String, 66 | sourceNodeId: json["sourceNodeId"] as String, 67 | sourcePoint: ConnectionPoint.values[json["sourcePoint"] as int], 68 | thickness: (json["thickness"] as num).toDouble(), 69 | type: ConnectionType.values[json["type"] as int], 70 | ); 71 | 72 | if (json["targetConnections"] != null) { 73 | final connections = json["targetConnections"] as List; 74 | model.targetConnections = 75 | connections 76 | .map( 77 | (conn) => Connection( 78 | nodeId: conn["nodeId"] as String, 79 | point: ConnectionPoint.values[conn["point"] as int], 80 | connectionContent: conn["content"] as String?, 81 | ), 82 | ) 83 | .toList(); 84 | } 85 | return model; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/features/models/node_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/utils/enums.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | 4 | class NodeModel { 5 | String id; 6 | NodeType nodeType; 7 | Size size; 8 | int color; 9 | String data; 10 | Offset position; 11 | List connectionId; 12 | 13 | NodeModel({ 14 | required this.id, 15 | required this.nodeType, 16 | this.size = const Size(150, 75), 17 | this.color = 2, 18 | required this.data, 19 | required this.position, 20 | }) : connectionId = []; 21 | 22 | NodeModel copyWith() { 23 | NodeModel newNode = NodeModel( 24 | id: id, 25 | nodeType: nodeType, 26 | color: color, 27 | size: Size(size.width, size.height), 28 | data: data, 29 | position: Offset(position.dx, position.dy), 30 | ); 31 | newNode.connectionId = connectionId; 32 | return newNode; 33 | } 34 | 35 | Map toJson() { 36 | return { 37 | "id": id, 38 | "nodeType": nodeType.index, 39 | "data": data, 40 | "position": {"dx": position.dx, "dy": position.dy}, 41 | "color": color, 42 | "size": {"width": size.width, "height": size.height}, 43 | "connectionId": connectionId, 44 | }; 45 | } 46 | 47 | factory NodeModel.fromJson(Map json) { 48 | NodeModel node = NodeModel( 49 | id: json["id"], 50 | nodeType: NodeType.values[json["nodeType"]], 51 | data: json["data"], 52 | position: Offset( 53 | json["position"]["dx"].toDouble(), 54 | json["position"]["dy"].toDouble(), 55 | ), 56 | color: json["color"], 57 | size: Size( 58 | json["size"]["width"].toDouble(), 59 | json["size"]["height"].toDouble(), 60 | ), 61 | ); 62 | 63 | if (json["connectionId"] != null) { 64 | node.connectionId = List.from(json["connectionId"]); 65 | } 66 | 67 | return node; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/features/models/user_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:supabase_flutter/supabase_flutter.dart'; 2 | 3 | class CurrentUser { 4 | final String id; 5 | final String? name; // Full name (e.g., "Antara Paul") 6 | final String? username; // Unique username (e.g., "@antara_paul") 7 | final String email; 8 | final String? avatarUrl; // URL for the profile picture 9 | final String provider; // 'email', 'google', 'github' 10 | 11 | CurrentUser({ 12 | required this.id, 13 | this.name, 14 | this.username, 15 | required this.email, 16 | this.avatarUrl, 17 | required this.provider, 18 | }); 19 | 20 | /// Factory constructor to parse a Supabase `User` object into `CurrentUser`. 21 | /// It intelligently extracts data based on the authentication provider. 22 | factory CurrentUser.fromSupabaseUser(User user) { 23 | final Map userMetadata = user.userMetadata ?? {}; 24 | final Map appMetadata = user.appMetadata ?? {}; 25 | 26 | String? name; 27 | String? username; 28 | String? avatarUrl; 29 | String provider = appMetadata['provider'] ?? 'email'; // Default to email 30 | 31 | // Extract relevant data based on the provider 32 | switch (provider) { 33 | case 'google': 34 | name = userMetadata['full_name'] ?? userMetadata['name']; 35 | // Google typically doesn't provide a 'username'. You might derive it 36 | // from the email if you need one, or leave it null. 37 | username = null; 38 | avatarUrl = userMetadata['avatar_url'] ?? userMetadata['picture']; 39 | break; 40 | case 'github': 41 | name = userMetadata['full_name'] ?? userMetadata['name']; 42 | username = userMetadata['preferred_username'] ?? userMetadata['user_name']; 43 | avatarUrl = userMetadata['avatar_url']; 44 | break; 45 | case 'email': 46 | default: // For email and any other unhandled providers 47 | // For email provider, you likely store custom 'userName' and 'name' 48 | // in userMetadata during signup or profile editing. 49 | name = userMetadata['name'] ?? user.email?.split('@').first; 50 | username = userMetadata['userName'] ?? user.email?.split('@').first; 51 | avatarUrl = userMetadata['profile_picture_url']; // Custom field for uploaded PFP 52 | break; 53 | } 54 | 55 | return CurrentUser( 56 | id: user.id, 57 | name: name, 58 | username: username, 59 | email: user.email!, 60 | avatarUrl: avatarUrl, 61 | provider: provider, 62 | ); 63 | } 64 | 65 | /// Creates a copy of the [CurrentUser] object with optional new values. 66 | CurrentUser copyWith({ 67 | String? name, 68 | String? username, 69 | String? email, 70 | String? avatarUrl, 71 | }) { 72 | return CurrentUser( 73 | id: id, 74 | name: name ?? this.name, 75 | username: username ?? this.username, 76 | email: email ?? this.email, 77 | avatarUrl: avatarUrl ?? this.avatarUrl, 78 | provider: provider, 79 | ); 80 | } 81 | } -------------------------------------------------------------------------------- /lib/features/models/workspace_model.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/models/connection_model.dart'; 2 | import 'package:cookethflow/features/models/node_model.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | 5 | class WorkspaceModel { 6 | String id; 7 | String owner; 8 | String name; 9 | List editorIdList; 10 | List viewerIdList; 11 | DateTime? lastEdited; 12 | List nodeList; 13 | List connectionList; 14 | 15 | WorkspaceModel({ 16 | required this.id, 17 | required this.owner, 18 | required this.name, 19 | required this.editorIdList, 20 | required this.viewerIdList, 21 | required this.lastEdited, 22 | this.nodeList = const [], 23 | this.connectionList = const [], 24 | }); 25 | 26 | WorkspaceModel copyWith({ 27 | String? id, 28 | String? owner, 29 | List? editorIdList, 30 | List? viewerIdList, 31 | DateTime? lastEdited, 32 | List? nodeList, 33 | List? connectionList, 34 | }) { 35 | return WorkspaceModel( 36 | id: id ?? this.id, 37 | owner: owner ?? this.owner, 38 | name: name, 39 | editorIdList: editorIdList ?? List.from(this.editorIdList), 40 | viewerIdList: viewerIdList ?? List.from(this.viewerIdList), 41 | lastEdited: lastEdited ?? this.lastEdited, 42 | nodeList: nodeList ?? List.from(this.nodeList), 43 | connectionList: connectionList ?? List.from(this.connectionList), 44 | ); 45 | } 46 | 47 | Map toJson() { 48 | return { 49 | 'id': id, 50 | 'owner': owner, 51 | 'name': name, 52 | 'editorIdList': editorIdList, 53 | 'viewerIdList': viewerIdList, 54 | 'lastEdited': lastEdited?.toIso8601String(), 55 | 'nodeList': nodeList.map((node) => node.toJson()).toList(), 56 | 'connectionList': connectionList.map((conn) => conn.toJson()).toList(), 57 | }; 58 | } 59 | 60 | factory WorkspaceModel.fromJson(Map json) { 61 | return WorkspaceModel( 62 | id: json['id'] as String, 63 | owner: json['owner'] as String, 64 | name: json['name'] as String, 65 | editorIdList: List.from(json['editorIdList']), 66 | viewerIdList: List.from(json['viewerIdList']), 67 | lastEdited: DateTime.parse(json['lastEdited'] as String), 68 | nodeList: 69 | (json['nodeList'] as List) 70 | .map( 71 | (nodeJson) => 72 | NodeModel.fromJson(nodeJson as Map), 73 | ) 74 | .toList(), 75 | connectionList: 76 | (json['connectionList'] as List) 77 | .map( 78 | (connJson) => 79 | ConnectionModel.fromJson(connJson as Map), 80 | ) 81 | .toList(), 82 | ); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/features/workspace/pages/desktop/workspace_desktop.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' as rh; 2 | import 'package:cookethflow/core/theme/colors.dart'; 3 | import 'package:cookethflow/features/workspace/pages/canvas_page.dart'; 4 | import 'package:cookethflow/features/workspace/widgets/export_project_button.dart'; 5 | import 'package:cookethflow/features/workspace/widgets/toolbar.dart'; // Assuming this might be used later 6 | import 'package:cookethflow/features/workspace/widgets/undo_redo_button.dart'; 7 | import 'package:cookethflow/features/workspace/widgets/workspace_drawer.dart'; 8 | import 'package:cookethflow/features/workspace/widgets/zoom_control_button.dart'; 9 | import 'package:flutter/material.dart'; 10 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 11 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 12 | 13 | class WorkspaceDesktop extends StatelessWidget { 14 | const WorkspaceDesktop({super.key}); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | // Determine device type for responsive adjustments 19 | bool isDesktop = 20 | rh.ResponsiveLayoutHelper.getDeviceType(context) == 21 | rh.DeviceType.desktop; 22 | 23 | return Scaffold( 24 | backgroundColor: const Color(0xFFFF8F8F8), 25 | body: Padding( 26 | padding: EdgeInsets.symmetric(horizontal: 40.w, vertical: 40.h), 27 | child: Stack( 28 | children: [ 29 | // 1. CanvasPage - This should be the base layer, filling the entire available space 30 | const CanvasPage(), 31 | 32 | const WorkspaceDrawer(), 33 | SizedBox(width: 20.w), 34 | // Undo/Redo Controls Container 35 | Positioned(top: 0,left: 0.21.sw,child: UndoRedoButton()), 36 | // Export project button 37 | Positioned(top: 0,right: 0.02.sw,child: ExportProjectButton()), 38 | 39 | Positioned(right: 0,top: 0.15.sh,child: ToolBar()), 40 | 41 | // 3. Zoom Control - Positioned at the bottom right of the Stack 42 | Positioned( 43 | bottom: 0.h, // Aligns to the bottom edge of the Stack 44 | right: 0.w, // Aligns to the right edge of the Stack 45 | child: ZoomControlButton(), 46 | ), 47 | ], 48 | ), 49 | ), 50 | ); 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /lib/features/workspace/pages/mobile/workspace_mobile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class WorkspaceMobile extends StatelessWidget { 4 | const WorkspaceMobile({super.key}); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return const Center( 9 | child: Text( 10 | 'cooketh flow', 11 | style: TextStyle( 12 | fontSize: 28, 13 | fontWeight: FontWeight.bold, 14 | color: Colors.black, 15 | ), 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/features/workspace/pages/workspace.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' 2 | as responsive_helper; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | import 'package:cookethflow/features/workspace/pages/desktop/workspace_desktop.dart'; 6 | import 'package:cookethflow/features/workspace/pages/tablet/workspace_tablet.dart'; 7 | import 'package:cookethflow/features/workspace/pages/mobile/workspace_mobile.dart'; 8 | 9 | class WorkspacePage extends StatelessWidget { 10 | const WorkspacePage({super.key}); 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | Widget workspaceScreen; 15 | 16 | switch (responsive_helper.ResponsiveLayoutHelper.getDeviceType(context)) { 17 | case responsive_helper.DeviceType.desktop: 18 | workspaceScreen = const WorkspaceDesktop(); 19 | break; 20 | case responsive_helper.DeviceType.tab: 21 | workspaceScreen = const WorkspaceTablet(); 22 | break; 23 | case responsive_helper.DeviceType.mobile: 24 | workspaceScreen = const WorkspaceMobile(); 25 | break; 26 | } 27 | 28 | return Scaffold( 29 | body: workspaceScreen, 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/features/workspace/providers/workspace_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/utils/state_handler.dart'; 2 | 3 | class WorkspaceProvider extends StateHandler { 4 | WorkspaceProvider() : super(); 5 | 6 | bool _isLoading = false; 7 | bool _isDrawerOpen = false; 8 | int? _selectedTileIndex; // Stores the index of the currently selected tile, null if none 9 | 10 | bool get isLoading => _isLoading; 11 | bool get isDrawerOpen => _isDrawerOpen; 12 | int? get selectedTileIndex => _selectedTileIndex; // Getter for the selected index 13 | 14 | // New getter to easily check if any tile is selected for the drawer's border 15 | bool get hasSelectedTile => _selectedTileIndex != null; 16 | 17 | void selectTile(int index) { 18 | if (_selectedTileIndex == index) { 19 | // If the same tile is tapped again, deselect it 20 | _selectedTileIndex = null; 21 | } else { 22 | // Otherwise, select the new tile 23 | _selectedTileIndex = index; 24 | } 25 | notifyListeners(); 26 | } 27 | 28 | void setLoadingState() { 29 | _isLoading = !_isLoading; 30 | notifyListeners(); 31 | } 32 | 33 | void toggleDrawer() { 34 | _isDrawerOpen = !_isDrawerOpen; 35 | notifyListeners(); 36 | } 37 | } -------------------------------------------------------------------------------- /lib/features/workspace/services/export_serice.dart: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/lib/features/workspace/services/export_serice.dart -------------------------------------------------------------------------------- /lib/features/workspace/widgets/connector_customizer.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/theme/colors.dart'; 2 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' as rh; 3 | import 'package:flutter/material.dart'; 4 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 5 | 6 | class CoonectorCustomizer extends StatelessWidget { 7 | const CoonectorCustomizer({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Dialog( 12 | insetPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20), 13 | child: Container( 14 | width: 420, 15 | padding: const EdgeInsets.all(12), 16 | decoration: BoxDecoration( 17 | color: Colors.white, 18 | borderRadius: BorderRadius.circular(12), 19 | border: Border.all(color: const Color(0xFFE0E0E0), width: 1), 20 | ), 21 | child: Column( 22 | mainAxisSize: MainAxisSize.min, 23 | children: [ 24 | // Header with close button 25 | Row( 26 | mainAxisAlignment: MainAxisAlignment.end, 27 | children: [ 28 | IconButton( 29 | icon: const Icon(PhosphorIconsRegular.x, size: 24, color: Colors.black54), 30 | onPressed: () => Navigator.pop(context), 31 | padding: EdgeInsets.zero, 32 | constraints: const BoxConstraints(), 33 | ), 34 | ], 35 | ), 36 | const SizedBox(height: 8), 37 | 38 | // Thickness selection buttons 39 | Row( 40 | children: [ 41 | _buildModeButton('Thin', PhosphorIconsFill.circle, color: Colors.black), 42 | const SizedBox(width: 8), 43 | _buildModeButton('Medium', PhosphorIconsFill.circle, color: Colors.black), 44 | const SizedBox(width: 8), 45 | _buildModeButton('Thick', PhosphorIconsFill.circle, color: Colors.black), 46 | ], 47 | ), 48 | const SizedBox(height: 20), 49 | 50 | // Color grid 51 | Column( 52 | children: [ 53 | // Top row (darker colors) 54 | Wrap( 55 | spacing: 12, // Horizontal gap between color boxes 56 | children: secondaryColors.map((color) => _buildColorBox(color)).toList(), 57 | ), 58 | const SizedBox(height: 8), 59 | // Bottom row (lighter colors) 60 | Wrap( 61 | spacing: 12, 62 | children: tertiaryColors.map((color) => _buildColorBox(color)).toList(), 63 | ), 64 | ], 65 | ), 66 | ], 67 | ), 68 | ), 69 | ); 70 | } 71 | 72 | Widget _buildModeButton(String text, IconData icon, {Color color = Colors.black}) { 73 | bool isSelected = text == 'Thin'; 74 | double iconSize = text == 'Thin' ? 12.0 : text == 'Medium' ? 16.0 : 20.0; // Different sizes for Thin, Medium, Thick 75 | return Container( 76 | padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), 77 | decoration: BoxDecoration( 78 | color: isSelected ? Color(0xFFD9D9D9) : null, 79 | borderRadius: BorderRadius.circular(8), 80 | ), 81 | child: Row( 82 | mainAxisSize: MainAxisSize.min, 83 | children: [ 84 | Icon( 85 | icon, 86 | size: iconSize, 87 | color: color, 88 | ), 89 | const SizedBox(width: 4), 90 | Text( 91 | text, 92 | style: const TextStyle( 93 | fontSize: 14, 94 | color: Colors.black87, 95 | fontWeight: FontWeight.w500, 96 | ), 97 | ), 98 | ], 99 | ), 100 | ); 101 | } 102 | 103 | Widget _buildColorBox(Color color, {bool isSelected = false}) { 104 | return Container( 105 | width: 28, 106 | height: 28, 107 | decoration: BoxDecoration( 108 | color: color, 109 | border: isSelected 110 | ? Border.all(color: Colors.blue, width: 2) 111 | : Border.all(color: Colors.grey.shade300, width: 1), 112 | ), 113 | ); 114 | } 115 | } -------------------------------------------------------------------------------- /lib/features/workspace/widgets/export_project_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/theme/colors.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 5 | 6 | class ExportProjectButton extends StatelessWidget { 7 | const ExportProjectButton({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return ElevatedButton( 12 | onPressed: () {}, 13 | style: ElevatedButton.styleFrom( 14 | elevation: 0, 15 | backgroundColor: primaryColor, 16 | padding: EdgeInsets.symmetric(vertical: 32.h, horizontal: 24.w), 17 | shape: RoundedRectangleBorder( 18 | borderRadius: BorderRadius.circular(12.r), 19 | ), 20 | ), 21 | child: Row( 22 | mainAxisSize: MainAxisSize.min, 23 | children: [ 24 | Text( 25 | 'Export Flowchart', 26 | style: TextStyle( 27 | fontFamily: 'Fredrik', 28 | fontSize: 18.sp, 29 | color: Colors.white, 30 | fontWeight: FontWeight.w500, 31 | ), 32 | ), 33 | SizedBox(width: 16.w), 34 | Icon(PhosphorIconsRegular.export, color: Colors.white, size: 24.sp), 35 | ], 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/features/workspace/widgets/node_colour.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/theme/colors.dart'; 2 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' as rh; 3 | import 'package:flutter/material.dart'; 4 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 5 | 6 | class NodeColourPicker extends StatelessWidget { 7 | const NodeColourPicker({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Dialog( 12 | insetPadding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20), 13 | child: Container( 14 | width: 420, 15 | padding: const EdgeInsets.all(12), 16 | decoration: BoxDecoration( 17 | color: Colors.white, 18 | borderRadius: BorderRadius.circular(12), 19 | border: Border.all(color: const Color(0xFFE0E0E0), width: 1), 20 | ), 21 | child: Column( 22 | mainAxisSize: MainAxisSize.min, 23 | children: [ 24 | // Header with close button 25 | Row( 26 | mainAxisAlignment: MainAxisAlignment.end, 27 | children: [ 28 | IconButton( 29 | icon: const Icon(PhosphorIconsRegular.x, size: 24, color: Colors.black54), 30 | onPressed: () => Navigator.pop(context), 31 | padding: EdgeInsets.zero, 32 | constraints: const BoxConstraints(), 33 | ), 34 | ], 35 | ), 36 | const SizedBox(height: 8), 37 | 38 | // Mode selection buttons 39 | Row( 40 | children: [ 41 | _buildModeButton('Fill', PhosphorIconsRegular.square, color: Colors.black), 42 | const SizedBox(width: 8), 43 | _buildModeButton('Transparent', PhosphorIconsFill.square, color: const Color.fromARGB(88, 0, 0, 0)), 44 | const SizedBox(width: 8), 45 | _buildModeButton('No Fill', PhosphorIconsFill.square, color: Colors.black), 46 | ], 47 | ), 48 | const SizedBox(height: 20), 49 | 50 | // Color grid 51 | Column( 52 | children: [ 53 | // Top row 54 | Wrap( 55 | spacing: 12, // Horizontal gap between color boxes 56 | children: secondaryColors.map((color) => _buildColorBox(color)).toList(), 57 | ), 58 | const SizedBox(height: 8), 59 | // Bottom row 60 | Wrap( 61 | spacing: 12, // Horizontal gap between color boxes 62 | children: tertiaryColors.asMap().entries.map((entry) { 63 | Color color = entry.value; 64 | bool isSelected = entry.key == 3; // Light Purple is selected 65 | return _buildColorBox(color, isSelected: isSelected); 66 | }).toList(), 67 | ), 68 | ], 69 | ), 70 | ], 71 | ), 72 | ), 73 | ); 74 | } 75 | 76 | Widget _buildModeButton(String text, IconData icon, {Color color = Colors.black}) { 77 | bool isSelected = text == 'Fill'; // Hardcode "Fill" as selected 78 | return Container( 79 | padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), 80 | decoration: BoxDecoration( 81 | color: isSelected ? Color(0XFFD9D9D9): null, 82 | borderRadius: BorderRadius.circular(8), 83 | ), 84 | child: Row( 85 | mainAxisSize: MainAxisSize.min, 86 | children: [ 87 | Icon( 88 | icon, 89 | size: 18, 90 | color: color, 91 | ), 92 | const SizedBox(width: 4), 93 | Text( 94 | text, 95 | style: const TextStyle( 96 | fontSize: 14, 97 | color: Colors.black87, 98 | fontWeight: FontWeight.w500, 99 | ), 100 | ), 101 | ], 102 | ), 103 | ); 104 | } 105 | 106 | Widget _buildColorBox(Color color, {bool isSelected = false}) { 107 | return Container( 108 | width: 28, 109 | height: 28, 110 | decoration: BoxDecoration( 111 | color: color, 112 | border: isSelected 113 | ? Border.all(color: Colors.blue, width: 2) 114 | : Border.all(color: Colors.grey.shade300, width: 1), 115 | ), 116 | ); 117 | } 118 | } -------------------------------------------------------------------------------- /lib/features/workspace/widgets/sticky_notes.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:cookethflow/core/theme/colors.dart'; 3 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 4 | 5 | 6 | class StickyNotesWidget extends StatelessWidget { 7 | const StickyNotesWidget({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Dialog( 12 | insetPadding: EdgeInsets.symmetric(horizontal: 20, vertical: 20), 13 | child: Container( 14 | width: 200, 15 | padding: EdgeInsets.all(20), 16 | decoration: BoxDecoration( 17 | color: Colors.white, 18 | borderRadius: BorderRadius.circular(12), 19 | border: Border.all(color: const Color(0xFFD9D9D9), width: 1.2), 20 | ), 21 | child: Column( 22 | mainAxisSize: MainAxisSize.min, 23 | crossAxisAlignment: CrossAxisAlignment.start, 24 | children: [ 25 | // Header 26 | Row( 27 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 28 | children: [ 29 | Text( 30 | 'Sticky notes', 31 | style: TextStyle( 32 | fontSize: 20, 33 | fontWeight: FontWeight.w600, 34 | color: Colors.black, 35 | ), 36 | ), 37 | IconButton( 38 | icon: Icon(PhosphorIconsRegular.x, size: 24, color: Colors.black87), 39 | onPressed: () => Navigator.pop(context), 40 | padding: EdgeInsets.zero, 41 | constraints: BoxConstraints(), 42 | ), 43 | ], 44 | ), 45 | SizedBox(height: 16), 46 | 47 | // Grid of sticky notes with scroll 48 | SizedBox( 49 | height: 240, 50 | child: GridView.count( 51 | crossAxisCount: 2, 52 | mainAxisSpacing: 24, 53 | crossAxisSpacing: 24, 54 | childAspectRatio: 1.0, 55 | shrinkWrap: true, 56 | physics: AlwaysScrollableScrollPhysics(), 57 | children: [ 58 | _buildStickyNote(tertiaryColors[0], secondaryColors[0]), 59 | _buildStickyNote(tertiaryColors[1], secondaryColors[1]), 60 | _buildStickyNote(tertiaryColors[2], secondaryColors[2]), 61 | _buildStickyNote(tertiaryColors[3], secondaryColors[3]), 62 | _buildStickyNote(tertiaryColors[4], secondaryColors[4]), 63 | _buildStickyNote(tertiaryColors[5], secondaryColors[5]), 64 | _buildStickyNote(tertiaryColors[6], secondaryColors[6]), 65 | _buildStickyNote(tertiaryColors[7], secondaryColors[7]), 66 | _buildStickyNote(tertiaryColors[8], secondaryColors[8]), 67 | _buildStickyNote(tertiaryColors[9], secondaryColors[9]), 68 | ], 69 | ), 70 | ), 71 | ], 72 | ), 73 | ), 74 | ); 75 | } 76 | 77 | Widget _buildStickyNote(Color fillColor, Color borderColor) { 78 | return GestureDetector( 79 | onTap: () { 80 | print('Sticky note tapped'); 81 | }, 82 | child: Container( 83 | width: 20, 84 | height: 20, 85 | decoration: BoxDecoration( 86 | color: fillColor, 87 | border: Border.all(color: borderColor, width: 2), 88 | borderRadius: BorderRadius.circular(8), 89 | ), 90 | ), 91 | ); 92 | } 93 | } -------------------------------------------------------------------------------- /lib/features/workspace/widgets/undo_redo_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/core/helpers/responsive_layout.helper.dart' as rh; 2 | import 'package:cookethflow/features/workspace/widgets/vertical_divider.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 5 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 6 | 7 | class UndoRedoButton extends StatelessWidget { 8 | const UndoRedoButton({super.key}); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | bool isDesktop = 13 | rh.ResponsiveLayoutHelper.getDeviceType(context) == 14 | rh.DeviceType.desktop; 15 | return Container( 16 | padding: EdgeInsets.symmetric( 17 | horizontal: isDesktop ? 24.w : 32.w, 18 | vertical: 16.h, 19 | ), 20 | decoration: BoxDecoration( 21 | color: Colors.white, 22 | borderRadius: BorderRadius.circular(12.r), 23 | border: Border.all(color: const Color(0xFFD9D9D9), width: 1.2), 24 | ), 25 | child: SizedBox( 26 | height: 56.h, // Fixed height for consistency 27 | child: Row( 28 | mainAxisSize: MainAxisSize.min, 29 | children: [ 30 | IconButton( 31 | onPressed: () {}, 32 | icon: Icon( 33 | PhosphorIconsRegular.arrowArcLeft, 34 | size: 32.sp, 35 | color: Colors.black, 36 | ), 37 | ), 38 | VerticalCustomDivider(), // Custom divider 39 | IconButton( 40 | onPressed: () {}, 41 | icon: Icon( 42 | PhosphorIconsRegular.arrowArcRight, 43 | size: 32.sp, 44 | color: Colors.black, 45 | ), 46 | ), 47 | ], 48 | ), 49 | ), 50 | ); 51 | } 52 | } -------------------------------------------------------------------------------- /lib/features/workspace/widgets/vertical_divider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | 4 | class VerticalCustomDivider extends StatelessWidget { 5 | const VerticalCustomDivider({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Container( 10 | height: 24.h, 11 | width: 1.2.w, 12 | color: const Color(0xFFD9D9D9), 13 | margin: EdgeInsets.symmetric(horizontal: 8.w), 14 | ); 15 | } 16 | } -------------------------------------------------------------------------------- /lib/features/workspace/widgets/zoom_control_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/features/workspace/widgets/vertical_divider.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:phosphor_flutter/phosphor_flutter.dart'; 5 | 6 | class ZoomControlButton extends StatelessWidget { 7 | const ZoomControlButton({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Container( 12 | padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 16.h), 13 | decoration: BoxDecoration( 14 | border: Border.all(color: const Color(0XFFD9D9D9), width: 1.2), 15 | color: Colors.white, 16 | borderRadius: BorderRadius.circular(12.r), 17 | ), 18 | child: Row( 19 | mainAxisSize: MainAxisSize.min, 20 | crossAxisAlignment: CrossAxisAlignment.center, 21 | children: [ 22 | Text( 23 | "100%", 24 | style: TextStyle( 25 | color: Colors.black, 26 | fontWeight: FontWeight.w500, 27 | fontSize: 24.sp, 28 | ), 29 | ), 30 | SizedBox(width: 8.w), 31 | VerticalCustomDivider(), 32 | SizedBox(width: 8.w), 33 | IconButton( 34 | onPressed: () {}, 35 | icon: Icon(PhosphorIconsRegular.plus, size: 24.sp), 36 | visualDensity: VisualDensity.compact, 37 | ), 38 | SizedBox(width: 8.w), 39 | VerticalCustomDivider(), 40 | SizedBox(width: 8.w), 41 | IconButton( 42 | onPressed: () {}, 43 | icon: Icon(PhosphorIconsRegular.minus, size: 24.sp), 44 | visualDensity: VisualDensity.compact, 45 | ), 46 | ], 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:cookethflow/app.dart'; 2 | import 'package:cookethflow/core/providers/supabase_provider.dart'; 3 | import 'package:cookethflow/features/auth/providers/auth_provider.dart'; 4 | import 'package:cookethflow/features/dashboard/providers/dashboard_provider.dart'; 5 | import 'package:cookethflow/features/workspace/providers/workspace_provider.dart'; 6 | import 'package:flutter/foundation.dart'; 7 | import 'package:flutter/material.dart'; 8 | import 'package:flutter_dotenv/flutter_dotenv.dart'; 9 | import 'package:flutter_web_plugins/flutter_web_plugins.dart'; 10 | import 'package:provider/provider.dart'; 11 | import 'package:supabase_flutter/supabase_flutter.dart'; 12 | 13 | void main() async { 14 | WidgetsFlutterBinding.ensureInitialized(); 15 | String supabaseUrl; 16 | String supabaseApiKey; 17 | 18 | // Load environment variables 19 | if (kIsWeb) { 20 | // For web, use --dart-define values 21 | supabaseUrl = const String.fromEnvironment( 22 | 'SUPABASE_URL', 23 | defaultValue: '', 24 | ); 25 | supabaseApiKey = const String.fromEnvironment( 26 | 'SUPABASE_KEY', 27 | defaultValue: '', 28 | ); 29 | } else { 30 | // For non-web platforms, load from .env 31 | await dotenv.load(fileName: '.env'); 32 | supabaseUrl = dotenv.env['SUPABASE_URL'] ?? ''; 33 | supabaseApiKey = dotenv.env['SUPABASE_KEY'] ?? ''; 34 | } 35 | 36 | // Validate environment variables 37 | if (supabaseUrl.isEmpty || supabaseApiKey.isEmpty) { 38 | throw Exception('SUPABASE_URL and SUPABASE_KEY must be provided'); 39 | } 40 | 41 | final instance = await Supabase.initialize( 42 | url: supabaseUrl, 43 | anonKey: supabaseApiKey, 44 | ); 45 | 46 | usePathUrlStrategy(); 47 | runApp( 48 | MultiProvider( 49 | providers: [ 50 | ChangeNotifierProvider( 51 | create: (_) => SupabaseService(instance.client), 52 | ), 53 | ChangeNotifierProxyProvider( 54 | create: 55 | (ctx) => AuthenticationProvider( 56 | Provider.of(ctx, listen: false), 57 | ), 58 | update: 59 | (context, supabaseService, previousAuth) => 60 | previousAuth ?? AuthenticationProvider(supabaseService), 61 | ), 62 | ChangeNotifierProvider( 63 | create: 64 | (ctx) => DashboardProvider( 65 | instance.client, 66 | Provider.of(ctx, listen: false), 67 | ), 68 | // update: 69 | // (context, auth, previous) => previous ?? DashboardProvider(auth), 70 | ), 71 | ChangeNotifierProvider( 72 | create: (context) => WorkspaceProvider(), 73 | ), 74 | ], 75 | child: const MyApp(), 76 | ), 77 | ); 78 | } 79 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void fl_register_plugins(FlPluginRegistry* registry) { 14 | g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = 15 | fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); 16 | file_selector_plugin_register_with_registrar(file_selector_linux_registrar); 17 | g_autoptr(FlPluginRegistrar) gtk_registrar = 18 | fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin"); 19 | gtk_plugin_register_with_registrar(gtk_registrar); 20 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 21 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 22 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 23 | } 24 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | file_selector_linux 7 | gtk 8 | url_launcher_linux 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /linux/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.13) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} 10 | "main.cc" 11 | "my_application.cc" 12 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 13 | ) 14 | 15 | # Apply the standard set of build settings. This can be removed for applications 16 | # that need different build settings. 17 | apply_standard_settings(${BINARY_NAME}) 18 | 19 | # Add preprocessor definitions for the application ID. 20 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 21 | 22 | # Add dependency libraries. Add any application-specific dependencies here. 23 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 24 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 25 | 26 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 27 | -------------------------------------------------------------------------------- /linux/runner/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/runner/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 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import app_links 9 | import file_selector_macos 10 | import google_sign_in_ios 11 | import path_provider_foundation 12 | import shared_preferences_foundation 13 | import sqflite_darwin 14 | import url_launcher_macos 15 | 16 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 17 | AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin")) 18 | FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) 19 | FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) 20 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 21 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 22 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 23 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 24 | } 25 | -------------------------------------------------------------------------------- /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 | 43 | 49 | 50 | 51 | 52 | 53 | 64 | 66 | 72 | 73 | 74 | 75 | 81 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | @main 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | 10 | override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { 11 | return true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/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 = cookethflow 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.cookethflow.cookethflow 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2025 com.cookethflow. 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() 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 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:cookethflow/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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | cookethflow 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cookethflow", 3 | "short_name": "cookethflow", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /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/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # Set fallback configurations for older versions of the flutter tool. 14 | if (NOT DEFINED FLUTTER_TARGET_PLATFORM) 15 | set(FLUTTER_TARGET_PLATFORM "windows-x64") 16 | endif() 17 | 18 | # === Flutter Library === 19 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 20 | 21 | # Published to parent scope for install step. 22 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 23 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 24 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 25 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 26 | 27 | list(APPEND FLUTTER_LIBRARY_HEADERS 28 | "flutter_export.h" 29 | "flutter_windows.h" 30 | "flutter_messenger.h" 31 | "flutter_plugin_registrar.h" 32 | "flutter_texture_registrar.h" 33 | ) 34 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 35 | add_library(flutter INTERFACE) 36 | target_include_directories(flutter INTERFACE 37 | "${EPHEMERAL_DIR}" 38 | ) 39 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 40 | add_dependencies(flutter flutter_assemble) 41 | 42 | # === Wrapper === 43 | list(APPEND CPP_WRAPPER_SOURCES_CORE 44 | "core_implementations.cc" 45 | "standard_codec.cc" 46 | ) 47 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 48 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 49 | "plugin_registrar.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 52 | list(APPEND CPP_WRAPPER_SOURCES_APP 53 | "flutter_engine.cc" 54 | "flutter_view_controller.cc" 55 | ) 56 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 57 | 58 | # Wrapper sources needed for a plugin. 59 | add_library(flutter_wrapper_plugin STATIC 60 | ${CPP_WRAPPER_SOURCES_CORE} 61 | ${CPP_WRAPPER_SOURCES_PLUGIN} 62 | ) 63 | apply_standard_settings(flutter_wrapper_plugin) 64 | set_target_properties(flutter_wrapper_plugin PROPERTIES 65 | POSITION_INDEPENDENT_CODE ON) 66 | set_target_properties(flutter_wrapper_plugin PROPERTIES 67 | CXX_VISIBILITY_PRESET hidden) 68 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 69 | target_include_directories(flutter_wrapper_plugin PUBLIC 70 | "${WRAPPER_ROOT}/include" 71 | ) 72 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 73 | 74 | # Wrapper sources needed for the runner. 75 | add_library(flutter_wrapper_app STATIC 76 | ${CPP_WRAPPER_SOURCES_CORE} 77 | ${CPP_WRAPPER_SOURCES_APP} 78 | ) 79 | apply_standard_settings(flutter_wrapper_app) 80 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 81 | target_include_directories(flutter_wrapper_app PUBLIC 82 | "${WRAPPER_ROOT}/include" 83 | ) 84 | add_dependencies(flutter_wrapper_app flutter_assemble) 85 | 86 | # === Flutter tool backend === 87 | # _phony_ is a non-existent file to force this command to run every time, 88 | # since currently there's no way to get a full input/output list from the 89 | # flutter tool. 90 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 91 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 92 | add_custom_command( 93 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 94 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 95 | ${CPP_WRAPPER_SOURCES_APP} 96 | ${PHONY_OUTPUT} 97 | COMMAND ${CMAKE_COMMAND} -E env 98 | ${FLUTTER_TOOL_ENVIRONMENT} 99 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 100 | ${FLUTTER_TARGET_PLATFORM} $ 101 | VERBATIM 102 | ) 103 | add_custom_target(flutter_assemble DEPENDS 104 | "${FLUTTER_LIBRARY}" 105 | ${FLUTTER_LIBRARY_HEADERS} 106 | ${CPP_WRAPPER_SOURCES_CORE} 107 | ${CPP_WRAPPER_SOURCES_PLUGIN} 108 | ${CPP_WRAPPER_SOURCES_APP} 109 | ) 110 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void RegisterPlugins(flutter::PluginRegistry* registry) { 14 | AppLinksPluginCApiRegisterWithRegistrar( 15 | registry->GetRegistrarForPlugin("AppLinksPluginCApi")); 16 | FileSelectorWindowsRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("FileSelectorWindows")); 18 | UrlLauncherWindowsRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 20 | } 21 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | app_links 7 | file_selector_windows 8 | url_launcher_windows 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /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 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 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.cookethflow" "\0" 93 | VALUE "FileDescription", "cookethflow" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "cookethflow" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2025 com.cookethflow. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "cookethflow.exe" "\0" 98 | VALUE "ProductName", "cookethflow" "\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(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"cookethflow", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /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/CookethOrg/Cooketh-Flow/263ad8f52d916dfaf7c50e83638687dca2dcd9d7/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /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 | unsigned int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr) 51 | -1; // remove the trailing null character 52 | int input_length = (int)wcslen(utf16_string); 53 | std::string utf8_string; 54 | if (target_length == 0 || target_length > utf8_string.max_size()) { 55 | return utf8_string; 56 | } 57 | utf8_string.resize(target_length); 58 | int converted_length = ::WideCharToMultiByte( 59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 60 | input_length, utf8_string.data(), target_length, nullptr, nullptr); 61 | if (converted_length == 0) { 62 | return std::string(); 63 | } 64 | return utf8_string; 65 | } 66 | -------------------------------------------------------------------------------- /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 a win32 window with |title| that is positioned and sized 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 this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | --------------------------------------------------------------------------------