diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..73f69e0958 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/appflowy_client.iml b/.idea/appflowy_client.iml new file mode 100644 index 0000000000..3d6231c1bd --- /dev/null +++ b/.idea/appflowy_client.iml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml new file mode 100644 index 0000000000..06f3134367 --- /dev/null +++ b/.idea/libraries/Dart_Packages.xml @@ -0,0 +1,928 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/Dart_SDK.xml b/.idea/libraries/Dart_SDK.xml new file mode 100644 index 0000000000..6068110626 --- /dev/null +++ b/.idea/libraries/Dart_SDK.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000..facec90f25 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..e69de29bb2 diff --git a/README.md b/README.md index e6d5faaa0d..b0514bbabc 100644 --- a/README.md +++ b/README.md @@ -1 +1,38 @@ -# appflowy_client \ No newline at end of file +# AppFlowy client + +* The Big Picture + * Introduce + * Goals + * Cross-platform + +* Getting started + * Build + * Running + +* Contributing + * First steps + * Opening issues + * Participating in discussions + * Finding something to work on + * Open your PR + * Review Process + * Getting more involved + * Organization membership + * Contributor + * Maintainer + +## The Big Picture + +### Introduce + +### Goals + +### Cross-platform + + +## Getting Started +Read the [architecture doc](doc/architecture.md) before you started. + +## Contributing +Read the [architecture doc](doc/architecture.md) before you started. + diff --git a/app_flowy/.gitignore b/app_flowy/.gitignore new file mode 100644 index 0000000000..4de7d6f750 --- /dev/null +++ b/app_flowy/.gitignore @@ -0,0 +1,48 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +/packages/flowy_protobuf \ No newline at end of file diff --git a/app_flowy/.metadata b/app_flowy/.metadata new file mode 100644 index 0000000000..a8ebbd603e --- /dev/null +++ b/app_flowy/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: fa5883b78e566877613ad1ccb48dd92075cb5c23 + channel: dev + +project_type: app diff --git a/app_flowy/.vscode/launch.json b/app_flowy/.vscode/launch.json new file mode 100644 index 0000000000..5e7d5eef3c --- /dev/null +++ b/app_flowy/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "app_flowy", + "request": "launch", + "program": "${workspaceRoot}/lib/main.dart", + "type": "dart", + }, + { + "name": "app_flowy (profile mode)", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + ] +} \ No newline at end of file diff --git a/app_flowy/Makefile b/app_flowy/Makefile new file mode 100644 index 0000000000..1f35bf6aaf --- /dev/null +++ b/app_flowy/Makefile @@ -0,0 +1,7 @@ +.PHONY: freeze_build, free_watch + +freeze_build: + flutter pub run build_runner build --delete-conflicting-outputs + +watch: + flutter pub run build_runner watch \ No newline at end of file diff --git a/app_flowy/README.md b/app_flowy/README.md new file mode 100644 index 0000000000..fc31e8b15e --- /dev/null +++ b/app_flowy/README.md @@ -0,0 +1,16 @@ +# app_flowy + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/app_flowy/analysis_options.yaml b/app_flowy/analysis_options.yaml new file mode 100644 index 0000000000..aadd68ab09 --- /dev/null +++ b/app_flowy/analysis_options.yaml @@ -0,0 +1,34 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - "**/*.g.dart" + - "**/*.freezed.dart" + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/app_flowy/android/.gitignore b/app_flowy/android/.gitignore new file mode 100644 index 0000000000..6f568019d3 --- /dev/null +++ b/app_flowy/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/app_flowy/android/app/build.gradle b/app_flowy/android/app/build.gradle new file mode 100644 index 0000000000..e2f9734817 --- /dev/null +++ b/app_flowy/android/app/build.gradle @@ -0,0 +1,68 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 30 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.app_flowy" + minSdkVersion 16 + targetSdkVersion 30 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/app_flowy/android/app/src/debug/AndroidManifest.xml b/app_flowy/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000000..bbcce3827b --- /dev/null +++ b/app_flowy/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/app_flowy/android/app/src/main/AndroidManifest.xml b/app_flowy/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..a9fd47bd31 --- /dev/null +++ b/app_flowy/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + diff --git a/app_flowy/android/app/src/main/kotlin/com/example/app_flowy/MainActivity.kt b/app_flowy/android/app/src/main/kotlin/com/example/app_flowy/MainActivity.kt new file mode 100644 index 0000000000..cd02c5ed92 --- /dev/null +++ b/app_flowy/android/app/src/main/kotlin/com/example/app_flowy/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.app_flowy + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/app_flowy/android/app/src/main/res/drawable-v21/launch_background.xml b/app_flowy/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000000..f74085f3f6 --- /dev/null +++ b/app_flowy/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/app_flowy/android/app/src/main/res/drawable/launch_background.xml b/app_flowy/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000000..304732f884 --- /dev/null +++ b/app_flowy/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/app_flowy/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app_flowy/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..db77bb4b7b Binary files /dev/null and b/app_flowy/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app_flowy/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app_flowy/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..17987b79bb Binary files /dev/null and b/app_flowy/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app_flowy/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app_flowy/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..09d4391482 Binary files /dev/null and b/app_flowy/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app_flowy/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app_flowy/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..d5f1c8d34e Binary files /dev/null and b/app_flowy/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app_flowy/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app_flowy/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000..4d6372eebd Binary files /dev/null and b/app_flowy/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app_flowy/android/app/src/main/res/values-night/styles.xml b/app_flowy/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000000..449a9f9308 --- /dev/null +++ b/app_flowy/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/app_flowy/android/app/src/main/res/values/styles.xml b/app_flowy/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000000..d74aa35c28 --- /dev/null +++ b/app_flowy/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/app_flowy/android/app/src/profile/AndroidManifest.xml b/app_flowy/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000000..bbcce3827b --- /dev/null +++ b/app_flowy/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/app_flowy/android/build.gradle b/app_flowy/android/build.gradle new file mode 100644 index 0000000000..ed45c65885 --- /dev/null +++ b/app_flowy/android/build.gradle @@ -0,0 +1,29 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/app_flowy/android/gradle.properties b/app_flowy/android/gradle.properties new file mode 100644 index 0000000000..94adc3a3f9 --- /dev/null +++ b/app_flowy/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/app_flowy/android/gradle/wrapper/gradle-wrapper.properties b/app_flowy/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..bc6a58afdd --- /dev/null +++ b/app_flowy/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/app_flowy/android/settings.gradle b/app_flowy/android/settings.gradle new file mode 100644 index 0000000000..44e62bcf06 --- /dev/null +++ b/app_flowy/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/app_flowy/assets/images/appflowy_launch_splash.jpg b/app_flowy/assets/images/appflowy_launch_splash.jpg new file mode 100644 index 0000000000..7e3bb9cee6 Binary files /dev/null and b/app_flowy/assets/images/appflowy_launch_splash.jpg differ diff --git a/app_flowy/ios/.gitignore b/app_flowy/ios/.gitignore new file mode 100644 index 0000000000..151026b91b --- /dev/null +++ b/app_flowy/ios/.gitignore @@ -0,0 +1,33 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/app_flowy/ios/Flutter/AppFrameworkInfo.plist b/app_flowy/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000000..9367d483e4 --- /dev/null +++ b/app_flowy/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/app_flowy/ios/Flutter/Debug.xcconfig b/app_flowy/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000000..ec97fc6f30 --- /dev/null +++ b/app_flowy/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/app_flowy/ios/Flutter/Release.xcconfig b/app_flowy/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000000..c4855bfe20 --- /dev/null +++ b/app_flowy/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/app_flowy/ios/Podfile b/app_flowy/ios/Podfile new file mode 100644 index 0000000000..1e8c3c90a5 --- /dev/null +++ b/app_flowy/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/app_flowy/ios/Runner.xcodeproj/project.pbxproj b/app_flowy/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..2b1d21fd89 --- /dev/null +++ b/app_flowy/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,471 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.example.appFlowy; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.example.appFlowy; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.example.appFlowy; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/app_flowy/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/app_flowy/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..919434a625 --- /dev/null +++ b/app_flowy/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/app_flowy/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app_flowy/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/app_flowy/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app_flowy/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/app_flowy/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000..f9b0d7c5ea --- /dev/null +++ b/app_flowy/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/app_flowy/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app_flowy/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000000..a28140cfdb --- /dev/null +++ b/app_flowy/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/ios/Runner.xcworkspace/contents.xcworkspacedata b/app_flowy/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..1d526a16ed --- /dev/null +++ b/app_flowy/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/app_flowy/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app_flowy/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/app_flowy/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app_flowy/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/app_flowy/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000..f9b0d7c5ea --- /dev/null +++ b/app_flowy/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/app_flowy/ios/Runner/AppDelegate.swift b/app_flowy/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000000..70693e4a8c --- /dev/null +++ b/app_flowy/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..d36b1fab2d --- /dev/null +++ b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000..dc9ada4725 Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000000..28c6bf0301 Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000000..2ccbfd967d Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000000..f091b6b0bc Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000000..4cde12118d Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000000..d0ef06e7ed Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000000..dcdc2306c2 Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000000..2ccbfd967d Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000000..c8f9ed8f5c Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000000..a6d6b8609d Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000000..a6d6b8609d Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000000..75b2d164a5 Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000000..c4df70d39d Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000000..6a84f41e14 Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000000..d0e1f58536 Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000000..0bedcf2fd4 --- /dev/null +++ b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000000..9da19eacad Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000..9da19eacad Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000..9da19eacad Binary files /dev/null and b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000000..89c2725b70 --- /dev/null +++ b/app_flowy/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +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. \ No newline at end of file diff --git a/app_flowy/ios/Runner/Base.lproj/LaunchScreen.storyboard b/app_flowy/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000000..f2e259c7c9 --- /dev/null +++ b/app_flowy/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/ios/Runner/Base.lproj/Main.storyboard b/app_flowy/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000000..f3c28516fb --- /dev/null +++ b/app_flowy/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/ios/Runner/Info.plist b/app_flowy/ios/Runner/Info.plist new file mode 100644 index 0000000000..607d5e00cd --- /dev/null +++ b/app_flowy/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + app_flowy + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/app_flowy/ios/Runner/Runner-Bridging-Header.h b/app_flowy/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000000..308a2a560b --- /dev/null +++ b/app_flowy/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/app_flowy/lib/home/application/home_bloc.dart b/app_flowy/lib/home/application/home_bloc.dart new file mode 100644 index 0000000000..259abc3bb6 --- /dev/null +++ b/app_flowy/lib/home/application/home_bloc.dart @@ -0,0 +1,42 @@ +import 'package:app_flowy/home/domain/edit_context.dart'; +import 'package:app_flowy/home/domain/page_context.dart'; +import 'package:app_flowy/home/presentation/widgets/blank_page.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:dartz/dartz.dart'; + +part 'home_event.dart'; +part 'home_state.dart'; +part 'home_bloc.freezed.dart'; + +class HomeBloc extends Bloc { + HomeBloc() : super(HomeState.initial()); + + @override + Stream mapEventToState( + HomeEvent event, + ) async* { + yield* event.map( + setPage: (e) async* { + yield state.copyWith(pageContext: e.context); + }, + showLoading: (e) async* { + yield state.copyWith(isLoading: e.isLoading); + }, + setEditPannel: (e) async* { + yield state.copyWith(editContext: some(e.editContext)); + }, + dismissEditPannel: (value) async* { + yield state.copyWith(editContext: none()); + }, + showMenu: (e) async* { + yield state.copyWith(showMenu: e.isShow); + }, + ); + } + + @override + Future close() { + return super.close(); + } +} diff --git a/app_flowy/lib/home/application/home_bloc.freezed.dart b/app_flowy/lib/home/application/home_bloc.freezed.dart new file mode 100644 index 0000000000..16ed6f5120 --- /dev/null +++ b/app_flowy/lib/home/application/home_bloc.freezed.dart @@ -0,0 +1,921 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides + +part of 'home_bloc.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +class _$HomeEventTearOff { + const _$HomeEventTearOff(); + + _ShowLoading showLoading(bool isLoading) { + return _ShowLoading( + isLoading, + ); + } + + _ShowMenu showMenu(bool isShow) { + return _ShowMenu( + isShow, + ); + } + + SetCurrentPage setPage(PageContext context) { + return SetCurrentPage( + context, + ); + } + + _ShowEditPannel setEditPannel(EditPannelContext editContext) { + return _ShowEditPannel( + editContext, + ); + } + + _DismissEditPannel dismissEditPannel() { + return const _DismissEditPannel(); + } +} + +/// @nodoc +const $HomeEvent = _$HomeEventTearOff(); + +/// @nodoc +mixin _$HomeEvent { + @optionalTypeArgs + TResult when({ + required TResult Function(bool isLoading) showLoading, + required TResult Function(bool isShow) showMenu, + required TResult Function(PageContext context) setPage, + required TResult Function(EditPannelContext editContext) setEditPannel, + required TResult Function() dismissEditPannel, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(bool isLoading)? showLoading, + TResult Function(bool isShow)? showMenu, + TResult Function(PageContext context)? setPage, + TResult Function(EditPannelContext editContext)? setEditPannel, + TResult Function()? dismissEditPannel, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(_ShowLoading value) showLoading, + required TResult Function(_ShowMenu value) showMenu, + required TResult Function(SetCurrentPage value) setPage, + required TResult Function(_ShowEditPannel value) setEditPannel, + required TResult Function(_DismissEditPannel value) dismissEditPannel, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ShowLoading value)? showLoading, + TResult Function(_ShowMenu value)? showMenu, + TResult Function(SetCurrentPage value)? setPage, + TResult Function(_ShowEditPannel value)? setEditPannel, + TResult Function(_DismissEditPannel value)? dismissEditPannel, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $HomeEventCopyWith<$Res> { + factory $HomeEventCopyWith(HomeEvent value, $Res Function(HomeEvent) then) = + _$HomeEventCopyWithImpl<$Res>; +} + +/// @nodoc +class _$HomeEventCopyWithImpl<$Res> implements $HomeEventCopyWith<$Res> { + _$HomeEventCopyWithImpl(this._value, this._then); + + final HomeEvent _value; + // ignore: unused_field + final $Res Function(HomeEvent) _then; +} + +/// @nodoc +abstract class _$ShowLoadingCopyWith<$Res> { + factory _$ShowLoadingCopyWith( + _ShowLoading value, $Res Function(_ShowLoading) then) = + __$ShowLoadingCopyWithImpl<$Res>; + $Res call({bool isLoading}); +} + +/// @nodoc +class __$ShowLoadingCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res> + implements _$ShowLoadingCopyWith<$Res> { + __$ShowLoadingCopyWithImpl( + _ShowLoading _value, $Res Function(_ShowLoading) _then) + : super(_value, (v) => _then(v as _ShowLoading)); + + @override + _ShowLoading get _value => super._value as _ShowLoading; + + @override + $Res call({ + Object? isLoading = freezed, + }) { + return _then(_ShowLoading( + isLoading == freezed + ? _value.isLoading + : isLoading // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc + +class _$_ShowLoading implements _ShowLoading { + const _$_ShowLoading(this.isLoading); + + @override + final bool isLoading; + + @override + String toString() { + return 'HomeEvent.showLoading(isLoading: $isLoading)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other is _ShowLoading && + (identical(other.isLoading, isLoading) || + const DeepCollectionEquality() + .equals(other.isLoading, isLoading))); + } + + @override + int get hashCode => + runtimeType.hashCode ^ const DeepCollectionEquality().hash(isLoading); + + @JsonKey(ignore: true) + @override + _$ShowLoadingCopyWith<_ShowLoading> get copyWith => + __$ShowLoadingCopyWithImpl<_ShowLoading>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(bool isLoading) showLoading, + required TResult Function(bool isShow) showMenu, + required TResult Function(PageContext context) setPage, + required TResult Function(EditPannelContext editContext) setEditPannel, + required TResult Function() dismissEditPannel, + }) { + return showLoading(isLoading); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(bool isLoading)? showLoading, + TResult Function(bool isShow)? showMenu, + TResult Function(PageContext context)? setPage, + TResult Function(EditPannelContext editContext)? setEditPannel, + TResult Function()? dismissEditPannel, + required TResult orElse(), + }) { + if (showLoading != null) { + return showLoading(isLoading); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ShowLoading value) showLoading, + required TResult Function(_ShowMenu value) showMenu, + required TResult Function(SetCurrentPage value) setPage, + required TResult Function(_ShowEditPannel value) setEditPannel, + required TResult Function(_DismissEditPannel value) dismissEditPannel, + }) { + return showLoading(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ShowLoading value)? showLoading, + TResult Function(_ShowMenu value)? showMenu, + TResult Function(SetCurrentPage value)? setPage, + TResult Function(_ShowEditPannel value)? setEditPannel, + TResult Function(_DismissEditPannel value)? dismissEditPannel, + required TResult orElse(), + }) { + if (showLoading != null) { + return showLoading(this); + } + return orElse(); + } +} + +abstract class _ShowLoading implements HomeEvent { + const factory _ShowLoading(bool isLoading) = _$_ShowLoading; + + bool get isLoading => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + _$ShowLoadingCopyWith<_ShowLoading> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$ShowMenuCopyWith<$Res> { + factory _$ShowMenuCopyWith(_ShowMenu value, $Res Function(_ShowMenu) then) = + __$ShowMenuCopyWithImpl<$Res>; + $Res call({bool isShow}); +} + +/// @nodoc +class __$ShowMenuCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res> + implements _$ShowMenuCopyWith<$Res> { + __$ShowMenuCopyWithImpl(_ShowMenu _value, $Res Function(_ShowMenu) _then) + : super(_value, (v) => _then(v as _ShowMenu)); + + @override + _ShowMenu get _value => super._value as _ShowMenu; + + @override + $Res call({ + Object? isShow = freezed, + }) { + return _then(_ShowMenu( + isShow == freezed + ? _value.isShow + : isShow // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc + +class _$_ShowMenu implements _ShowMenu { + const _$_ShowMenu(this.isShow); + + @override + final bool isShow; + + @override + String toString() { + return 'HomeEvent.showMenu(isShow: $isShow)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other is _ShowMenu && + (identical(other.isShow, isShow) || + const DeepCollectionEquality().equals(other.isShow, isShow))); + } + + @override + int get hashCode => + runtimeType.hashCode ^ const DeepCollectionEquality().hash(isShow); + + @JsonKey(ignore: true) + @override + _$ShowMenuCopyWith<_ShowMenu> get copyWith => + __$ShowMenuCopyWithImpl<_ShowMenu>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(bool isLoading) showLoading, + required TResult Function(bool isShow) showMenu, + required TResult Function(PageContext context) setPage, + required TResult Function(EditPannelContext editContext) setEditPannel, + required TResult Function() dismissEditPannel, + }) { + return showMenu(isShow); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(bool isLoading)? showLoading, + TResult Function(bool isShow)? showMenu, + TResult Function(PageContext context)? setPage, + TResult Function(EditPannelContext editContext)? setEditPannel, + TResult Function()? dismissEditPannel, + required TResult orElse(), + }) { + if (showMenu != null) { + return showMenu(isShow); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ShowLoading value) showLoading, + required TResult Function(_ShowMenu value) showMenu, + required TResult Function(SetCurrentPage value) setPage, + required TResult Function(_ShowEditPannel value) setEditPannel, + required TResult Function(_DismissEditPannel value) dismissEditPannel, + }) { + return showMenu(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ShowLoading value)? showLoading, + TResult Function(_ShowMenu value)? showMenu, + TResult Function(SetCurrentPage value)? setPage, + TResult Function(_ShowEditPannel value)? setEditPannel, + TResult Function(_DismissEditPannel value)? dismissEditPannel, + required TResult orElse(), + }) { + if (showMenu != null) { + return showMenu(this); + } + return orElse(); + } +} + +abstract class _ShowMenu implements HomeEvent { + const factory _ShowMenu(bool isShow) = _$_ShowMenu; + + bool get isShow => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + _$ShowMenuCopyWith<_ShowMenu> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $SetCurrentPageCopyWith<$Res> { + factory $SetCurrentPageCopyWith( + SetCurrentPage value, $Res Function(SetCurrentPage) then) = + _$SetCurrentPageCopyWithImpl<$Res>; + $Res call({PageContext context}); +} + +/// @nodoc +class _$SetCurrentPageCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res> + implements $SetCurrentPageCopyWith<$Res> { + _$SetCurrentPageCopyWithImpl( + SetCurrentPage _value, $Res Function(SetCurrentPage) _then) + : super(_value, (v) => _then(v as SetCurrentPage)); + + @override + SetCurrentPage get _value => super._value as SetCurrentPage; + + @override + $Res call({ + Object? context = freezed, + }) { + return _then(SetCurrentPage( + context == freezed + ? _value.context + : context // ignore: cast_nullable_to_non_nullable + as PageContext, + )); + } +} + +/// @nodoc + +class _$SetCurrentPage implements SetCurrentPage { + const _$SetCurrentPage(this.context); + + @override + final PageContext context; + + @override + String toString() { + return 'HomeEvent.setPage(context: $context)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other is SetCurrentPage && + (identical(other.context, context) || + const DeepCollectionEquality().equals(other.context, context))); + } + + @override + int get hashCode => + runtimeType.hashCode ^ const DeepCollectionEquality().hash(context); + + @JsonKey(ignore: true) + @override + $SetCurrentPageCopyWith get copyWith => + _$SetCurrentPageCopyWithImpl(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(bool isLoading) showLoading, + required TResult Function(bool isShow) showMenu, + required TResult Function(PageContext context) setPage, + required TResult Function(EditPannelContext editContext) setEditPannel, + required TResult Function() dismissEditPannel, + }) { + return setPage(context); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(bool isLoading)? showLoading, + TResult Function(bool isShow)? showMenu, + TResult Function(PageContext context)? setPage, + TResult Function(EditPannelContext editContext)? setEditPannel, + TResult Function()? dismissEditPannel, + required TResult orElse(), + }) { + if (setPage != null) { + return setPage(context); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ShowLoading value) showLoading, + required TResult Function(_ShowMenu value) showMenu, + required TResult Function(SetCurrentPage value) setPage, + required TResult Function(_ShowEditPannel value) setEditPannel, + required TResult Function(_DismissEditPannel value) dismissEditPannel, + }) { + return setPage(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ShowLoading value)? showLoading, + TResult Function(_ShowMenu value)? showMenu, + TResult Function(SetCurrentPage value)? setPage, + TResult Function(_ShowEditPannel value)? setEditPannel, + TResult Function(_DismissEditPannel value)? dismissEditPannel, + required TResult orElse(), + }) { + if (setPage != null) { + return setPage(this); + } + return orElse(); + } +} + +abstract class SetCurrentPage implements HomeEvent { + const factory SetCurrentPage(PageContext context) = _$SetCurrentPage; + + PageContext get context => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $SetCurrentPageCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$ShowEditPannelCopyWith<$Res> { + factory _$ShowEditPannelCopyWith( + _ShowEditPannel value, $Res Function(_ShowEditPannel) then) = + __$ShowEditPannelCopyWithImpl<$Res>; + $Res call({EditPannelContext editContext}); +} + +/// @nodoc +class __$ShowEditPannelCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res> + implements _$ShowEditPannelCopyWith<$Res> { + __$ShowEditPannelCopyWithImpl( + _ShowEditPannel _value, $Res Function(_ShowEditPannel) _then) + : super(_value, (v) => _then(v as _ShowEditPannel)); + + @override + _ShowEditPannel get _value => super._value as _ShowEditPannel; + + @override + $Res call({ + Object? editContext = freezed, + }) { + return _then(_ShowEditPannel( + editContext == freezed + ? _value.editContext + : editContext // ignore: cast_nullable_to_non_nullable + as EditPannelContext, + )); + } +} + +/// @nodoc + +class _$_ShowEditPannel implements _ShowEditPannel { + const _$_ShowEditPannel(this.editContext); + + @override + final EditPannelContext editContext; + + @override + String toString() { + return 'HomeEvent.setEditPannel(editContext: $editContext)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other is _ShowEditPannel && + (identical(other.editContext, editContext) || + const DeepCollectionEquality() + .equals(other.editContext, editContext))); + } + + @override + int get hashCode => + runtimeType.hashCode ^ const DeepCollectionEquality().hash(editContext); + + @JsonKey(ignore: true) + @override + _$ShowEditPannelCopyWith<_ShowEditPannel> get copyWith => + __$ShowEditPannelCopyWithImpl<_ShowEditPannel>(this, _$identity); + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(bool isLoading) showLoading, + required TResult Function(bool isShow) showMenu, + required TResult Function(PageContext context) setPage, + required TResult Function(EditPannelContext editContext) setEditPannel, + required TResult Function() dismissEditPannel, + }) { + return setEditPannel(editContext); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(bool isLoading)? showLoading, + TResult Function(bool isShow)? showMenu, + TResult Function(PageContext context)? setPage, + TResult Function(EditPannelContext editContext)? setEditPannel, + TResult Function()? dismissEditPannel, + required TResult orElse(), + }) { + if (setEditPannel != null) { + return setEditPannel(editContext); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ShowLoading value) showLoading, + required TResult Function(_ShowMenu value) showMenu, + required TResult Function(SetCurrentPage value) setPage, + required TResult Function(_ShowEditPannel value) setEditPannel, + required TResult Function(_DismissEditPannel value) dismissEditPannel, + }) { + return setEditPannel(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ShowLoading value)? showLoading, + TResult Function(_ShowMenu value)? showMenu, + TResult Function(SetCurrentPage value)? setPage, + TResult Function(_ShowEditPannel value)? setEditPannel, + TResult Function(_DismissEditPannel value)? dismissEditPannel, + required TResult orElse(), + }) { + if (setEditPannel != null) { + return setEditPannel(this); + } + return orElse(); + } +} + +abstract class _ShowEditPannel implements HomeEvent { + const factory _ShowEditPannel(EditPannelContext editContext) = + _$_ShowEditPannel; + + EditPannelContext get editContext => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + _$ShowEditPannelCopyWith<_ShowEditPannel> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$DismissEditPannelCopyWith<$Res> { + factory _$DismissEditPannelCopyWith( + _DismissEditPannel value, $Res Function(_DismissEditPannel) then) = + __$DismissEditPannelCopyWithImpl<$Res>; +} + +/// @nodoc +class __$DismissEditPannelCopyWithImpl<$Res> + extends _$HomeEventCopyWithImpl<$Res> + implements _$DismissEditPannelCopyWith<$Res> { + __$DismissEditPannelCopyWithImpl( + _DismissEditPannel _value, $Res Function(_DismissEditPannel) _then) + : super(_value, (v) => _then(v as _DismissEditPannel)); + + @override + _DismissEditPannel get _value => super._value as _DismissEditPannel; +} + +/// @nodoc + +class _$_DismissEditPannel implements _DismissEditPannel { + const _$_DismissEditPannel(); + + @override + String toString() { + return 'HomeEvent.dismissEditPannel()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other is _DismissEditPannel); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function(bool isLoading) showLoading, + required TResult Function(bool isShow) showMenu, + required TResult Function(PageContext context) setPage, + required TResult Function(EditPannelContext editContext) setEditPannel, + required TResult Function() dismissEditPannel, + }) { + return dismissEditPannel(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function(bool isLoading)? showLoading, + TResult Function(bool isShow)? showMenu, + TResult Function(PageContext context)? setPage, + TResult Function(EditPannelContext editContext)? setEditPannel, + TResult Function()? dismissEditPannel, + required TResult orElse(), + }) { + if (dismissEditPannel != null) { + return dismissEditPannel(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_ShowLoading value) showLoading, + required TResult Function(_ShowMenu value) showMenu, + required TResult Function(SetCurrentPage value) setPage, + required TResult Function(_ShowEditPannel value) setEditPannel, + required TResult Function(_DismissEditPannel value) dismissEditPannel, + }) { + return dismissEditPannel(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_ShowLoading value)? showLoading, + TResult Function(_ShowMenu value)? showMenu, + TResult Function(SetCurrentPage value)? setPage, + TResult Function(_ShowEditPannel value)? setEditPannel, + TResult Function(_DismissEditPannel value)? dismissEditPannel, + required TResult orElse(), + }) { + if (dismissEditPannel != null) { + return dismissEditPannel(this); + } + return orElse(); + } +} + +abstract class _DismissEditPannel implements HomeEvent { + const factory _DismissEditPannel() = _$_DismissEditPannel; +} + +/// @nodoc +class _$HomeStateTearOff { + const _$HomeStateTearOff(); + + _HomeState call( + {required bool isLoading, + required bool showMenu, + required PageContext pageContext, + required Option editContext}) { + return _HomeState( + isLoading: isLoading, + showMenu: showMenu, + pageContext: pageContext, + editContext: editContext, + ); + } +} + +/// @nodoc +const $HomeState = _$HomeStateTearOff(); + +/// @nodoc +mixin _$HomeState { + bool get isLoading => throw _privateConstructorUsedError; + bool get showMenu => throw _privateConstructorUsedError; + PageContext get pageContext => throw _privateConstructorUsedError; + Option get editContext => + throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $HomeStateCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $HomeStateCopyWith<$Res> { + factory $HomeStateCopyWith(HomeState value, $Res Function(HomeState) then) = + _$HomeStateCopyWithImpl<$Res>; + $Res call( + {bool isLoading, + bool showMenu, + PageContext pageContext, + Option editContext}); +} + +/// @nodoc +class _$HomeStateCopyWithImpl<$Res> implements $HomeStateCopyWith<$Res> { + _$HomeStateCopyWithImpl(this._value, this._then); + + final HomeState _value; + // ignore: unused_field + final $Res Function(HomeState) _then; + + @override + $Res call({ + Object? isLoading = freezed, + Object? showMenu = freezed, + Object? pageContext = freezed, + Object? editContext = freezed, + }) { + return _then(_value.copyWith( + isLoading: isLoading == freezed + ? _value.isLoading + : isLoading // ignore: cast_nullable_to_non_nullable + as bool, + showMenu: showMenu == freezed + ? _value.showMenu + : showMenu // ignore: cast_nullable_to_non_nullable + as bool, + pageContext: pageContext == freezed + ? _value.pageContext + : pageContext // ignore: cast_nullable_to_non_nullable + as PageContext, + editContext: editContext == freezed + ? _value.editContext + : editContext // ignore: cast_nullable_to_non_nullable + as Option, + )); + } +} + +/// @nodoc +abstract class _$HomeStateCopyWith<$Res> implements $HomeStateCopyWith<$Res> { + factory _$HomeStateCopyWith( + _HomeState value, $Res Function(_HomeState) then) = + __$HomeStateCopyWithImpl<$Res>; + @override + $Res call( + {bool isLoading, + bool showMenu, + PageContext pageContext, + Option editContext}); +} + +/// @nodoc +class __$HomeStateCopyWithImpl<$Res> extends _$HomeStateCopyWithImpl<$Res> + implements _$HomeStateCopyWith<$Res> { + __$HomeStateCopyWithImpl(_HomeState _value, $Res Function(_HomeState) _then) + : super(_value, (v) => _then(v as _HomeState)); + + @override + _HomeState get _value => super._value as _HomeState; + + @override + $Res call({ + Object? isLoading = freezed, + Object? showMenu = freezed, + Object? pageContext = freezed, + Object? editContext = freezed, + }) { + return _then(_HomeState( + isLoading: isLoading == freezed + ? _value.isLoading + : isLoading // ignore: cast_nullable_to_non_nullable + as bool, + showMenu: showMenu == freezed + ? _value.showMenu + : showMenu // ignore: cast_nullable_to_non_nullable + as bool, + pageContext: pageContext == freezed + ? _value.pageContext + : pageContext // ignore: cast_nullable_to_non_nullable + as PageContext, + editContext: editContext == freezed + ? _value.editContext + : editContext // ignore: cast_nullable_to_non_nullable + as Option, + )); + } +} + +/// @nodoc + +class _$_HomeState implements _HomeState { + const _$_HomeState( + {required this.isLoading, + required this.showMenu, + required this.pageContext, + required this.editContext}); + + @override + final bool isLoading; + @override + final bool showMenu; + @override + final PageContext pageContext; + @override + final Option editContext; + + @override + String toString() { + return 'HomeState(isLoading: $isLoading, showMenu: $showMenu, pageContext: $pageContext, editContext: $editContext)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other is _HomeState && + (identical(other.isLoading, isLoading) || + const DeepCollectionEquality() + .equals(other.isLoading, isLoading)) && + (identical(other.showMenu, showMenu) || + const DeepCollectionEquality() + .equals(other.showMenu, showMenu)) && + (identical(other.pageContext, pageContext) || + const DeepCollectionEquality() + .equals(other.pageContext, pageContext)) && + (identical(other.editContext, editContext) || + const DeepCollectionEquality() + .equals(other.editContext, editContext))); + } + + @override + int get hashCode => + runtimeType.hashCode ^ + const DeepCollectionEquality().hash(isLoading) ^ + const DeepCollectionEquality().hash(showMenu) ^ + const DeepCollectionEquality().hash(pageContext) ^ + const DeepCollectionEquality().hash(editContext); + + @JsonKey(ignore: true) + @override + _$HomeStateCopyWith<_HomeState> get copyWith => + __$HomeStateCopyWithImpl<_HomeState>(this, _$identity); +} + +abstract class _HomeState implements HomeState { + const factory _HomeState( + {required bool isLoading, + required bool showMenu, + required PageContext pageContext, + required Option editContext}) = _$_HomeState; + + @override + bool get isLoading => throw _privateConstructorUsedError; + @override + bool get showMenu => throw _privateConstructorUsedError; + @override + PageContext get pageContext => throw _privateConstructorUsedError; + @override + Option get editContext => + throw _privateConstructorUsedError; + @override + @JsonKey(ignore: true) + _$HomeStateCopyWith<_HomeState> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/app_flowy/lib/home/application/home_event.dart b/app_flowy/lib/home/application/home_event.dart new file mode 100644 index 0000000000..ec4d0a457b --- /dev/null +++ b/app_flowy/lib/home/application/home_event.dart @@ -0,0 +1,15 @@ +part of 'home_bloc.dart'; + +@freezed +abstract class HomeEvent with _$HomeEvent { + const factory HomeEvent.showLoading(bool isLoading) = _ShowLoading; + const factory HomeEvent.showMenu(bool isShow) = _ShowMenu; + + //page + const factory HomeEvent.setPage(PageContext context) = SetCurrentPage; + + //edit pannel + const factory HomeEvent.setEditPannel(EditPannelContext editContext) = + _ShowEditPannel; + const factory HomeEvent.dismissEditPannel() = _DismissEditPannel; +} diff --git a/app_flowy/lib/home/application/home_state.dart b/app_flowy/lib/home/application/home_state.dart new file mode 100644 index 0000000000..fdbe7d8ab2 --- /dev/null +++ b/app_flowy/lib/home/application/home_state.dart @@ -0,0 +1,18 @@ +part of 'home_bloc.dart'; + +@freezed +abstract class HomeState implements _$HomeState { + const factory HomeState({ + required bool isLoading, + required bool showMenu, + required PageContext pageContext, + required Option editContext, + }) = _HomeState; + + factory HomeState.initial() => HomeState( + isLoading: false, + showMenu: true, + pageContext: BlankPageContext(), + editContext: none(), + ); +} diff --git a/app_flowy/lib/home/domain/edit_context.dart b/app_flowy/lib/home/domain/edit_context.dart new file mode 100644 index 0000000000..cd52bc7f11 --- /dev/null +++ b/app_flowy/lib/home/domain/edit_context.dart @@ -0,0 +1,23 @@ +import 'package:equatable/equatable.dart'; +import 'package:flutter/material.dart'; + +abstract class EditPannelContext extends Equatable { + final String identifier; + final String title; + final Widget child; + const EditPannelContext( + {required this.child, required this.identifier, required this.title}); + + @override + List get props => [identifier]; +} + +class BlankEditPannelContext extends EditPannelContext { + const BlankEditPannelContext() + : super(child: const Text('Blank'), identifier: '1', title: ''); +} + +class CellEditPannelContext extends EditPannelContext { + const CellEditPannelContext() + : super(child: const Text('shit'), identifier: 'test', title: 'test'); +} diff --git a/app_flowy/lib/home/domain/page_context.dart b/app_flowy/lib/home/domain/page_context.dart new file mode 100644 index 0000000000..a787bd927f --- /dev/null +++ b/app_flowy/lib/home/domain/page_context.dart @@ -0,0 +1,19 @@ +import 'package:equatable/equatable.dart'; +import 'package:flutter/material.dart'; + +abstract class HomeStackPage extends StatefulWidget { + final PageContext pageContext; + const HomeStackPage({Key? key, required this.pageContext}) : super(key: key); +} + +enum PageType { + blank, +} + +List pages = PageType.values.toList(); + +abstract class PageContext extends Equatable { + final PageType pageType; + final String pageTitle; + const PageContext(this.pageType, {required this.pageTitle}); +} diff --git a/app_flowy/lib/home/presentation/auth_widget.dart b/app_flowy/lib/home/presentation/auth_widget.dart new file mode 100644 index 0000000000..4f1abe2294 --- /dev/null +++ b/app_flowy/lib/home/presentation/auth_widget.dart @@ -0,0 +1,5 @@ +import 'package:flutter/widgets.dart'; + +abstract class IAuth { + Widget authScreen(); +} diff --git a/app_flowy/lib/home/presentation/home_screen.dart b/app_flowy/lib/home/presentation/home_screen.dart new file mode 100644 index 0000000000..25326edaf5 --- /dev/null +++ b/app_flowy/lib/home/presentation/home_screen.dart @@ -0,0 +1,34 @@ +import 'package:app_flowy/home/domain/page_context.dart'; +import 'package:app_flowy/home/presentation/widgets/blank_page.dart'; +import 'package:flutter/material.dart'; + +class HomeScreen extends StatelessWidget { + static GlobalKey scaffoldKey = GlobalKey(); + const HomeScreen({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + child: null, + ); + } +} + +extension PageTypeExtension on PageType { + HomeStackPage builder(PageContext context) { + switch (this) { + case PageType.blank: + return BlankPage(context: context); + } + } +} + +List buildPagesWidget(PageContext pageContext) { + return PageType.values.map((pageType) { + if (pageType == pageContext.pageType) { + return pageType.builder(pageContext); + } else { + return BlankPage(context: BlankPageContext()); + } + }).toList(); +} diff --git a/app_flowy/lib/home/presentation/widgets/blank_page.dart b/app_flowy/lib/home/presentation/widgets/blank_page.dart new file mode 100644 index 0000000000..da6a4bf03b --- /dev/null +++ b/app_flowy/lib/home/presentation/widgets/blank_page.dart @@ -0,0 +1,32 @@ +import 'package:app_flowy/home/domain/page_context.dart'; +import 'package:flutter/material.dart'; + +class BlankPageContext extends PageContext { + const BlankPageContext() : super(PageType.blank, pageTitle: 'Blank'); + + @override + List get props => []; +} + +class BlankPage extends HomeStackPage { + const BlankPage({Key? key, required PageContext context}) + : super(key: key, pageContext: context); + + @override + State createState() => _BlankPageState(); +} + +class _BlankPageState extends State { + @override + Widget build(BuildContext context) { + return Container( + color: Theme.of(context).colorScheme.primary, + child: const Center( + child: Text( + 'Hello AppFlowy', + style: TextStyle(fontSize: 60), + ), + ), + ); + } +} diff --git a/app_flowy/lib/main.dart b/app_flowy/lib/main.dart new file mode 100644 index 0000000000..76aa42d13f --- /dev/null +++ b/app_flowy/lib/main.dart @@ -0,0 +1,14 @@ +import 'package:app_flowy/startup/startup.dart'; +import 'package:app_flowy/welcome/presentation/welcome_screen.dart'; +import 'package:flutter/material.dart'; + +class FlowyAppFactory implements AppFactory { + @override + Widget create() { + return const WelcomeScreen(); + } +} + +void main() { + App.run(FlowyAppFactory()); +} diff --git a/app_flowy/lib/startup/deps_inject/prelude.dart b/app_flowy/lib/startup/deps_inject/prelude.dart new file mode 100644 index 0000000000..a727df41a6 --- /dev/null +++ b/app_flowy/lib/startup/deps_inject/prelude.dart @@ -0,0 +1,17 @@ +import 'package:app_flowy/startup/launch.dart'; +import 'package:app_flowy/startup/startup.dart'; +import 'package:app_flowy/welcome/infrastructure/deps_impl.dart'; +import 'package:flowy_sdk/flowy_sdk.dart'; +import 'package:get_it/get_it.dart'; + +void resolveDependencies(IntegrationEnv env) => initGetIt(getIt, env); + +Future initGetIt( + GetIt getIt, + IntegrationEnv env, +) async { + getIt.registerLazySingleton(() => const FlowySDK()); + getIt.registerLazySingleton(() => AppLauncher(env, getIt)); + + await Welcome.dependencyResolved(getIt); +} diff --git a/app_flowy/lib/startup/launch.dart b/app_flowy/lib/startup/launch.dart new file mode 100644 index 0000000000..b2d5310afa --- /dev/null +++ b/app_flowy/lib/startup/launch.dart @@ -0,0 +1,40 @@ +import 'package:app_flowy/startup/startup.dart'; +import 'package:get_it/get_it.dart'; + +class LaunchContext { + GetIt getIt; + IntegrationEnv env; + LaunchContext(this.getIt, this.env); +} + +enum LaunchTaskType { + dataProcessing, + appLauncher, +} + +/// The interface of an app launch task, which will trigger +/// some nonresident indispensable task in app launching task. +abstract class LaunchTask { + LaunchTaskType get type => LaunchTaskType.dataProcessing; + void initialize(LaunchContext context); +} + +class AppLauncher { + List tasks; + IntegrationEnv env; + GetIt getIt; + + AppLauncher(this.env, this.getIt) : tasks = List.from([]); + + void addTask(LaunchTask task) { + tasks.add(task); + } + + void launch() { + final context = LaunchContext(getIt, env); + for (var task in tasks) { + task.initialize(context); + } + } +} +//test git hooks diff --git a/app_flowy/lib/startup/startup.dart b/app_flowy/lib/startup/startup.dart new file mode 100644 index 0000000000..f990c67fff --- /dev/null +++ b/app_flowy/lib/startup/startup.dart @@ -0,0 +1,34 @@ +import 'package:app_flowy/startup/launch.dart'; +import 'package:app_flowy/startup/tasks/prelude.dart'; +import 'package:flutter/material.dart'; +import 'package:get_it/get_it.dart'; +import 'deps_inject/prelude.dart'; + +final getIt = GetIt.instance; +enum IntegrationEnv { + dev, + pro, +} + +abstract class AppFactory { + Widget create(); +} + +class App { + static void run(AppFactory f) { + // Specify the evn + const env = IntegrationEnv.dev; + + // Config the deps graph + getIt.registerFactory(() => f); + + resolveDependencies(env); + + // add task + // getIt().addTask(RustSDKInitTask()); + getIt().addTask(AppWidgetTask()); + + // execute the tasks + getIt().launch(); + } +} diff --git a/app_flowy/lib/startup/tasks/app_widget_task.dart b/app_flowy/lib/startup/tasks/app_widget_task.dart new file mode 100644 index 0000000000..2e22b58f96 --- /dev/null +++ b/app_flowy/lib/startup/tasks/app_widget_task.dart @@ -0,0 +1,47 @@ +import 'package:app_flowy/startup/startup.dart'; +import 'package:flowy_style/theme.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:window_size/window_size.dart'; +import 'package:app_flowy/startup/launch.dart'; + +class AppWidgetTask extends LaunchTask { + @override + LaunchTaskType get type => LaunchTaskType.appLauncher; + + @override + void initialize(LaunchContext context) { + final widget = context.getIt().create(); + final app = AppWidget(child: widget); + runApp(app); + } +} + +class AppWidget extends StatelessWidget { + final Widget child; + const AppWidget({ + Key? key, + required this.child, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + setWindowMinSize(const Size(500, 500)); + + final theme = AppTheme.fromType(ThemeType.light); + return Provider.value( + value: theme, + child: MaterialApp( + title: 'AppFlowy', + debugShowCheckedModeBanner: false, + theme: theme.themeData, + navigatorKey: AppGlobals.rootNavKey, + home: child, + )); + } +} + +class AppGlobals { + static GlobalKey rootNavKey = GlobalKey(); + static NavigatorState get nav => rootNavKey.currentState!; +} diff --git a/app_flowy/lib/startup/tasks/prelude.dart b/app_flowy/lib/startup/tasks/prelude.dart new file mode 100644 index 0000000000..d4474f0342 --- /dev/null +++ b/app_flowy/lib/startup/tasks/prelude.dart @@ -0,0 +1,2 @@ +export 'app_widget_task.dart'; +export 'rust_sdk_init_task.dart'; diff --git a/app_flowy/lib/startup/tasks/rust_sdk_init_task.dart b/app_flowy/lib/startup/tasks/rust_sdk_init_task.dart new file mode 100644 index 0000000000..f65a4d73bb --- /dev/null +++ b/app_flowy/lib/startup/tasks/rust_sdk_init_task.dart @@ -0,0 +1,55 @@ +import 'dart:io'; +import 'package:app_flowy/startup/launch.dart'; +import 'package:app_flowy/startup/startup.dart'; +import 'package:bloc/bloc.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:flowy_sdk/flowy_sdk.dart'; +import 'package:flutter/material.dart'; +import 'package:flowy_logger/flowy_logger.dart'; + +class RustSDKInitTask extends LaunchTask { + @override + LaunchTaskType get type => LaunchTaskType.dataProcessing; + + @override + void initialize(LaunchContext context) async { + WidgetsFlutterBinding.ensureInitialized(); + + Bloc.observer = ApplicationBlocObserver(); + + switch (context.env) { + case IntegrationEnv.dev: + await context.getIt().init(Directory('./temp/flowy_dev')); + break; + case IntegrationEnv.pro: + Directory directory = await getApplicationDocumentsDirectory(); + final documentPath = directory.path; + + final flowySandbox = Directory('$documentPath/flowy'); + await context.getIt().init(flowySandbox); + break; + default: + assert(false, 'Unsupported env'); + } + } +} + +class ApplicationBlocObserver extends BlocObserver { + @override + void onTransition(Bloc bloc, Transition transition) { + Log.debug(transition); + super.onTransition(bloc, transition); + } + + @override + void onError(BlocBase bloc, Object error, StackTrace stackTrace) { + Log.debug(error); + super.onError(bloc, error, stackTrace); + } +} + +class EngineBlocConfig { + static void setup() { + Bloc.observer = ApplicationBlocObserver(); + } +} diff --git a/app_flowy/lib/user/application/sign_in/sign_in_bloc.dart b/app_flowy/lib/user/application/sign_in/sign_in_bloc.dart new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app_flowy/lib/user/application/sign_in/sign_in_event.dart b/app_flowy/lib/user/application/sign_in/sign_in_event.dart new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app_flowy/lib/user/application/sign_in/sign_in_state.dart b/app_flowy/lib/user/application/sign_in/sign_in_state.dart new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app_flowy/lib/user/application/sign_up/sign_up_bloc.dart b/app_flowy/lib/user/application/sign_up/sign_up_bloc.dart new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app_flowy/lib/user/application/sign_up/sign_up_event.dart b/app_flowy/lib/user/application/sign_up/sign_up_event.dart new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app_flowy/lib/user/application/sign_up/sign_up_state.dart b/app_flowy/lib/user/application/sign_up/sign_up_state.dart new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/app_flowy/lib/user/application/sign_up/sign_up_state.dart @@ -0,0 +1 @@ + diff --git a/app_flowy/lib/user/presentation/sign_in/sign_in_screen.dart b/app_flowy/lib/user/presentation/sign_in/sign_in_screen.dart new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app_flowy/lib/user/presentation/sign_up/sign_up_screen.dart b/app_flowy/lib/user/presentation/sign_up/sign_up_screen.dart new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app_flowy/lib/welcome/application/welcome_bloc.dart b/app_flowy/lib/welcome/application/welcome_bloc.dart new file mode 100644 index 0000000000..fceb041730 --- /dev/null +++ b/app_flowy/lib/welcome/application/welcome_bloc.dart @@ -0,0 +1,27 @@ +import 'package:app_flowy/welcome/domain/auth_state.dart'; +import 'package:app_flowy/welcome/domain/deps.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'welcome_event.dart'; +part 'welcome_state.dart'; +part 'welcome_bloc.freezed.dart'; + +class WelcomeBloc extends Bloc { + final IWelcomeAuth authCheck; + WelcomeBloc(this.authCheck) : super(WelcomeState.initial()); + + @override + Stream mapEventToState(WelcomeEvent event) async* { + yield* event.map( + check: (val) async* { + add(const WelcomeEvent.authCheck()); + yield state; + }, + authCheck: (val) async* { + final authState = await authCheck.getAuthState(); + yield state.copyWith(auth: authState); + }, + ); + } +} diff --git a/app_flowy/lib/welcome/application/welcome_bloc.freezed.dart b/app_flowy/lib/welcome/application/welcome_bloc.freezed.dart new file mode 100644 index 0000000000..da7a00bff4 --- /dev/null +++ b/app_flowy/lib/welcome/application/welcome_bloc.freezed.dart @@ -0,0 +1,381 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides + +part of 'welcome_bloc.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +class _$WelcomeEventTearOff { + const _$WelcomeEventTearOff(); + + _Check check() { + return const _Check(); + } + + _AuthCheck authCheck() { + return const _AuthCheck(); + } +} + +/// @nodoc +const $WelcomeEvent = _$WelcomeEventTearOff(); + +/// @nodoc +mixin _$WelcomeEvent { + @optionalTypeArgs + TResult when({ + required TResult Function() check, + required TResult Function() authCheck, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? check, + TResult Function()? authCheck, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(_Check value) check, + required TResult Function(_AuthCheck value) authCheck, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Check value)? check, + TResult Function(_AuthCheck value)? authCheck, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $WelcomeEventCopyWith<$Res> { + factory $WelcomeEventCopyWith( + WelcomeEvent value, $Res Function(WelcomeEvent) then) = + _$WelcomeEventCopyWithImpl<$Res>; +} + +/// @nodoc +class _$WelcomeEventCopyWithImpl<$Res> implements $WelcomeEventCopyWith<$Res> { + _$WelcomeEventCopyWithImpl(this._value, this._then); + + final WelcomeEvent _value; + // ignore: unused_field + final $Res Function(WelcomeEvent) _then; +} + +/// @nodoc +abstract class _$CheckCopyWith<$Res> { + factory _$CheckCopyWith(_Check value, $Res Function(_Check) then) = + __$CheckCopyWithImpl<$Res>; +} + +/// @nodoc +class __$CheckCopyWithImpl<$Res> extends _$WelcomeEventCopyWithImpl<$Res> + implements _$CheckCopyWith<$Res> { + __$CheckCopyWithImpl(_Check _value, $Res Function(_Check) _then) + : super(_value, (v) => _then(v as _Check)); + + @override + _Check get _value => super._value as _Check; +} + +/// @nodoc + +class _$_Check implements _Check { + const _$_Check(); + + @override + String toString() { + return 'WelcomeEvent.check()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other is _Check); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() check, + required TResult Function() authCheck, + }) { + return check(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? check, + TResult Function()? authCheck, + required TResult orElse(), + }) { + if (check != null) { + return check(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_Check value) check, + required TResult Function(_AuthCheck value) authCheck, + }) { + return check(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Check value)? check, + TResult Function(_AuthCheck value)? authCheck, + required TResult orElse(), + }) { + if (check != null) { + return check(this); + } + return orElse(); + } +} + +abstract class _Check implements WelcomeEvent { + const factory _Check() = _$_Check; +} + +/// @nodoc +abstract class _$AuthCheckCopyWith<$Res> { + factory _$AuthCheckCopyWith( + _AuthCheck value, $Res Function(_AuthCheck) then) = + __$AuthCheckCopyWithImpl<$Res>; +} + +/// @nodoc +class __$AuthCheckCopyWithImpl<$Res> extends _$WelcomeEventCopyWithImpl<$Res> + implements _$AuthCheckCopyWith<$Res> { + __$AuthCheckCopyWithImpl(_AuthCheck _value, $Res Function(_AuthCheck) _then) + : super(_value, (v) => _then(v as _AuthCheck)); + + @override + _AuthCheck get _value => super._value as _AuthCheck; +} + +/// @nodoc + +class _$_AuthCheck implements _AuthCheck { + const _$_AuthCheck(); + + @override + String toString() { + return 'WelcomeEvent.authCheck()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other is _AuthCheck); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() check, + required TResult Function() authCheck, + }) { + return authCheck(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? check, + TResult Function()? authCheck, + required TResult orElse(), + }) { + if (authCheck != null) { + return authCheck(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_Check value) check, + required TResult Function(_AuthCheck value) authCheck, + }) { + return authCheck(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_Check value)? check, + TResult Function(_AuthCheck value)? authCheck, + required TResult orElse(), + }) { + if (authCheck != null) { + return authCheck(this); + } + return orElse(); + } +} + +abstract class _AuthCheck implements WelcomeEvent { + const factory _AuthCheck() = _$_AuthCheck; +} + +/// @nodoc +class _$WelcomeStateTearOff { + const _$WelcomeStateTearOff(); + + _WelcomeState call({required AuthState auth}) { + return _WelcomeState( + auth: auth, + ); + } +} + +/// @nodoc +const $WelcomeState = _$WelcomeStateTearOff(); + +/// @nodoc +mixin _$WelcomeState { + AuthState get auth => throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $WelcomeStateCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $WelcomeStateCopyWith<$Res> { + factory $WelcomeStateCopyWith( + WelcomeState value, $Res Function(WelcomeState) then) = + _$WelcomeStateCopyWithImpl<$Res>; + $Res call({AuthState auth}); + + $AuthStateCopyWith<$Res> get auth; +} + +/// @nodoc +class _$WelcomeStateCopyWithImpl<$Res> implements $WelcomeStateCopyWith<$Res> { + _$WelcomeStateCopyWithImpl(this._value, this._then); + + final WelcomeState _value; + // ignore: unused_field + final $Res Function(WelcomeState) _then; + + @override + $Res call({ + Object? auth = freezed, + }) { + return _then(_value.copyWith( + auth: auth == freezed + ? _value.auth + : auth // ignore: cast_nullable_to_non_nullable + as AuthState, + )); + } + + @override + $AuthStateCopyWith<$Res> get auth { + return $AuthStateCopyWith<$Res>(_value.auth, (value) { + return _then(_value.copyWith(auth: value)); + }); + } +} + +/// @nodoc +abstract class _$WelcomeStateCopyWith<$Res> + implements $WelcomeStateCopyWith<$Res> { + factory _$WelcomeStateCopyWith( + _WelcomeState value, $Res Function(_WelcomeState) then) = + __$WelcomeStateCopyWithImpl<$Res>; + @override + $Res call({AuthState auth}); + + @override + $AuthStateCopyWith<$Res> get auth; +} + +/// @nodoc +class __$WelcomeStateCopyWithImpl<$Res> extends _$WelcomeStateCopyWithImpl<$Res> + implements _$WelcomeStateCopyWith<$Res> { + __$WelcomeStateCopyWithImpl( + _WelcomeState _value, $Res Function(_WelcomeState) _then) + : super(_value, (v) => _then(v as _WelcomeState)); + + @override + _WelcomeState get _value => super._value as _WelcomeState; + + @override + $Res call({ + Object? auth = freezed, + }) { + return _then(_WelcomeState( + auth: auth == freezed + ? _value.auth + : auth // ignore: cast_nullable_to_non_nullable + as AuthState, + )); + } +} + +/// @nodoc + +class _$_WelcomeState implements _WelcomeState { + const _$_WelcomeState({required this.auth}); + + @override + final AuthState auth; + + @override + String toString() { + return 'WelcomeState(auth: $auth)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other is _WelcomeState && + (identical(other.auth, auth) || + const DeepCollectionEquality().equals(other.auth, auth))); + } + + @override + int get hashCode => + runtimeType.hashCode ^ const DeepCollectionEquality().hash(auth); + + @JsonKey(ignore: true) + @override + _$WelcomeStateCopyWith<_WelcomeState> get copyWith => + __$WelcomeStateCopyWithImpl<_WelcomeState>(this, _$identity); +} + +abstract class _WelcomeState implements WelcomeState { + const factory _WelcomeState({required AuthState auth}) = _$_WelcomeState; + + @override + AuthState get auth => throw _privateConstructorUsedError; + @override + @JsonKey(ignore: true) + _$WelcomeStateCopyWith<_WelcomeState> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/app_flowy/lib/welcome/application/welcome_event.dart b/app_flowy/lib/welcome/application/welcome_event.dart new file mode 100644 index 0000000000..cfa2484eab --- /dev/null +++ b/app_flowy/lib/welcome/application/welcome_event.dart @@ -0,0 +1,7 @@ +part of 'welcome_bloc.dart'; + +@freezed +abstract class WelcomeEvent with _$WelcomeEvent { + const factory WelcomeEvent.check() = _Check; + const factory WelcomeEvent.authCheck() = _AuthCheck; +} diff --git a/app_flowy/lib/welcome/application/welcome_state.dart b/app_flowy/lib/welcome/application/welcome_state.dart new file mode 100644 index 0000000000..e713be4871 --- /dev/null +++ b/app_flowy/lib/welcome/application/welcome_state.dart @@ -0,0 +1,12 @@ +part of 'welcome_bloc.dart'; + +@freezed +abstract class WelcomeState implements _$WelcomeState { + const factory WelcomeState({ + required AuthState auth, + }) = _WelcomeState; + + factory WelcomeState.initial() => const WelcomeState( + auth: AuthState.unauthenticated(), + ); +} diff --git a/app_flowy/lib/welcome/domain/auth_state.dart b/app_flowy/lib/welcome/domain/auth_state.dart new file mode 100644 index 0000000000..10533a85a2 --- /dev/null +++ b/app_flowy/lib/welcome/domain/auth_state.dart @@ -0,0 +1,8 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; +part 'auth_state.freezed.dart'; + +@freezed +abstract class AuthState with _$AuthState { + const factory AuthState.authenticated() = Authenticated; + const factory AuthState.unauthenticated() = Unauthenticated; +} diff --git a/app_flowy/lib/welcome/domain/auth_state.freezed.dart b/app_flowy/lib/welcome/domain/auth_state.freezed.dart new file mode 100644 index 0000000000..433fc1af6d --- /dev/null +++ b/app_flowy/lib/welcome/domain/auth_state.freezed.dart @@ -0,0 +1,244 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides + +part of 'auth_state.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +class _$AuthStateTearOff { + const _$AuthStateTearOff(); + + Authenticated authenticated() { + return const Authenticated(); + } + + Unauthenticated unauthenticated() { + return const Unauthenticated(); + } +} + +/// @nodoc +const $AuthState = _$AuthStateTearOff(); + +/// @nodoc +mixin _$AuthState { + @optionalTypeArgs + TResult when({ + required TResult Function() authenticated, + required TResult Function() unauthenticated, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? authenticated, + TResult Function()? unauthenticated, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult map({ + required TResult Function(Authenticated value) authenticated, + required TResult Function(Unauthenticated value) unauthenticated, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Authenticated value)? authenticated, + TResult Function(Unauthenticated value)? unauthenticated, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $AuthStateCopyWith<$Res> { + factory $AuthStateCopyWith(AuthState value, $Res Function(AuthState) then) = + _$AuthStateCopyWithImpl<$Res>; +} + +/// @nodoc +class _$AuthStateCopyWithImpl<$Res> implements $AuthStateCopyWith<$Res> { + _$AuthStateCopyWithImpl(this._value, this._then); + + final AuthState _value; + // ignore: unused_field + final $Res Function(AuthState) _then; +} + +/// @nodoc +abstract class $AuthenticatedCopyWith<$Res> { + factory $AuthenticatedCopyWith( + Authenticated value, $Res Function(Authenticated) then) = + _$AuthenticatedCopyWithImpl<$Res>; +} + +/// @nodoc +class _$AuthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res> + implements $AuthenticatedCopyWith<$Res> { + _$AuthenticatedCopyWithImpl( + Authenticated _value, $Res Function(Authenticated) _then) + : super(_value, (v) => _then(v as Authenticated)); + + @override + Authenticated get _value => super._value as Authenticated; +} + +/// @nodoc + +class _$Authenticated implements Authenticated { + const _$Authenticated(); + + @override + String toString() { + return 'AuthState.authenticated()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other is Authenticated); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() authenticated, + required TResult Function() unauthenticated, + }) { + return authenticated(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? authenticated, + TResult Function()? unauthenticated, + required TResult orElse(), + }) { + if (authenticated != null) { + return authenticated(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Authenticated value) authenticated, + required TResult Function(Unauthenticated value) unauthenticated, + }) { + return authenticated(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Authenticated value)? authenticated, + TResult Function(Unauthenticated value)? unauthenticated, + required TResult orElse(), + }) { + if (authenticated != null) { + return authenticated(this); + } + return orElse(); + } +} + +abstract class Authenticated implements AuthState { + const factory Authenticated() = _$Authenticated; +} + +/// @nodoc +abstract class $UnauthenticatedCopyWith<$Res> { + factory $UnauthenticatedCopyWith( + Unauthenticated value, $Res Function(Unauthenticated) then) = + _$UnauthenticatedCopyWithImpl<$Res>; +} + +/// @nodoc +class _$UnauthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res> + implements $UnauthenticatedCopyWith<$Res> { + _$UnauthenticatedCopyWithImpl( + Unauthenticated _value, $Res Function(Unauthenticated) _then) + : super(_value, (v) => _then(v as Unauthenticated)); + + @override + Unauthenticated get _value => super._value as Unauthenticated; +} + +/// @nodoc + +class _$Unauthenticated implements Unauthenticated { + const _$Unauthenticated(); + + @override + String toString() { + return 'AuthState.unauthenticated()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other is Unauthenticated); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult when({ + required TResult Function() authenticated, + required TResult Function() unauthenticated, + }) { + return unauthenticated(); + } + + @override + @optionalTypeArgs + TResult maybeWhen({ + TResult Function()? authenticated, + TResult Function()? unauthenticated, + required TResult orElse(), + }) { + if (unauthenticated != null) { + return unauthenticated(); + } + return orElse(); + } + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(Authenticated value) authenticated, + required TResult Function(Unauthenticated value) unauthenticated, + }) { + return unauthenticated(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(Authenticated value)? authenticated, + TResult Function(Unauthenticated value)? unauthenticated, + required TResult orElse(), + }) { + if (unauthenticated != null) { + return unauthenticated(this); + } + return orElse(); + } +} + +abstract class Unauthenticated implements AuthState { + const factory Unauthenticated() = _$Unauthenticated; +} diff --git a/app_flowy/lib/welcome/domain/deps.dart b/app_flowy/lib/welcome/domain/deps.dart new file mode 100644 index 0000000000..5f344ca95e --- /dev/null +++ b/app_flowy/lib/welcome/domain/deps.dart @@ -0,0 +1,12 @@ +import 'package:flutter/widgets.dart'; + +import 'auth_state.dart'; + +abstract class IWelcomeAuth { + Future getAuthState(); +} + +abstract class IWelcomeRoute { + Widget signIn(); + Widget home(); +} diff --git a/app_flowy/lib/welcome/infrastructure/deps_impl.dart b/app_flowy/lib/welcome/infrastructure/deps_impl.dart new file mode 100644 index 0000000000..71d032a6af --- /dev/null +++ b/app_flowy/lib/welcome/infrastructure/deps_impl.dart @@ -0,0 +1,38 @@ +import 'package:app_flowy/home/presentation/home_screen.dart'; +import 'package:app_flowy/welcome/application/welcome_bloc.dart'; +import 'package:app_flowy/welcome/domain/auth_state.dart'; +import 'package:app_flowy/welcome/domain/deps.dart'; +import 'package:flutter/widgets.dart'; +import 'package:get_it/get_it.dart'; +import 'package:time/time.dart'; + +class Welcome { + static Future dependencyResolved(GetIt getIt) async { + getIt.registerFactory(() => AuthCheck()); + getIt.registerFactory(() => WelcomeRoute()); + + getIt + .registerFactory(() => WelcomeBloc(getIt())); + } +} + +class AuthCheck implements IWelcomeAuth { + @override + Future getAuthState() async { + return Future.delayed(3.0.seconds, () { + return const AuthState.authenticated(); + }); + } +} + +class WelcomeRoute implements IWelcomeRoute { + @override + Widget home() { + return const HomeScreen(); + } + + @override + Widget signIn() { + return Container(); + } +} diff --git a/app_flowy/lib/welcome/presentation/welcome_screen.dart b/app_flowy/lib/welcome/presentation/welcome_screen.dart new file mode 100644 index 0000000000..6fa1652ca3 --- /dev/null +++ b/app_flowy/lib/welcome/presentation/welcome_screen.dart @@ -0,0 +1,43 @@ +import 'package:app_flowy/welcome/domain/deps.dart'; +import 'package:app_flowy/welcome/presentation/widgets/body.dart'; +import 'package:app_flowy/startup/startup.dart'; +import 'package:app_flowy/welcome/application/welcome_bloc.dart'; +import 'package:flowy_style/route/animation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flowy_style/time/prelude.dart'; + +class WelcomeScreen extends StatelessWidget { + const WelcomeScreen({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return BlocProvider( + create: (context) => + getIt()..add(const WelcomeEvent.check()), + child: Scaffold( + body: BlocListener( + listener: (context, state) { + state.auth.map( + authenticated: (_) => + _pushToScreen(context, getIt().home()), + unauthenticated: (_) => + _pushToScreen(context, getIt().signIn()), + ); + }, + child: const Body(), + ), + ), + ); + } + + void _pushToScreen(BuildContext context, Widget screen) { + /// Let the splash view sit for a bit. Mainly for aesthetics and to ensure a smooth intro animation. + Future.delayed(1.0.seconds, () { + Navigator.push( + context, + PageRoutes.fade( + () => screen, RouteDurations.slow.inMilliseconds * .001)); + }); + } +} diff --git a/app_flowy/lib/welcome/presentation/widgets/body.dart b/app_flowy/lib/welcome/presentation/widgets/body.dart new file mode 100644 index 0000000000..4800e8b52e --- /dev/null +++ b/app_flowy/lib/welcome/presentation/widgets/body.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; + +class Body extends StatelessWidget { + const Body({Key? key}) : super(key: key); + @override + Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; + + return Container( + alignment: Alignment.center, + child: SingleChildScrollView( + child: Stack( + alignment: Alignment.center, + children: [ + Image( + fit: BoxFit.cover, + width: size.width, + height: size.height, + image: const AssetImage( + 'assets/images/appflowy_launch_splash.jpg')), + const CircularProgressIndicator.adaptive(), + ], + ), + ), + ); + } +} diff --git a/app_flowy/macos/.gitignore b/app_flowy/macos/.gitignore new file mode 100644 index 0000000000..d2fd377230 --- /dev/null +++ b/app_flowy/macos/.gitignore @@ -0,0 +1,6 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/xcuserdata/ diff --git a/app_flowy/macos/Flutter/Flutter-Debug.xcconfig b/app_flowy/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000000..4b81f9b2d2 --- /dev/null +++ b/app_flowy/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/app_flowy/macos/Flutter/Flutter-Release.xcconfig b/app_flowy/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000000..5caa9d1579 --- /dev/null +++ b/app_flowy/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/app_flowy/macos/Flutter/GeneratedPluginRegistrant.swift b/app_flowy/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000000..d906c508d9 --- /dev/null +++ b/app_flowy/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,16 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import flowy_sdk +import path_provider_macos +import window_size + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FlowySdkPlugin.register(with: registry.registrar(forPlugin: "FlowySdkPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + WindowSizePlugin.register(with: registry.registrar(forPlugin: "WindowSizePlugin")) +} diff --git a/app_flowy/macos/Podfile b/app_flowy/macos/Podfile new file mode 100644 index 0000000000..dade8dfad0 --- /dev/null +++ b/app_flowy/macos/Podfile @@ -0,0 +1,40 @@ +platform :osx, '10.11' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/app_flowy/macos/Podfile.lock b/app_flowy/macos/Podfile.lock new file mode 100644 index 0000000000..ee4eff018c --- /dev/null +++ b/app_flowy/macos/Podfile.lock @@ -0,0 +1,34 @@ +PODS: + - flowy_sdk (0.0.1): + - FlutterMacOS + - FlutterMacOS (1.0.0) + - path_provider_macos (0.0.1): + - FlutterMacOS + - window_size (0.0.2): + - FlutterMacOS + +DEPENDENCIES: + - flowy_sdk (from `Flutter/ephemeral/.symlinks/plugins/flowy_sdk/macos`) + - FlutterMacOS (from `Flutter/ephemeral`) + - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`) + - window_size (from `Flutter/ephemeral/.symlinks/plugins/window_size/macos`) + +EXTERNAL SOURCES: + flowy_sdk: + :path: Flutter/ephemeral/.symlinks/plugins/flowy_sdk/macos + FlutterMacOS: + :path: Flutter/ephemeral + path_provider_macos: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos + window_size: + :path: Flutter/ephemeral/.symlinks/plugins/window_size/macos + +SPEC CHECKSUMS: + flowy_sdk: 12d2c047ed260a0aa8788a0b9616da46e2312025 + FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 + path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b + window_size: 339dafa0b27a95a62a843042038fa6c3c48de195 + +PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c + +COCOAPODS: 1.10.1 diff --git a/app_flowy/macos/Runner.xcodeproj/project.pbxproj b/app_flowy/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..05498ff484 --- /dev/null +++ b/app_flowy/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,632 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + D7360C6D6177708F7B2D3C9D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CD81A6C7244B2318E0BA2E8 /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1823EB6E74189944EAA69652 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 1CD81A6C7244B2318E0BA2E8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* app_flowy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = app_flowy.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 6DEEC7DEFA746DDF1338FF4D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 7D41C30A3910C3A40B6085E3 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D7360C6D6177708F7B2D3C9D /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 6B44C542FA0845A8F2FA3624 /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* app_flowy.app */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + 6B44C542FA0845A8F2FA3624 /* Pods */ = { + isa = PBXGroup; + children = ( + 6DEEC7DEFA746DDF1338FF4D /* Pods-Runner.debug.xcconfig */, + 7D41C30A3910C3A40B6085E3 /* Pods-Runner.release.xcconfig */, + 1823EB6E74189944EAA69652 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1CD81A6C7244B2318E0BA2E8 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 611CF908D5E75C6DF581F81A /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + 4372B34726148A3BC297850A /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* app_flowy.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 4372B34726148A3BC297850A /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 611CF908D5E75C6DF581F81A /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/app_flowy/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app_flowy/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/app_flowy/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app_flowy/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app_flowy/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000000..8ded78fa48 --- /dev/null +++ b/app_flowy/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/macos/Runner.xcworkspace/contents.xcworkspacedata b/app_flowy/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..21a3cc14c7 --- /dev/null +++ b/app_flowy/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/app_flowy/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app_flowy/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/app_flowy/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app_flowy/macos/Runner/AppDelegate.swift b/app_flowy/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000000..d53ef64377 --- /dev/null +++ b/app_flowy/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..a2ec33f19f --- /dev/null +++ b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000000..3c4935a7ca Binary files /dev/null and b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000000..ed4cc16421 Binary files /dev/null and b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000000..483be61389 Binary files /dev/null and b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000000..bcbf36df2f Binary files /dev/null and b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000000..9c0a652864 Binary files /dev/null and b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000000..e71a726136 Binary files /dev/null and b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000000..8a31fe2dd3 Binary files /dev/null and b/app_flowy/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/app_flowy/macos/Runner/Base.lproj/MainMenu.xib b/app_flowy/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000000..537341abf9 --- /dev/null +++ b/app_flowy/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/macos/Runner/Configs/AppInfo.xcconfig b/app_flowy/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000000..b42bbd8f62 --- /dev/null +++ b/app_flowy/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = app_flowy + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.appFlowy + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2021 com.example. All rights reserved. diff --git a/app_flowy/macos/Runner/Configs/Debug.xcconfig b/app_flowy/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000000..36b0fd9464 --- /dev/null +++ b/app_flowy/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/app_flowy/macos/Runner/Configs/Release.xcconfig b/app_flowy/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000000..dff4f49561 --- /dev/null +++ b/app_flowy/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/app_flowy/macos/Runner/Configs/Warnings.xcconfig b/app_flowy/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000000..42bcbf4780 --- /dev/null +++ b/app_flowy/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/app_flowy/macos/Runner/DebugProfile.entitlements b/app_flowy/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000000..dddb8a30c8 --- /dev/null +++ b/app_flowy/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/app_flowy/macos/Runner/Info.plist b/app_flowy/macos/Runner/Info.plist new file mode 100644 index 0000000000..4789daa6a4 --- /dev/null +++ b/app_flowy/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/app_flowy/macos/Runner/MainFlutterWindow.swift b/app_flowy/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000000..2722837ec9 --- /dev/null +++ b/app_flowy/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController.init() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/app_flowy/macos/Runner/Release.entitlements b/app_flowy/macos/Runner/Release.entitlements new file mode 100644 index 0000000000..852fa1a472 --- /dev/null +++ b/app_flowy/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/app_flowy/packages/flowy_logger/.gitignore b/app_flowy/packages/flowy_logger/.gitignore new file mode 100644 index 0000000000..1985397a2c --- /dev/null +++ b/app_flowy/packages/flowy_logger/.gitignore @@ -0,0 +1,74 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 diff --git a/app_flowy/packages/flowy_logger/.metadata b/app_flowy/packages/flowy_logger/.metadata new file mode 100644 index 0000000000..13a1909853 --- /dev/null +++ b/app_flowy/packages/flowy_logger/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 63062a64432cce03315d6b5196fda7912866eb37 + channel: dev + +project_type: package diff --git a/app_flowy/packages/flowy_logger/CHANGELOG.md b/app_flowy/packages/flowy_logger/CHANGELOG.md new file mode 100644 index 0000000000..ac071598e5 --- /dev/null +++ b/app_flowy/packages/flowy_logger/CHANGELOG.md @@ -0,0 +1,3 @@ +## [0.0.1] - TODO: Add release date. + +* TODO: Describe initial release. diff --git a/app_flowy/packages/flowy_logger/LICENSE b/app_flowy/packages/flowy_logger/LICENSE new file mode 100644 index 0000000000..ba75c69f7f --- /dev/null +++ b/app_flowy/packages/flowy_logger/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/app_flowy/packages/flowy_logger/README.md b/app_flowy/packages/flowy_logger/README.md new file mode 100644 index 0000000000..6733aedc98 --- /dev/null +++ b/app_flowy/packages/flowy_logger/README.md @@ -0,0 +1,14 @@ +# flowy_logger + +A new Flutter package project. + +## Getting Started + +This project is a starting point for a Dart +[package](https://flutter.dev/developing-packages/), +a library module containing code that can be shared easily across +multiple Flutter or Dart projects. + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/app_flowy/packages/flowy_logger/lib/flowy_logger.dart b/app_flowy/packages/flowy_logger/lib/flowy_logger.dart new file mode 100644 index 0000000000..177a8fb197 --- /dev/null +++ b/app_flowy/packages/flowy_logger/lib/flowy_logger.dart @@ -0,0 +1,33 @@ +// ignore: import_of_legacy_library_into_null_safe +import 'package:logger/logger.dart'; + +class Log { + static final shared = Log(); + late Logger _logger; + + Log() { + _logger = Logger( + printer: PrettyPrinter( + methodCount: 2, // number of method calls to be displayed + errorMethodCount: + 8, // number of method calls if stacktrace is provided + lineLength: 120, // width of the output + colors: true, // Colorful log messages + printEmojis: true, // Print an emoji for each log message + printTime: true // Should each log print contain a timestamp + ), + ); + } + + static void info(dynamic msg) { + Log.shared._logger.i(msg); + } + + static void debug(dynamic msg) { + Log.shared._logger.d(msg); + } + + static void error(dynamic msg) { + Log.shared._logger.e(msg); + } +} diff --git a/app_flowy/packages/flowy_logger/pubspec.lock b/app_flowy/packages/flowy_logger/pubspec.lock new file mode 100644 index 0000000000..d7109d849c --- /dev/null +++ b/app_flowy/packages/flowy_logger/pubspec.lock @@ -0,0 +1,154 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + logger: + dependency: "direct main" + description: + name: logger + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/app_flowy/packages/flowy_logger/pubspec.yaml b/app_flowy/packages/flowy_logger/pubspec.yaml new file mode 100644 index 0000000000..ec49706247 --- /dev/null +++ b/app_flowy/packages/flowy_logger/pubspec.yaml @@ -0,0 +1,55 @@ +name: flowy_logger +description: A new Flutter package project. +version: 0.0.1 +author: +homepage: + +environment: + sdk: ">=2.12.0-0 <3.0.0" + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + logger: ^1.0.0 + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/app_flowy/packages/flowy_logger/test/flowy_logger_test.dart b/app_flowy/packages/flowy_logger/test/flowy_logger_test.dart new file mode 100644 index 0000000000..ab73b3a234 --- /dev/null +++ b/app_flowy/packages/flowy_logger/test/flowy_logger_test.dart @@ -0,0 +1 @@ +void main() {} diff --git a/app_flowy/packages/flowy_sdk/.gitignore b/app_flowy/packages/flowy_sdk/.gitignore new file mode 100644 index 0000000000..4889ceeb9a --- /dev/null +++ b/app_flowy/packages/flowy_sdk/.gitignore @@ -0,0 +1,76 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 + +**/*.dylib \ No newline at end of file diff --git a/app_flowy/packages/flowy_sdk/.metadata b/app_flowy/packages/flowy_sdk/.metadata new file mode 100644 index 0000000000..632500f793 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 63062a64432cce03315d6b5196fda7912866eb37 + channel: dev + +project_type: plugin diff --git a/app_flowy/packages/flowy_sdk/CHANGELOG.md b/app_flowy/packages/flowy_sdk/CHANGELOG.md new file mode 100644 index 0000000000..41cc7d8192 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/app_flowy/packages/flowy_sdk/LICENSE b/app_flowy/packages/flowy_sdk/LICENSE new file mode 100644 index 0000000000..ba75c69f7f --- /dev/null +++ b/app_flowy/packages/flowy_sdk/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/app_flowy/packages/flowy_sdk/README.md b/app_flowy/packages/flowy_sdk/README.md new file mode 100644 index 0000000000..42fe69bd08 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/README.md @@ -0,0 +1,15 @@ +# flowy_sdk + +A new flutter plugin project. + +## Getting Started + +This project is a starting point for a Flutter +[plug-in package](https://flutter.dev/developing-packages/), +a specialized package that includes platform-specific implementation code for +Android and/or iOS. + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. + diff --git a/app_flowy/packages/flowy_sdk/analysis_options.yaml b/app_flowy/packages/flowy_sdk/analysis_options.yaml new file mode 100644 index 0000000000..1ddc9bdf8b --- /dev/null +++ b/app_flowy/packages/flowy_sdk/analysis_options.yaml @@ -0,0 +1,4 @@ +analyzer: + exclude: + - "**/*.g.dart" + - "**/*.freezed.dart" diff --git a/app_flowy/packages/flowy_sdk/android/.gitignore b/app_flowy/packages/flowy_sdk/android/.gitignore new file mode 100644 index 0000000000..c6cbe562a4 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/android/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/app_flowy/packages/flowy_sdk/android/build.gradle b/app_flowy/packages/flowy_sdk/android/build.gradle new file mode 100644 index 0000000000..52a1508a46 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/android/build.gradle @@ -0,0 +1,40 @@ +group 'com.plugin.flowy_sdk' +version '1.0-SNAPSHOT' + +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +rootProject.allprojects { + repositories { + google() + jcenter() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +android { + compileSdkVersion 30 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + defaultConfig { + minSdkVersion 16 + } +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/app_flowy/packages/flowy_sdk/android/gradle.properties b/app_flowy/packages/flowy_sdk/android/gradle.properties new file mode 100644 index 0000000000..94adc3a3f9 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/app_flowy/packages/flowy_sdk/android/gradle/wrapper/gradle-wrapper.properties b/app_flowy/packages/flowy_sdk/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..3c9d0852bf --- /dev/null +++ b/app_flowy/packages/flowy_sdk/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/app_flowy/packages/flowy_sdk/android/settings.gradle b/app_flowy/packages/flowy_sdk/android/settings.gradle new file mode 100644 index 0000000000..fab0d5f031 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'flowy_sdk' diff --git a/app_flowy/packages/flowy_sdk/android/src/main/AndroidManifest.xml b/app_flowy/packages/flowy_sdk/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..8aaf86b5f5 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/android/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + diff --git a/app_flowy/packages/flowy_sdk/android/src/main/kotlin/com/plugin/flowy_sdk/FlowySdkPlugin.kt b/app_flowy/packages/flowy_sdk/android/src/main/kotlin/com/plugin/flowy_sdk/FlowySdkPlugin.kt new file mode 100644 index 0000000000..bac76ffca2 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/android/src/main/kotlin/com/plugin/flowy_sdk/FlowySdkPlugin.kt @@ -0,0 +1,36 @@ +package com.plugin.flowy_sdk + +import androidx.annotation.NonNull + +import io.flutter.embedding.engine.plugins.FlutterPlugin +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugin.common.MethodChannel.MethodCallHandler +import io.flutter.plugin.common.MethodChannel.Result +import io.flutter.plugin.common.PluginRegistry.Registrar + +/** FlowySdkPlugin */ +class FlowySdkPlugin: FlutterPlugin, MethodCallHandler { + /// The MethodChannel that will the communication between Flutter and native Android + /// + /// This local reference serves to register the plugin with the Flutter Engine and unregister it + /// when the Flutter Engine is detached from the Activity + private lateinit var channel : MethodChannel + + override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flowy_sdk") + channel.setMethodCallHandler(this) + } + + override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { + if (call.method == "getPlatformVersion") { + result.success("Android ${android.os.Build.VERSION.RELEASE}") + } else { + result.notImplemented() + } + } + + override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { + channel.setMethodCallHandler(null) + } +} diff --git a/app_flowy/packages/flowy_sdk/example/.gitignore b/app_flowy/packages/flowy_sdk/example/.gitignore new file mode 100644 index 0000000000..0fa6b675c0 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/.gitignore @@ -0,0 +1,46 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/app_flowy/packages/flowy_sdk/example/.metadata b/app_flowy/packages/flowy_sdk/example/.metadata new file mode 100644 index 0000000000..36a46146d9 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 63062a64432cce03315d6b5196fda7912866eb37 + channel: dev + +project_type: app diff --git a/app_flowy/packages/flowy_sdk/example/README.md b/app_flowy/packages/flowy_sdk/example/README.md new file mode 100644 index 0000000000..6b1eb3ecae --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/README.md @@ -0,0 +1,16 @@ +# flowy_sdk_example + +Demonstrates how to use the flowy_sdk plugin. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/app_flowy/packages/flowy_sdk/example/analysis_options.yaml b/app_flowy/packages/flowy_sdk/example/analysis_options.yaml new file mode 100644 index 0000000000..1e22c01d9f --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/analysis_options.yaml @@ -0,0 +1,5 @@ +include: ../analysis_options.yaml + +analyzer: + exclude: + diff --git a/app_flowy/packages/flowy_sdk/example/android/.gitignore b/app_flowy/packages/flowy_sdk/example/android/.gitignore new file mode 100644 index 0000000000..0a741cb43d --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/.gitignore @@ -0,0 +1,11 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties diff --git a/app_flowy/packages/flowy_sdk/example/android/app/build.gradle b/app_flowy/packages/flowy_sdk/example/android/app/build.gradle new file mode 100644 index 0000000000..cccedb641b --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/app/build.gradle @@ -0,0 +1,59 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 30 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.plugin.flowy_sdk_example" + minSdkVersion 16 + targetSdkVersion 30 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/debug/AndroidManifest.xml b/app_flowy/packages/flowy_sdk/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000000..af20dacd10 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/AndroidManifest.xml b/app_flowy/packages/flowy_sdk/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..5a5a080d56 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/kotlin/com/plugin/flowy_sdk_example/MainActivity.kt b/app_flowy/packages/flowy_sdk/example/android/app/src/main/kotlin/com/plugin/flowy_sdk_example/MainActivity.kt new file mode 100644 index 0000000000..a71ff77e5a --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/app/src/main/kotlin/com/plugin/flowy_sdk_example/MainActivity.kt @@ -0,0 +1,6 @@ +package com.plugin.flowy_sdk_example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/drawable-v21/launch_background.xml b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000000..f74085f3f6 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/drawable/launch_background.xml b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000000..304732f884 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000..db77bb4b7b Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000..17987b79bb Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000000..09d4391482 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000..d5f1c8d34e Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000..4d6372eebd Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/values-night/styles.xml b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000000..449a9f9308 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/values/styles.xml b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000000..d74aa35c28 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/android/app/src/profile/AndroidManifest.xml b/app_flowy/packages/flowy_sdk/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000000..af20dacd10 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/app_flowy/packages/flowy_sdk/example/android/build.gradle b/app_flowy/packages/flowy_sdk/example/android/build.gradle new file mode 100644 index 0000000000..c505a86352 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/app_flowy/packages/flowy_sdk/example/android/gradle.properties b/app_flowy/packages/flowy_sdk/example/android/gradle.properties new file mode 100644 index 0000000000..94adc3a3f9 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/app_flowy/packages/flowy_sdk/example/android/gradle/wrapper/gradle-wrapper.properties b/app_flowy/packages/flowy_sdk/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..bc6a58afdd --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/app_flowy/packages/flowy_sdk/example/android/settings.gradle b/app_flowy/packages/flowy_sdk/example/android/settings.gradle new file mode 100644 index 0000000000..44e62bcf06 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/app_flowy/packages/flowy_sdk/example/integration_test/app_test.dart b/app_flowy/packages/flowy_sdk/example/integration_test/app_test.dart new file mode 100644 index 0000000000..4d978c8f09 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/integration_test/app_test.dart @@ -0,0 +1,33 @@ +// This is a basic Flutter integration test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +// import 'package:flutter/material.dart'; +// import 'package:flutter_test/flutter_test.dart'; +// import 'package:integration_test/integration_test.dart'; + +// import 'package:flowy_sdk_example/main.dart' as app; + +// void main() => run(_testMain); + +// void _testMain() { +// testWidgets('Counter increments smoke test', (WidgetTester tester) async { +// // Build our app and trigger a frame. +// app.main(); + +// // Trigger a frame. +// await tester.pumpAndSettle(); + +// // Verify that platform version is retrieved. +// expect( +// find.byWidgetPredicate( +// (Widget widget) => widget is Text && +// widget.data.startsWith('Running on:'), +// ), +// findsOneWidget, +// ); +// }); +// } diff --git a/app_flowy/packages/flowy_sdk/example/integration_test/driver.dart b/app_flowy/packages/flowy_sdk/example/integration_test/driver.dart new file mode 100644 index 0000000000..a03bca081a --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/integration_test/driver.dart @@ -0,0 +1,8 @@ +// This file is provided as a convenience for running integration tests via the +// flutter drive command. +// +// flutter drive --driver integration_test/driver.dart --target integration_test/app_test.dart + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() => integrationDriver(); diff --git a/app_flowy/packages/flowy_sdk/example/ios/.gitignore b/app_flowy/packages/flowy_sdk/example/ios/.gitignore new file mode 100644 index 0000000000..e96ef602b8 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/app_flowy/packages/flowy_sdk/example/ios/Flutter/AppFrameworkInfo.plist b/app_flowy/packages/flowy_sdk/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000000..9367d483e4 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Flutter/Debug.xcconfig b/app_flowy/packages/flowy_sdk/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000000..e8efba1146 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/app_flowy/packages/flowy_sdk/example/ios/Flutter/Release.xcconfig b/app_flowy/packages/flowy_sdk/example/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000000..399e9340e6 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/app_flowy/packages/flowy_sdk/example/ios/Podfile b/app_flowy/packages/flowy_sdk/example/ios/Podfile new file mode 100644 index 0000000000..1e8c3c90a5 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.pbxproj b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..1c2b396890 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,471 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.plugin.flowySdkExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.plugin.flowySdkExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.plugin.flowySdkExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..1d526a16ed --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000..f9b0d7c5ea --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000000..a28140cfdb --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..1d526a16ed --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000..f9b0d7c5ea --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/AppDelegate.swift b/app_flowy/packages/flowy_sdk/example/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000000..70693e4a8c --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..d36b1fab2d --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000..dc9ada4725 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000000..28c6bf0301 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000000..2ccbfd967d Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000000..f091b6b0bc Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000000..4cde12118d Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000000..d0ef06e7ed Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000000..dcdc2306c2 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000000..2ccbfd967d Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000000..c8f9ed8f5c Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000000..a6d6b8609d Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000000..a6d6b8609d Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000000..75b2d164a5 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000000..c4df70d39d Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000000..6a84f41e14 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000000..d0e1f58536 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000000..0bedcf2fd4 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000000..9da19eacad Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000..9da19eacad Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000..9da19eacad Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000000..89c2725b70 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +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. \ No newline at end of file diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/app_flowy/packages/flowy_sdk/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000000..f2e259c7c9 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Base.lproj/Main.storyboard b/app_flowy/packages/flowy_sdk/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000000..f3c28516fb --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Info.plist b/app_flowy/packages/flowy_sdk/example/ios/Runner/Info.plist new file mode 100644 index 0000000000..46afe6a4bd --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + flowy_sdk_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/app_flowy/packages/flowy_sdk/example/ios/Runner/Runner-Bridging-Header.h b/app_flowy/packages/flowy_sdk/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000000..308a2a560b --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/app_flowy/packages/flowy_sdk/example/lib/main.dart b/app_flowy/packages/flowy_sdk/example/lib/main.dart new file mode 100644 index 0000000000..df64a3b08c --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/lib/main.dart @@ -0,0 +1,57 @@ +import 'package:flutter/material.dart'; +import 'dart:async'; + +import 'package:flutter/services.dart'; +import 'package:flowy_sdk/flowy_sdk.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatefulWidget { + @override + _MyAppState createState() => _MyAppState(); +} + +class _MyAppState extends State { + String _platformVersion = 'Unknown'; + + @override + void initState() { + super.initState(); + initPlatformState(); + } + + // Platform messages are asynchronous, so we initialize in an async method. + Future initPlatformState() async { + String platformVersion; + // Platform messages may fail, so we use a try/catch PlatformException. + try { + platformVersion = await FlowySDK.platformVersion; + } on PlatformException { + platformVersion = 'Failed to get platform version.'; + } + + // If the widget was removed from the tree while the asynchronous platform + // message was in flight, we want to discard the reply rather than calling + // setState to update our non-existent appearance. + if (!mounted) return; + setState(() { + _platformVersion = platformVersion; + }); + } + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: const Text('Plugin example app'), + ), + body: Center( + child: Text('Running on: $_platformVersion\n'), + ), + ), + ); + } +} diff --git a/app_flowy/packages/flowy_sdk/example/macos/.gitignore b/app_flowy/packages/flowy_sdk/example/macos/.gitignore new file mode 100644 index 0000000000..d2fd377230 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/.gitignore @@ -0,0 +1,6 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/xcuserdata/ diff --git a/app_flowy/packages/flowy_sdk/example/macos/Flutter/Flutter-Debug.xcconfig b/app_flowy/packages/flowy_sdk/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000000..785633d3a8 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/app_flowy/packages/flowy_sdk/example/macos/Flutter/Flutter-Release.xcconfig b/app_flowy/packages/flowy_sdk/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000000..5fba960c3a --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/app_flowy/packages/flowy_sdk/example/macos/Flutter/GeneratedPluginRegistrant.swift b/app_flowy/packages/flowy_sdk/example/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000000..7f32fa30c5 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,12 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import flowy_sdk + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FlowySdkPlugin.register(with: registry.registrar(forPlugin: "FlowySdkPlugin")) +} diff --git a/app_flowy/packages/flowy_sdk/example/macos/Podfile b/app_flowy/packages/flowy_sdk/example/macos/Podfile new file mode 100644 index 0000000000..d60ec71028 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Podfile @@ -0,0 +1,82 @@ +platform :osx, '10.11' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def parse_KV_file(file, separator='=') + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return []; + end + pods_ary = [] + skip_line_start_symbols = ["#", "/"] + File.foreach(file_abs_path) { |line| + next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } + plugin = line.split(pattern=separator) + if plugin.length == 2 + podname = plugin[0].strip() + path = plugin[1].strip() + podpath = File.expand_path("#{path}", file_abs_path) + pods_ary.push({:name => podname, :path => podpath}); + else + puts "Invalid plugin specification: #{line}" + end + } + return pods_ary +end + +def pubspec_supports_macos(file) + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return false; + end + File.foreach(file_abs_path) { |line| + return true if line =~ /^\s*macos:/ + } + return false +end + +target 'Runner' do + use_frameworks! + use_modular_headers! + + # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock + # referring to absolute paths on developers' machines. + ephemeral_dir = File.join('Flutter', 'ephemeral') + symlink_dir = File.join(ephemeral_dir, '.symlinks') + symlink_plugins_dir = File.join(symlink_dir, 'plugins') + system("rm -rf #{symlink_dir}") + system("mkdir -p #{symlink_plugins_dir}") + + # Flutter Pods + generated_xcconfig = parse_KV_file(File.join(ephemeral_dir, 'Flutter-Generated.xcconfig')) + if generated_xcconfig.empty? + puts "Flutter-Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first." + end + generated_xcconfig.map { |p| + if p[:name] == 'FLUTTER_FRAMEWORK_DIR' + symlink = File.join(symlink_dir, 'flutter') + File.symlink(File.dirname(p[:path]), symlink) + pod 'FlutterMacOS', :path => File.join(symlink, File.basename(p[:path])) + end + } + + # Plugin Pods + plugin_pods = parse_KV_file('../.flutter-plugins') + plugin_pods.map { |p| + symlink = File.join(symlink_plugins_dir, p[:name]) + File.symlink(p[:path], symlink) + if pubspec_supports_macos(File.join(symlink, 'pubspec.yaml')) + pod p[:name], :path => File.join(symlink, 'macos') + end + } +end + +# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. +install! 'cocoapods', :disable_input_output_paths => true diff --git a/app_flowy/packages/flowy_sdk/example/macos/Podfile.lock b/app_flowy/packages/flowy_sdk/example/macos/Podfile.lock new file mode 100644 index 0000000000..dd86b1d5b4 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Podfile.lock @@ -0,0 +1,39 @@ +PODS: + - flowy_infra (0.0.1): + - FlutterMacOS + - flowy_sdk (0.0.1): + - FlutterMacOS + - FlutterMacOS (1.0.0) + - path_provider (0.0.1) + - path_provider_macos (0.0.1): + - FlutterMacOS + +DEPENDENCIES: + - flowy_infra (from `Flutter/ephemeral/.symlinks/plugins/flowy_infra/macos`) + - flowy_sdk (from `Flutter/ephemeral/.symlinks/plugins/flowy_sdk/macos`) + - FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`) + - path_provider (from `Flutter/ephemeral/.symlinks/plugins/path_provider/macos`) + - path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`) + +EXTERNAL SOURCES: + flowy_infra: + :path: Flutter/ephemeral/.symlinks/plugins/flowy_infra/macos + flowy_sdk: + :path: Flutter/ephemeral/.symlinks/plugins/flowy_sdk/macos + FlutterMacOS: + :path: Flutter/ephemeral/.symlinks/flutter/darwin-x64 + path_provider: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider/macos + path_provider_macos: + :path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos + +SPEC CHECKSUMS: + flowy_infra: 6638deea1ca0baeef75156d16236123d4703161d + flowy_sdk: 12d2c047ed260a0aa8788a0b9616da46e2312025 + FlutterMacOS: 15bea8a44d2fa024068daa0140371c020b4b6ff9 + path_provider: e0848572d1d38b9a7dd099e79cf83f5b7e2cde9f + path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b + +PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7 + +COCOAPODS: 1.10.1 diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner.xcodeproj/project.pbxproj b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..ac3debdf8e --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,654 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; }; + 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + B7C2E82907836001B5A6F548 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49D7864808B727FDFB82A4C2 /* Pods_Runner.framework */; }; + D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; }; + D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */, + 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */, + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0E4B7400A641C13F34C1A73C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* flowy_sdk_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = flowy_sdk_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 4959329ACC9EF83FB15AC0E5 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 49D7864808B727FDFB82A4C2 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + A82DF8E6F43DF0AD4D0653DC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D73912F022F37F9E000D13A0 /* App.framework in Frameworks */, + 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */, + B7C2E82907836001B5A6F548 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 426A48CDE70CED9D3E9185FC /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* flowy_sdk_example.app */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + D73912EF22F37F9E000D13A0 /* App.framework */, + 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + 426A48CDE70CED9D3E9185FC /* Pods */ = { + isa = PBXGroup; + children = ( + A82DF8E6F43DF0AD4D0653DC /* Pods-Runner.debug.xcconfig */, + 4959329ACC9EF83FB15AC0E5 /* Pods-Runner.release.xcconfig */, + 0E4B7400A641C13F34C1A73C /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 49D7864808B727FDFB82A4C2 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 40E676EAFF7C261E0E226351 /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + 648FD3193605213263C327B2 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* flowy_sdk_example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 40E676EAFF7C261E0E226351 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 648FD3193605213263C327B2 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter/ephemeral", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.11; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter/ephemeral", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter/ephemeral", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000000..3d8205cf56 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..21a3cc14c7 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/AppDelegate.swift b/app_flowy/packages/flowy_sdk/example/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000000..d53ef64377 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000..a2ec33f19f --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000000..3c4935a7ca Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000000..ed4cc16421 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000000..483be61389 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000000..bcbf36df2f Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000000..9c0a652864 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000000..e71a726136 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000000..8a31fe2dd3 Binary files /dev/null and b/app_flowy/packages/flowy_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Base.lproj/MainMenu.xib b/app_flowy/packages/flowy_sdk/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000000..537341abf9 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/AppInfo.xcconfig b/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000000..282eb8ee67 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = flowy_sdk_example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.plugin.flowySdkExample + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2021 com.plugin. All rights reserved. diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/Debug.xcconfig b/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000000..36b0fd9464 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/Release.xcconfig b/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000000..dff4f49561 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/Warnings.xcconfig b/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000000..42bcbf4780 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/DebugProfile.entitlements b/app_flowy/packages/flowy_sdk/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000000..dddb8a30c8 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Info.plist b/app_flowy/packages/flowy_sdk/example/macos/Runner/Info.plist new file mode 100644 index 0000000000..4789daa6a4 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/MainFlutterWindow.swift b/app_flowy/packages/flowy_sdk/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000000..2722837ec9 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController.init() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/app_flowy/packages/flowy_sdk/example/macos/Runner/Release.entitlements b/app_flowy/packages/flowy_sdk/example/macos/Runner/Release.entitlements new file mode 100644 index 0000000000..852fa1a472 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/app_flowy/packages/flowy_sdk/example/pubspec.lock b/app_flowy/packages/flowy_sdk/example/pubspec.lock new file mode 100644 index 0000000000..8043273325 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/pubspec.lock @@ -0,0 +1,323 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.2" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + dartz: + dependency: transitive + description: + name: dartz + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.0-nullsafety.2" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.1" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.11" + flowy_logger: + dependency: transitive + description: + path: "../../flowy_logger" + relative: true + source: path + version: "0.0.1" + flowy_protobuf: + dependency: transitive + description: + path: "../../flowy_protobuf" + relative: true + source: path + version: "0.0.1" + flowy_sdk: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "0.0.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_driver: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.1" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + infra: + dependency: transitive + description: + path: "../../infra" + relative: true + source: path + version: "0.0.1" + integration_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + isolates: + dependency: transitive + description: + name: isolates + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.3+8" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + logger: + dependency: transitive + description: + name: logger + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.1" + protobuf: + dependency: transitive + description: + name: protobuf + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + sync_http: + dependency: transitive + description: + name: sync_http + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + time: + dependency: transitive + description: + name: time + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + vm_service: + dependency: transitive + description: + name: vm_service + url: "https://pub.dartlang.org" + source: hosted + version: "6.2.0" + webdriver: + dependency: transitive + description: + name: webdriver + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" diff --git a/app_flowy/packages/flowy_sdk/example/pubspec.yaml b/app_flowy/packages/flowy_sdk/example/pubspec.yaml new file mode 100644 index 0000000000..33fd1b7f2e --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/pubspec.yaml @@ -0,0 +1,73 @@ +name: flowy_sdk_example +description: Demonstrates how to use the flowy_sdk plugin. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +environment: + sdk: ">=2.7.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + + flowy_sdk: + # When depending on this package from a real application you should use: + # flowy_sdk: ^x.y.z + # See https://dart.dev/tools/pub/dependencies#version-constraints + # The example app is bundled with the plugin so we use a path dependency on + # the parent directory to use the current plugin's version. + path: ../ + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.1 + +dev_dependencies: + flutter_test: + sdk: flutter + integration_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/app_flowy/packages/flowy_sdk/example/test/widget_test.dart b/app_flowy/packages/flowy_sdk/example/test/widget_test.dart new file mode 100644 index 0000000000..c4b3f0e7f7 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/example/test/widget_test.dart @@ -0,0 +1,29 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import '../lib/main.dart'; + +void main() { + testWidgets('Verify Platform version', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(MyApp()); + + // Verify that platform version is retrieved. + expect( + find.byWidgetPredicate((Widget widget) { + if (widget is Text && widget.data != null) { + return widget.data.startsWith('Running on:'); + } + return false; + }), + findsOneWidget, + ); + }); +} diff --git a/app_flowy/packages/flowy_sdk/ios/.gitignore b/app_flowy/packages/flowy_sdk/ios/.gitignore new file mode 100644 index 0000000000..aa479fd3ce --- /dev/null +++ b/app_flowy/packages/flowy_sdk/ios/.gitignore @@ -0,0 +1,37 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig +/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/app_flowy/packages/flowy_sdk/ios/Assets/.gitkeep b/app_flowy/packages/flowy_sdk/ios/Assets/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/app_flowy/packages/flowy_sdk/ios/Classes/FlowySdkPlugin.h b/app_flowy/packages/flowy_sdk/ios/Classes/FlowySdkPlugin.h new file mode 100644 index 0000000000..813ed1c19b --- /dev/null +++ b/app_flowy/packages/flowy_sdk/ios/Classes/FlowySdkPlugin.h @@ -0,0 +1,4 @@ +#import + +@interface FlowySdkPlugin : NSObject +@end diff --git a/app_flowy/packages/flowy_sdk/ios/Classes/FlowySdkPlugin.m b/app_flowy/packages/flowy_sdk/ios/Classes/FlowySdkPlugin.m new file mode 100644 index 0000000000..0343b9ec20 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/ios/Classes/FlowySdkPlugin.m @@ -0,0 +1,15 @@ +#import "FlowySdkPlugin.h" +#if __has_include() +#import +#else +// Support project import fallback if the generated compatibility header +// is not copied when this plugin is created as a library. +// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 +#import "flowy_sdk-Swift.h" +#endif + +@implementation FlowySdkPlugin ++ (void)registerWithRegistrar:(NSObject*)registrar { + [SwiftFlowySdkPlugin registerWithRegistrar:registrar]; +} +@end diff --git a/app_flowy/packages/flowy_sdk/ios/Classes/SwiftFlowySdkPlugin.swift b/app_flowy/packages/flowy_sdk/ios/Classes/SwiftFlowySdkPlugin.swift new file mode 100644 index 0000000000..736d69d565 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/ios/Classes/SwiftFlowySdkPlugin.swift @@ -0,0 +1,18 @@ +import Flutter +import UIKit + +public class SwiftFlowySdkPlugin: NSObject, FlutterPlugin { + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel(name: "flowy_sdk", binaryMessenger: registrar.messenger()) + let instance = SwiftFlowySdkPlugin() + registrar.addMethodCallDelegate(instance, channel: channel) + } + + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + result("iOS " + UIDevice.current.systemVersion) + } + + public static func dummyMethodToEnforceBundling() { + link_me_please() + } +} diff --git a/app_flowy/packages/flowy_sdk/ios/flowy_sdk.podspec b/app_flowy/packages/flowy_sdk/ios/flowy_sdk.podspec new file mode 100644 index 0000000000..de720c906f --- /dev/null +++ b/app_flowy/packages/flowy_sdk/ios/flowy_sdk.podspec @@ -0,0 +1,24 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint flowy_sdk.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'flowy_sdk' + s.version = '0.0.1' + s.summary = 'A new flutter plugin project.' + s.description = <<-DESC +A new flutter plugin project. + DESC + s.homepage = 'http://example.com' + s.license = { :file => '../LICENSE' } + s.author = { 'Your Company' => 'email@example.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'Flutter' + s.platform = :ios, '8.0' + + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.swift_version = '5.0' + s.vendored_libraries = "libflowy_ffi.dylib" +end diff --git a/app_flowy/packages/flowy_sdk/lib/cqrs/auto_gen.dart b/app_flowy/packages/flowy_sdk/lib/cqrs/auto_gen.dart new file mode 100644 index 0000000000..2296cc99f1 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/lib/cqrs/auto_gen.dart @@ -0,0 +1,1328 @@ + + +/// Auto gen code from rust ast, do not edit +part of 'cqrs.dart'; +class WorkspaceCreateRequest { + WorkspaceCreation body; + WorkspaceCreateRequest(this.body); + Future> send() { + final command = Command.Workspace_Create; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Workspace.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class WorkspaceDeleteRequest { + IdentifiableEntity body; + WorkspaceDeleteRequest(this.body); + Future> send() { + final command = Command.Workspace_Delete; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Workspace.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class WorkspaceUpdateRequest { + WorkspaceChangeset body; + WorkspaceUpdateRequest(this.body); + Future> send() { + final command = Command.Workspace_Update; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Workspace.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class WorkspaceQueryRequest { + WorkspaceQuery body; + WorkspaceQueryRequest(this.body); + Future> send() { + final command = Command.Workspace_Query; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = WorkspaceQueryResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class ViewCreateRequest { + ViewCreation body; + ViewCreateRequest(this.body); + Future> send() { + final command = Command.View_Create; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = ViewCreation.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class ViewDeleteRequest { + IdentifiableEntity body; + ViewDeleteRequest(this.body); + Future> send() { + final command = Command.View_Delete; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = View.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class ViewUpdateRequest { + ViewChangeset body; + ViewUpdateRequest(this.body); + Future> send() { + final command = Command.View_Update; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = View.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class ViewQueryRequest { + ViewQuery body; + ViewQueryRequest(this.body); + Future> send() { + final command = Command.View_Query; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = ViewQueryResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class GridViewCreateRequest { + GridViewCreation body; + GridViewCreateRequest(this.body); + Future> send() { + final command = Command.Grid_View_Create; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = GridViewCreationResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class ViewDisplayUpdateRequest { + ViewDisplayChangeset body; + ViewDisplayUpdateRequest(this.body); + Future> send() { + final command = Command.View_Display_Update; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = ViewDisplay.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class TableCreateRequest { + TableCreation body; + TableCreateRequest(this.body); + Future> send() { + final command = Command.Table_Create; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = TableCreation.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class TableDeleteRequest { + IdentifiableEntity body; + TableDeleteRequest(this.body); + Future> send() { + final command = Command.Table_Delete; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = FYTable.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class TableUpdateRequest { + FYTableChangeset body; + TableUpdateRequest(this.body); + Future> send() { + final command = Command.Table_Update; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = FYTable.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class TableQueryRequest { + TableQuery body; + TableQueryRequest(this.body); + Future> send() { + final command = Command.Table_Query; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = TableQueryResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class RowCreateRequest { + RowCreation body; + RowCreateRequest(this.body); + Future> send() { + final command = Command.Row_Create; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Row.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class RowDeleteRequest { + IdentifiableEntity body; + RowDeleteRequest(this.body); + Future> send() { + final command = Command.Row_Delete; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Row.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class RowUpdateRequest { + RowChangeset body; + RowUpdateRequest(this.body); + Future> send() { + final command = Command.Row_Update; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Row.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class RowQueryRequest { + RowQuery body; + RowQueryRequest(this.body); + Future> send() { + final command = Command.Row_Query; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = RowQueryResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class FieldCreateRequest { + FieldCreation body; + FieldCreateRequest(this.body); + Future> send() { + final command = Command.Field_Create; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Field.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class FieldDeleteRequest { + IdentifiableEntity body; + FieldDeleteRequest(this.body); + Future> send() { + final command = Command.Field_Delete; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Field.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class FieldUpdateRequest { + FieldChangeset body; + FieldUpdateRequest(this.body); + Future> send() { + final command = Command.Field_Update; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Field.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class FieldQueryRequest { + FieldQuery body; + FieldQueryRequest(this.body); + Future> send() { + final command = Command.Field_Query; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = FieldQueryResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class AppCreateRequest { + AppCreation body; + AppCreateRequest(this.body); + Future> send() { + final command = Command.App_Create; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = App.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class AppDeleteRequest { + IdentifiableEntity body; + AppDeleteRequest(this.body); + Future> send() { + final command = Command.App_Delete; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = App.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class AppUpdateRequest { + AppChangeset body; + AppUpdateRequest(this.body); + Future> send() { + final command = Command.App_Update; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = App.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class AppQueryRequest { + AppQuery body; + AppQueryRequest(this.body); + Future> send() { + final command = Command.App_Query; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = AppQueryResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class CellCreateRequest { + CellCreation body; + CellCreateRequest(this.body); + Future> send() { + final command = Command.Cell_Create; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Cell.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class CellDeleteRequest { + IdentifiableEntity body; + CellDeleteRequest(this.body); + Future> send() { + final command = Command.Cell_Delete; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Cell.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class CellUpdateRequest { + CellChangeset body; + CellUpdateRequest(this.body); + Future> send() { + final command = Command.Cell_Update; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = Cell.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class CellQueryRequest { + CellQuery body; + CellQueryRequest(this.body); + Future> send() { + final command = Command.Cell_Query; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = CellQueryResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class UserQueryRequest { + Uint8List? body; + UserQueryRequest(); + Future> send() { + final command = Command.User_Query; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = UserQueryResult.fromBuffer(response.body); + return left(pb); + } + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + + }); + } +} +class UserCheckRequest { + Uint8List? body; + UserCheckRequest(); + Future> send() { + final command = Command.User_Check; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = User.fromBuffer(response.body); + return left(pb); + } + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + + }); + } +} +class UserSignInRequest { + UserSignIn body; + UserSignInRequest(this.body); + Future> send() { + final command = Command.User_Sign_In; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = UserSignInResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class UserSignUpRequest { + UserSignUp body; + UserSignUpRequest(this.body); + Future> send() { + final command = Command.User_Sign_Up; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = UserSignUpResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class UserSignOutRequest { + UserSignOut body; + UserSignOutRequest(this.body); + Future> send() { + final command = Command.User_Sign_Out; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + return left(response); + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class UserActiveRequest { + User body; + UserActiveRequest(this.body); + Future> send() { + final command = Command.User_Active; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + return left(response); + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class UserMobileCodeRequest { + VerificationCodeRequest body; + UserMobileCodeRequest(this.body); + Future> send() { + final command = Command.User_Mobile_Code; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = VerificationCodeResponse.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class UserAuthInputRequest { + UserAuthInput body; + UserAuthInputRequest(this.body); + Future> send() { + final command = Command.User_Auth_Input; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = UserAuthInput.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class BucketSetRequest { + BucketItem body; + BucketSetRequest(this.body); + Future> send() { + final command = Command.Bucket_Set; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + return left(response); + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class BucketGetRequest { + BucketItem body; + BucketGetRequest(this.body); + Future> send() { + final command = Command.Bucket_Get; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncQuery(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = BucketItem.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class BucketDeleteRequest { + BucketItem body; + BucketDeleteRequest(this.body); + Future> send() { + final command = Command.Bucket_Delete; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + return left(response); + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} +class CSVImportRequest { + FlowyResource body; + CSVImportRequest(this.body); + Future> send() { + final command = Command.CSV_Import; + var request = RequestPacket.create() + ..command = command + ..id = uuid(); + return protobufToBytes(body).fold( + (req_bytes) { + request.body = req_bytes; + return asyncCommand(request).then((response) { + try { + if (response.hasErr()) { + return right(FlowyError.from(response)); + } else { + final pb = ShareResult.fromBuffer(response.body); + return left(pb); + } + + } catch (e, s) { + final error = FlowyError.fromError('error: ${e.runtimeType}. Stack trace: $s', StatusCode.ProtobufDeserializeError); + return right(error); + } + }); + }, + (err) => Future(() { + final error = FlowyError.fromError(err, StatusCode.ProtobufSerializeError); + return right(error); + }), + ); + } +} diff --git a/app_flowy/packages/flowy_sdk/lib/cqrs/cqrs.dart b/app_flowy/packages/flowy_sdk/lib/cqrs/cqrs.dart new file mode 100644 index 0000000000..feb88b3821 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/lib/cqrs/cqrs.dart @@ -0,0 +1,55 @@ +import 'package:dartz/dartz.dart'; +import 'package:flowy_protobuf/remote.dart'; +import 'package:infra/uuid.dart'; +import 'dart:typed_data'; +import 'package:flowy_protobuf/all.dart'; +import 'util.dart'; + +part 'auto_gen.dart'; + +class FlowyError { + late StatusCode _statusCode; + late String _error; + late bool _has_error; + + StatusCode get statusCode { + return _statusCode; + } + + String get error { + return _error; + } + + bool get has_error { + return _has_error; + } + + String toString() { + return "$_statusCode: $_error"; + } + + @override + bool operator ==(other) { + if (other is FlowyError) { + return (this.statusCode == other.statusCode && + this._error == other._error); + } else { + return false; + } + } + + FlowyError({required StatusCode statusCode, required String error}) { + _statusCode = statusCode; + _error = error; + _has_error = true; + } + + factory FlowyError.from(ResponsePacket resp) { + return FlowyError(statusCode: resp.statusCode, error: resp.err) + .._has_error = resp.hasErr(); + } + + factory FlowyError.fromError(String error, StatusCode statusCode) { + return FlowyError(statusCode: statusCode, error: error); + } +} diff --git a/app_flowy/packages/flowy_sdk/lib/cqrs/util.dart b/app_flowy/packages/flowy_sdk/lib/cqrs/util.dart new file mode 100644 index 0000000000..076d36df18 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/lib/cqrs/util.dart @@ -0,0 +1,77 @@ +import 'package:dartz/dartz.dart'; +import 'package:flowy_protobuf/remote.dart'; +// ignore: import_of_legacy_library_into_null_safe +import 'package:protobuf/protobuf.dart'; +import 'package:flowy_sdk/ffi/adaptor.dart'; +import 'dart:typed_data'; +import 'package:flowy_logger/flowy_logger.dart'; + +Either protobufToBytes( + T? message) { + try { + if (message != null) { + return left(message.writeToBuffer()); + } else { + return left(Uint8List.fromList([])); + } + } catch (e, s) { + return right( + 'FlowyFFI syncRequest error: ${e.runtimeType}. Stack trace: $s'); + } +} + +Future asyncCommand(RequestPacket request) { + try { + return FFIAdaptor.asyncRequest(request).future.then((value) { + try { + final resp = ResponsePacket.fromBuffer(value); + return Future.microtask(() => resp); + } catch (e, s) { + Log.error('FlowyFFI asyncRequest error: ${e.runtimeType}\n'); + Log.error('Stack trace \n $s'); + final resp = responseFromRequest( + request, "FlowyFFI asyncRequest error: ${e.runtimeType}"); + return Future.microtask(() => resp); + } + }); + } catch (e, s) { + Log.error('FlowyFFI asyncRequest error: ${e.runtimeType}\n'); + Log.error('Stack trace \n $s'); + final resp = responseFromRequest( + request, "FlowyFFI asyncRequest error: ${e.runtimeType}"); + return Future.microtask(() => resp); + } +} + +Future asyncQuery(RequestPacket request) { + try { + return FFIAdaptor.asyncQuery(request).future.then((value) { + try { + final resp = ResponsePacket.fromBuffer(value); + return Future.microtask(() => resp); + } catch (e, s) { + Log.error('FlowyFFI asyncRequest error: ${e.runtimeType}\n'); + Log.error('Stack trace \n $s'); + final resp = responseFromRequest( + request, "FlowyFFI asyncRequest error: ${e.runtimeType}"); + return Future.microtask(() => resp); + } + }); + } catch (e, s) { + Log.error('FlowyFFI asyncRequest error: ${e.runtimeType}\n'); + Log.error('Stack trace \n $s'); + final resp = responseFromRequest( + request, "FlowyFFI asyncRequest error: ${e.runtimeType}"); + return Future.microtask(() => resp); + } +} + +ResponsePacket responseFromRequest(RequestPacket request, String message) { + var resp = ResponsePacket(); + resp.id = request.id; + resp.statusCode = StatusCode.Fail; + resp.command = request.command; + resp.err = message; + + return resp; +} diff --git a/app_flowy/packages/flowy_sdk/lib/ffi/adaptor.dart b/app_flowy/packages/flowy_sdk/lib/ffi/adaptor.dart new file mode 100644 index 0000000000..c699f8dc2e --- /dev/null +++ b/app_flowy/packages/flowy_sdk/lib/ffi/adaptor.dart @@ -0,0 +1,129 @@ +import 'dart:ffi'; +// ignore: import_of_legacy_library_into_null_safe +import 'package:isolates/isolates.dart'; +// ignore: import_of_legacy_library_into_null_safe +import 'package:isolates/ports.dart'; +import 'package:ffi/ffi.dart'; + +import 'package:flowy_protobuf/model/grpc.pb.dart'; +import 'package:flutter/services.dart'; +import 'dart:async'; +import 'dart:typed_data'; +import 'package:flowy_sdk/ffi/ffi.dart' as ffi; + +enum FFIExceptionType { + RequestPacketIsEmpty, + InvalidResponseLength, + ResponsePacketIsInvalid, +} + +class FFIAdaptorException implements Exception { + FFIExceptionType type; + FFIAdaptorException(this.type); +} + +class FFIAdaptor { + static Completer asyncRequest(RequestPacket request) { + Uint8List bytes = request.writeToBuffer(); + + assert(bytes.isEmpty == false); + if (bytes.isEmpty) { + throw FFIAdaptorException(FFIExceptionType.RequestPacketIsEmpty); + } + + final Pointer input = calloc.allocate(bytes.length); + final list = input.asTypedList(bytes.length); + list.setAll(0, bytes); + + final completer = Completer(); + final port = singleCompletePort(completer); + ffi.async_command(port.nativePort, input, bytes.length); + calloc.free(input); + + return completer; + } + + static Completer asyncQuery(RequestPacket request) { + Uint8List bytes = request.writeToBuffer(); + assert(bytes.isEmpty == false); + if (bytes.isEmpty) { + throw FFIAdaptorException(FFIExceptionType.RequestPacketIsEmpty); + } + + final Pointer input = calloc.allocate(bytes.length); + final list = input.asTypedList(bytes.length); + list.setAll(0, bytes); + + final completer = Completer(); + final port = singleCompletePort(completer); + ffi.async_query(port.nativePort, input, bytes.length); + calloc.free(input); + + return completer; + } + + //https://suragch.medium.com/working-with-bytes-in-dart-6ece83455721 + static FFISafeUint8Wrapper syncRequest(RequestPacket request) { + Uint8List bytes; + try { + bytes = request.writeToBuffer(); + } catch (e, s) { + //TODO nathan: upload the log + print('Sync RequestPacket writeToBuffer error: ${e.runtimeType}'); + print('Stack trace \n $s'); + rethrow; + } + + assert(bytes.isEmpty == false); + if (bytes.isEmpty) { + throw FFIAdaptorException(FFIExceptionType.RequestPacketIsEmpty); + } + + final Pointer dartPtr = _pointerFromBytes(bytes); + Pointer rustPtr = ffi.sync_command(dartPtr, bytes.length); + calloc.free(dartPtr); + FFISafeUint8Wrapper safeWrapper; + try { + safeWrapper = FFISafeUint8Wrapper(rustPtr); + } catch (_) { + rethrow; + } + return safeWrapper; + } + + // inline? + static Pointer _pointerFromBytes(Uint8List bytes) { + final Pointer ptr = calloc.allocate(bytes.length); + final list = ptr.asTypedList(bytes.length); + list.setAll(0, bytes); + return ptr; + } +} + +class FFISafeUint8Wrapper { + Pointer _ptr; + int _responseBytesLen = 0; + int _markerBytesLen = 4; + FFISafeUint8Wrapper(this._ptr) { + try { + this._responseBytesLen = + ByteData.sublistView(_ptr.asTypedList(_markerBytesLen)) + .getUint32(0, Endian.big); + } catch (_) { + throw FFIAdaptorException(FFIExceptionType.RequestPacketIsEmpty); + } + + if (this._responseBytesLen < _markerBytesLen) { + throw FFIAdaptorException(FFIExceptionType.ResponsePacketIsInvalid); + } + } + + void destroy() { + ffi.free_rust(_ptr, _responseBytesLen + _markerBytesLen); + } + + Uint8List buffer() { + Pointer respPtr = _ptr.elementAt(_markerBytesLen); + return respPtr.asTypedList(_responseBytesLen); + } +} diff --git a/app_flowy/packages/flowy_sdk/lib/ffi/ffi.dart b/app_flowy/packages/flowy_sdk/lib/ffi/ffi.dart new file mode 100644 index 0000000000..e469b3535e --- /dev/null +++ b/app_flowy/packages/flowy_sdk/lib/ffi/ffi.dart @@ -0,0 +1,204 @@ +/// bindings for `libflowy_ffi` + +import 'dart:ffi'; +import 'dart:io'; +// ignore: import_of_legacy_library_into_null_safe +import 'package:ffi/ffi.dart' as ffi; +import 'package:flutter/foundation.dart' as Foundation; + +// ignore_for_file: unused_import, camel_case_types, non_constant_identifier_names +final DynamicLibrary _dl = _open(); + +/// Reference to the Dynamic Library, it should be only used for low-level access +final DynamicLibrary dl = _dl; +DynamicLibrary _open() { + if (is_tester()) { + return DynamicLibrary.open( + '${Directory.systemTemp.path}/app_flowy/libflowy_ffi.dylib'); + } else { + if (Platform.isAndroid) return DynamicLibrary.open('libflowy_ffi.so'); + if (Platform.isMacOS) return DynamicLibrary.executable(); + if (Platform.isIOS) return DynamicLibrary.executable(); + throw UnsupportedError('This platform is not supported.'); + } +} + +/// C function `async_command`. +void async_command( + int port, + Pointer input, + int len, +) { + _invoke_async(port, input, len); +} + +final _invoke_async_Dart _invoke_async = + _dl.lookupFunction<_invoke_async_C, _invoke_async_Dart>('async_command'); +typedef _invoke_async_C = Void Function( + Int64 port, + Pointer input, + Uint64 len, +); +typedef _invoke_async_Dart = void Function( + int port, + Pointer input, + int len, +); + +/// C function `command_sync`. +Pointer sync_command( + Pointer input, + int len, +) { + return _invoke_sync(input, len); +} + +final _invoke_sync_Dart _invoke_sync = + _dl.lookupFunction<_invoke_sync_C, _invoke_sync_Dart>('sync_command'); +typedef _invoke_sync_C = Pointer Function( + Pointer input, + Uint64 len, +); +typedef _invoke_sync_Dart = Pointer Function( + Pointer input, + int len, +); + +/// C function `async_query`. +void async_query( + int port, + Pointer input, + int len, +) { + _invoke_async_query(port, input, len); +} + +final _invoke_async_query_Dart _invoke_async_query = + _dl.lookupFunction<_invoke_async_query_C, _invoke_async_query_Dart>( + 'async_query'); +typedef _invoke_async_query_C = Void Function( + Int64 port, + Pointer input, + Uint64 len, +); +typedef _invoke_async_query_Dart = void Function( + int port, + Pointer input, + int len, +); + +/// C function `free_rust`. +void free_rust( + Pointer input, + int len, +) { + _free_rust(input, len); +} + +final _free_rust_Dart _free_rust = + _dl.lookupFunction<_free_rust_C, _free_rust_Dart>('free_rust'); +typedef _free_rust_C = Void Function( + Pointer input, + Uint64 len, +); +typedef _free_rust_Dart = void Function( + Pointer input, + int len, +); + +/// C function `init_stream`. +int init_stream(int port) { + return _init_stream(port); +} + +final _init_stream_Dart _init_stream = + _dl.lookupFunction<_init_stream_C, _init_stream_Dart>('init_stream'); + +typedef _init_stream_C = Int32 Function( + Int64 port, +); +typedef _init_stream_Dart = int Function( + int port, +); + +/// C function `init_logger`. +int init_logger() { + return _init_logger(); +} + +final _init_logger_Dart _init_logger = + _dl.lookupFunction<_init_logger_C, _init_logger_Dart>('init_logger'); +typedef _init_logger_C = Int64 Function(); +typedef _init_logger_Dart = int Function(); + +/// C function `init_sdk`. +int init_sdk( + Pointer path, +) { + return _init_sdk(path); +} + +final _init_sdk_Dart _init_sdk = + _dl.lookupFunction<_init_sdk_C, _init_sdk_Dart>('init_sdk'); +typedef _init_sdk_C = Int64 Function( + Pointer path, +); +typedef _init_sdk_Dart = int Function( + Pointer path, +); + +/// C function `link_me_please`. +void link_me_please() { + _link_me_please(); +} + +final _link_me_please_Dart _link_me_please = _dl + .lookupFunction<_link_me_please_C, _link_me_please_Dart>('link_me_please'); +typedef _link_me_please_C = Void Function(); +typedef _link_me_please_Dart = void Function(); + +/// Binding to `allo-isolate` crate +void store_dart_post_cobject( + Pointer)>> ptr, +) { + _store_dart_post_cobject(ptr); +} + +final _store_dart_post_cobject_Dart _store_dart_post_cobject = _dl + .lookupFunction<_store_dart_post_cobject_C, _store_dart_post_cobject_Dart>( + 'store_dart_post_cobject'); +typedef _store_dart_post_cobject_C = Void Function( + Pointer)>> ptr, +); +typedef _store_dart_post_cobject_Dart = void Function( + Pointer)>> ptr, +); + +/// C function `setup_logger`. +void setup_logger( + Pointer ptr, +) { + _setup_logger(ptr); +} + +final _setup_logger_Dart _setup_logger = + _dl.lookupFunction<_setup_logger_C, _setup_logger_Dart>('setup_logger'); +typedef _setup_logger_C = Void Function( + Pointer ptr, +); +typedef _setup_logger_Dart = void Function( + Pointer ptr, +); + +bool is_tester() { + if (Foundation.kDebugMode) { + // ignore: unnecessary_null_comparison + if (Platform.executable == null) { + return false; + } else { + return Platform.executable.contains("tester"); + } + } else { + return false; + } +} diff --git a/app_flowy/packages/flowy_sdk/lib/ffi/rust_to_flutter_stream.dart b/app_flowy/packages/flowy_sdk/lib/ffi/rust_to_flutter_stream.dart new file mode 100644 index 0000000000..a88a9b6d2a --- /dev/null +++ b/app_flowy/packages/flowy_sdk/lib/ffi/rust_to_flutter_stream.dart @@ -0,0 +1,54 @@ +import 'dart:isolate'; +import 'dart:async'; +import 'dart:typed_data'; +import 'dart:ffi'; +import 'package:flowy_logger/flowy_logger.dart'; +import 'package:flowy_protobuf/model/observable.pb.dart'; + +typedef ObserverCallback = void Function(ObservableSubject observable); + +class R2FStream { + static R2FStream shared = R2FStream._internal(); + late RawReceivePort _ffiPort; + late StreamController _streamController; + late StreamController _observableController; + late StreamSubscription _ffiSubscription; + + int get port => _ffiPort.sendPort.nativePort; + StreamController get observable => _observableController; + + R2FStream._internal() { + _ffiPort = RawReceivePort(); + _streamController = StreamController(); + _observableController = StreamController.broadcast(); + + _ffiPort.handler = _streamController.add; + _ffiSubscription = _streamController.stream.listen(streamCallback); + } + + factory R2FStream() { + return shared; + } + + static listen(void Function(ObservableSubject subject) callback) { + R2FStream.shared.observable.stream.listen(callback); + } + + void streamCallback(Uint8List bytes) { + try { + final observable = ObservableSubject.fromBuffer(bytes); + _observableController.add(observable); + } catch (e, s) { + Log.error('FFIStream handleReceviedBytes error: ${e.runtimeType}'); + Log.error('Stack trace \n $s'); + rethrow; + } + } + + Future dispose() async { + await _ffiSubscription.cancel(); + await _streamController.close(); + await _observableController.close(); + _ffiPort.close(); + } +} diff --git a/app_flowy/packages/flowy_sdk/lib/flowy_sdk.dart b/app_flowy/packages/flowy_sdk/lib/flowy_sdk.dart new file mode 100644 index 0000000000..e1a1dc8524 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/lib/flowy_sdk.dart @@ -0,0 +1,34 @@ +export 'cqrs/cqrs.dart'; +export 'package:async/async.dart'; + +import 'dart:io'; +import 'dart:async'; +import 'package:flutter/services.dart'; +import 'dart:ffi'; +import 'ffi/rust_to_flutter_stream.dart'; +import 'ffi/ffi.dart' as ffi; +import 'package:ffi/ffi.dart'; + +class FlowySDK { + static const MethodChannel _channel = MethodChannel('flowy_sdk'); + static Future get platformVersion async { + final String version = await _channel.invokeMethod('getPlatformVersion'); + return version; + } + + const FlowySDK(); + + void dispose() { + R2FStream.shared.dispose(); + } + + Future init(Directory sdkDir) async { + final port = R2FStream.shared.port; + ffi.init_stream(port); + + ffi.init_logger(); + ffi.store_dart_post_cobject(NativeApi.postCObject); + print("Application document directory: ${sdkDir.absolute}"); + ffi.init_sdk(sdkDir.path.toNativeUtf8()); + } +} diff --git a/app_flowy/packages/flowy_sdk/macos/Classes/FlowySdkPlugin.swift b/app_flowy/packages/flowy_sdk/macos/Classes/FlowySdkPlugin.swift new file mode 100644 index 0000000000..320d758f2c --- /dev/null +++ b/app_flowy/packages/flowy_sdk/macos/Classes/FlowySdkPlugin.swift @@ -0,0 +1,23 @@ +import Cocoa +import FlutterMacOS + +public class FlowySdkPlugin: NSObject, FlutterPlugin { + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel(name: "flowy_sdk", binaryMessenger: registrar.messenger) + let instance = FlowySdkPlugin() + registrar.addMethodCallDelegate(instance, channel: channel) + } + + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + switch call.method { + case "getPlatformVersion": + result("macOS " + ProcessInfo.processInfo.operatingSystemVersionString) + default: + result(FlutterMethodNotImplemented) + } + } + + public static func dummyMethodToEnforceBundling() { + link_me_please() + } +} diff --git a/app_flowy/packages/flowy_sdk/macos/Classes/binding.h b/app_flowy/packages/flowy_sdk/macos/Classes/binding.h new file mode 100644 index 0000000000..9ac0b90249 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/macos/Classes/binding.h @@ -0,0 +1,22 @@ +#include +#include +#include +#include + +int64_t init_logger(); + +int64_t init_sdk(char *path); + +int32_t init_stream(int64_t port); + +void async_command(int64_t port, const uint8_t *input, uintptr_t len); + +void async_query(int64_t port, const uint8_t *input, uintptr_t len); + +const uint8_t *sync_command(const uint8_t *input, uintptr_t len); + +void free_rust( + uint8_t *ptr, + uint32_t length); + +void link_me_please(void); \ No newline at end of file diff --git a/app_flowy/packages/flowy_sdk/macos/flowy_sdk.podspec b/app_flowy/packages/flowy_sdk/macos/flowy_sdk.podspec new file mode 100644 index 0000000000..79b009d92e --- /dev/null +++ b/app_flowy/packages/flowy_sdk/macos/flowy_sdk.podspec @@ -0,0 +1,24 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint flowy_sdk.podspec' to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'flowy_sdk' + s.version = '0.0.1' + s.summary = 'A new flutter plugin project.' + s.description = <<-DESC +A new flutter plugin project. + DESC + s.homepage = 'http://example.com' + s.license = { :file => '../LICENSE' } + s.author = { 'Your Company' => 'email@example.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'FlutterMacOS' + + s.platform = :osx, '10.11' + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } + s.swift_version = '5.0' + # s.static_framework = true + s.vendored_libraries = "libflowy_ffi.dylib" +end diff --git a/app_flowy/packages/flowy_sdk/pubspec.lock b/app_flowy/packages/flowy_sdk/pubspec.lock new file mode 100644 index 0000000000..29eacfab55 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/pubspec.lock @@ -0,0 +1,511 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "20.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.7" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.10" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "1.12.2" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.12" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.2" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "7.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "3.6.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + dartz: + dependency: "direct main" + description: + name: dartz + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.0-nullsafety.2" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + ffi: + dependency: "direct main" + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.0" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.11" + flowy_logger: + dependency: "direct main" + description: + path: "../flowy_logger" + relative: true + source: path + version: "0.0.1" + flowy_protobuf: + dependency: "direct main" + description: + path: "../flowy_protobuf" + relative: true + source: path + version: "0.0.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.1" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + infra: + dependency: "direct main" + description: + path: "../infra" + relative: true + source: path + version: "0.0.1" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.4" + isolates: + dependency: "direct main" + description: + name: isolates + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.3+8" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + logger: + dependency: transitive + description: + name: logger + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.0" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" + protobuf: + dependency: transitive + description: + name: protobuf + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.9" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + time: + dependency: transitive + description: + name: time + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+3" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" diff --git a/app_flowy/packages/flowy_sdk/pubspec.yaml b/app_flowy/packages/flowy_sdk/pubspec.yaml new file mode 100644 index 0000000000..e90d63afb0 --- /dev/null +++ b/app_flowy/packages/flowy_sdk/pubspec.yaml @@ -0,0 +1,79 @@ +name: flowy_sdk +description: A new flutter plugin project. +version: 0.0.1 +author: +homepage: +publish_to: 'none' + +environment: + sdk: ">=2.12.0-0 <3.0.0" + flutter: ">=1.20.0" + +dependencies: + flutter: + sdk: flutter + ffi: ^1.0.0 + isolates: ^3.0.3+8 + flowy_logger: + path: ../flowy_logger + flowy_protobuf: + path: ../flowy_protobuf + infra: + path: ../infra + dartz: '0.10.0-nullsafety.2' + freezed_annotation: ^0.14.1 + +dev_dependencies: + flutter_test: + sdk: flutter + build_runner: '1.12.2' + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + # This section identifies this Flutter project as a plugin project. + # The 'pluginClass' and Android 'package' identifiers should not ordinarily + # be modified. They are used by the tooling to maintain consistency when + # adding or updating assets for this project. + plugin: + platforms: + android: + package: com.plugin.flowy_sdk + pluginClass: FlowySdkPlugin + ios: + pluginClass: FlowySdkPlugin + macos: + pluginClass: FlowySdkPlugin + + # To add assets to your plugin package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # To add custom fonts to your plugin package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/app_flowy/packages/flowy_sdk/test/flowy_sdk_test.dart b/app_flowy/packages/flowy_sdk/test/flowy_sdk_test.dart new file mode 100644 index 0000000000..f19b9258bf --- /dev/null +++ b/app_flowy/packages/flowy_sdk/test/flowy_sdk_test.dart @@ -0,0 +1,23 @@ +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:flowy_sdk/flowy_sdk.dart'; + +void main() { + const MethodChannel channel = MethodChannel('flowy_sdk'); + + TestWidgetsFlutterBinding.ensureInitialized(); + + setUp(() { + channel.setMockMethodCallHandler((MethodCall methodCall) async { + return '42'; + }); + }); + + tearDown(() { + channel.setMockMethodCallHandler(null); + }); + + test('getPlatformVersion', () async { + expect(await FlowySDK.platformVersion, '42'); + }); +} diff --git a/app_flowy/packages/flowy_style/.gitignore b/app_flowy/packages/flowy_style/.gitignore new file mode 100644 index 0000000000..a247422ef7 --- /dev/null +++ b/app_flowy/packages/flowy_style/.gitignore @@ -0,0 +1,75 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/ephemeral +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 diff --git a/app_flowy/packages/flowy_style/.metadata b/app_flowy/packages/flowy_style/.metadata new file mode 100644 index 0000000000..f46c92994f --- /dev/null +++ b/app_flowy/packages/flowy_style/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: fa5883b78e566877613ad1ccb48dd92075cb5c23 + channel: dev + +project_type: package diff --git a/app_flowy/packages/flowy_style/CHANGELOG.md b/app_flowy/packages/flowy_style/CHANGELOG.md new file mode 100644 index 0000000000..41cc7d8192 --- /dev/null +++ b/app_flowy/packages/flowy_style/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/app_flowy/packages/flowy_style/LICENSE b/app_flowy/packages/flowy_style/LICENSE new file mode 100644 index 0000000000..ba75c69f7f --- /dev/null +++ b/app_flowy/packages/flowy_style/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/app_flowy/packages/flowy_style/README.md b/app_flowy/packages/flowy_style/README.md new file mode 100644 index 0000000000..c5c5afe55d --- /dev/null +++ b/app_flowy/packages/flowy_style/README.md @@ -0,0 +1,14 @@ +# flowy_style + +A new Flutter package project. + +## Getting Started + +This project is a starting point for a Dart +[package](https://flutter.dev/developing-packages/), +a library module containing code that can be shared easily across +multiple Flutter or Dart projects. + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/app_flowy/packages/flowy_style/analysis_options.yaml b/app_flowy/packages/flowy_style/analysis_options.yaml new file mode 100644 index 0000000000..ccef0be1f7 --- /dev/null +++ b/app_flowy/packages/flowy_style/analysis_options.yaml @@ -0,0 +1,9 @@ +include: package:flutter_lints/flutter.yaml + +analyzer: + exclude: + - "**/*.g.dart" + - "**/*.freezed.dart" + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/app_flowy/packages/flowy_style/lib/route/animation.dart b/app_flowy/packages/flowy_style/lib/route/animation.dart new file mode 100644 index 0000000000..265380353a --- /dev/null +++ b/app_flowy/packages/flowy_style/lib/route/animation.dart @@ -0,0 +1,83 @@ +import 'package:animations/animations.dart'; +import 'package:flutter/material.dart'; + +typedef PageBuilder = Widget Function(); + +class PageRoutes { + static const double kDefaultDuration = .35; + static const Curve kDefaultEaseFwd = Curves.easeOut; + static const Curve kDefaultEaseReverse = Curves.easeOut; + + static Route fade(PageBuilder pageBuilder, + [double duration = kDefaultDuration]) { + return PageRouteBuilder( + transitionDuration: Duration(milliseconds: (duration * 1000).round()), + pageBuilder: (context, animation, secondaryAnimation) => pageBuilder(), + transitionsBuilder: (context, animation, secondaryAnimation, child) { + return FadeTransition(opacity: animation, child: child); + }, + ); + } + + static Route fadeThrough(PageBuilder pageBuilder, + [double duration = kDefaultDuration]) { + return PageRouteBuilder( + transitionDuration: Duration(milliseconds: (duration * 1000).round()), + pageBuilder: (context, animation, secondaryAnimation) => pageBuilder(), + transitionsBuilder: (context, animation, secondaryAnimation, child) { + return FadeThroughTransition( + animation: animation, + secondaryAnimation: secondaryAnimation, + child: child); + }, + ); + } + + static Route fadeScale(PageBuilder pageBuilder, + [double duration = kDefaultDuration]) { + return PageRouteBuilder( + transitionDuration: Duration(milliseconds: (duration * 1000).round()), + pageBuilder: (context, animation, secondaryAnimation) => pageBuilder(), + transitionsBuilder: (context, animation, secondaryAnimation, child) { + return FadeScaleTransition(animation: animation, child: child); + }, + ); + } + + static Route sharedAxis(PageBuilder pageBuilder, + [SharedAxisTransitionType type = SharedAxisTransitionType.scaled, + double duration = kDefaultDuration]) { + return PageRouteBuilder( + transitionDuration: Duration(milliseconds: (duration * 1000).round()), + pageBuilder: (context, animation, secondaryAnimation) => pageBuilder(), + transitionsBuilder: (context, animation, secondaryAnimation, child) { + return SharedAxisTransition( + child: child, + animation: animation, + secondaryAnimation: secondaryAnimation, + transitionType: type, + ); + }, + ); + } + + static Route slide(PageBuilder pageBuilder, + {double duration = kDefaultDuration, + Offset startOffset = const Offset(1, 0), + Curve easeFwd = kDefaultEaseFwd, + Curve easeReverse = kDefaultEaseReverse}) { + return PageRouteBuilder( + transitionDuration: Duration(milliseconds: (duration * 1000).round()), + pageBuilder: (context, animation, secondaryAnimation) => pageBuilder(), + transitionsBuilder: (context, animation, secondaryAnimation, child) { + bool reverse = animation.status == AnimationStatus.reverse; + return SlideTransition( + position: Tween(begin: startOffset, end: Offset(0, 0)) + .animate(CurvedAnimation( + parent: animation, curve: reverse ? easeReverse : easeFwd)), + child: child, + ); + }, + ); + } +} diff --git a/app_flowy/packages/flowy_style/lib/text_style.dart b/app_flowy/packages/flowy_style/lib/text_style.dart new file mode 100644 index 0000000000..0d4d0f2538 --- /dev/null +++ b/app_flowy/packages/flowy_style/lib/text_style.dart @@ -0,0 +1,87 @@ +import 'package:flutter/material.dart'; +import 'package:textstyle_extensions/textstyle_extensions.dart'; + +class Fonts { + static const String lato = "Lato"; + + static const String quicksand = "Quicksand"; + + static const String emoji = "OpenSansEmoji"; +} + +class FontSizes { + static double get scale => 1; + + static double get s11 => 11 * scale; + + static double get s12 => 12 * scale; + + static double get s14 => 14 * scale; + + static double get s16 => 16 * scale; + + static double get s18 => 18 * scale; +} + +// ignore: non_constant_identifier_names +class TextStyles { + static const TextStyle lato = TextStyle( + fontFamily: Fonts.lato, + fontWeight: FontWeight.w400, + letterSpacing: 0, + height: 1, + fontFamilyFallback: [ + Fonts.emoji, + ], + ); + + static const TextStyle quicksand = TextStyle( + fontFamily: Fonts.quicksand, + fontWeight: FontWeight.w400, + fontFamilyFallback: [ + Fonts.emoji, + ], + ); + + // ignore: non_constant_identifier_names + static TextStyle get T1 => quicksand.bold.size(FontSizes.s14).letterSpace(.7); + + // ignore: non_constant_identifier_names + static TextStyle get T2 => lato.bold.size(FontSizes.s12).letterSpace(.4); + + // ignore: non_constant_identifier_names + static TextStyle get H1 => lato.bold.size(FontSizes.s14); + + // ignore: non_constant_identifier_names + static TextStyle get H2 => lato.bold.size(FontSizes.s12); + + // ignore: non_constant_identifier_names + static TextStyle get Body1 => lato.size(FontSizes.s14); + + // ignore: non_constant_identifier_names + static TextStyle get Body2 => lato.size(FontSizes.s12); + + // ignore: non_constant_identifier_names + static TextStyle get Body3 => lato.size(FontSizes.s11); + + // ignore: non_constant_identifier_names + static TextStyle get Callout => + quicksand.size(FontSizes.s14).letterSpace(1.75); + + // ignore: non_constant_identifier_names + static TextStyle get CalloutFocus => Callout.bold; + + // ignore: non_constant_identifier_names + static TextStyle get Btn => + quicksand.bold.size(FontSizes.s14).letterSpace(1.75); + + // ignore: non_constant_identifier_names + static TextStyle get BtnSelected => + quicksand.size(FontSizes.s14).letterSpace(1.75); + + // ignore: non_constant_identifier_names + static TextStyle get Footnote => quicksand.bold.size(FontSizes.s11); + + // ignore: non_constant_identifier_names + static TextStyle get Caption => lato.size(FontSizes.s11).letterSpace(.3); +} diff --git a/app_flowy/packages/flowy_style/lib/theme.dart b/app_flowy/packages/flowy_style/lib/theme.dart new file mode 100644 index 0000000000..0346578fee --- /dev/null +++ b/app_flowy/packages/flowy_style/lib/theme.dart @@ -0,0 +1,100 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:infra/color.dart'; + +enum ThemeType { + light, + dark, +} + +class AppTheme { + static ThemeType defaultTheme = ThemeType.light; + + bool isDark; + late Color bg1; // + late Color surface; // + late Color bg2; + late Color accent1; + late Color accent1Dark; + late Color accent1Darker; + late Color accent2; + late Color accent3; + late Color grey; + late Color greyStrong; + late Color greyWeak; + late Color error; + late Color focus; + + late Color txt; + late Color accentTxt; + + /// Default constructor + AppTheme({this.isDark = true}) { + txt = isDark ? Colors.white : Colors.black; + accentTxt = isDark ? Colors.black : Colors.white; + } + + /// fromType factory constructor + factory AppTheme.fromType(ThemeType t) { + switch (t) { + case ThemeType.light: + return AppTheme(isDark: false) + ..bg1 = const Color(0xfff1f7f0) + ..bg2 = const Color(0xffc1dcbc) + ..surface = Colors.white + ..accent1 = const Color(0xff00a086) + ..accent1Dark = const Color(0xff00856f) + ..accent1Darker = const Color(0xff006b5a) + ..accent2 = const Color(0xfff09433) + ..accent3 = const Color(0xff5bc91a) + ..greyWeak = const Color(0xff909f9c) + ..grey = const Color(0xff515d5a) + ..greyStrong = const Color(0xff151918) + ..error = Colors.red.shade900 + ..focus = const Color(0xFF0ee2b1); + + case ThemeType.dark: + return AppTheme(isDark: true) + ..bg1 = const Color(0xff121212) + ..bg2 = const Color(0xff2c2c2c) + ..surface = const Color(0xff252525) + ..accent1 = const Color(0xff00a086) + ..accent1Dark = const Color(0xff00caa5) + ..accent1Darker = const Color(0xff00caa5) + ..accent2 = const Color(0xfff19e46) + ..accent3 = const Color(0xff5BC91A) + ..greyWeak = const Color(0xffa8b3b0) + ..grey = const Color(0xffced4d3) + ..greyStrong = const Color(0xffffffff) + ..error = const Color(0xffe55642) + ..focus = const Color(0xff0ee2b1); + } + } + + ThemeData get themeData { + var t = ThemeData.from( + textTheme: (isDark ? ThemeData.dark() : ThemeData.light()).textTheme, + colorScheme: ColorScheme( + brightness: isDark ? Brightness.dark : Brightness.light, + primary: accent1, + primaryVariant: accent1Darker, + secondary: accent2, + secondaryVariant: ColorUtils.shiftHsl(accent2, -.2), + background: bg1, + surface: surface, + onBackground: txt, + onSurface: txt, + onError: txt, + onPrimary: accentTxt, + onSecondary: accentTxt, + error: error), + ); + return t.copyWith( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + highlightColor: accent1, + toggleableActiveColor: accent1); + } + + Color shift(Color c, double d) => + ColorUtils.shiftHsl(c, d * (isDark ? -1 : 1)); +} diff --git a/app_flowy/packages/flowy_style/lib/time/duration.dart b/app_flowy/packages/flowy_style/lib/time/duration.dart new file mode 100644 index 0000000000..b880cc4f18 --- /dev/null +++ b/app_flowy/packages/flowy_style/lib/time/duration.dart @@ -0,0 +1,16 @@ +import 'package:time/time.dart'; +export 'package:time/time.dart'; + +class Durations { + static Duration get fastest => .15.seconds; + + static Duration get fast => .25.seconds; + + static Duration get medium => .35.seconds; + + static Duration get slow => .7.seconds; +} + +class RouteDurations { + static Duration get slow => .7.seconds; +} diff --git a/app_flowy/packages/flowy_style/lib/time/prelude.dart b/app_flowy/packages/flowy_style/lib/time/prelude.dart new file mode 100644 index 0000000000..45ecdea60c --- /dev/null +++ b/app_flowy/packages/flowy_style/lib/time/prelude.dart @@ -0,0 +1,2 @@ +export "duration.dart"; +export 'package:time/time.dart'; diff --git a/app_flowy/packages/flowy_style/pubspec.lock b/app_flowy/packages/flowy_style/pubspec.lock new file mode 100644 index 0000000000..dbbf063842 --- /dev/null +++ b/app_flowy/packages/flowy_style/pubspec.lock @@ -0,0 +1,210 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + animations: + dependency: "direct main" + description: + name: animations + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + dartz: + dependency: "direct main" + description: + name: dartz + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.0-nullsafety.2" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + infra: + dependency: "direct main" + description: + path: "../infra" + relative: true + source: path + version: "0.0.1" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + textstyle_extensions: + dependency: "direct main" + description: + name: textstyle_extensions + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0-nullsafety" + time: + dependency: "direct main" + description: + name: time + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/app_flowy/packages/flowy_style/pubspec.yaml b/app_flowy/packages/flowy_style/pubspec.yaml new file mode 100644 index 0000000000..73ebd8011e --- /dev/null +++ b/app_flowy/packages/flowy_style/pubspec.yaml @@ -0,0 +1,61 @@ +name: flowy_style +description: A new Flutter package project. +version: 0.0.1 +homepage: +publish_to: 'none' + +environment: + sdk: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + infra: + path: ../infra + time: '>=2.0.0' + textstyle_extensions: '2.0.0-nullsafety' + animations: ^2.0.0 + dartz: '0.10.0-nullsafety.2' + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^1.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/app_flowy/packages/flowy_style/test/flowy_style_test.dart b/app_flowy/packages/flowy_style/test/flowy_style_test.dart new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/app_flowy/packages/flowy_style/test/flowy_style_test.dart @@ -0,0 +1 @@ + diff --git a/app_flowy/packages/infra/.gitignore b/app_flowy/packages/infra/.gitignore new file mode 100644 index 0000000000..a247422ef7 --- /dev/null +++ b/app_flowy/packages/infra/.gitignore @@ -0,0 +1,75 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/ephemeral +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 diff --git a/app_flowy/packages/infra/.metadata b/app_flowy/packages/infra/.metadata new file mode 100644 index 0000000000..f46c92994f --- /dev/null +++ b/app_flowy/packages/infra/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: fa5883b78e566877613ad1ccb48dd92075cb5c23 + channel: dev + +project_type: package diff --git a/app_flowy/packages/infra/CHANGELOG.md b/app_flowy/packages/infra/CHANGELOG.md new file mode 100644 index 0000000000..41cc7d8192 --- /dev/null +++ b/app_flowy/packages/infra/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/app_flowy/packages/infra/LICENSE b/app_flowy/packages/infra/LICENSE new file mode 100644 index 0000000000..ba75c69f7f --- /dev/null +++ b/app_flowy/packages/infra/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/app_flowy/packages/infra/README.md b/app_flowy/packages/infra/README.md new file mode 100644 index 0000000000..a458e2da17 --- /dev/null +++ b/app_flowy/packages/infra/README.md @@ -0,0 +1,14 @@ +# infra + +A new Flutter package project. + +## Getting Started + +This project is a starting point for a Dart +[package](https://flutter.dev/developing-packages/), +a library module containing code that can be shared easily across +multiple Flutter or Dart projects. + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/app_flowy/packages/infra/analysis_options.yaml b/app_flowy/packages/infra/analysis_options.yaml new file mode 100644 index 0000000000..a5744c1cfb --- /dev/null +++ b/app_flowy/packages/infra/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/app_flowy/packages/infra/lib/color.dart b/app_flowy/packages/infra/lib/color.dart new file mode 100644 index 0000000000..02af0d687a --- /dev/null +++ b/app_flowy/packages/infra/lib/color.dart @@ -0,0 +1,25 @@ +import 'dart:ui'; + +import 'package:flutter/cupertino.dart'; + +class ColorUtils { + static Color shiftHsl(Color c, [double amt = 0]) { + var hslc = HSLColor.fromColor(c); + return hslc.withLightness((hslc.lightness + amt).clamp(0.0, 1.0)).toColor(); + } + + static Color parseHex(String value) => + Color(int.parse(value.substring(1, 7), radix: 16) + 0xFF000000); + + static Color blend(Color dst, Color src, double opacity) { + return Color.fromARGB( + 255, + (dst.red.toDouble() * (1.0 - opacity) + src.red.toDouble() * opacity) + .toInt(), + (dst.green.toDouble() * (1.0 - opacity) + src.green.toDouble() * opacity) + .toInt(), + (dst.blue.toDouble() * (1.0 - opacity) + src.blue.toDouble() * opacity) + .toInt(), + ); + } +} diff --git a/app_flowy/packages/infra/lib/uuid.dart b/app_flowy/packages/infra/lib/uuid.dart new file mode 100644 index 0000000000..df8aee9dda --- /dev/null +++ b/app_flowy/packages/infra/lib/uuid.dart @@ -0,0 +1,5 @@ +import 'package:uuid/uuid.dart'; + +String uuid() { + return const Uuid().v4(); +} diff --git a/app_flowy/packages/infra/pubspec.lock b/app_flowy/packages/infra/pubspec.lock new file mode 100644 index 0000000000..31e0c4fa0b --- /dev/null +++ b/app_flowy/packages/infra/pubspec.lock @@ -0,0 +1,182 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + time: + dependency: "direct main" + description: + name: time + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + uuid: + dependency: "direct main" + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/app_flowy/packages/infra/pubspec.yaml b/app_flowy/packages/infra/pubspec.yaml new file mode 100644 index 0000000000..3a079eb02b --- /dev/null +++ b/app_flowy/packages/infra/pubspec.yaml @@ -0,0 +1,57 @@ +name: infra +description: A new Flutter package project. +version: 0.0.1 +homepage: +publish_to: 'none' + +environment: + sdk: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + time: '>=2.0.0' + uuid: ">=2.2.2" + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^1.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/app_flowy/packages/infra/test/infra_test.dart b/app_flowy/packages/infra/test/infra_test.dart new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/app_flowy/packages/infra/test/infra_test.dart @@ -0,0 +1 @@ + diff --git a/app_flowy/pubspec.lock b/app_flowy/pubspec.lock new file mode 100644 index 0000000000..4caf2001f8 --- /dev/null +++ b/app_flowy/pubspec.lock @@ -0,0 +1,695 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "22.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.1" + animations: + dependency: transitive + description: + name: animations + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.1" + bloc: + dependency: transitive + description: + name: bloc + url: "https://pub.dartlang.org" + source: hosted + version: "7.0.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "7.0.0" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + dartz: + dependency: transitive + description: + name: dartz + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.0-nullsafety.2" + equatable: + dependency: "direct main" + description: + name: equatable + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + flowy_logger: + dependency: transitive + description: + path: "packages/flowy_logger" + relative: true + source: path + version: "0.0.1" + flowy_protobuf: + dependency: "direct main" + description: + path: "packages/flowy_protobuf" + relative: true + source: path + version: "0.0.1" + flowy_sdk: + dependency: "direct main" + description: + path: "packages/flowy_sdk" + relative: true + source: path + version: "0.0.1" + flowy_style: + dependency: "direct main" + description: + path: "packages/flowy_style" + relative: true + source: path + version: "0.0.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + url: "https://pub.dartlang.org" + source: hosted + version: "7.0.1" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.2" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.2" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + get_it: + dependency: "direct main" + description: + name: get_it + url: "https://pub.dartlang.org" + source: hosted + version: "7.1.3" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + infra: + dependency: transitive + description: + path: "packages/infra" + relative: true + source: path + version: "0.0.1" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + isolates: + dependency: transitive + description: + name: isolates + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.3+8" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + logger: + dependency: transitive + description: + name: logger + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + path_provider: + dependency: "direct main" + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.1" + protobuf: + dependency: transitive + description: + name: protobuf + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + provider: + dependency: transitive + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.4" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + textstyle_extensions: + dependency: transitive + description: + name: textstyle_extensions + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0-nullsafety" + time: + dependency: "direct main" + description: + name: time + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + window_size: + dependency: "direct main" + description: + path: "plugins/window_size" + ref: e48abe7c3e9ebfe0b81622167c5201d4e783bb81 + resolved-ref: e48abe7c3e9ebfe0b81622167c5201d4e783bb81 + url: "git://github.com/google/flutter-desktop-embedding.git" + source: git + version: "0.1.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" +sdks: + dart: ">=2.13.0 <3.0.0" + flutter: ">=1.20.0" diff --git a/app_flowy/pubspec.yaml b/app_flowy/pubspec.yaml new file mode 100644 index 0000000000..72d88d79bd --- /dev/null +++ b/app_flowy/pubspec.yaml @@ -0,0 +1,110 @@ +name: app_flowy +description: A new Flutter project. + +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.12.0 <3.0.0" + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + flowy_sdk: + path: packages/flowy_sdk + flowy_protobuf: + path: packages/flowy_protobuf + flowy_style: + path: packages/flowy_style + + # third party packages + time: '>=2.0.0' + equatable: '>=2.0.2' + freezed_annotation: + get_it: '>=7.1.3' + flutter_bloc: '>=7.0.1' + path_provider: ">=1.6.24" + window_size: + git: + url: git://github.com/google/flutter-desktop-embedding.git + path: plugins/window_size + ref: e48abe7c3e9ebfe0b81622167c5201d4e783bb81 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + build_runner: + freezed: '>=0.14.2' + flutter_lints: ^1.0.0 + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - assets/images/ + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/app_flowy/test/widget_test.dart b/app_flowy/test/widget_test.dart new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/app_flowy/test/widget_test.dart @@ -0,0 +1 @@ + diff --git a/app_flowy/web/favicon.png b/app_flowy/web/favicon.png new file mode 100644 index 0000000000..8aaa46ac1a Binary files /dev/null and b/app_flowy/web/favicon.png differ diff --git a/app_flowy/web/icons/Icon-192.png b/app_flowy/web/icons/Icon-192.png new file mode 100644 index 0000000000..b749bfef07 Binary files /dev/null and b/app_flowy/web/icons/Icon-192.png differ diff --git a/app_flowy/web/icons/Icon-512.png b/app_flowy/web/icons/Icon-512.png new file mode 100644 index 0000000000..88cfd48dff Binary files /dev/null and b/app_flowy/web/icons/Icon-512.png differ diff --git a/app_flowy/web/index.html b/app_flowy/web/index.html new file mode 100644 index 0000000000..501ec3737b --- /dev/null +++ b/app_flowy/web/index.html @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + app_flowy + + + + + + + diff --git a/app_flowy/web/manifest.json b/app_flowy/web/manifest.json new file mode 100644 index 0000000000..05b16ccb95 --- /dev/null +++ b/app_flowy/web/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "app_flowy", + "short_name": "app_flowy", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/doc/architecture.md b/doc/architecture.md new file mode 100644 index 0000000000..71f97e649d --- /dev/null +++ b/doc/architecture.md @@ -0,0 +1,193 @@ +# AppFlowy Architecture +This documentation introduces the Domain-Driven Design and the design of AppFlowy. Feel free to skip the first part +if you know what Domain-Driven Design is. +* Basic Concepts + * Layered architecture + * Domain Driven Design + +* AppFlowy Design + * Overview + * Operation Flow + * Create + * Read + * Update + * Delete + +# Basic Concepts + +## Layered architecture +The most common architecture pattern is the layered architecture pattern, known as the n-tier architecture pattern. +Partition the software into `layers` to reduce the complexity. Each layer of the layered architecture pattern has a +specific role and responsibility. + +## Domain Driven Design +For many architects, the process of data modeling is driven by intuition. However, there are well-formulated methodologies +for approaching it more formally. I recommend the [Domain-Driven Design](https://en.wikipedia.org/wiki/Domain-driven_design) +and choose it as AppFlowy architecture. + +DDD consists of four layers. + +``` + ┌──────────────────────────────────────────────────┐ ─────────▶ + │ Presentation Layer │──┐ Dependency + └──────────────────────────────────────────────────┘ │ + │ │ + ▼ │ + ┌──────────────────────────────────────────────────┐ │ + │ Application Layer │ │ + └──────────────────────────────────────────────────┘ │ + │ │ + ▼ │ + ┌──────────────────────────────────────────────────┐ │ + │ Domain Layer │◀─┘ + └──────────────────────────────────────────────────┘ + ▲ + │ + ┌──────────────────────────────────────────────────┐ + │ Infrastructure Layer │ + └──────────────────────────────────────────────────┘ + + ▲ + │ + Level of ├───────────────────┐ + Abstraction │ Presentation │ + ├───────────────────┴───────┐ + │ Application │ + ├───────────────────────────┴─────────┐ + │ Domain │ + ├─────────────────────────────────────┴────────┐ + │ Infrastructure │ + └──────────────────────────────────────────────┴─────▶ + Complexity +``` + +**Presentation**: +* Responsible for presenting information to the user and interpreting user commands. +* Consists of Widgets and also the state of the Widgets. + +**Application**: +* Defines the jobs the software is supposed to do. (Shouldn't find any UI code or network code) +* Coordinates the application activity and delegates work to the next layer down. +* It doesn't contain any complex business logic but the basic validation on the user input before + passing to the other layer. + +**Domain**: +* Responsible for representing concepts of the business. +* Manages the business state or delegated to the infrastructure layer. +* Self contained and it doesn't depend on any other layers. Domain should be well isolated from the + other layers. + +**Infrastructure**: + +This layer acts as a supporting library for all the other layers. It deals with APIs, +databases and network, etc. + +DDD classifies data as referenceable objects, or entities, and non-referenceable objects, or values. + +**Entity** + +user, order, book, table. They are referenceable because they carry an identity which +allows us to reference them. + +**Value** + +email, phone number, name, age, description. They can't be referenced. They can be only included into +entities and serve as attributes. Values could be simple or could be composite. + +**Aggregate** + +entities can be grouped into aggregates. Aggregates can simplify the model by accessing th entire +aggregate. For instance, Table has lots of row. Each row using the table_id to reference to the +table. TableAggregate includes two entities: Table and the Row. + +``` + TableAggregate + ┌────────────────────────────────────────────────────────────────┐ + │ │ + │ ┌────────────────────┐ ┌─────────────────────────┐ │ + │ │struct Table { │ │struct Row { │ │ + │ │ id: String, │ │ table_id: String, │ │ + │ │ desc: String, │◀▶───────│} │ │ + │ │} │ │ │ │ + │ └────────────────────┘ └─────────────────────────┘ │ + │ │ + └────────────────────────────────────────────────────────────────┘ +``` + +DDD also introduces `Service` and `Repository`. + +**Service** + +When a significant process of transformation in the domain is not a natural responsibility of an `Entity` or `Value object`, add +an operation to the model as standalone interface declared as a Service. For instance: The `Value object`, EmailAddress, +uses the function `validateEmailAddress` to verify the email address is valid or not. `Service` exists in Application, Domain and +Infrastructure. + +``` +class EmailAddress { + final Either, String> value; + + factory EmailAddress(String? input) { + return EmailAddress._( + validateEmailAddress(input), + ); + } + + const EmailAddress._(this.value); +} + + +Either, String> validateEmailAddress(String? input) { + ... +} +``` + +**Repository** + +Repository offer an interface to retrieve and persist aggregates. They hide the database or network details from the domain. +The Repository interfaces are declared in the Domain Layer, but the repositories themselves are implemented in the Infrastructure Layer. +You can replace the interface implementation without impacting the domain layer. For instance: + +``` +// Interface: +abstract class AuthInterface { + ... +} + +// Implementation +class AuthRepository implements AuthInterface { + ... +} +``` +More often than not, the repository interface can be divided into sub-repository in order to reduce the complexity. + +## AppFlowy Design + +The AppFlowy Client consists of lots of modules. Each of them follows the DDD design pattern and using [dependency injection](https://levelup.gitconnected.com/dependency-injection-in-swift-bc16d66b038b) +to communication with other module. + +``` + Client + ┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ │ + │ User Editor Setting │ + │ ┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐ │ + │ │ presentation │ Dependency │ presentation │ │ presentation │ │ + │ │ │ Injection │ │ │ │ │ + │ │ application ├───────────────▶│ application │ │ application │ │ + │ │ │◀───────────────│ │ │ │ ◉ ◉ ◉ │ + │ │ domain │ │ domain │ │ domain │ │ + │ │ │ │ │ │ │ │ + │ │ Infrastructure │ │ Infrastructure │ │ Infrastructure │ │ + │ └───────────────────┘ └───────────────────┘ └───────────────────┘ │ + │ ▲ │ │ + │ │ Dependency Injection │ │ + │ └─────────────────────────────────────────────────────────────┘ │ + │ │ + └──────────────────────────────────────────────────────────────────────────────────────────────────────┘ +``` + +Let's dig it how can I construct each module. I take `User` module for demonstration. + + +# Event-Driven \ No newline at end of file diff --git a/doc/imgs/ddd_big_pic.png b/doc/imgs/ddd_big_pic.png new file mode 100644 index 0000000000..1f05b56df1 Binary files /dev/null and b/doc/imgs/ddd_big_pic.png differ diff --git a/scripts/makefile/db.toml b/scripts/makefile/db.toml new file mode 100644 index 0000000000..3abea8e265 --- /dev/null +++ b/scripts/makefile/db.toml @@ -0,0 +1,8 @@ +[tasks.setup-diesel] +script = [ + """ + brew install sqlite3 + cargo install diesel_cli --no-default-features --features sqlite + """, +] +script_runner = "@shell" diff --git a/scripts/makefile/desktop.toml b/scripts/makefile/desktop.toml new file mode 100644 index 0000000000..b5fdafb44e --- /dev/null +++ b/scripts/makefile/desktop.toml @@ -0,0 +1,103 @@ + +[tasks.desktop] +category = "Build" +dependencies = ["cqrs_gen", "desktop-debug", "desktop-release", "post-desktop"] +description = "Build desktop targets" + +[tasks.desktop-debug] +condition = { env_true = ["DEV"] } +env = { DESKTOP_TARGET = "x86_64-apple-darwin" } +private = true +run_task = { name = ["desktop-build", "post-desktop-dylib-to-system"] } + + +[tasks.desktop-release] +condition = { env_true = ["RELEASE"] } +env = { DESKTOP_TARGET = "x86_64-apple-darwin" } +private = true +run_task = "desktop-build" + +[tasks.desktop-build] +# args = ["build", "--target", "${DESKTOP_TARGET}"] +category = "Build" +# command = "cargo" +condition = { platforms = ["mac"], env_true = ["DEV"] } +dependencies = ["export-env", "setup-crate-type-macos"] +description = "Build desktop targets." +script = [ + """ + cd rust-lib/ + cargo build --package=flowy-ffi --target ${DESKTOP_TARGET} + cd ../ + """, +] + +[tasks.post-desktop] +condition = { platforms = ["mac"] } +dependencies = ["restore-crate-type"] +script = [ + """ + cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/x86_64-apple-darwin/${LIB_OUT_DIR}/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib \ + ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/flutter-lib/packages/flowy_sdk/macos/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib + """, + """ + cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/binding.h \ + ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/flutter-lib/packages/flowy_sdk/macos/Classes/binding.h + """, +] +script_runner = "@duckscript" + +[tasks.setup-crate-type-macos] +env = { TARGET_OS = "macos" } +private = true +run_task = "setup-crate-type" + +[tasks.export-env] +script = [ + """ +# Try to fix the issue +# ld: warning: dylib (/Users/vedon/Documents/Private/RustProject/App-Flowy/app_flowy/flutter-lib/packages/flowy_sdk/macos/libflowy_ffi.dylib) was built for newer macOS version (10.15) than being linked (10.11) +# ld: warning: dylib (/Users/vedon/Documents/Private/RustProject/App-Flowy/app_flowy/flutter-lib/packages/flowy_sdk/macos/libflowy_ffi.dylib) was built for newer macOS version (10.15) than being linked (10.11) +# https://users.rust-lang.org/t/compile-rust-binary-for-older-versions-of-mac-osx/38695/3 +# https://stackoverflow.com/questions/43216273/object-file-was-built-for-newer-osx-version-than-being-linked + + + export MACOSX_DEPLOYMENT_TARGET=10.11 + """, +] +script_runner = "@shell" + +[tasks.post-desktop-dylib-to-system] +condition = { platforms = ["mac"] } +script = [ + """ + target_path = set ${TMPDIR}/app_flowy/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib + echo "remove old dylib" + rm ${target_path} + echo "copy new dylib to system" + cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/x86_64-apple-darwin/${LIB_OUT_DIR}/lib${CARGO_MAKE_CRATE_FS_NAME}.dylib ${target_path} + """, +] +script_runner = "@duckscript" + +[tasks.clean-flowy-sdk] +condition = { platforms = ["mac"] } +script = [ + """ + cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/flutter-lib/packages/flowy_sdk + flutter clean + """, +] +script_runner = "@shell" + + +[tasks.cqrs_gen] +script = [ + """ + manifest_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/tool/rust-tool/Cargo.toml + cqrs_file=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-store/src/entities/command.rs + output_file=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/flutter-lib/packages/flowy_sdk/lib/cqrs/auto_gen.dart + cargo run --manifest-path ${manifest_path} flutter --cqrs=${cqrs_file} --output=${output_file} + """, +] +script_runner = "@shell" diff --git a/scripts/makefile/flutter.toml b/scripts/makefile/flutter.toml new file mode 100644 index 0000000000..b82d1252da --- /dev/null +++ b/scripts/makefile/flutter.toml @@ -0,0 +1,25 @@ +[tasks.freeze_setup] +script = [ + """ + flutter clean + flutter pub get + flutter pub run build_runner build --delete-conflicting-outputs + """, +] +script_runner = "@shell" + +[tasks.freeze_watch] +script = [ + """ + flutter pub run build_runner watch + """, +] +script_runner = "@shell" + +[tasks.add_platform] +description = "Add platform support" +script = [""" + flutter create --template=plugin --platforms=${@} . + """] +script_runner = "@shell" + diff --git a/scripts/makefile/pb.toml b/scripts/makefile/pb.toml new file mode 100644 index 0000000000..c9d7d7359a --- /dev/null +++ b/scripts/makefile/pb.toml @@ -0,0 +1,49 @@ + + +[tasks.pb_init_setup_dev] +description = "Setup protobuf" +script = [ + """ + brew tap dart-lang/dart + brew install dart + pub global activate protoc_plugin + cargo install --force --version 2.18.0 protobuf-codegen + """, +] +script_runner = "@shell" + +[tasks.gen_pb_file] +script = [ + """ + pb_gen_exec=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/tool/rust-tool/Cargo.toml + proto_source_file=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-store/src/entities/ + proto_define_dir=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-protobuf/define + derive_file=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-ast/src/auto_gen_file/category_from_str.rs + rust_mod_file=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-protobuf/src/model/mod.rs + flutter_mod_file=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/flutter-lib/packages/flowy_protobuf/lib/all.dart + cargo run --manifest-path ${pb_gen_exec} pb-gen -i=${proto_source_file} --derive_file=${derive_file} --proto_define_dir=${proto_define_dir} --rust_mod_file=${rust_mod_file} --flutter_mod_file=${flutter_mod_file} + """, +] +script_runner = "@shell" + +[tasks.gen_rust_pb] +script = [ + """ + protoc --rust_out=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-protobuf/src/model \ + --proto_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-protobuf/define \ + ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-protobuf/define/*.proto + """, +] +script_runner = "@shell" + +[tasks.gen_dart_pb] +script = [ + """ + dart_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/flutter-lib/packages/flowy_protobuf/lib/model + pb_define_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-protobuf/define + pb_proto_files=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-protobuf/define/*.proto + rm -rf ${dart_path}/* + protoc --dart_out=${dart_path} --proto_path=${pb_define_path} ${pb_proto_files} + """, +] +script_runner = "@shell" diff --git a/scripts/makefile/tool.toml b/scripts/makefile/tool.toml new file mode 100644 index 0000000000..042dc1542a --- /dev/null +++ b/scripts/makefile/tool.toml @@ -0,0 +1,81 @@ +[tasks.rust_env_setup] +dependencies = ["rustup", "add_targets", "rust_tools"] +description = "Setup the rust env" + +[tasks.rustup] +script = [ + """ + sudo xcode-select -s /Applications/Xcode.app/Contents/Developer + curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y + echo 'export PATH="$$HOME/.cargo/bin:$$PATH"' >> ~/.bash_profile + source ~/.bash_profile + """, +] +script_runner = "@shell" + +[tasks.add_compile_targets] +script = [ + """ + rustup target add aarch64-linux-android + rustup target add arm-linux-androideabi + rustup target add armv7-linux-androideabi + rustup target add i686-linux-android + rustup target add aarch64-apple-ios + rustup target add x86_64-apple-ios + rustup target add x86_64-apple-darwin + """, +] +script_runner = "@shell" + +[tasks.rust_tools] +script = [ + """ + # cargo install clog-cli --force +# cargo install cargo-cache + rustup component add rustfmt + cargo install ripgrep + cargo install rusty-hook + cargo install cargo-expand + """, +] +script_runner = "@shell" + +[tasks.fmt] +args = ["fmt", "--", "--emit=files"] +command = "cargo" +install_crate = "rustfmt" +[tasks.rust_commit_hook] +script = [ + """ + manifest_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/tool/rust-tool/Cargo.toml + cargo run --manifest-path ${manifest_path} hook --commit --path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib + """, +] +script_runner = "@shell" + +[tasks.reset_db] +script = [ + """ + tool=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/tool/rust-tool/Cargo.toml + cargo run --manifest-path ${tool} db --reset + """, +] +script_runner = "@shell" + +[tasks.plantuml] +script = [""" + brew cask install java + brew install graphviz + """] +script_runner = "@shell" + +# For the system Java wrappers to find this JDK, symlink it with +# sudo ln -sfn /Users/weidongfu/Documents/tools/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk +# This is a beta version of openjdk for Apple Silicon +# (openjdk 16 preview). + +# openjdk is keg-only, which means it was not symlinked into /Users/weidongfu/Documents/tools/homebrew, +# because it shadows the macOS `java` wrapper. + +# If you need to have openjdk first in your PATH run: +# echo 'export PATH="/Users/weidongfu/Documents/tools/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc