Merge branch 'develop' of github.com:AppFlowy-IO/AppFlowy into refactor-tauri-document

This commit is contained in:
qinluhe 2023-04-11 10:45:11 +08:00
commit d42084f242
458 changed files with 9825 additions and 3845 deletions

View File

@ -0,0 +1,27 @@
<!---
Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw).
-->
<!---
If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section.
-->
### Feature Preview
<!---
List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example:
fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106
-->
---
<!---
Before you mark this PR ready for review, run through this checklist!
-->
#### PR Checklist
- [ ] My code adheres to the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides)
- [ ] I've listed at least one issue that this PR fixes in the description above.
- [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
- [ ] All existing tests are passing.

View File

@ -16,7 +16,7 @@ on:
- "frontend/**"
env:
FLUTTER_VERSION: "3.3.9"
FLUTTER_VERSION: "3.7.5"
RUST_TOOLCHAIN: "1.65"
jobs:

View File

@ -35,7 +35,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.3.9"
flutter-version: "3.7.5"
cache: true
- name: Cache Cargo
@ -56,15 +56,16 @@ jobs:
- name: Setup Environment
run: |
cargo install --force cargo-make
cargo install --force duckscript_cli
if [ "$RUNNER_OS" == "Linux" ]; then
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
sudo apt-get update
sudo apt-get install -y dart curl build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
sudo apt-get install keybinder-3.0
elif [ "$RUNNER_OS" == "Windows" ]; then
vcpkg integrate install
cargo install --force duckscript_cli
elif [ "$RUNNER_OS" == "macOS" ]; then
echo 'do nothing'
fi
@ -77,17 +78,6 @@ jobs:
cargo install cargo-make
cargo make appflowy-flutter-deps-tools
- name: Build Test lib
working-directory: frontend
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
cargo make --profile production-linux-x86_64 appflowy
elif [ "$RUNNER_OS" == "macOS" ]; then
cargo make --profile production-mac-x86_64 appflowy
elif [ "$RUNNER_OS" == "Windows" ]; then
cargo make --profile production-windows-x86 appflowy
fi
- name: Config Flutter
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
@ -99,22 +89,27 @@ jobs:
fi
shell: bash
- name: Flutter Code Generation
working-directory: frontend/appflowy_flutter
- name: Build Test lib
working-directory: frontend
run: |
flutter packages pub get
flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json
flutter packages pub run build_runner build --delete-conflicting-outputs
if [ "$RUNNER_OS" == "Linux" ]; then
cargo make --profile development-linux-x86_64 appflowy-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
cargo make --profile development-mac-x86_64 appflowy-dev
elif [ "$RUNNER_OS" == "Windows" ]; then
cargo make --profile development-windows-x86 appflowy-dev
fi
shell: bash
- name: Run AppFlowy tests
working-directory: frontend/appflowy_flutter
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
flutter test integration_test -d Linux --coverage
flutter test integration_test/runner.dart -d Linux --coverage
elif [ "$RUNNER_OS" == "macOS" ]; then
flutter test integration_test -d macOS --coverage
flutter test integration_test/runner.dart -d macOS --coverage
elif [ "$RUNNER_OS" == "Windows" ]; then
flutter test integration_test -d Windows --coverage
flutter test integration_test/runner.dart -d Windows --coverage
fi
shell: bash
@ -125,4 +120,3 @@ jobs:
# env_vars: ${{ matrix.os }}
# fail_ci_if_error: true
# verbose: true

View File

@ -3,10 +3,10 @@ name: release
on:
push:
tags:
- '*'
- "*"
env:
FLUTTER_VERSION: "3.3.9"
FLUTTER_VERSION: "3.7.5"
RUST_TOOLCHAIN: "1.65"
jobs:
@ -136,7 +136,11 @@ jobs:
fail-fast: false
matrix:
job:
- { target: x86_64-apple-darwin, os: macos-10.15, extra-build-args: "" }
- {
target: x86_64-apple-darwin,
os: macos-10.15,
extra-build-args: "",
}
steps:
- name: Checkout source code
uses: actions/checkout@v3
@ -172,7 +176,7 @@ jobs:
working-directory: frontend
run: |
flutter config --enable-macos-desktop
cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-mac-x86_64 appflowy
dart ./scripts/flutter_release_build/build_flowy.dart . ${{ github.ref_name }}
- name: Create macOS dmg
run: |
@ -225,9 +229,21 @@ jobs:
fail-fast: false
matrix:
job:
- { arch: x86_64, target: x86_64-unknown-linux-gnu, os: ubuntu-20.04, extra-build-args: "", flutter_profile: production-linux-x86_64 }
- {
arch: x86_64,
target: x86_64-unknown-linux-gnu,
os: ubuntu-20.04,
extra-build-args: "",
flutter_profile: production-linux-x86_64,
}
# - { arch: aarch64, target: aarch64-unknown-linux-gnu, os: ubuntu-20.04, extra-build-args: "", flutter_profile: production-linux-aarch64 }
- { arch: x86_64, target: x86_64-unknown-linux-gnu, os: ubuntu-18.04, extra-build-args: "", flutter_profile: production-linux-x86_64}
- {
arch: x86_64,
target: x86_64-unknown-linux-gnu,
os: ubuntu-18.04,
extra-build-args: "",
flutter_profile: production-linux-x86_64,
}
steps:
- name: Checkout source code
uses: actions/checkout@v3
@ -275,7 +291,7 @@ jobs:
working-directory: frontend
run: |
flutter config --enable-linux-desktop
cargo make --env APP_VERSION=${{ github.ref_name }} --profile ${{ matrix.job.flutter_profile}} appflowy
dart ./scripts/flutter_release_build/build_flowy.dart . ${{ github.ref_name }}
- name: Archive Assert
working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}
@ -324,6 +340,7 @@ jobs:
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_PACKAGE_NAME }}
asset_name: ${{ env.LINUX_PACKAGE_NAME }}
asset_content_type: application/octet-stream
@ -352,3 +369,12 @@ jobs:
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/appflowy_client:${{ github.ref_name }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/af_build_cache:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/af_build_cache:buildcache,mode=max
notify-discord:
runs-on: ubuntu-latest
needs: [build-for-linux, build-for-windows, build-for-macOS]
steps:
- name: Notify Discord
run: |
curl -H "Content-Type: application/json" -d '{"username": "release@appflowy", "content": "🎉 AppFlowy ${{ github.ref_name }} is available. https://github.com/AppFlowy-IO/AppFlowy/releases/tag/'${{ github.ref_name }}'"}' "https://discord.com/api/webhooks/${{ secrets.DISCORD }}"
shell: bash

View File

@ -20,7 +20,7 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: "1.65"
FLUTTER_VERSION: "3.3.9"
FLUTTER_VERSION: "3.7.5"
jobs:
test-on-ubuntu:

View File

@ -11,7 +11,7 @@ on:
env:
CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.3.9"
FLUTTER_VERSION: "3.7.5"
RUST_TOOLCHAIN: "1.65"
jobs:

2
.gitignore vendored
View File

@ -35,3 +35,5 @@ pubspec.lock
.githooks/gitlint
.githooks/gitlint.exe
.fvm/
**/AppFlowy-Collab/

View File

@ -1,5 +1,12 @@
# Release Notes
## Version 0.1.2 - 03/28/2023
### Bug Fixes
- Fix: update calendar selected range.
- Fix: duplicate view.
## Version 0.1.1 - 03/21/2023
### New features

View File

@ -44,16 +44,16 @@ You are in charge of your data and customizations.
<p align="center"><img src="https://github.com/AppFlowy-IO/appflowy/blob/main/doc/imgs/howtostar.gif" alt="AppFlowy Github - how to star the repo" width="100%" /></p>
## Getting Started with development
Please view the [documentation](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy) for OS specific development instructions
## Roadmap
- [AppFlowy Roadmap ReadMe](https://appflowy.gitbook.io/docs/essential-documentation/roadmap)
- [AppFlowy Public Roadmap](https://github.com/orgs/AppFlowy-IO/projects/5/views/12)
* [AppFlowy Roadmap ReadMe](https://appflowy.gitbook.io/docs/essential-documentation/roadmap)
* [AppFlowy Public Roadmap](https://github.com/orgs/AppFlowy-IO/projects/5/views/12)
If you'd like to propose a feature, submit a feature request [here](https://github.com/AppFlowy-IO/AppFlowy/issues/new?assignees=&labels=&template=feature_request.yaml&title=%5BFR%5D+) <br/>
If you'd like to report a bug, submit bug report [here](https://github.com/AppFlowy-IO/AppFlowy/issues/new?assignees=&labels=&template=bug_report.yaml&title=%5BBug%5D+)
If you'd like to report a bug, submit a bug report [here](https://github.com/AppFlowy-IO/AppFlowy/issues/new?assignees=&labels=&template=bug_report.yaml&title=%5BBug%5D+)
## **Releases**
@ -61,37 +61,37 @@ Please see the [changelog](https://www.appflowy.io/whatsnew) for more details ab
## Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. Please look at [Contributing to AppFlowy](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/contributing-to-appflowy) for details.
Contributions make the open-source community a fantastic place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. Please look at [Contributing to AppFlowy](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/contributing-to-appflowy) for details.
If your Pull Request is accepted as it fixes a bug, adds functionality, or makes AppFlowy's codebase significantly easier to use or understand, congratulations! If your administrative and managerial work behind the scenes that sustains the community as a whole, congratulations! You are now an official contributor to AppFlowy. Get in touch with us ([link](https://tally.so/r/mKP5z3)) to receive the very special Contributor T-shirt!
If your Pull Request is accepted as it fixes a bug, adds functionality, or makes AppFlowy's codebase significantly easier to use or understand, **Congratulations!** If your administrative and managerial work behind the scenes sustains the community, **Congratulations!** You are now an official contributor to AppFlowy. Get in touch with us ([link](https://tally.so/r/mKP5z3)) to receive the very special Contributor T-shirt!
Proudly wear your T-shirt and show it to us by tagging [@appflowy](https://twitter.com/appflowy) on Twitter.
## Join the community to build AppFlowy together
## Join the community to build AppFlowy together!
<a href="https://github.com/AppFlowy-IO/AppFlowy/graphs/contributors">
<img src="https://contrib.rocks/image?repo=AppFlowy-IO/AppFlowy" />
</a>
## Why Are We Building This?
Notion has been our favorite project and knowledge management tool in recent years because of its aesthetic appeal and functionality. Our team uses it daily, and we are on its paid plan. However, as we all know Notion has its limitations. These include weak data security and poor compatibility with mobile devices. Likewise, alternative collaborative workplace management tools also have their constraints.
Notion has been our favourite project and knowledge management tool in recent years because of its aesthetic appeal and functionality. Our team uses it daily, and we are on its paid plan. However, as we all know, Notion has its limitations. These include weak data security and poor compatibility with mobile devices. Likewise, alternative collaborative workplace management tools also have their constraints.
The limitations we encountered using these tools rooted in our past work experience with collaborative productivity tools lead to our firm belief that there is, and will be a glass ceiling on what's possible in the future for tools like Notion. This emanates from these tools probable struggles to scale horizontally at some point. It implies that they will likely be forced to prioritize for a proportion of customers whose needs can be quite different from the rest. While decision-makers want a workplace OS, the truth is that it is not very possible to come up with a one-size fits all solution in such a fragmented market.
The limitations we encountered using these tools and our past work experience with collaborative productivity tools have led to our firm belief that there is a glass ceiling on what's possible for these tools in the future. This emanates from the fact that these tools will probably struggle to scale horizontally at some point and be forced to prioritize a proportion of customers whose needs differ from the rest. While decision-makers want a workplace OS, it is impossible to come up with a one-size fits all solution in such a fragmented market.
When a customer's evolving core needs are not satisfied, they either switch to another or build one from the ground up, in-house. Consequently, they either go under another ceiling or buy an expensive ticket to learn a hard lesson. This is a requirement for many resources and expertise, building a reliable and easy-to-use collaborative tool, not to mention the speed and native experience. The same may apply to individual users as well.
All these restrictions necessitate our mission - to make it possible for anyone to create apps that suit their needs well.
- To individuals, we would like to offer Notion's functionality along with data security and cross-platform native experience.
- To enterprises and hackers, AppFlowy is dedicated to offering building blocks, that is, collaboration infra services to enable you to make apps on your own. Moreover, you have 100% control of your data. You can design and modify AppFlowy your way, with a single codebase written in Flutter and Rust supporting multiple platforms armed with long-term maintainability.
* To individuals, we would like to offer Notion's functionality, data security, and cross-platform native experience.
* To enterprises and hackers, AppFlowy is dedicated to offering building blocks and collaboration infra services to enable you to make apps on your own. Moreover, you have 100% control of your data. You can design and modify AppFlowy your way, with a single codebase written in Flutter and Rust supporting multiple platforms armed with long-term maintainability.
We decided to achieve this mission by upholding the three most fundamental values:
- Data privacy first
- Reliable native experience
- Community-driven extensibility
* Data privacy first
* Reliable native experience
* Community-driven extensibility
To be honest, we do not claim to outperform Notion in terms of functionality and design, at least for now. Besides, our priority doesn't lie in more functionality at the moment. Instead, we would like to cultivate a community to democratize the knowledge and wheels of making complex workplace management tools, while enabling people and businesses to create beautiful things on their own by equipping them with a versatile toolbox of building blocks.
We do not claim to outperform Notion in terms of functionality and design, at least for now. Besides, our priority doesn't lie in more functionality at the moment. Instead, we would like to cultivate a community to democratize the knowledge and wheels of making complex workplace management tools while enabling people and businesses to create beautiful things on their own by equipping them with a versatile toolbox of building blocks.
## License
@ -101,6 +101,6 @@ Distributed under the AGPLv3 License. See [`LICENSE.md`](https://github.com/AppF
Special thanks to these amazing projects which help power AppFlowy.IO:
- [flutter-quill](https://github.com/singerdmx/flutter-quill)
- [cargo-make](https://github.com/sagiegurari/cargo-make)
- [contrib.rocks](https://contrib.rocks)
* [flutter-quill](https://github.com/singerdmx/flutter-quill)
* [cargo-make](https://github.com/sagiegurari/cargo-make)
* [contrib.rocks](https://contrib.rocks)

View File

@ -12,8 +12,8 @@
"type": "dart",
"preLaunchTask": "AF: Build Appflowy Core",
"env": {
// "RUST_LOG": "trace",
"RUST_LOG": "debug"
"RUST_LOG": "trace",
// "RUST_LOG": "debug"
},
"cwd": "${workspaceRoot}/appflowy_flutter"
},

View File

@ -1,223 +1,225 @@
{
"version": "2.0.0",
// https://code.visualstudio.com/docs/editor/tasks
// https://gist.github.com/deadalusai/9e13e36d61ec7fb72148
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
"tasks": [
{
"label": "AF: Clean + Rebuild All",
"type": "shell",
"dependsOrder": "sequence",
"dependsOn": [
"AF: Dart Clean",
"AF: Flutter Clean",
"AF: Build Appflowy Core",
"AF: Flutter Pub Get",
"AF: Flutter Package Get",
"AF: Generate Language Files",
"AF: Generate Freezed Files"
],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "AF: Clean + Rebuild All (Android)",
"type": "shell",
"dependsOrder": "sequence",
"dependsOn": [
"AF: Dart Clean",
"AF: Flutter Clean",
"AF: Build Appflowy Core_for_android",
"AF: Flutter Pub Get",
"AF: Flutter Package Get",
"AF: Generate Language Files",
"AF: Generate Freezed Files"
],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "AF: Build Appflowy Core_for_android",
"type": "shell",
"command": "cargo make --profile development-android appflowy-core-dev-android",
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Build Appflowy Core",
"type": "shell",
"windows": {
"command": "cargo make --profile development-windows-x86 appflowy-core-dev"
},
"linux": {
"command": "cargo make --profile \"development-linux-$(uname -m)\" appflowy-core-dev"
},
"osx": {
"command": "cargo make --profile \"development-mac-$(uname -m)\" appflowy-core-dev"
},
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Code Gen",
"type": "shell",
"dependsOrder": "sequence",
"dependsOn": [
"AF: Flutter Clean",
"AF: Flutter Pub Get",
"AF: Flutter Package Get",
"AF: Generate Language Files",
"AF: Generate Freezed Files"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "AF: Flutter Clean",
"type": "shell",
"command": "flutter clean",
"options": {
"cwd": "${workspaceFolder}/appflowy_flutter"
}
},
{
"label": "AF: Flutter Pub Get",
"type": "shell",
"command": "flutter pub get",
"options": {
"cwd": "${workspaceFolder}/appflowy_flutter"
}
},
{
"label": "AF: Flutter Package Get",
"type": "shell",
"command": "flutter packages pub get",
"options": {
"cwd": "${workspaceFolder}/appflowy_flutter"
}
},
{
"label": "AF: Generate Freezed Files",
"type": "shell",
"command": "flutter pub run build_runner build --delete-conflicting-outputs",
"options": {
"cwd": "${workspaceFolder}/appflowy_flutter"
}
},
{
"label": "AF: Generate Language Files",
"type": "shell",
"command": "sh ./scripts/generate_language_files.sh",
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c",
".\\scripts\\generate_language_files.cmd"
]
}
}
},
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Flutter Clean",
"type": "shell",
"command": "cargo make flutter_clean",
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: flutter build aar",
"type": "flutter",
"command": "flutter",
"args": [
"build",
"aar"
],
"group": "build",
"problemMatcher": [],
"detail": "appflowy_flutter"
},
{
"label": "AF: Tauri UI Dev",
"type": "shell",
"isBackground": true,
"command": "yarn",
"args": ["dev"],
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
},
{
"label": "AF: Tauri UI Build",
"type": "shell",
"command": "npm run build",
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
},
{
"label": "AF: Tauri Dev",
"type": "shell",
"command": "npm run tauri:dev",
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
},
{
"label": "AF: Tauri Clean",
"type": "shell",
"command": "cargo make tauri_clean",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Tauri Clean + Dev",
"type": "shell",
"dependsOrder": "sequence",
"dependsOn": [
"AF: Tauri Clean",
"AF: Tauri UI Dev"
],
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Tauri ESLint",
"type": "shell",
"command": "npx eslint --fix src",
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
},
]
}
"version": "2.0.0",
// https://code.visualstudio.com/docs/editor/tasks
// https://gist.github.com/deadalusai/9e13e36d61ec7fb72148
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
"tasks": [
{
"label": "AF: Clean + Rebuild All",
"type": "shell",
"dependsOrder": "sequence",
"dependsOn": [
"AF: Dart Clean",
"AF: Flutter Clean",
"AF: Build Appflowy Core",
"AF: Flutter Pub Get",
"AF: Flutter Package Get",
"AF: Generate Language Files",
"AF: Generate Freezed Files"
],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "AF: Clean + Rebuild All (Android)",
"type": "shell",
"dependsOrder": "sequence",
"dependsOn": [
"AF: Dart Clean",
"AF: Flutter Clean",
"AF: Build Appflowy Core_for_android",
"AF: Flutter Pub Get",
"AF: Flutter Package Get",
"AF: Generate Language Files",
"AF: Generate Freezed Files"
],
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "AF: Build Appflowy Core_for_android",
"type": "shell",
"command": "cargo make --profile development-android appflowy-core-dev-android",
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Build Appflowy Core",
"type": "shell",
"windows": {
"command": "cargo make --profile development-windows-x86 appflowy-core-dev"
},
"linux": {
"command": "cargo make --profile \"development-linux-$(uname -m)\" appflowy-core-dev"
},
"osx": {
"command": "cargo make --profile \"development-mac-$(uname -m)\" appflowy-core-dev"
},
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Code Gen",
"type": "shell",
"dependsOrder": "sequence",
"dependsOn": [
"AF: Flutter Clean",
"AF: Flutter Pub Get",
"AF: Flutter Package Get",
"AF: Generate Language Files",
"AF: Generate Freezed Files"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "AF: Flutter Clean",
"type": "shell",
"command": "flutter clean",
"options": {
"cwd": "${workspaceFolder}/appflowy_flutter"
}
},
{
"label": "AF: Flutter Pub Get",
"type": "shell",
"command": "flutter pub get",
"options": {
"cwd": "${workspaceFolder}/appflowy_flutter"
}
},
{
"label": "AF: Flutter Package Get",
"type": "shell",
"command": "flutter packages pub get",
"options": {
"cwd": "${workspaceFolder}/appflowy_flutter"
}
},
{
"label": "AF: Generate Freezed Files",
"type": "shell",
"command": "flutter pub run build_runner build --delete-conflicting-outputs",
"options": {
"cwd": "${workspaceFolder}/appflowy_flutter"
}
},
{
"label": "AF: Generate Language Files",
"type": "shell",
"command": "sh ./scripts/generate_language_files.sh",
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/d",
"/c",
".\\scripts\\generate_language_files.cmd"
]
}
}
},
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Flutter Clean",
"type": "shell",
"command": "cargo make flutter_clean",
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: flutter build aar",
"type": "flutter",
"command": "flutter",
"args": [
"build",
"aar"
],
"group": "build",
"problemMatcher": [],
"detail": "appflowy_flutter"
},
{
"label": "AF: Tauri UI Dev",
"type": "shell",
"isBackground": true,
"command": "yarn",
"args": [
"dev"
],
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
},
{
"label": "AF: Tauri UI Build",
"type": "shell",
"command": "npm run build",
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
},
{
"label": "AF: Tauri Dev",
"type": "shell",
"command": "npm run tauri:dev",
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
},
{
"label": "AF: Tauri Clean",
"type": "shell",
"command": "cargo make tauri_clean",
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Tauri Clean + Dev",
"type": "shell",
"dependsOrder": "sequence",
"dependsOn": [
"AF: Tauri Clean",
"AF: Tauri UI Dev"
],
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "AF: Tauri ESLint",
"type": "shell",
"command": "npx eslint --fix src",
"options": {
"cwd": "${workspaceFolder}/appflowy_tauri"
}
},
]
}

View File

@ -23,7 +23,7 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
CARGO_MAKE_CRATE_NAME = "dart-ffi"
LIB_NAME = "dart_ffi"
CURRENT_APP_VERSION = "0.1.1"
CURRENT_APP_VERSION = "0.1.2"
FLUTTER_DESKTOP_FEATURES = "dart,rev-sqlite"
PRODUCT_NAME = "AppFlowy"
# CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html

View File

@ -40,7 +40,7 @@ lib/generated_plugin_registrant.dart
lib/generated/
# Freezed generated files
*.g.dart
*.g.dart
*.freezed.dart
# Symbolication related
@ -67,4 +67,4 @@ windows/flutter/dart_ffi/
**/**/*.so
**/**/Brewfile.lock.json
**/.sandbox
**/.vscode/
**/.vscode/

View File

@ -1,6 +1,6 @@
<h1 align="center" style="margin:0"> AppFlowy_Flutter</h1>
<div align="center">
<img src="https://img.shields.io/badge/Flutter-v3.3.10-blue"/>
<img src="https://img.shields.io/badge/Flutter-v3.7.5-blue"/>
<img src="https://img.shields.io/badge/Rust-v1.65-orange"/>
</div>
@ -9,13 +9,16 @@
This Repository contains the codebase for the frontend of the application, currently we use Flutter as our frontend framework.
### Platforms Supported Using Flutter 💻
- Linux
- macOS
- Windows
> We later expect to extend support to Android and iOS devices using Flutter.
> We later expect to extend support to Android and iOS devices using Flutter.
### Am I Eligible to Contribute?
Yes! You are eligible to contribute, check out the ways in which you can [contribute to AppFlowy](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/contributing-to-appflowy). Some of the ways in which you can contribute are:
- Non-Coding Contributions
- Documentation
- Feature Requests and Feedbacks
@ -23,26 +26,27 @@ Yes! You are eligible to contribute, check out the ways in which you can [contri
- Improve Translations
- Coding Contributions
To contribute to `AppFlowy_Flutter` codebase specifically (coding contribution) we suggest you to have basic knowledge of Flutter. In case you are new to Flutter, we may suggest you to learn the basics and then try to contribute, get started with Flutter [here](https://flutter.dev/docs/get-started/codelab).
### What OS Should I Use for Development?
We support all OS for Development i.e Linux, macOS and Windows. However, most of us promote macOS and Linux over Windows. We have detailed [docs](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/environment-setup) on How to Setup `AppFlowy_Flutter` in your local system in each OS.
### Getting Started ❇
We have a detailed documentation, on how to [get started](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/contributing-to-appflowy) with the project, and make your first contribution. However, we do have some specific picks for you.
- [Code Architecture](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/architecture/frontend/frontend/codemap)
- [Making Your First PR](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/submitting-your-first-pull-request)
- [The Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides)
- [How to run/debug the application](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/launcher-and-tasks)
### Need Help?
- New to GitHub? Follow [these](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/setting-up-your-repositories) steps to get started
- Stuck Somewhere? Join the [Discord](https://discord.gg/9Q2xaN37tV) Group and we are there to help you!
<!--
<!--
## release check
1. [entitlements](https://flutter.dev/desktop#setting-up-entitlements)
2. [symbols stripped](https://flutter.dev/docs/development/platform-integration/c-interop) -->

View File

@ -1,5 +1,17 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="16" height="16" rx="8" fill="#00BCF0"/>
<rect x="7.5" y="4" width="1" height="8" rx="0.5" fill="white"/>
<rect x="12" y="7.5" width="1" height="8" rx="0.5" transform="rotate(90 12 7.5)" fill="white"/>
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
version="1.1"
id="svg808"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs812" />
<path
id="path930"
style="fill:#00bcf0;fill-opacity:1"
transform="rotate(-90)"
d="M 0,7.9238281 A 8,8 0 0 0 -8.0585938,0 8,8 0 0 0 -16,8.0390625 8,8 0 0 0 -7.9804688,16 8,8 0 0 0 0,8 Z M -4,8 c 0,0.2769988 -0.2230012,0.5 -0.5,0.5 h -3 v 3 c 0,0.277 -0.2230012,0.5 -0.5,0.5 -0.2769988,0 -0.5,-0.223 -0.5,-0.5 v -3 h -3 C -11.777,8.5 -12,8.2769988 -12,8 c 0,-0.2769988 0.223,-0.5 0.5,-0.5 h 3 v -3 C -8.5,4.2230012 -8.2769988,4 -8,4 c 0.2769988,0 0.5,0.2230012 0.5,0.5 v 3 h 3 C -4.2230012,7.5 -4,7.7230012 -4,8 Z" />
</svg>

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 766 B

View File

@ -188,17 +188,18 @@
"exportDatabase": "Export database",
"selectFiles": "Select the files that need to be export",
"createNewFolder": "Create a new folder",
"createNewFolderDesc": "Tell us where you want to store your data ...",
"createNewFolderDesc": "Tell us where you want to store your data",
"open": "Open",
"openFolder": "Open an existing folder",
"openFolderDesc": "Read and write it to your existing AppFlowy folder ...",
"openFolderDesc": "Read and write it to your existing AppFlowy folder",
"folderHintText": "folder name",
"location": "Creating a new folder",
"locationDesc": "Pick a name for your AppFlowy data folder",
"browser": "Browse",
"create": "Create",
"folderPath": "Path to store your folder",
"locationCannotBeEmpty": "Path cannot be empty"
"locationCannotBeEmpty": "Path cannot be empty",
"pathCopiedSnackbar": "File storage path copied to clipboard!"
},
"user": {
"name": "Name",
@ -325,7 +326,8 @@
"checklist": {
"panelTitle": "Add an item"
},
"menuName": "Grid"
"menuName": "Grid",
"referencedGridPrefix": "View of"
},
"document": {
"menuName": "Document",
@ -365,6 +367,7 @@
"changeCover": "Change Cover",
"colors": "Colors",
"images": "Images",
"clearAll": "Clear All",
"abstract": "Abstract",
"addCover": "Add Cover",
"addLocalImage": "Add local image",
@ -382,14 +385,14 @@
"imageSavingFailed": "Image Saving Failed",
"addIcon": "Add Icon"
}
}
},
"board": {
"column": {
"create_new_card": "New"
},
"menuName": "Board"
"menuName": "Board",
"referencedBoardPrefix": "View of"
},
"calendar": {
"menuName": "Calendar",

View File

@ -40,6 +40,13 @@
"markdown": "Markdown",
"copyLink": "複製連結"
},
"moreAction": {
"small": "小",
"medium": "中",
"large": "大",
"fontSize": "字體大小",
"import": "匯入"
},
"disclosureAction": {
"rename": "重新命名",
"delete": "刪除",
@ -64,6 +71,7 @@
},
"dialogCreatePageNameHint": "頁面名稱",
"questionBubble": {
"shortcuts": "快捷鍵",
"whatsNew": "新功能",
"help": "幫助 & 支援",
"debug": {
@ -90,11 +98,21 @@
"inlineCode": "程式碼",
"quote": "區塊引言",
"header": "標題",
"highlight": "反白"
"highlight": "反白",
"color": "顏色"
},
"tooltip": {
"lightMode": "切換至亮色模式",
"darkMode": "切換至暗色模式"
"darkMode": "切換至暗色模式",
"openAsPage": "以頁面開啓",
"addNewRow": "新增列表",
"openMenu": "點擊開啓選單",
"viewDataBase": "查看資料庫",
"referencePage": "這個 {name} 已參照"
},
"sideBar": {
"closeSidebar": "關閉側邊欄",
"openSidebar": "開啓側邊欄"
},
"notifications": {
"export": {
@ -114,7 +132,14 @@
"signIn": "登入",
"signOut": "登出",
"complete": "完成",
"save": "儲存"
"save": "儲存",
"generate": "產生",
"esc": "離開",
"keep": "保存",
"tryAgain": "再試一次",
"discard": "放棄變更",
"replace": "取代",
"insertBelow": "在下面插入"
},
"label": {
"welcome": "歡迎!",
@ -142,22 +167,99 @@
"appearance": "外觀",
"language": "語言",
"user": "使用者",
"files": "檔案",
"open": "開啟設定"
},
"appearance": {
"themeMode": {
"label": "Theme Mode",
"label": "主題模式",
"light": "亮色模式",
"dark": "暗色模式",
"system": "Adapt to System"
}
"system": "系統設定"
},
"theme": "主題"
},
"files": {
"defaultLocation": "Appflowy 資料儲存位置",
"doubleTapToCopy": "雙擊以複製路徑",
"restoreLocation": "回復 Appflowy 預設路徑",
"customizeLocation": "開啓其他資料夾",
"restartApp": "請重新啓動以讓更動生效",
"exportDatabase": "匯出資料庫",
"selectFiles": "選擇需要匯出的檔案",
"createNewFolder": "建立新檔案",
"createNewFolderDesc": "選擇你想儲存資料的位置",
"open": "打開",
"openFolder": "開啓一個已經存在的資料夾",
"openFolderDesc": "讀寫已存在的 AppFlowy 資料夾",
"folderHintText": "資料夾名稱",
"location": "建立新資料夾",
"locationDesc": "命名 Appflowy 資料夾",
"browser": "瀏覽",
"create": "建立",
"folderPath": "儲存資料夾的路徑",
"locationCannotBeEmpty": "路徑不能爲空",
"pathCopiedSnackbar": "檔案儲存空間的路徑已被複製到剪貼簿!"
},
"user": {
"name": "名稱",
"icon": "圖標",
"selectAnIcon": "選擇圖標",
"pleaseInputYourOpenAIKey": "請輸入你的 OpenAI 密鑰"
}
},
"grid": {
"settings": {
"filter": "篩選",
"sort": "排序",
"sortBy": "排序方式",
"Properties": "內容"
"Properties": "內容",
"group": "群組",
"addFilter": "增加",
"deleteFilter": "刪除篩選器",
"filterBy": "以...篩選",
"typeAValue": "輸入一個值...",
"layout": "佈局"
},
"textFilter": {
"contains": "包含",
"doesNotContain": "不包含",
"endsWith": "以...結尾",
"startWith": "以...開頭",
"is": "是",
"isNot": "不是",
"isEmpty": "爲空",
"isNotEmpty": "不爲空",
"choicechipPrefix": {
"isNot": "不是",
"startWith": "以...開頭",
"endWith": "以...結尾",
"isEmpty": "爲空",
"isNotEmpty": "不爲空"
}
},
"checkboxFilter": {
"isChecked": "已核取",
"isUnchecked": "未核取",
"choicechipPrefix": {
"is": "是"
}
},
"checklistFilter": {
"isComplete": "已完成",
"isIncomplted": "未完成"
},
"singleSelectOptionFilter": {
"is": "是",
"isNot": "不是",
"isEmpty": "爲空",
"isNotEmpty": "不爲空"
},
"multiSelectOptionFilter": {
"contains": "包含",
"doesNotContain": "不包含",
"isEmpty": "爲空",
"isNotEmpty": "不爲空"
},
"field": {
"hide": "隱藏",
@ -172,6 +274,7 @@
"singleSelectFieldName": "單選",
"multiSelectFieldName": "多選",
"urlFieldName": "網址",
"checklistFieldName": "核取列表",
"numberFormat": "數字格式",
"dateFormat": "日期格式",
"includeTime": "包含時間",
@ -186,13 +289,23 @@
"addSelectOption": "新增選項",
"optionTitle": "選項",
"addOption": "新增選項",
"editProperty": "編輯內容"
"editProperty": "編輯內容",
"newColumn": "新欄位",
"deleteFieldPromptMessage": "你確定嗎?這個內容將被刪除"
},
"sort": {
"ascending": "升冪排序",
"descending": "降冪排序",
"deleteSort": "刪除排序",
"addSort": "新增排序"
},
"row": {
"duplicate": "複製",
"delete": "刪除",
"textPlaceholder": "空",
"copyProperty": "已將內容複製至剪貼簿"
"copyProperty": "已將內容複製至剪貼簿",
"count": "Count",
"newRow": "新列表"
},
"selectOption": {
"create": "建立",
@ -210,6 +323,9 @@
"panelTitle": "搜尋或建立選項",
"searchOption": "搜尋選項"
},
"checklist": {
"panelTitle": "新增物件"
},
"menuName": "網格"
},
"document": {
@ -217,10 +333,78 @@
"date": {
"timeHintTextInTwelveHour": "01:00 PM",
"timeHintTextInTwentyFourHour": "13:00"
},
"slashMenu": {
"board": {
"selectABoardToLinkTo": "選擇要連結的看板",
"createANewBoard": "建立新的看板"
},
"grid": {
"selectAGridToLinkTo": "選擇要連結的網格",
"createANewGrid": "建立新網格"
}
},
"plugins": {
"referencedBoard": "已參照的看板",
"referencedGrid": "已參照的網格",
"autoGeneratorMenuItemName": "OpenAI 寫手",
"autoGeneratorTitleName": "OpenAI: 叫人工智慧寫下任何事情...",
"autoGeneratorLearnMore": "Learn more",
"autoGeneratorGenerate": "產生",
"autoGeneratorHintText": "問 OpenAI ...",
"autoGeneratorCantGetOpenAIKey": "無法取得 OpenAI 密鑰",
"smartEdit": "人工智慧助理",
"openAI": "OpenAI",
"smartEditFixSpelling": "修正拼寫",
"warning": "⚠️ AI 的回答可能不精確或是存在誤導",
"smartEditSummarize": "總結",
"smartEditCouldNotFetchResult": "無法取得 OpenAI 的結果",
"smartEditCouldNotFetchKey": "無法取得 OpenAI 密鑰",
"smartEditDisabled": "在設定連結 OpenAI ",
"discardResponse": "你確定放棄人工智慧的回覆?",
"cover": {
"changeCover": "更換封面",
"colors": "顏色",
"images": "圖片",
"abstract": "摘要",
"addCover": "新增封面",
"addLocalImage": "新增本機圖片",
"invalidImageUrl": "無效的圖片網址",
"failedToAddImageToGallery": "新增圖片到圖庫失敗",
"enterImageUrl": "輸入圖片網址",
"add": "Add",
"back": "Back",
"saveToGallery": "儲存到",
"removeIcon": "移除圖標",
"pasteImageUrl": "複製圖片網址",
"or": "或",
"pickFromFiles": "挑選檔案",
"couldNotFetchImage": "無法截取圖片",
"imageSavingFailed": "圖片儲存失敗",
"addIcon": "新增圖標"
}
}
},
"sideBar": {
"openSidebar": "Open sidebar",
"closeSidebar": "Close sidebar"
"board": {
"column": {
"create_new_card": "建立"
},
"menuName": "看板"
},
"calendar": {
"menuName": "日曆",
"defaultNewCalendarTitle": "未命名的",
"navigation": {
"today": "今天",
"jumpToday": "跳至今天",
"previousMonth": "上個月",
"nextMonth": "下個月"
},
"settings": {
"showWeekNumbers": "顯示星期",
"showWeekends": "顯示週末",
"firstDayOfWeek": "一週的第一天",
"layoutDateField": "排列方式"
}
}
}

View File

@ -0,0 +1,43 @@
import 'package:appflowy_board/appflowy_board.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/util.dart';
/// Integration tests for an empty board. The [TestWorkspaceService] will load
/// a workspace from an empty board `assets/test/workspaces/board.zip` for all
/// tests.
///
/// To create another integration test with a preconfigured workspace.
/// Use the following steps.
/// 1. Create a new workspace from the AppFlowy launch screen.
/// 2. Modify the workspace until it is suitable as the starting point for
/// the integration test you need to land.
/// 3. Use a zip utility program to zip the workspace folder that you created.
/// 4. Add the zip file under `assets/test/workspaces/`
/// 5. Add a new enumeration to [TestWorkspace] in `integration_test/utils/data.dart`.
/// For example, if you added a workspace called `empty_calendar.zip`,
/// then [TestWorkspace] should have the following value:
/// ```dart
/// enum TestWorkspace {
/// board('board'),
/// empty_calendar('empty_calendar');
///
/// /* code */
/// }
/// ```
/// 6. Double check that the .zip file that you added is included as an asset in
/// the pubspec.yaml file under appflowy_flutter.
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
const service = TestWorkspaceService(TestWorkspace.board);
group('board', () {
setUpAll(() async => await service.setUpAll());
setUp(() async => await service.setUp());
testWidgets('integration test unzips the proper workspace and loads it correctly.', (tester) async {
await tester.initializeAppFlowy();
expect(find.byType(AppFlowyBoard), findsOneWidget);
});
});
}

View File

@ -0,0 +1,120 @@
import 'package:appflowy/plugins/document/presentation/plugins/base/built_in_page_widget.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'util/keyboard.dart';
import 'util/util.dart';
/// Integration tests for an empty document. The [TestWorkspaceService] will load a workspace from an empty document `assets/test/workspaces/empty_document.zip` for all tests.
///
/// To create another integration test with a preconfigured workspace. Use the following steps:
/// 1. Create a new workspace from the AppFlowy launch screen.
/// 2. Modify the workspace until it is suitable as the starting point for the integration test you need to land.
/// 3. Use a zip utility program to zip the workspace folder that you created.
/// 4. Add the zip file under `assets/test/workspaces/`
/// 5. Add a new enumeration to [TestWorkspace] in `integration_test/utils/data.dart`. For example, if you added a workspace called `empty_calendar.zip`, then [TestWorkspace] should have the following value:
/// ```dart
/// enum TestWorkspace {
/// board('board'),
/// empty_calendar('empty_calendar');
///
/// /* code */
/// }
/// ```
/// 6. Double check that the .zip file that you added is included as an asset in the pubspec.yaml file under appflowy_flutter.
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
const service = TestWorkspaceService(TestWorkspace.emptyDocument);
group('Tests on a workspace with only an empty document', () {
setUpAll(() async => await service.setUpAll());
setUp(() async => await service.setUp());
testWidgets('/board shortcut creates a new board and view of the board', (tester) async {
await tester.initializeAppFlowy();
// Needs tab to obtain focus for the app flowy editor.
// by default the tap appears at the center of the widget.
final Finder editor = find.byType(AppFlowyEditor);
await tester.tap(editor);
await tester.pumpAndSettle();
// tester.sendText() cannot be used since the editor
// does not contain any EditableText widgets.
// to interact with the app during an integration test,
// simulate physical keyboard events.
await FlowyTestKeyboard.simulateKeyDownEvent([
LogicalKeyboardKey.slash,
LogicalKeyboardKey.keyB,
LogicalKeyboardKey.keyO,
LogicalKeyboardKey.keyA,
LogicalKeyboardKey.keyR,
LogicalKeyboardKey.keyD,
LogicalKeyboardKey.arrowDown,
], tester: tester);
// Checks whether the options in the selection menu
// for /board exist.
expect(find.byType(SelectionMenuItemWidget), findsAtLeastNWidgets(2));
// Finalizes the slash command that creates the board.
await FlowyTestKeyboard.simulateKeyDownEvent([
LogicalKeyboardKey.enter,
], tester: tester);
// Checks whether new board is referenced and properly on the page.
expect(find.byType(BuiltInPageWidget), findsOneWidget);
// Checks whether the new database was created
const newBoardLabel = "Untitled";
expect(find.text(newBoardLabel), findsOneWidget);
// Checks whether a view of the database was created
const viewOfBoardLabel = "View of Untitled";
expect(find.text(viewOfBoardLabel), findsNWidgets(2));
});
testWidgets('/grid shortcut creates a new grid and view of the grid', (tester) async {
await tester.initializeAppFlowy();
// Needs tab to obtain focus for the app flowy editor.
// by default the tap appears at the center of the widget.
final Finder editor = find.byType(AppFlowyEditor);
await tester.tap(editor);
await tester.pumpAndSettle();
// tester.sendText() cannot be used since the editor
// does not contain any EditableText widgets.
// to interact with the app during an integration test,
// simulate physical keyboard events.
await FlowyTestKeyboard.simulateKeyDownEvent([
LogicalKeyboardKey.slash,
LogicalKeyboardKey.keyG,
LogicalKeyboardKey.keyR,
LogicalKeyboardKey.keyI,
LogicalKeyboardKey.keyD,
LogicalKeyboardKey.arrowDown,
], tester: tester);
// Checks whether the options in the selection menu
// for /grid exist.
expect(find.byType(SelectionMenuItemWidget), findsAtLeastNWidgets(2));
// Finalizes the slash command that creates the board.
await simulateKeyDownEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
// Checks whether new board is referenced and properly on the page.
expect(find.byType(BuiltInPageWidget), findsOneWidget);
// Checks whether the new database was created
const newTableLabel = "Untitled";
expect(find.text(newTableLabel), findsOneWidget);
// Checks whether a view of the database was created
const viewOfTableLabel = "View of Untitled";
expect(find.text(viewOfTableLabel), findsNWidgets(2));
});
});
}

View File

@ -0,0 +1,19 @@
import 'package:integration_test/integration_test.dart';
import 'board_test.dart' as board_test;
import 'switch_folder_test.dart' as switch_folder_test;
import 'empty_document_test.dart' as empty_document_test;
/// The main task runner for all integration tests in AppFlowy.
///
/// Having a single entrypoint for integration tests is necessary due to an
/// [issue caused by switching files with integration testing](https://github.com/flutter/flutter/issues/101031).
/// If flutter/flutter#101031 is resolved, this file can be removed completely.
/// Once removed, the integration_test.yaml must be updated to exclude this as
/// as the test target.
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
switch_folder_test.main();
board_test.main();
empty_document_test.main();
}

View File

@ -1,10 +1,5 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/presentation/plugins/base/built_in_page_widget.dart';
import 'package:appflowy/user/presentation/folder/folder_widget.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/style_widget/text_field.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
@ -162,135 +157,5 @@ void main() {
await TestFolder.currentLocation(),
);
});
testWidgets('/board shortcut creates a new board', (tester) async {
const folderName = 'appflowy';
await TestFolder.cleanTestLocation(folderName);
await TestFolder.setTestLocation(folderName);
await tester.initializeAppFlowy();
// tap open button
await mockGetDirectoryPath(folderName);
await tester.tapOpenFolderButton();
await tester.wait(1000);
await tester.expectToSeeWelcomePage();
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
// Necessary for being able to enterText when not in debug mode
binding.testTextInput.register();
// Needs tab to obtain focus for the app flowy editor.
// by default the tap appears at the center of the widget.
final Finder editor = find.byType(AppFlowyEditor);
await tester.tap(editor);
await tester.pumpAndSettle();
// tester.sendText() cannot be used since the editor
// does not contain any EditableText widgets.
// to interact with the app during an integration test,
// simulate physical keyboard events.
await simulateKeyDownEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.arrowLeft);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.slash);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.keyB);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.keyO);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.keyA);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.keyR);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.keyD);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);
await tester.pumpAndSettle();
// Checks whether the options in the selection menu
// for /board exist.
expect(find.byType(SelectionMenuItemWidget), findsAtLeastNWidgets(2));
// Finalizes the slash command that creates the board.
await simulateKeyDownEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
// Checks whether new board is referenced and properly on the page.
expect(find.byType(BuiltInPageWidget), findsOneWidget);
// Checks whether the new board is in the side bar.
final sidebarLabel = LocaleKeys.newPageText.tr();
expect(find.text(sidebarLabel), findsOneWidget);
});
testWidgets('/grid shortcut creates a new grid', (tester) async {
const folderName = 'appflowy';
await TestFolder.cleanTestLocation(folderName);
await TestFolder.setTestLocation(folderName);
await tester.initializeAppFlowy();
// tap open button
await mockGetDirectoryPath(folderName);
await tester.tapOpenFolderButton();
await tester.wait(1000);
await tester.expectToSeeWelcomePage();
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
// Necessary for being able to enterText when not in debug mode
binding.testTextInput.register();
// Needs tab to obtain focus for the app flowy editor.
// by default the tap appears at the center of the widget.
final Finder editor = find.byType(AppFlowyEditor);
await tester.tap(editor);
await tester.pumpAndSettle();
// tester.sendText() cannot be used since the editor
// does not contain any EditableText widgets.
// to interact with the app during an integration test,
// simulate physical keyboard events.
await simulateKeyDownEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.arrowLeft);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.slash);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.keyG);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.keyR);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.keyI);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.keyD);
await tester.pumpAndSettle();
await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);
await tester.pumpAndSettle();
// Checks whether the options in the selection menu
// for /grid exist.
expect(find.byType(SelectionMenuItemWidget), findsAtLeastNWidgets(2));
// Finalizes the slash command that creates the board.
await simulateKeyDownEvent(LogicalKeyboardKey.enter);
await tester.pumpAndSettle();
// Checks whether new board is referenced and properly on the page.
expect(find.byType(BuiltInPageWidget), findsOneWidget);
// Checks whether the new board is in the side bar.
final sidebarLabel = LocaleKeys.newPageText.tr();
expect(find.text(sidebarLabel), findsOneWidget);
});
});
}

View File

@ -0,0 +1,66 @@
import 'dart:io';
import 'package:appflowy/workspace/application/settings/settings_location_cubit.dart';
import 'package:archive/archive_io.dart';
import 'package:flutter/services.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
enum TestWorkspace {
board("board"),
emptyDocument("empty_document");
const TestWorkspace(this._name);
final String _name;
Future<File> get zip async {
final Directory parent = await TestWorkspace._parent;
final File out = File(p.join(parent.path, '$_name.zip'));
if (await out.exists()) return out;
await out.create();
final ByteData data = await rootBundle.load(_asset);
await out.writeAsBytes(data.buffer.asUint8List());
return out;
}
Future<Directory> get root async {
final Directory parent = await TestWorkspace._parent;
return Directory(p.join(parent.path, _name));
}
static Future<Directory> get _parent async {
final Directory root = await getTemporaryDirectory();
if (await root.exists()) return root;
await root.create();
return root;
}
String get _asset => 'assets/test/workspaces/$_name.zip';
}
class TestWorkspaceService {
const TestWorkspaceService(this.workspace);
final TestWorkspace workspace;
/// Instructs the application to read workspace data from the workspace found under this [TestWorkspace]'s path.
Future<void> setUpAll() async {
SharedPreferences.setMockInitialValues(
{
kSettingsLocationDefaultLocation:
await workspace.root.then((value) => value.path),
},
);
}
/// Workspaces that are checked into source are compressed. [TestWorkspaceService.setUp()] decompresses the file into an ephemeral directory that will be ignored by source control.
Future<void> setUp() async {
final inputStream =
InputFileStream(await workspace.zip.then((value) => value.path));
final archive = ZipDecoder().decodeBuffer(inputStream);
extractArchiveToDisk(
archive, await TestWorkspace._parent.then((value) => value.path));
}
}

View File

@ -0,0 +1,12 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart' as flutter_test;
class FlowyTestKeyboard {
static Future<void> simulateKeyDownEvent(List<LogicalKeyboardKey> keys,
{required flutter_test.WidgetTester tester}) async {
for (final LogicalKeyboardKey key in keys) {
await flutter_test.simulateKeyDownEvent(key);
await tester.pumpAndSettle();
}
}
}

View File

@ -1,3 +1,4 @@
export 'base.dart';
export 'launch.dart';
export 'settings.dart';
export 'data.dart';

View File

@ -3,7 +3,7 @@ import 'dart:typed_data';
import 'package:appflowy_backend/protobuf/flowy-notification/protobuf.dart';
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/notification.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/notification.pb.dart';
import 'package:appflowy_backend/rust_stream.dart';
import 'notification_helper.dart';

View File

@ -9,7 +9,7 @@ import 'package:appflowy_backend/protobuf/flowy-database/group_changeset.pb.dart
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:collection/collection.dart';
import 'dart:async';
import 'package:dartz/dartz.dart';
@ -79,7 +79,7 @@ class DatabaseController {
final DatabaseViewBackendService _databaseViewBackendSvc;
final FieldController fieldController;
late DatabaseViewCache _viewCache;
final LayoutTypePB layoutType;
final DatabaseLayoutPB layoutType;
// Callbacks
DatabaseCallbacks? _databaseCallbacks;
@ -110,7 +110,7 @@ class DatabaseController {
_listenOnFieldsChanged();
_listenOnGroupChanged();
_listenOnLayoutChanged();
if (layoutType == LayoutTypePB.Calendar) {
if (layoutType == DatabaseLayoutPB.Calendar) {
_listenOnCalendarLayoutChanged();
}
}

View File

@ -5,7 +5,7 @@ import 'package:dartz/dartz.dart';
class DatabaseBackendService {
static Future<Either<List<DatabaseDescriptionPB>, FlowyError>>
getAllDatabase() {
getAllDatabases() {
return DatabaseEventGetDatabases().send().then((result) {
return result.fold((l) => left(l.items), (r) => right(r));
});

View File

@ -5,7 +5,7 @@ import 'package:appflowy_backend/protobuf/flowy-database/setting_entities.pb.dar
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/group.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart';
@ -86,7 +86,7 @@ class DatabaseViewBackendService {
}
Future<Either<LayoutSettingPB, FlowyError>> getLayoutSetting(
LayoutTypePB layoutType) {
DatabaseLayoutPB layoutType) {
final payload = DatabaseLayoutIdPB.create()
..viewId = viewId
..layout = layoutType;

View File

@ -2,7 +2,6 @@ import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'field_service.dart';
part 'field_action_sheet_bloc.freezed.dart';
@ -64,11 +63,6 @@ class FieldActionSheetBloc
},
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed

View File

@ -1,6 +1,5 @@
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'dart:async';
import 'package:dartz/dartz.dart';
import 'field_service.dart';
import 'type_option/type_option_context.dart';
@ -17,8 +16,7 @@ class FieldEditorBloc extends Bloc<FieldEditorEvent, FieldEditorState> {
required String fieldName,
required bool isGroupField,
required IFieldTypeOptionLoader loader,
}) : dataController =
TypeOptionController(viewId: viewId, loader: loader),
}) : dataController = TypeOptionController(viewId: viewId, loader: loader),
super(FieldEditorState.initial(viewId, fieldName, isGroupField)) {
on<FieldEditorEvent>(
(event, emit) async {
@ -63,11 +61,6 @@ class FieldEditorBloc extends Bloc<FieldEditorEvent, FieldEditorState> {
},
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed

View File

@ -2,7 +2,6 @@ import 'package:appflowy_backend/protobuf/flowy-database/date_type_option.pb.dar
import 'package:appflowy_backend/protobuf/flowy-database/date_type_option_entities.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'package:protobuf/protobuf.dart';
import 'type_option_context.dart';
@ -52,11 +51,6 @@ class DateTypeOptionBloc
}
});
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed

View File

@ -1,7 +1,6 @@
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'package:protobuf/protobuf.dart';
import 'package:dartz/dartz.dart';
part 'edit_select_option_bloc.freezed.dart';
@ -27,11 +26,6 @@ class EditSelectOptionBloc
);
}
@override
Future<void> close() async {
return super.close();
}
SelectOptionPB _updateColor(SelectOptionColorPB color) {
state.option.freeze();
return state.option.rebuild((option) {

View File

@ -2,7 +2,6 @@ import 'package:appflowy_backend/protobuf/flowy-database/format.pbenum.dart';
import 'package:appflowy_backend/protobuf/flowy-database/number_type_option.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'package:protobuf/protobuf.dart';
import 'type_option_context.dart';
@ -29,11 +28,6 @@ class NumberTypeOptionBloc
typeOption.format = format;
});
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed

View File

@ -1,7 +1,6 @@
import 'package:appflowy_backend/protobuf/flowy-database/format.pbenum.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
part 'number_format_bloc.freezed.dart';
class NumberFormatBloc extends Bloc<NumberFormatEvent, NumberFormatState> {
@ -21,11 +20,6 @@ class NumberFormatBloc extends Bloc<NumberFormatEvent, NumberFormatState> {
},
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed

View File

@ -49,11 +49,6 @@ class SelectOptionTypeOptionBloc
},
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed

View File

@ -1,6 +1,5 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'package:dartz/dartz.dart';
part 'setting_bloc.freezed.dart';
@ -18,11 +17,6 @@ class DatabaseSettingBloc
},
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed

View File

@ -6,7 +6,7 @@ import 'package:dartz/dartz.dart';
import 'package:equatable/equatable.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
@ -30,7 +30,7 @@ class BoardBloc extends Bloc<BoardEvent, BoardState> {
BoardBloc({required ViewPB view})
: _databaseController = DatabaseController(
view: view,
layoutType: LayoutTypePB.Board,
layoutType: DatabaseLayoutPB.Board,
),
super(BoardState.initial(view.id)) {
boardController = AppFlowyBoardController(

View File

@ -1,6 +1,5 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'package:dartz/dartz.dart';
part 'board_setting_bloc.freezed.dart';
@ -17,11 +16,6 @@ class BoardSettingBloc extends Bloc<BoardSettingEvent, BoardSettingState> {
},
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed

View File

@ -3,7 +3,7 @@ import 'package:appflowy/plugins/util.dart';
import 'package:appflowy/startup/plugin/plugin.dart';
import 'package:appflowy/workspace/presentation/home/home_stack.dart';
import 'package:appflowy/workspace/presentation/widgets/left_bar_item.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
@ -29,7 +29,7 @@ class BoardPluginBuilder implements PluginBuilder {
PluginType get pluginType => PluginType.board;
@override
ViewLayoutTypePB? get layoutType => ViewLayoutTypePB.Board;
ViewLayoutPB? get layoutType => ViewLayoutPB.Board;
}
class BoardPluginConfig implements PluginConfig {

View File

@ -7,7 +7,7 @@ import 'package:appflowy/plugins/database_view/application/field/field_controlle
import 'package:appflowy/plugins/database_view/application/row/row_cache.dart';
import 'package:appflowy/plugins/database_view/application/row/row_data_controller.dart';
import 'package:appflowy/plugins/database_view/widgets/row/row_detail.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/row_entities.pb.dart';
import 'package:appflowy_board/appflowy_board.dart';
@ -184,7 +184,7 @@ class _BoardContentState extends State<BoardContent> {
width: 20,
child: svgWidget(
"home/add",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
),
onAddButtonClick: () {
@ -207,7 +207,7 @@ class _BoardContentState extends State<BoardContent> {
width: 20,
child: svgWidget(
"home/add",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
),
title: FlowyText.medium(

View File

@ -113,7 +113,7 @@ class _SettingItem extends StatelessWidget {
},
leftIcon: svgWidget(
action.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
),
);

View File

@ -3,7 +3,7 @@ import 'package:appflowy/plugins/database_view/application/field/field_controlle
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart';
import 'package:calendar_view/calendar_view.dart';
import 'package:dartz/dartz.dart';
@ -28,7 +28,7 @@ class CalendarBloc extends Bloc<CalendarEvent, CalendarState> {
CalendarBloc({required ViewPB view})
: _databaseController = DatabaseController(
view: view,
layoutType: LayoutTypePB.Calendar,
layoutType: DatabaseLayoutPB.Calendar,
),
super(CalendarState.initial()) {
on<CalendarEvent>(

View File

@ -23,8 +23,6 @@ class CalendarSettingBloc
});
}
@override
Future<void> close() async => super.close();
}
@freezed

View File

@ -3,7 +3,7 @@ import 'package:appflowy/startup/plugin/plugin.dart';
import 'package:appflowy/workspace/presentation/home/home_stack.dart';
import 'package:appflowy/workspace/presentation/widgets/left_bar_item.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:flutter/material.dart';
import '../../util.dart';
@ -29,7 +29,7 @@ class CalendarPluginBuilder extends PluginBuilder {
PluginType get pluginType => PluginType.calendar;
@override
ViewLayoutTypePB? get layoutType => ViewLayoutTypePB.Calendar;
ViewLayoutPB? get layoutType => ViewLayoutPB.Calendar;
}
class CalendarPluginConfig implements PluginConfig {

View File

@ -203,7 +203,7 @@ class _NewEventButton extends StatelessWidget {
iconPadding: EdgeInsets.zero,
icon: svgWidget(
"home/add",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
width: 22,
);

View File

@ -1,6 +1,6 @@
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/database_view/calendar/application/calendar_bloc.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:calendar_view/calendar_view.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';

View File

@ -1,5 +1,3 @@
import 'dart:async';
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/filter/choicechip/select_option/select_option_loader.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
@ -63,11 +61,6 @@ class SelectOptionFilterListBloc<T>
);
}
@override
Future<void> close() async {
return super.close();
}
void _updateSelectOptions({
String? predicate,
Set<String>? selectedOptionIds,

View File

@ -4,7 +4,7 @@ import 'package:appflowy/plugins/database_view/application/row/row_service.dart'
import 'package:dartz/dartz.dart';
import 'package:equatable/equatable.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/protobuf.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

View File

@ -61,11 +61,6 @@ class GridHeaderBloc extends Bloc<GridHeaderEvent, GridHeaderState> {
listenWhen: () => !isClosed,
);
}
@override
Future<void> close() async {
return super.close();
}
}
@freezed

View File

@ -2,7 +2,6 @@ import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'dart:async';
import 'package:dartz/dartz.dart';
import '../../../application/row/row_cache.dart';
@ -34,11 +33,6 @@ class RowActionSheetBloc
);
}
@override
Future<void> close() async {
return super.close();
}
void logResult(Either<Unit, FlowyError> result) {
result.fold((l) => null, (err) => Log.error(err));
}

View File

@ -4,7 +4,7 @@ import 'package:appflowy/startup/plugin/plugin.dart';
import 'package:appflowy/workspace/presentation/home/home_stack.dart';
import 'package:appflowy/workspace/presentation/widgets/left_bar_item.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:flutter/material.dart';
import 'presentation/grid_page.dart';
@ -29,7 +29,7 @@ class GridPluginBuilder implements PluginBuilder {
PluginType get pluginType => PluginType.grid;
@override
ViewLayoutTypePB? get layoutType => ViewLayoutTypePB.Grid;
ViewLayoutPB? get layoutType => ViewLayoutPB.Grid;
}
class GridPluginConfig implements PluginConfig {

View File

@ -8,7 +8,7 @@ import 'package:flowy_infra_ui/style_widget/scrolling/styled_scroll_bar.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_scrollview.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/error_page.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter/material.dart';
import 'package:linked_scroll_controller/linked_scroll_controller.dart';
@ -38,7 +38,7 @@ class GridPage extends StatefulWidget {
Key? key,
}) : databaseController = DatabaseController(
view: view,
layoutType: LayoutTypePB.Grid,
layoutType: DatabaseLayoutPB.Grid,
),
super(key: key);

View File

@ -38,12 +38,15 @@ class ChoiceChipButton extends StatelessWidget {
child: FlowyButton(
decoration: decoration,
useIntrinsicWidth: true,
text: FlowyText(filterInfo.fieldInfo.name),
text: FlowyText(
filterInfo.fieldInfo.name,
color: AFThemeExtension.of(context).textColor,
),
margin: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
radius: const BorderRadius.all(Radius.circular(14)),
leftIcon: svgWidget(
filterInfo.fieldInfo.fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
rightIcon: _ChoicechipFilterDesc(filterDesc: filterDesc),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
@ -62,7 +65,8 @@ class _ChoicechipFilterDesc extends StatelessWidget {
Widget build(BuildContext context) {
final arrow = Transform.rotate(
angle: -math.pi / 2,
child: svgWidget("home/arrow_left"),
child: svgWidget("home/arrow_left",
color: AFThemeExtension.of(context).textColor),
);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 2),

View File

@ -18,14 +18,19 @@ class ConditionButton extends StatelessWidget {
Widget build(BuildContext context) {
final arrow = Transform.rotate(
angle: -math.pi / 2,
child: svgWidget("home/arrow_left"),
child: svgWidget("home/arrow_left",
color: AFThemeExtension.of(context).textColor),
);
return SizedBox(
height: 20,
child: FlowyButton(
useIntrinsicWidth: true,
text: FlowyText(conditionName, fontSize: 10),
text: FlowyText(
conditionName,
fontSize: 10,
color: AFThemeExtension.of(context).textColor,
),
margin: const EdgeInsets.symmetric(horizontal: 4),
radius: const BorderRadius.all(Radius.circular(2)),
rightIcon: arrow,

View File

@ -3,6 +3,7 @@ import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.da
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/field_type_extension.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
@ -117,19 +118,16 @@ class _FilterTextFieldDelegate extends SliverPersistentHeaderDelegate {
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return Padding(
return Container(
padding: const EdgeInsets.only(top: 4),
child: Container(
color: Theme.of(context).colorScheme.background,
height: fixHeight,
child: FlowyTextField(
hintText: LocaleKeys.grid_settings_filterBy.tr(),
onChanged: (text) {
context
.read<GridCreateFilterBloc>()
.add(GridCreateFilterEvent.didReceiveFilterText(text));
},
),
height: fixHeight,
child: FlowyTextField(
hintText: LocaleKeys.grid_settings_filterBy.tr(),
onChanged: (text) {
context
.read<GridCreateFilterBloc>()
.add(GridCreateFilterEvent.didReceiveFilterText(text));
},
),
);
}
@ -158,11 +156,15 @@ class _FilterPropertyCell extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlowyButton(
text: FlowyText.medium(fieldInfo.name),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
fieldInfo.name,
color: AFThemeExtension.of(context).textColor,
),
onTap: () => onTap(fieldInfo),
leftIcon: svgWidget(
fieldInfo.fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
);
}

View File

@ -3,6 +3,7 @@ import 'package:appflowy/workspace/presentation/widgets/pop_up_action.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
import 'package:flutter/material.dart';
@ -31,10 +32,11 @@ class _DisclosureButtonState extends State<DisclosureButton> {
.toList(),
buildChild: (controller) {
return FlowyIconButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
width: 20,
icon: svgWidget(
"editor/details",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
onPressed: () => controller.show(),
);

View File

@ -71,12 +71,15 @@ class _AddFilterButtonState extends State<AddFilterButton> {
SizedBox(
height: 28,
child: FlowyButton(
text: FlowyText(LocaleKeys.grid_settings_addFilter.tr()),
text: FlowyText(
LocaleKeys.grid_settings_addFilter.tr(),
color: AFThemeExtension.of(context).textColor,
),
useIntrinsicWidth: true,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
leftIcon: svgWidget(
"home/add",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
onTap: () => popoverController.show(),
),

View File

@ -14,12 +14,15 @@ class GridAddRowButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlowyButton(
text: FlowyText.medium(LocaleKeys.grid_row_newRow.tr()),
text: FlowyText.medium(
LocaleKeys.grid_row_newRow.tr(),
color: Theme.of(context).colorScheme.tertiary,
),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
onTap: () => context.read<GridBloc>().add(const GridEvent.createRow()),
leftIcon: svgWidget(
"home/add",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).colorScheme.tertiary,
),
);
}

View File

@ -164,11 +164,10 @@ class FieldCellButton extends StatelessWidget {
.replaceAll(Characters(''), Characters('\u{200B}'))
.toString();
return FlowyButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
hoverColor: AFThemeExtension.of(context).greyHover,
onTap: onTap,
leftIcon: svgWidget(
field.fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
leftIcon: FlowySvg(
name: field.fieldType.iconName(),
),
radius: BorderRadius.zero,
text: FlowyText.medium(

View File

@ -5,6 +5,7 @@ import 'package:appflowy/startup/startup.dart';
import 'package:appflowy/workspace/presentation/widgets/dialogs.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
@ -81,8 +82,10 @@ class _EditFieldButton extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
LocaleKeys.grid_field_editProperty.tr(),
color: AFThemeExtension.of(context).textColor,
),
onTap: onTap,
),
@ -148,9 +151,12 @@ class FieldActionCell extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlowyButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
action.title(),
color: enable ? null : Theme.of(context).disabledColor,
color: enable
? AFThemeExtension.of(context).textColor
: Theme.of(context).disabledColor,
),
onTap: () {
if (enable) {
@ -160,7 +166,7 @@ class FieldActionCell extends StatelessWidget {
leftIcon: svgWidget(
action.iconName(),
color: enable
? Theme.of(context).colorScheme.onSurface
? AFThemeExtension.of(context).textColor
: Theme.of(context).disabledColor,
),
);

View File

@ -147,6 +147,8 @@ class _FieldNameTextFieldState extends State<_FieldNameTextField> {
widget.popoverMutex.listenOnPopoverChanged(() {
if (focusNode.hasFocus) {
focusNode.unfocus();
} else {
focusNode.requestFocus();
}
});

View File

@ -1,5 +1,6 @@
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
import 'package:flutter/material.dart';
@ -57,11 +58,15 @@ class FieldTypeCell extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
text: FlowyText.medium(fieldType.title()),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
fieldType.title(),
color: AFThemeExtension.of(context).textColor,
),
onTap: () => onSelectField(fieldType),
leftIcon: svgWidget(
fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
),
);

View File

@ -4,6 +4,7 @@ import 'package:appflowy/plugins/database_view/application/field/type_option/typ
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:dartz/dartz.dart' show Either;
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-database/field_entities.pb.dart';
@ -110,17 +111,19 @@ class _SwitchFieldButton extends StatelessWidget {
Widget _buildMoreButton(BuildContext context) {
final bloc = context.read<FieldTypeOptionEditBloc>();
return FlowyButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
bloc.state.field.fieldType.title(),
color: AFThemeExtension.of(context).textColor,
),
margin: GridSize.typeOptionContentInsets,
leftIcon: svgWidget(
bloc.state.field.fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
rightIcon: svgWidget(
"grid/more",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
);
}

View File

@ -178,12 +178,9 @@ class CreateFieldButton extends StatelessWidget {
child: FlowyButton(
radius: BorderRadius.zero,
text: FlowyText.medium(LocaleKeys.grid_field_newColumn.tr()),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
hoverColor: AFThemeExtension.of(context).greyHover,
onTap: () {},
leftIcon: svgWidget(
"home/add",
color: Theme.of(context).colorScheme.onSurface,
),
leftIcon: const FlowySvg(name: 'home/add'),
),
popupBuilder: (BuildContext popover) {
return FieldEditor(

View File

@ -151,10 +151,7 @@ class DateFormatButton extends StatelessWidget {
margin: buttonMargins,
onTap: onTap,
onHover: onHover,
rightIcon: svgWidget(
"grid/more",
color: Theme.of(context).colorScheme.onSurface,
),
rightIcon: const FlowySvg(name: 'grid/more'),
),
);
}
@ -182,10 +179,7 @@ class TimeFormatButton extends StatelessWidget {
margin: buttonMargins,
onTap: onTap,
onHover: onHover,
rightIcon: svgWidget(
"grid/more",
color: Theme.of(context).colorScheme.onSurface,
),
rightIcon: const FlowySvg(name: 'grid/more'),
),
);
}

View File

@ -61,7 +61,7 @@ class NumberTypeOptionWidget extends TypeOptionWidget {
margin: GridSize.typeOptionContentInsets,
rightIcon: svgWidget(
"grid/more",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
text: Row(
children: [

View File

@ -1,6 +1,7 @@
import 'package:appflowy/plugins/database_view/application/field/type_option/select_option_type_option_bloc.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:appflowy_backend/protobuf/flowy-database/select_type_option.pb.dart';
import 'package:flutter/material.dart';
@ -194,7 +195,7 @@ class _OptionCellState extends State<_OptionCell> {
padding: const EdgeInsets.symmetric(horizontal: 6.0),
child: svgWidget(
"grid/details",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
),
],
@ -243,7 +244,11 @@ class _AddOptionButton extends StatelessWidget {
child: SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
text: FlowyText.medium(LocaleKeys.grid_field_addSelectOption.tr()),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
LocaleKeys.grid_field_addSelectOption.tr(),
color: AFThemeExtension.of(context).textColor,
),
onTap: () {
context
.read<SelectOptionTypeOptionBloc>()
@ -251,7 +256,7 @@ class _AddOptionButton extends StatelessWidget {
},
leftIcon: svgWidget(
"home/add",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
),
),

View File

@ -1,6 +1,7 @@
import 'package:appflowy/plugins/database_view/application/field/type_option/edit_select_option_bloc.dart';
import 'package:appflowy/plugins/database_view/widgets/row/cells/select_option_cell/extension.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
@ -103,10 +104,14 @@ class _DeleteTag extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
text: FlowyText.medium(LocaleKeys.grid_selectOption_deleteTag.tr()),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
LocaleKeys.grid_selectOption_deleteTag.tr(),
color: AFThemeExtension.of(context).textColor,
),
leftIcon: svgWidget(
"grid/delete",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
onTap: () {
context

View File

@ -3,6 +3,7 @@ import 'package:appflowy/plugins/database_view/grid/application/row/row_action_s
import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
@ -56,9 +57,12 @@ class _ActionCell extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
action.title(),
color: action.enable() ? null : Theme.of(context).disabledColor,
color: action.enable()
? AFThemeExtension.of(context).textColor
: Theme.of(context).disabledColor,
),
onTap: () {
if (action.enable()) {
@ -67,7 +71,7 @@ class _ActionCell extends StatelessWidget {
},
leftIcon: svgWidget(
action.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
),
);

View File

@ -5,6 +5,7 @@ import 'package:appflowy/plugins/database_view/grid/application/row/row_bloc.dar
import 'package:appflowy/plugins/database_view/widgets/row/cell_builder.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
@ -152,11 +153,15 @@ class _InsertButton extends StatelessWidget {
Widget build(BuildContext context) {
return FlowyIconButton(
tooltipText: LocaleKeys.tooltip_addNewRow.tr(),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
width: 20,
height: 30,
onPressed: () => context.read<RowBloc>().add(const RowEvent.createRow()),
iconPadding: const EdgeInsets.all(3),
icon: svgWidget("home/add"),
icon: svgWidget(
'home/add',
color: Theme.of(context).colorScheme.tertiary,
),
);
}
}
@ -182,11 +187,15 @@ class _MenuButtonState extends State<_MenuButton> {
Widget build(BuildContext context) {
return FlowyIconButton(
tooltipText: LocaleKeys.tooltip_openMenu.tr(),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
width: 20,
height: 30,
onPressed: () => widget.openMenu(),
iconPadding: const EdgeInsets.all(3),
icon: svgWidget("editor/details"),
icon: svgWidget(
'editor/details',
color: Theme.of(context).colorScheme.tertiary,
),
);
}
}

View File

@ -5,6 +5,7 @@ import 'package:appflowy/plugins/database_view/grid/presentation/layout/sizes.da
import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/field_type_extension.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
@ -116,19 +117,16 @@ class _FilterTextFieldDelegate extends SliverPersistentHeaderDelegate {
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
return Padding(
return Container(
padding: const EdgeInsets.only(top: 4),
child: Container(
color: Theme.of(context).colorScheme.background,
height: fixHeight,
child: FlowyTextField(
hintText: LocaleKeys.grid_settings_sortBy.tr(),
onChanged: (text) {
context
.read<CreateSortBloc>()
.add(CreateSortEvent.didReceiveFilterText(text));
},
),
height: fixHeight,
child: FlowyTextField(
hintText: LocaleKeys.grid_settings_sortBy.tr(),
onChanged: (text) {
context
.read<CreateSortBloc>()
.add(CreateSortEvent.didReceiveFilterText(text));
},
),
);
}
@ -157,11 +155,15 @@ class _SortPropertyCell extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlowyButton(
text: FlowyText.medium(fieldInfo.name),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
fieldInfo.name,
color: AFThemeExtension.of(context).textColor,
),
onTap: () => onTap(fieldInfo),
leftIcon: svgWidget(
fieldInfo.fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
);
}

View File

@ -37,7 +37,10 @@ class SortChoiceButton extends StatelessWidget {
return FlowyButton(
decoration: decoration,
useIntrinsicWidth: true,
text: FlowyText(text),
text: FlowyText(
text,
color: AFThemeExtension.of(context).textColor,
),
margin: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
radius: BorderRadius.all(radius),
leftIcon: leftIcon,

View File

@ -125,7 +125,7 @@ class _SortItem extends StatelessWidget {
hoverColor: AFThemeExtension.of(context).lightGreyHover,
icon: svgWidget(
"home/close",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
);
@ -182,13 +182,11 @@ class _AddSortButtonState extends State<_AddSortButton> {
child: SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
hoverColor: AFThemeExtension.of(context).greyHover,
disable: getCreatableSorts(widget.fieldController.fieldInfos).isEmpty,
text: FlowyText.medium(LocaleKeys.grid_sort_addSort.tr()),
onTap: () => _popoverController.show(),
leftIcon: svgWidget(
"home/add",
color: Theme.of(context).colorScheme.onSurface,
),
leftIcon: const FlowySvg(name: 'home/add'),
),
),
popupBuilder: (BuildContext context) {
@ -220,10 +218,7 @@ class _DeleteSortButton extends StatelessWidget {
.read<SortEditorBloc>()
.add(const SortEditorEvent.deleteAllSorts());
},
leftIcon: svgWidget(
"editor/delete",
color: Theme.of(context).colorScheme.onSurface,
),
leftIcon: const FlowySvg(name: 'editor/delete'),
),
);
},

View File

@ -55,13 +55,16 @@ class SortChoiceChip extends StatelessWidget {
Widget build(BuildContext context) {
final arrow = Transform.rotate(
angle: -math.pi / 2,
child: svgWidget("home/arrow_left"),
child: svgWidget(
"home/arrow_left",
color: Theme.of(context).iconTheme.color,
),
);
final text = LocaleKeys.grid_settings_sort.tr();
final leftIcon = svgWidget(
"grid/setting/sort",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
);
return SizedBox(

View File

@ -25,7 +25,7 @@ class _FilterButtonState extends State<FilterButton> {
return BlocBuilder<GridFilterMenuBloc, GridFilterMenuState>(
builder: (context, state) {
final textColor = state.filters.isEmpty
? null
? AFThemeExtension.of(context).textColor
: Theme.of(context).colorScheme.primary;
return _wrapPopover(

View File

@ -82,7 +82,7 @@ class _GridGroupCell extends StatelessWidget {
text: FlowyText.medium(fieldInfo.name),
leftIcon: svgWidget(
fieldInfo.fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
rightIcon: rightIcon,
onTap: () {

View File

@ -5,6 +5,7 @@ import 'package:appflowy/plugins/database_view/grid/presentation/widgets/header/
import 'package:appflowy/startup/startup.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -96,7 +97,7 @@ class _GridPropertyCellState extends State<_GridPropertyCell> {
Widget build(BuildContext context) {
final checkmark = svgWidget(
widget.fieldInfo.visibility ? 'home/show' : 'home/hide',
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
);
return SizedBox(
@ -115,10 +116,14 @@ class _GridPropertyCellState extends State<_GridPropertyCell> {
triggerActions: PopoverTriggerFlags.none,
margin: EdgeInsets.zero,
child: FlowyButton(
text: FlowyText.medium(widget.fieldInfo.name),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
widget.fieldInfo.name,
color: AFThemeExtension.of(context).textColor,
),
leftIcon: svgWidget(
widget.fieldInfo.fieldType.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
rightIcon: FlowyIconButton(
hoverColor: Colors.transparent,

View File

@ -2,6 +2,7 @@ import 'package:appflowy/plugins/database_view/application/field/field_controlle
import 'package:appflowy/plugins/database_view/application/setting/setting_bloc.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
@ -71,14 +72,17 @@ class _SettingItem extends StatelessWidget {
return SizedBox(
height: GridSize.popoverItemHeight,
child: FlowyButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText.medium(
action.title(),
color: action.enable() ? null : Theme.of(context).disabledColor,
color: action.enable()
? AFThemeExtension.of(context).textColor
: Theme.of(context).disabledColor,
),
onTap: () => onAction(action),
leftIcon: svgWidget(
action.iconName(),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
),
);

View File

@ -52,6 +52,7 @@ class _SettingButtonState extends State<SettingButton> {
triggerActions: PopoverTriggerFlags.none,
child: FlowyTextButton(
LocaleKeys.settings_title.tr(),
fontColor: AFThemeExtension.of(context).textColor,
fillColor: Colors.transparent,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
padding: GridSize.typeOptionContentInsets,

View File

@ -24,7 +24,7 @@ class _SortButtonState extends State<SortButton> {
return BlocBuilder<SortMenuBloc, SortMenuState>(
builder: (context, state) {
final textColor = state.sortInfos.isEmpty
? null
? AFThemeExtension.of(context).textColor
: Theme.of(context).colorScheme.primary;
return wrapPopover(

View File

@ -232,7 +232,7 @@ class _CardMoreOption extends StatelessWidget with CardAccessory {
padding: const EdgeInsets.all(3.0),
child: svgWidget(
'grid/details',
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
);
}
@ -254,7 +254,7 @@ class _CardEditOption extends StatelessWidget with CardAccessory {
padding: const EdgeInsets.all(3.0),
child: svgWidget(
'editor/edit',
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
);
}

View File

@ -3,11 +3,9 @@ import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:flowy_infra/size.dart';
import 'package:styled_widget/styled_widget.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:textstyle_extensions/textstyle_extensions.dart';
import '../cell_builder.dart';
@ -69,7 +67,6 @@ class _PrimaryCellAccessoryState extends State<PrimaryCellAccessory>
Widget build(BuildContext context) {
return Tooltip(
message: LocaleKeys.tooltip_openAsPage.tr(),
textStyle: AFThemeExtension.of(context).caption.textColor(Colors.white),
child: svgWidget(
"grid/expander",
color: Theme.of(context).colorScheme.primary,
@ -125,7 +122,6 @@ class _AccessoryHoverState extends State<AccessoryHover> {
@override
Widget build(BuildContext context) {
List<Widget> children = [
const _Background(),
Padding(padding: widget.contentPadding, child: widget.child),
];
@ -173,28 +169,6 @@ class AccessoryHoverState extends ChangeNotifier {
bool get onHover => _onHover;
}
class _Background extends StatelessWidget {
const _Background({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Consumer<AccessoryHoverState>(
builder: (context, state, child) {
if (state.onHover) {
return FlowyHoverContainer(
style: HoverStyle(
borderRadius: Corners.s6Border,
hoverColor: AFThemeExtension.of(context).lightGreyHover,
),
);
} else {
return const SizedBox();
}
},
);
}
}
class CellAccessoryContainer extends StatelessWidget {
final List<GridCellAccessoryBuilder> accessories;
const CellAccessoryContainer({required this.accessories, Key? key})

View File

@ -1,6 +1,7 @@
import 'package:appflowy/plugins/database_view/application/cell/cell_controller_builder.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -116,7 +117,11 @@ class _ChecklistOptionCellState extends State<_ChecklistOptionCell> {
children: [
Expanded(
child: FlowyButton(
text: FlowyText(widget.option.data.name),
hoverColor: AFThemeExtension.of(context).lightGreyHover,
text: FlowyText(
widget.option.data.name,
color: AFThemeExtension.of(context).textColor,
),
leftIcon: icon,
onTap: () => context
.read<ChecklistCellEditorBloc>()
@ -132,12 +137,13 @@ class _ChecklistOptionCellState extends State<_ChecklistOptionCell> {
Widget _disclosureButton() {
return FlowyIconButton(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
width: 20,
onPressed: () => _popoverController.show(),
iconPadding: const EdgeInsets.fromLTRB(2, 2, 2, 2),
icon: svgWidget(
"editor/details",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
);
}

View File

@ -20,7 +20,7 @@ class ChecklistProgressBar extends StatelessWidget {
percent: percent,
padding: EdgeInsets.zero,
progressColor: Theme.of(context).colorScheme.primary,
backgroundColor: AFThemeExtension.of(context).tint9,
backgroundColor: AFThemeExtension.of(context).progressBarBGcolor,
barRadius: const Radius.circular(5),
);
}

View File

@ -23,9 +23,8 @@ import '../../../../grid/presentation/widgets/common/type_option_separator.dart'
import '../../../../grid/presentation/widgets/header/type_option/date.dart';
import 'date_cal_bloc.dart';
final kToday = DateTime.now();
final kFirstDay = DateTime(kToday.year, kToday.month - 3, kToday.day);
final kLastDay = DateTime(kToday.year, kToday.month + 3, kToday.day);
final kFirstDay = DateTime.utc(1970, 1, 1);
final kLastDay = DateTime.utc(2100, 1, 1);
class DateCellEditor extends StatefulWidget {
final VoidCallback onDismissed;
@ -174,13 +173,13 @@ class _CellCalendarWidgetState extends State<_CellCalendarWidget> {
leftChevronPadding: EdgeInsets.zero,
leftChevronIcon: svgWidget(
"home/arrow_left",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
rightChevronPadding: EdgeInsets.zero,
rightChevronMargin: EdgeInsets.zero,
rightChevronIcon: svgWidget(
"home/arrow_right",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
headerMargin: const EdgeInsets.only(bottom: 8.0),
),
@ -255,7 +254,7 @@ class _IncludeTimeButton extends StatelessWidget {
children: [
svgWidget(
"grid/clock",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
const HSpace(4),
FlowyText.medium(LocaleKeys.grid_field_includeTime.tr()),
@ -386,10 +385,7 @@ class _DateTypeOptionButton extends StatelessWidget {
child: FlowyButton(
text: FlowyText.medium(title),
margin: GridSize.typeOptionContentInsets,
rightIcon: svgWidget(
"grid/more",
color: Theme.of(context).colorScheme.onSurface,
),
rightIcon: const FlowySvg(name: 'grid/more'),
),
),
),

View File

@ -106,7 +106,11 @@ class SelectOptionTag extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
child: FlowyText.medium(name, overflow: TextOverflow.ellipsis),
child: FlowyText.medium(
name,
overflow: TextOverflow.ellipsis,
color: Theme.of(context).colorScheme.onSurface,
),
),
if (onRemove != null)
FlowyIconButton(
@ -139,6 +143,9 @@ class SelectOptionTagCell extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FlowyHover(
style: HoverStyle(
hoverColor: AFThemeExtension.of(context).lightGreyHover,
),
child: InkWell(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,

View File

@ -210,7 +210,7 @@ class _CreateOptionCell extends StatelessWidget {
alignment: Alignment.centerLeft,
child: SelectOptionTag(
name: name,
color: AFThemeExtension.of(context).lightGreyHover,
color: AFThemeExtension.of(context).greyHover,
onSelected: () => context
.read<SelectOptionCellEditorBloc>()
.add(SelectOptionEditorEvent.newOption(name)),
@ -277,7 +277,7 @@ class _SelectOptionCellState extends State<_SelectOptionCell> {
iconPadding: const EdgeInsets.symmetric(horizontal: 6.0),
icon: svgWidget(
"editor/details",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
),
],

View File

@ -5,6 +5,7 @@ import 'package:appflowy/workspace/presentation/home/toast.dart';
import 'package:appflowy_popover/appflowy_popover.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -211,10 +212,8 @@ class _EditURLAccessoryState extends State<_EditURLAccessory>
controller: _popoverController,
direction: PopoverDirection.bottomWithLeftAligned,
offset: const Offset(0, 8),
child: svgWidget(
"editor/edit",
color: Theme.of(context).colorScheme.onSurface,
),
child: svgWidget("editor/edit",
color: AFThemeExtension.of(context).textColor),
popupBuilder: (BuildContext popoverContext) {
return URLEditorPopover(
cellController:
@ -246,7 +245,7 @@ class _CopyURLAccessoryState extends State<_CopyURLAccessory>
Widget build(BuildContext context) {
return svgWidget(
"editor/copy",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
);
}

View File

@ -103,7 +103,7 @@ class _CloseButton extends StatelessWidget {
iconPadding: const EdgeInsets.fromLTRB(2, 2, 2, 2),
icon: svgWidget(
"home/close",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
);
}

View File

@ -8,9 +8,8 @@ import 'package:appflowy_backend/protobuf/flowy-document/entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-user/user_profile.pbserver.dart';
import 'package:appflowy_editor/appflowy_editor.dart'
show EditorState, Document, Transaction, Node;
import 'package:appflowy_backend/protobuf/flowy-folder/trash.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/log.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -49,8 +48,7 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
emit(state.copyWith(isDeleted: false));
},
deletePermanently: (DeletePermanently value) async {
final result = await _trashService
.deleteViews([Tuple2(view.id, TrashType.TrashView)]);
final result = await _trashService.deleteViews([view.id]);
final newState = result.fold(
(l) => state.copyWith(forceClose: true), (r) => state);

View File

@ -1,7 +1,7 @@
import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-document/entities.pb.dart';

View File

@ -5,7 +5,7 @@ import 'package:appflowy/plugins/document/presentation/plugins/parsers/divider_n
import 'package:appflowy/plugins/document/presentation/plugins/parsers/math_equation_node_parser.dart';
import 'package:appflowy/plugins/document/presentation/plugins/parsers/code_block_node_parser.dart';
import 'package:appflowy_backend/protobuf/flowy-document/entities.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

View File

@ -3,7 +3,7 @@ import 'package:dartz/dartz.dart';
import 'package:appflowy_backend/dispatch/dispatch.dart';
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-document/protobuf.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
class ShareService {
Future<Either<ExportDataPB, FlowyError>> export(

View File

@ -10,7 +10,7 @@ import 'package:appflowy/startup/plugin/plugin.dart';
import 'package:appflowy/workspace/presentation/home/home_stack.dart';
import 'package:appflowy/workspace/presentation/widgets/left_bar_item.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -34,7 +34,7 @@ class DocumentPluginBuilder extends PluginBuilder {
PluginType get pluginType => PluginType.editor;
@override
ViewLayoutTypePB? get layoutType => ViewLayoutTypePB.Document;
ViewLayoutPB? get layoutType => ViewLayoutPB.Document;
}
class DocumentPlugin extends Plugin<int> {

View File

@ -1,5 +1,5 @@
import 'package:appflowy/plugins/document/presentation/plugins/board/board_view_menu_item.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_editor_plugins/appflowy_editor_plugins.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy/plugins/document/presentation/plugins/board/board_node_widget.dart';

View File

@ -34,7 +34,8 @@ class DocumentBanner extends StatelessWidget {
contentPadding: EdgeInsets.zero,
bgColor: Colors.transparent,
hoverColor: Theme.of(context).colorScheme.primary,
downColor: Theme.of(context).colorScheme.primaryContainer,
highlightColor:
Theme.of(context).colorScheme.primaryContainer,
outlineColor: Colors.white,
borderRadius: Corners.s8Border,
onPressed: onRestore,
@ -50,7 +51,7 @@ class DocumentBanner extends StatelessWidget {
contentPadding: EdgeInsets.zero,
bgColor: Colors.transparent,
hoverColor: Theme.of(context).colorScheme.primaryContainer,
downColor: Theme.of(context).colorScheme.primary,
highlightColor: Theme.of(context).colorScheme.primary,
outlineColor: Colors.white,
borderRadius: Corners.s8Border,
onPressed: onDelete,

View File

@ -32,6 +32,7 @@ class _FontSizeSwitcherState extends State<FontSizeSwitcher> {
FlowyText.semibold(
LocaleKeys.moreAction_fontSize.tr(),
fontSize: 12,
color: Theme.of(context).colorScheme.tertiary,
),
const SizedBox(
height: 5,
@ -43,9 +44,8 @@ class _FontSizeSwitcherState extends State<FontSizeSwitcher> {
_updateSelectedFontSize(_fontSizes[index].item2);
},
borderRadius: const BorderRadius.all(Radius.circular(5)),
selectedBorderColor: Theme.of(context).colorScheme.primaryContainer,
selectedColor: Theme.of(context).colorScheme.onSurface,
fillColor: Theme.of(context).colorScheme.primaryContainer,
selectedColor: Theme.of(context).colorScheme.tertiary,
fillColor: Theme.of(context).colorScheme.primary,
color: Theme.of(context).hintColor,
constraints: const BoxConstraints(
minHeight: 40.0,

View File

@ -28,7 +28,7 @@ class DocumentMoreButton extends StatelessWidget {
child: svgWidget(
'editor/details',
size: const Size(18, 18),
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).iconTheme.color,
),
);
}

Some files were not shown because too many files have changed in this diff Show More