Compare commits

...
898 Commits
Author SHA1 Message Date
appflowy a19536d525 chore: disable time format temporarily 2022-04-11 21:34:14 +08:00
appflowy 16a167c19c chore: update default grid 2022-04-11 21:14:45 +08:00
Nathan.fooo d0d8295e15 Merge pull request #447 from AppFlowy-IO/feat_grid_row_animation
Feat grid row animation
2022-04-11 21:07:15 +08:00
appflowy ac584fb7ef chore: fix warnings 2022-04-11 20:58:56 +08:00
appflowy f5b140a4d9 chore: disable some test 2022-04-11 20:54:43 +08:00
appflowy 31b2ace48f chore: replace SliverList with SliverAnimatedList 2022-04-11 20:52:15 +08:00
Nathan.fooo 6af78641d2 Merge pull request #446 from AppFlowy-IO/fix_data_error
Fix: grid data parser error
2022-04-11 15:37:27 +08:00
appflowy 82840e1201 chore: replace uuid with nanoid 2022-04-11 15:27:03 +08:00
appflowy f438898831 fix: grid header refresh issue 2022-04-11 14:17:56 +08:00
appflowy 2dd5930560 fix: deserial cells data from delta error 2022-04-11 14:09:50 +08:00
appflowy 9d629412c8 chore: fix transform field type error 2022-04-10 20:27:07 +08:00
appflowy 43095cb0dd chore: close grid handler 2022-04-10 16:29:45 +08:00
appflowy 5db5fd118e chore: highlight cell when edit 2022-04-10 15:07:06 +08:00
Nathan.fooo 5d9763ff7f Merge pull request #442 from AppFlowy-IO/feat_row_delete
Feature: support row delete
2022-04-10 14:57:45 +08:00
appflowy df6871e777 chore: fix wanrings 2022-04-10 14:41:42 +08:00
appflowy fbb2f49b6f chore: enable rust lint and test by remove path 2022-04-10 14:33:34 +08:00
appflowy f01d3250ae chore: reload after delete or insert row 2022-04-10 14:25:25 +08:00
appflowy 420b8ca05d chore: fix deserialize GridBlockMetaPad error 2022-04-10 10:31:55 +08:00
appflowy a755d52371 chore: using cow for row ids stuff 2022-04-10 09:14:42 +08:00
appflowy b92660058c chore: remove grid block from dart side 2022-04-10 07:10:15 +08:00
appflowy d08f298fb6 chore: rename structs 2022-04-09 22:42:42 +08:00
appflowy b93feb49c3 chore: config row action sheet 2022-04-09 22:07:48 +08:00
appflowy ed10ebac7a fix: add new select option tag from textfield 2022-04-09 20:50:03 +08:00
Nathan.fooo ce85050114 Merge pull request #441 from AppFlowy-IO/feat_date_cell
Feautre: support date column
2022-04-09 16:28:18 +08:00
appflowy a53ffdfade chore: update cell when field changed 2022-04-09 16:15:26 +08:00
appflowy 8a94644add chore: config date cell ui 2022-04-09 15:57:12 +08:00
appflowy 0ba0bb62ce chore: config flowy-sync crate log level 2022-04-09 11:55:00 +08:00
appflowy 953af35029 chore: rename struct property 2022-04-09 07:35:35 +08:00
Nathan.fooo 1e997ccaad Merge pull request #440 from AppFlowy-IO/fix_grid_ui_bugs
Fix grid UI bugs
2022-04-08 23:00:28 +08:00
appflowy fc4ed6c057 fix: grid header cell refresh after field was changed 2022-04-08 22:38:38 +08:00
appflowy fc77e0857a fix: select option cell pannel refresh 2022-04-08 21:57:24 +08:00
appflowy 59fbe02ded chore: rename class 2022-04-08 21:21:42 +08:00
appflowy 4f2c733746 chore: Merge branch 'release/0.0.4' 2022-04-08 20:22:40 +08:00
appflowy a035228798 chore: release beta package 2022-04-08 20:16:38 +08:00
appflowy 6de7933a2f fix: the updated option will added to selected option list 2022-04-08 17:44:06 +08:00
Annie 5e686906ec Update CHANGELOG.md 2022-04-08 15:17:54 +08:00
appflowy 1f657f3bf8 fix: blockService exception 2022-04-08 15:13:53 +08:00
Nathan.fooo 7b98e8dbca Update CHANGELOG.md 2022-04-08 14:46:20 +08:00
Nathan.fooo 814fdfe8e9 Merge pull request #438 from AppFlowy-IO/grid_bug_fix
chore: fix some ui bugs
2022-04-08 14:33:26 +08:00
appflowy ef008a7b0b chore: fix some ui bugs 2022-04-08 14:31:33 +08:00
appflowy 9073351cbb chore: disable create grid temporarily 2022-04-07 21:31:38 +08:00
Nathan.fooo 65993b7205 Merge pull request #435 from AppFlowy-IO/grid_field_operation
Grid field operation
2022-04-07 21:26:20 +08:00
appflowy 11627269be chore: config number ui 2022-04-07 20:54:22 +08:00
appflowy e15d335fed chore: config checkbox ui 2022-04-07 20:15:00 +08:00
appflowy c82c6d9c6e fix: deserialize multiple select cell data issues 2022-04-07 17:07:46 +08:00
appflowy bf8a752b4d fix: update row after field was changed 2022-04-07 16:37:12 +08:00
appflowy a3770a699c fix: unit test errors 2022-04-07 15:34:00 +08:00
appflowy d09a5bf42b chore: update and delete select option 2022-04-07 10:57:40 +08:00
appflowy 6a36e2bcfd chore: listen on cell update 2022-04-06 10:32:12 +08:00
appflowy c7a3bb73b9 chore: listen on row update 2022-04-05 22:46:23 +08:00
appflowy 2607822412 chore: show selection 2022-04-05 21:25:59 +08:00
appflowy 99d827f07d chore: update cell data 2022-04-05 14:25:07 +08:00
appflowy 5358203a46 chore: config option editor ui 2022-04-04 20:47:04 +08:00
appflowy 271a8485b6 chore: selection text field 2022-04-04 14:37:08 +08:00
appflowy 1abf0b565f chore: cell highlight 2022-04-04 11:10:41 +08:00
appflowy 5c3500e24c chore: cell select option editor 2022-04-03 22:22:54 +08:00
appflowy aa9e3d065b chore: show and hide property 2022-04-03 20:29:06 +08:00
appflowy 6a94594a35 chore: grid property list 2022-04-03 17:05:28 +08:00
appflowy 5d007c5359 chore: grid setting list 2022-04-03 10:53:31 +08:00
appflowy 147e948b35 chore: add grid setting 2022-04-02 23:54:48 +08:00
appflowy 6ac2617113 chore: update row state using provider 2022-04-02 23:48:56 +08:00
appflowy ca45673a9e chore: transform cell data 2022-04-02 21:30:25 +08:00
appflowy 2262dd0d7b chore: get cell metas 2022-04-02 10:54:01 +08:00
appflowy 82eed0506b chore: fix warnings 2022-04-02 08:54:32 +08:00
appflowy 915d71991a chore: save multi type option data 2022-04-01 22:46:01 +08:00
appflowy e0b969595c chore: save type option data as map 2022-04-01 17:17:31 +08:00
appflowy 80f82fa5b1 chore: update field type option data using deserializer 2022-04-01 09:31:10 +08:00
appflowy 3749168861 fix: fix some bugs 2022-03-31 22:51:46 +08:00
appflowy c3c75dde9f chore: show edit field 2022-03-31 19:45:54 +08:00
appflowy 7c6a857a69 chore: multi select 2022-03-31 14:59:57 +08:00
appflowy 4b27fef76e chore: select option color 2022-03-31 14:43:31 +08:00
appflowy 547b8ec29c fix: fix bugs 2022-03-30 22:51:52 +08:00
appflowy 065a72a8da chore: add option & color selection 2022-03-29 22:58:38 +08:00
appflowy 55b888e364 chore: single selection field 2022-03-29 11:29:21 +08:00
Mike Wallace 0c1670cdab Merge pull request #397 from hasanbeder/main
Add Turkish translation
2022-03-28 21:12:49 -04:00
hasanbeder 32aa19dc39 feat: Add Turkish translation.
Added support for the Turkish language.
2022-03-28 12:29:01 -04:00
hasanbeder dd589e0768 feat: Delete tr-TR.json 2022-03-28 12:28:50 -04:00
hasanbeder 47e2571f38 feat: Update language.dart
Turkish language line is added.
2022-03-28 12:28:35 -04:00
hasanbeder 4a797fcf96 feat: Update app_widget.dart
Turkish language line added.
2022-03-28 12:28:23 -04:00
hasanbeder f829c63bd2 feat: Turkish Language Added 2022-03-28 12:28:05 -04:00
appflowy d2080a6c03 chore: date field 2022-03-28 22:47:30 +08:00
appflowy 35e27b579f chore: number field 2022-03-27 22:38:50 +08:00
appflowy 8b7eee46bb chore: duplicate and hide field 2022-03-27 11:14:21 +08:00
appflowy c7bba01fe5 chore: delete field 2022-03-27 09:35:10 +08:00
appflowy b65b4796d2 fix: add event after bloc close 2022-03-26 22:05:26 +08:00
appflowy 16598650ff chore: lazy load cell 2022-03-26 20:27:32 +08:00
appflowy 28948e567c fix: serde type option data 2022-03-25 20:55:56 +08:00
appflowy 90e7873135 chore: create field 2022-03-25 15:02:43 +08:00
appflowy 2eccd0452b chore: close bloc when overlay dismiss 2022-03-24 23:52:06 +08:00
appflowy 3fdf922f81 chore: config create field pannel 2022-03-24 17:09:05 +08:00
appflowy 694963a47d chore: add update field and create field handler 2022-03-23 22:10:31 +08:00
appflowy 188302d4ba chore: config field editor 2022-03-22 20:51:15 +08:00
appflowy 2bbcfaf3ce chore: config edit pannel 2022-03-21 23:13:19 +08:00
appflowy 475d511829 fix: can't find overlay exists above editabletext 2022-03-20 22:38:57 +08:00
appflowy 1f30a77f1d feat: save text cell data 2022-03-20 17:17:06 +08:00
Nathan.fooo c77a31806d Merge pull request #420 from AppFlowy-IO/opti_compilation
Opti compilation
2022-03-19 18:35:36 +08:00
appflowy 6a3820253f chore: rename crates 2022-03-19 16:55:29 +08:00
appflowy b1d87d95cf chore: remove unuse crates 2022-03-19 16:23:34 +08:00
appflowy 27628cc78e chore: fix rust unit test 2022-03-18 22:13:12 +08:00
Nathan.fooo d6a1afe326 Merge pull request #419 from AppFlowy-IO/feat_grid_ui
Config grid ui
2022-03-18 21:41:52 +08:00
appflowy f181ce106d chore: Merge branch 'main' into feat_grid_ui 2022-03-18 21:09:06 +08:00
appflowy 318d7e6456 chore: fix warnings 2022-03-18 21:07:31 +08:00
appflowy 05bcd38534 chore: render rows 2022-03-18 17:14:46 +08:00
appflowy 9a40fc9974 chore: lazy load row data 2022-03-17 20:59:21 +08:00
appflowy 4730ca9302 chore: refactor grid block 2022-03-17 17:25:43 +08:00
appflowy 1237962ab2 chore: config notification of grid 2022-03-16 21:19:51 +08:00
Nathan.fooo 34530a58ec Merge pull request #415 from AppFlowy-IO/fix_git_protocol_issue
fix: git protocol security issue
2022-03-16 17:56:55 +08:00
appflowy 7fd06361b3 fix: git protocol security issue 2022-03-16 17:39:36 +08:00
appflowy 694c612c67 fix: event handler not found for ApplyDocDelta 2022-03-16 16:34:38 +08:00
appflowy 8c148e3b67 chore: save text cell data & insert row 2022-03-16 16:10:35 +08:00
appflowy b3ed254caf chore: add more test and fix warnings 2022-03-16 10:02:37 +08:00
appflowy 47081f3095 chore: update grid test 2022-03-15 19:00:28 +08:00
appflowy 50f32521c5 chore: rename trait 2022-03-15 11:07:18 +08:00
appflowy 46be04f94e chore: config update cell 2022-03-14 23:16:25 +08:00
appflowy 196d254278 chore: add row test 2022-03-14 17:24:25 +08:00
appflowy d101509b32 chore: add row test 2022-03-13 23:19:43 +08:00
appflowy 572e38ec1c chore: config grid row changeset 2022-03-13 11:07:29 +08:00
appflowy baa70f2ee6 chore: add grid unit test 2022-03-12 22:52:24 +08:00
appflowy 1e6d82c0ec chore: add field builder 2022-03-12 21:53:49 +08:00
appflowy 6579940dc8 chore: create default grid 2022-03-12 10:47:34 +08:00
appflowy df399d3f35 feat: support option enum in pb 2022-03-11 22:07:01 +08:00
appflowy e11176436d chore: grid block meta editor 2022-03-11 21:36:00 +08:00
appflowy 9a791974b4 chore: config grid rev persistence 2022-03-10 22:27:19 +08:00
appflowy cea7d30a53 chore: config BlockMetaPad 2022-03-10 21:43:23 +08:00
appflowy 7ac6a1dc89 chore: rename struct 2022-03-10 17:14:10 +08:00
appflowy e45be3b81e chore: add grid meta 2022-03-10 12:01:31 +08:00
appflowy fe8811392b feat: config cells 2022-03-09 19:37:33 +08:00
appflowy 321682717c chore: opti row rebuild 2022-03-09 12:11:27 +08:00
appflowy 00db755c29 feat: add cloumn bloc 2022-03-09 09:31:06 +08:00
appflowy 808d848f62 feat: cell border 2022-03-08 22:58:43 +08:00
appflowy 54cf451826 feat: config textfield cell 2022-03-08 15:25:56 +08:00
appflowy 0502eec717 chore: config plugin display 2022-03-07 20:51:13 +08:00
appflowy 1c1e955151 chore: set error_task script 2022-03-07 08:30:59 +08:00
appflowy 733b6f7176 feat: disable grid 2022-03-06 22:02:09 +08:00
Nathan.fooo a323073244 Merge pull request #412 from AppFlowy-IO/feat_grid
Create grid/table
2022-03-06 21:55:02 +08:00
appflowy 05441f865e feat: show grid 2022-03-06 21:31:18 +08:00
appflowy 9bb516786e fix: make grid with view_id 2022-03-06 11:28:24 +08:00
appflowy 264166fa29 chore: impl view data processor 2022-03-06 09:25:34 +08:00
appflowy 1b80934899 chore: impl view data processor 2022-03-05 22:30:42 +08:00
appflowy 5c155a07bf feat: move handles to flowy-block crate 2022-03-05 21:15:10 +08:00
appflowy 11ceb96f65 feat: return rows and fields 2022-03-05 17:52:25 +08:00
appflowy 8029f1035d chore: impl handler logic 2022-03-05 10:59:44 +08:00
appflowy d0b457c007 feat: integrate grid into flowy-sdk 2022-03-04 22:09:16 +08:00
appflowy 9125db7ef0 feat: config grid editor 2022-03-04 21:26:32 +08:00
appflowy 49807a0b57 feat: config grid db 2022-03-04 18:13:17 +08:00
appflowy 67e6b091a5 feat: config grid plugin 2022-03-04 18:13:17 +08:00
appflowy 477fa5f4f6 feat: config grid bloc 2022-03-04 18:13:17 +08:00
appflowy 0bbf17f776 feat: add grid widget 2022-03-04 18:13:16 +08:00
appflowy 03f34b143d feat: add grid event 2022-03-04 18:13:16 +08:00
appflowy 4187e99433 feat: add grid struct 2022-03-04 18:13:13 +08:00
appflowy 5549cff177 chore: add flowy-grid crate 2022-03-04 18:12:46 +08:00
appflowy 84afc50cd3 chore: rename classes 2022-03-04 18:12:46 +08:00
Nathan.fooo 383925ba55 Merge pull request #407 from AppFlowy-IO/refactor_flowy_document
Rename flowy-document to flowy-block
2022-03-02 15:46:49 +08:00
appflowy 2e6dd39780 refactor: rename flowy-document to flowy-block 2022-03-02 15:22:18 +08:00
Nathan.fooo 0e8ac4828b Merge pull request #405 from MikeWallaceDev/put_business_logic_in_services2
Put business logic in services2
2022-03-02 10:20:02 +08:00
MikeWallaceDev be14a6b0ad refactor: renamed helper.dart to notification_helper.dart 2022-03-01 11:31:20 -05:00
MikeWallaceDev 31467d3e98 refactor: move resolvers to /startup 2022-03-01 11:31:20 -05:00
MikeWallaceDev c2f2ad24db refactor: Empty out infrastructure folder
move router.dart to user/presentation
move network_monitor.dart to core
move deps_resolver.dart to user/presentation
2022-03-01 11:31:20 -05:00
MikeWallaceDev 853d9e8968 refactor: put UserSettings business logic in a service 2022-03-01 11:31:20 -05:00
MikeWallaceDev 33c758e711 refactor: put Auth business logic in a service 2022-03-01 11:31:20 -05:00
Nathan.fooo e7033aa6e8 Merge pull request #403 from AppFlowy-IO/refactor_document_data_layer
Refactor document data layer
2022-03-01 23:56:05 +08:00
appflowy 8a0308703e fix: compose folder error 2022-03-01 23:38:26 +08:00
appflowy b16b61f46c chore: merge main 2022-03-01 21:09:52 +08:00
appflowy 6eddb7c8c5 chore: serde ViewDataType as u8 2022-03-01 20:51:49 +08:00
Nathan.fooo cace6248e0 Merge pull request #401 from MikeWallaceDev/put_business_logic_in_services
Put business logic in services
2022-03-01 20:29:23 +08:00
Nathan.fooo dd61dd4d2f Merge pull request #402 from tsuiyuenhong/main 2022-03-01 18:58:19 +08:00
appflowy d1ce1686a4 chore: merge main 2022-03-01 16:26:09 +08:00
appflowy 7a36fed778 refactor: remove domain folder 2022-03-01 16:17:09 +08:00
tsuiyuenhong 65917da468 chore: use actions-cache to speed up dart & rust test. 2022-03-01 15:43:42 +08:00
MikeWallaceDev 64d651ab13 refactor: move markdown to application
created a core folder
2022-02-28 23:56:41 -05:00
MikeWallaceDev 4180765dc6 refactor: Put DocShare business logic in a service 2022-02-28 23:45:17 -05:00
MikeWallaceDev afab7f23c4 refactor: Put User business logic in a service 2022-02-28 23:37:41 -05:00
MikeWallaceDev 289b3e31e7 refactor: Put View business logic in a service 2022-02-28 23:06:36 -05:00
MikeWallaceDev 871d0bb7be refactor: put Workspace business logic in a service 2022-02-28 22:38:11 -05:00
appflowy 156d38179a fix: add default value of serde 2022-03-01 11:22:39 +08:00
MikeWallaceDev a979037644 refactor: put App business logic in a service. 2022-02-28 21:42:46 -05:00
appflowy b6de0caad6 refactor: show plugin 2022-03-01 10:25:21 +08:00
MikeWallaceDev 95d33c75a5 refactor: Put Trash business logic in service 2022-02-28 21:17:08 -05:00
MikeWallaceDev 6509247fbd refactor: put document business logic into service 2022-02-28 21:02:46 -05:00
Mike Wallace 8128283ad4 Merge pull request #396 from peter-gy/main
Add Hungarian translation
2022-02-28 20:09:13 -05:00
Mike Wallace 9112bbbcd3 Merge pull request #393 from ikipm/main
Add catalan translation
2022-02-28 19:59:45 -05:00
Mike Wallace d1e1813002 Merge pull request #387 from luzpaz/typos
Fix various typos
2022-02-28 19:59:16 -05:00
appflowy 8747457836 refactor: add plugins 2022-03-01 00:23:04 +08:00
Péter Ferenc Gyarmati d9f7b1047d feature: add Hungarian translation 2022-02-28 11:46:01 +01:00
appflowy 74831964a6 feat: update view properties 2022-02-28 16:00:43 +08:00
ikipm d00425d50b feature: Added catalan translation 2022-02-27 13:41:26 -05:00
luz paz 5d09e1509d fix: various typos
Found via `codespell -q 3 -S *.svg,./frontend/app_flowy/assets/translations -L bloc,crate,homestate,nd,ot,ser`
2022-02-27 13:14:14 -05:00
Mike Wallace 11fee0a815 Update README.md 2022-02-27 13:06:15 -05:00
Mike Wallace 4cf509d695 Merge pull request #302 from lays147/main
Add portuguese translation
2022-02-27 11:21:39 -05:00
Lays Rodrigues 8f50d0c6dc feat: add portuguese translation
Signed-off-by: Lays Rodrigues <laysrodriguessilva@gmail.com>
2022-02-27 10:28:58 -05:00
Nathan.fooo 912fb0b9da Merge pull request #391 from tsuiyuenhong/main
chore: use actions-cache to speed up CI.
2022-02-27 10:44:08 +08:00
tsuiyuenhong 3021bdc1af chore: use actions-cache to speed up CI. 2022-02-26 22:56:48 +08:00
appflowy 23ccfa54b5 feat: config new ViewType 2022-02-26 18:35:42 +08:00
appflowy d18e06a9ef feat: migrate ViewType::Doc to ViewType::QuillDocument 2022-02-26 18:28:09 +08:00
appflowy c843571e3d feat: add new view_type, kanban 2022-02-26 17:28:23 +08:00
Nathan.fooo e282a7672f Merge pull request #388 from AppFlowy-IO/remove_freezed_files
chore: delete remaining freeze files
2022-02-26 17:16:05 +08:00
appflowy d6770c6690 chore: delete freeze files 2022-02-26 16:49:55 +08:00
appflowy 01985848f9 refactor: rename structs 2022-02-26 11:03:42 +08:00
Mike Wallace 0a9fb53ef8 Merge pull request #289 from Aquitano/main
Added german translations
2022-02-25 13:49:31 -05:00
Aquitano / Thomas Breindl e9226243df Merge branch 'main' of https://github.com/Aquitano/appflowy 2022-02-25 11:51:11 -05:00
Aquitano / Thomas Breindl 2d7d61bdaa Renamed de_DE.json to de-DE.json 2022-02-25 11:51:11 -05:00
Aquitano 3eacf70edd Updated german translation
changes were suggested by lguenth
2022-02-25 11:51:11 -05:00
Aquitano / Thomas Breindl cebf097fb2 Added german translations
+ added de_DE.json
+ registered german locale
2022-02-25 11:51:11 -05:00
appflowy 6078e46d3d refactor: rename structs 2022-02-25 23:30:02 +08:00
Nathan.fooo 349a8350c3 Merge pull request #381 from MikeWallaceDev/adjust_commitlint_config
Adjust commitlint config
2022-02-25 13:15:51 +08:00
Nathan.fooo d13a6b9649 Merge pull request #382 from MikeWallaceDev/improve_french_translation
fix: improve French Canadian translation
2022-02-25 13:14:09 +08:00
Nathan.fooo d5cc168d75 Merge pull request #383 from AppFlowy-IO/fix_dart_test
ci: try to fix dart test
2022-02-25 13:13:52 +08:00
appflowy 926b1666dd ci: try to fix dart test 2022-02-25 11:37:14 +08:00
MikeWallaceDev 8bdcb43332 fix: improve French Canadian translation 2022-02-24 21:22:27 -05:00
Mehdi BertulandMikeWallaceDev f8f77db79b Fix the translation to fr-FR (Closes #369) (#371)
* fix: rename fr.json to fr-FR.json
* fix: the translation mistakes in fr-FR.json
* fix: added french language to system

Co-authored-by: MikeWallaceDev <mike@wallacehub.com>
2022-02-24 20:48:47 -05:00
MikeWallaceDev be3141b08e ci: improve commitlint configuration
Added types: build, feature
no longer checks subject's case
now forces a leading blank before body (This is required by Github)
Increased body length to 200
2022-02-24 20:36:18 -05:00
MikeWallaceDev 87cc542275 refactor: change order of rules
rules are now in order of a commit message and separated into sections.
2022-02-24 20:22:02 -05:00
Nathan.fooo 441627783b Merge pull request #379 from AppFlowy-IO/refactor_document
Refactor folder crate structs
2022-02-24 23:52:58 +08:00
Nathan.fooo 03192f8d7e Merge pull request #373 from PabloCastellano/more-docker
Multiple improvements in docker image
2022-02-24 23:25:42 +08:00
appflowy ed9a48fc1c chore: rename struct property 2022-02-24 23:19:41 +08:00
appflowy 93695dc4be chore: rename structs 2022-02-24 20:36:24 +08:00
appflowy 62c104179a chore: ignore ds_store files 2022-02-24 20:35:22 +08:00
appflowy b855a1199d Merge branch 'main' into refactor_document 2022-02-24 17:29:29 +08:00
Nathan.fooo 5fdeff83dd Merge pull request #377 from AppFlowy-IO/fix_dart_test
ci: fix dart test
2022-02-24 17:28:58 +08:00
Nathan.fooo 959b2db9a3 Merge pull request #376 from gaganyadav80/emoji_picker
feat: add emoji picker
2022-02-24 17:18:17 +08:00
appflowy d30ac55b0f ci: fix dart test 2022-02-24 17:08:31 +08:00
appflowy 67a3ba6b34 chore: merge main 2022-02-24 16:49:14 +08:00
Nathan 74ca10cf28 Merge branch 'main' of github.com:AppFlowy-IO/appflowy 2022-02-24 16:17:45 +08:00
nathan 4bcc05fc8a chore: add code gen introductions 2022-02-24 16:17:02 +08:00
Nathan.fooo c5759baea4 Merge pull request #374 from hieugao/refactor/remove-freezed-files
Remove `freezed` files
2022-02-24 16:15:43 +08:00
Hieu 0c9fc35cb3 ci: refactor code generation 2022-02-24 14:40:48 +07:00
Hieu d05e4bbc82 chore: ignore freezed files 2022-02-24 12:56:54 +07:00
Nathan.fooo aa77d52b58 Merge pull request #375 from Pualoo/fix_docbanner
fix: DocBanner overflow issue: #354
2022-02-24 11:58:33 +08:00
gaganyadav80 6ffa1ad191 feat: add emoji picker
1. files are under lib/workspace/presentation/widgets/emoji_picker/
2. add icon for emoji picker button on toolbar.
3. handles case when no emoji is found for the given query.
2022-02-24 02:09:51 +05:30
Pualoo 3a2424cda3 fix: DocBanner overflow issue#354 2022-02-23 14:33:08 -03:00
Hieu 288afbe68b ci: no more sed
Fix "Bad state: Unable to generate package graph"
2022-02-23 22:02:46 +07:00
appflowy c1237452ab refactor: rename some class names 2022-02-23 22:32:27 +08:00
Hieu 6e1c6d7a47 fix: cargo-make platforms, mac not macos 2022-02-23 21:18:20 +07:00
Hieu 6ae8efbdfe ci: generate freezed files 2022-02-23 20:40:22 +07:00
Hieu a0654d8a41 chore: disable invalid_annotation_target warning 2022-02-23 20:39:29 +07:00
Hieu a829d2ac61 refactor: remove freezed files 2022-02-23 20:33:17 +07:00
Pablo Castellano 3bfda80911 docs: add docker command to readme 2022-02-23 13:14:08 +01:00
Pablo Castellano 0b2bb33b73 fix: multiple improvements in docker image
* Reduce image size again, to 894MB
* Adjust permissions and remove need to run xhost
* Run appflowy as unprivileged user
* Add README file for more information
2022-02-23 12:28:28 +01:00
Nathan.fooo b8a4897056 Update CHANGELOG.md
add 0.0.3 version change log
2022-02-23 10:04:14 +08:00
appflowy 3028195e5e chore: rename docker image 2022-02-22 19:32:09 +08:00
Nathan.fooo fe3533cb2c Merge pull request #367 from AppFlowy-IO/docker_setting
Docker setting
2022-02-22 15:49:20 +08:00
appflowy 06d3aace92 ci: update build cache name 2022-02-22 15:48:51 +08:00
Nathan.fooo 3f90170c71 Merge pull request #348 from PabloCastellano/github-docker-push
Push docker image to Docker Hub
2022-02-22 09:18:10 +08:00
Nathan.fooo ef770980f5 Merge pull request #345 from PabloCastellano/docker 2022-02-21 22:47:30 +08:00
Nathan.fooo b5d463578a Merge pull request #364 from tsuiyuenhong/main 2022-02-21 22:46:02 +08:00
Pablo Castellano ca0851418e chore: use docker multi-stage builds
Previous image was 7.69GB which is somewhat heavy.
Now the resulting image is 1.20GB thanks to multi-stage builds.
2022-02-21 10:06:41 +01:00
xurunkang a6221d34cb chore: move CHANGELOG.md to the root dir 2022-02-21 15:59:04 +08:00
Nathan.fooo 7eada39a8b Merge pull request #346 from PabloCastellano/docker-fix
Fix docker build
2022-02-21 10:22:11 +08:00
Pablo Castellano 23795e1b67 feat: add docker-compose data persistance 2022-02-20 11:00:01 +01:00
Nathan.fooo 7314f02282 Merge pull request #352 from AppFlowy-IO/bloc_test
Bloc test
2022-02-20 16:37:40 +08:00
appflowy e3d9d4c42a chore: rename some enum 2022-02-20 16:34:15 +08:00
appflowy 22742c904b chore: rename some classes 2022-02-20 16:12:43 +08:00
appflowy 9012494e1f chore: update launch option 2022-02-20 09:59:52 +08:00
appflowy c9424c5d55 Merge branch 'main' into bloc_test 2022-02-20 08:49:53 +08:00
appflowy cdec567cbb feat: separate develop, release, test working directory 2022-02-20 08:35:52 +08:00
Annie 33358c2a04 Merge pull request #353 from jay-tau/patch-1
Add French Translations
2022-02-20 08:31:45 +08:00
appflowy e9ba9ad149 ci: add .appflowy_dev 2022-02-20 08:06:53 +08:00
appflowy 7d93ed8e81 ci: run actions when specified files changed. 2022-02-20 07:22:39 +08:00
appflowy 860ebc567b ci: update dart_tests 2022-02-20 07:08:42 +08:00
appflowy bf7e1b9829 ci: add build flowy_sdk deps 2022-02-19 23:26:38 +08:00
appflowy 0b0cbe192b ci: run flutter test on ci 2022-02-19 23:19:33 +08:00
Joel Tony 0acb7063ed Add 'fr' 2022-02-19 17:45:34 +05:30
Joel Tony cf1ecaf89b Create fr.json 2022-02-19 15:48:59 +05:30
appflowy 2781809f87 chore: await Sytem launch 2022-02-19 17:12:44 +08:00
appflowy 6fc8197468 feat: build flowy_sdk as dylib on macOS 2022-02-19 16:59:36 +08:00
appflowy c559c5cc6b feat: config bloc test 2022-02-19 16:48:57 +08:00
appflowy 2c3aade0f9 refactor: remove unuse code 2022-02-19 13:52:52 +08:00
appflowy dd8c26df02 refactor: revision_cache with sync_seq 2022-02-19 11:34:31 +08:00
appflowy dd832b7482 chore: rename some struct 2022-02-18 23:04:55 +08:00
Pablo Castellano cea62a5c8e ci: push docker image to Docker Hub 2022-02-17 22:48:34 +01:00
Pablo Castellano 7820c8e70d fix: also mount other required volumes in docker-compose 2022-02-17 21:43:02 +01:00
Pablo Castellano bde597a10b fix: docker build
❌ The protoc-gen-dart was not installed correctly.
✅ You can fix that by adding "dart pub global activate protoc_plugin" to your shell's
config file.(.bashrc, .bash, etc.)
2022-02-17 21:43:02 +01:00
Nathan.fooo 6593855f8f Merge pull request #343 from AppFlowy-IO/fix_windows_build
Fix windows build
2022-02-17 22:36:21 +08:00
Nathan.fooo dab835ad86 Merge pull request #341 from tsuiyuenhong/main
update release CI build steps.
2022-02-17 20:31:49 +08:00
appflowy 06967d8057 fix: path issue on windows 2022-02-17 20:10:29 +08:00
nathan ceaf1ccc21 feat: fix windows build erros 2022-02-17 16:32:10 +08:00
appflowy 33ff6b2f23 chore: update the prompt of protoc-gen-dart installation 2022-02-17 11:18:30 +08:00
visitor eda5d9f4f9 Merge branch 'AppFlowy-IO:main' into main 2022-02-17 09:51:05 +08:00
Nathan.fooo 5c74e1d667 Merge pull request #340 from AppFlowy-IO/fix_potential_ci_error
ci: fix potential ci error
2022-02-16 19:18:03 +08:00
appflowy e1f9260982 chore: fix unit errors 2022-02-16 18:44:42 +08:00
appflowy a7819c6456 chore: delete dart_event.dart 2022-02-16 18:11:25 +08:00
appflowy 373407fd57 ci: fix potential ci error 2022-02-16 18:09:43 +08:00
xurunkang 47d17e6bb2 feat: fix ci build error 2022-02-16 17:23:30 +08:00
Nathan.fooo 91b1430e7b Merge pull request #337 from AppFlowy-IO/auto_gen_dart_event
Auto gen dart event
2022-02-16 16:11:09 +08:00
Nathan.fooo 7335119933 Merge pull request #334 from dadyarri/fix-typo-in-ru-translate
fix typo in ru translate
2022-02-16 15:29:05 +08:00
appflowy 6061dc1989 chore: update unit test 2022-02-16 15:28:00 +08:00
appflowy c760ca6788 chore: update unit test 2022-02-16 14:23:27 +08:00
appflowy 5a0f87fe02 ci: add missing file 2022-02-16 12:27:41 +08:00
appflowy 2a6ce12a55 ci: fix ci errors 2022-02-16 12:22:26 +08:00
appflowy 0aed86737f feat: add dart_event.dart to gitignore 2022-02-16 11:16:24 +08:00
appflowy afd8335e95 chore: cache dart_event.dart file 2022-02-16 11:13:14 +08:00
appflowy cd013529d4 chore: write dart_event file 2022-02-16 11:05:43 +08:00
appflowy bf3a0b6e5b feat: add flowy_clean command to remove the build.rs cache 2022-02-15 22:37:13 +08:00
appflowy 0933935071 refactor: add code_gen crate 2022-02-15 22:18:34 +08:00
appflowy 427d2c2e25 chore: rename functions 2022-02-15 13:27:54 +08:00
appflowy aecf29ddca chore: support compile af on frontend/ directory 2022-02-15 10:10:47 +08:00
Nathan.fooo f65ee293ae Merge pull request #331 from tsuiyuenhong/main
feat: support automated release by Github CI. (macOS/Linux)
2022-02-15 08:29:31 +08:00
Daniil e9712540a1 style: fix typo in ru translate 2022-02-14 14:31:37 +03:00
xurunkang bcf9e83fd7 feat: support automated release by Github CI. (macOS/Linux) 2022-02-14 12:21:10 +08:00
Nathan.fooo fa33f0c21b Merge pull request #327 from hieugao/ci/add-more-commit-prefixes
Add some more commit prefixes
2022-02-13 22:10:37 +08:00
Annie 257ea11ce6 Merge pull request #299 from gustavosr98/main
Added spanish [Venezuela] translations
2022-02-13 12:50:08 +08:00
Nathan.fooo ddcbd25fae Merge pull request #328 from AppFlowy-IO/protoc_bin_vendored
refactor: optimize protobuf code gen process
2022-02-13 12:35:04 +08:00
appflowy 9b8c110a66 refactor: optimize protobuf code gen process 2022-02-13 12:04:34 +08:00
Hieu 320aea039a ci: add some more commit prefixes 2022-02-13 10:03:27 +07:00
Nathan.fooo 9434bff9c9 Update ci.yaml
fix ci.yaml format errors
2022-02-12 10:57:02 +08:00
appflowy ff203a91eb ci: update build macos command 2022-02-11 20:15:40 +08:00
appflowy afa629a2b4 feat: update macOS dev install command 2022-02-11 20:05:55 +08:00
Nathan.fooo f192406afd Merge pull request #325 from AppFlowy-IO/fix_discord_notify
ci: fix notify
2022-02-10 16:20:45 +08:00
appflowy 4e2bd6ba74 ci: fix notify 2022-02-10 16:19:16 +08:00
Nathan.fooo 53e2fbad3d Merge pull request #322 from AppFlowy-IO/revert-321-web_hook_test
Revert "ci: test web hook"
2022-02-10 15:29:11 +08:00
Nathan.fooo 4ba1ba00a5 Revert "ci: test web hook" 2022-02-10 15:28:52 +08:00
Nathan.fooo 5ceaee415c Merge pull request #321 from AppFlowy-IO/web_hook_test
ci: test web hook
2022-02-10 15:23:08 +08:00
appflowy bf36cbccbb ci: test web hook 2022-02-10 15:19:44 +08:00
Nathan.fooo 6d4335ae04 Merge pull request #320 from AppFlowy-IO/discord_web_hook
ci: update discord web hook
2022-02-10 15:16:57 +08:00
appflowy bbbf3006c9 ci: remove release hook 2022-02-10 15:16:37 +08:00
appflowy fa57de5419 ci: update hook file name 2022-02-10 15:16:21 +08:00
appflowy 04f61cdf5e ci: update discord web hook 2022-02-10 15:06:36 +08:00
Nathan.fooo 983fed16dc Merge pull request #316 from dadyarri/add-automatic-notifications
Add automatic notifications
2022-02-10 11:48:08 +08:00
Nathan.fooo e0495b65ab Merge pull request #318 from AppFlowy-IO/action_rename
ci: rename GitHub action
2022-02-10 10:39:51 +08:00
appflowy 45826b5571 ci: rename GitHub actions 2022-02-10 09:15:16 +08:00
Nathan.fooo 8df2dccfce Merge pull request #317 from AppFlowy-IO/opti_proto_gen
Optimize x.proto files geneneration process
2022-02-09 23:01:16 +08:00
appflowy 686507cd67 feat: remove cargo make pb command 2022-02-09 22:26:10 +08:00
appflowy 487e5035bb ci: fix flutter warnings 2022-02-09 22:22:31 +08:00
appflowy f872c6c1f8 ci: fix flutter warnings 2022-02-09 21:56:46 +08:00
appflowy 08433defd8 ci: try generate language files again 2022-02-09 21:47:52 +08:00
appflowy 68dfde4cf8 ci: cargo test without default features 2022-02-09 21:39:12 +08:00
Daniil d6409e5889 ci: add action when new release is published 2022-02-09 21:18:46 +08:00
Daniil ebfddc744b ci: add notification, when english UI strings has been updated 2022-02-09 21:18:39 +08:00
appflowy c407c38dc3 ci: install cargo-make 2022-02-09 21:13:51 +08:00
appflowy ddc2926c9b ci: switch to flutter stable channel 2022-02-09 20:57:49 +08:00
appflowy 17c8f9fdde ci: rename ci & fix generate language file command error 2022-02-09 20:46:39 +08:00
appflowy 82ac2a5d79 ci: generate language files and install pb tools 2022-02-09 20:35:07 +08:00
appflowy 5809758539 refactor: rename error-code to flowy-error-code in case of ambiguous 2022-02-09 19:26:06 +08:00
appflowy 93863462a2 fix: pass unit test 2022-02-09 19:17:15 +08:00
appflowy 7cceafa432 style: fix warnings 2022-02-09 18:39:58 +08:00
appflowy 4b63170e56 refactor: read cache proto info 2022-02-09 18:17:06 +08:00
appflowy 1c3c519b14 refactor: cache proto file info 2022-02-09 13:08:49 +08:00
appflowy 7646f984e0 refactor: generate x.proto file using build.rs 2022-02-09 09:57:03 +08:00
Nathan.fooo 32e0b5e96d Merge pull request #314 from AppFlowy-IO/fix_dart_pb
ci: fix dart pb
2022-02-09 08:02:58 +08:00
appflowy 30bedb337f ci: export path to CI 2022-02-09 07:32:59 +08:00
appflowy 832db73410 ci: add logs 2022-02-09 07:23:57 +08:00
appflowy 837666d36d ci: fix dart pb 2022-02-09 01:14:54 +08:00
Nathan.fooo 10187ce049 Merge pull request #312 from AppFlowy-IO/fix_ci
feat: install protoc-gen-dart if not installed
2022-02-09 01:08:26 +08:00
appflowy 68b0730dda ci: disable dart pb gen 2022-02-09 00:47:43 +08:00
appflowy 1ab3f42477 ci: install protoc binary 2022-02-08 23:52:00 +08:00
appflowy 15d91d3cbe ci: export path 2022-02-08 23:05:28 +08:00
appflowy f55de1fd17 feat: install protoc-gen-dart if not installed 2022-02-08 22:42:00 +08:00
Nathan.fooo 014ff27881 install protoc_plugin 2022-02-08 22:34:02 +08:00
appflowy dd3f1d0b24 ci: install protobuf code gen tool 2022-02-08 21:43:31 +08:00
appflowy 561aa348e9 fix: add futures-core crate features 2022-02-08 21:22:11 +08:00
Nathan.fooo 79d30eb84d Merge pull request #311 from AppFlowy-IO/opti_pb_gen
Opti protobuf code gen
2022-02-08 16:34:39 +08:00
appflowy d0b02cb4fd refactor: generate dart pb files with feature flag: dart 2022-02-08 16:24:59 +08:00
appflowy 9135b92a39 refactor: generate the pb files using build.rs 2022-02-08 14:36:59 +08:00
Gustavo Sanchez ecf2598be7 Merge branch 'main' into main 2022-02-07 16:12:11 -04:00
appflowy 59aed762e7 ci: fix compile errors 2022-02-07 16:04:35 +08:00
appflowy 337161c3d7 style: config log 2022-02-07 15:51:19 +08:00
appflowy 9f8e3b09c3 fix: compile errors 2022-02-07 15:48:01 +08:00
appflowy 0c6903f793 refactor: refactor some crates with http_server 2022-02-07 15:34:46 +08:00
appflowy 084e9c5f6f refactor: refactor some crates with http_server 2022-02-07 15:33:46 +08:00
appflowy 680d130986 refactor: remove unuse crate references 2022-02-07 10:47:09 +08:00
Nathan.fooo 248473dddf Merge pull request #310 from AppFlowy-IO/remove_backend
feat: remove backend
2022-02-06 21:26:16 +08:00
appflowy 67dff1720b feat: remove backend 2022-02-06 11:48:43 +08:00
Nathan.fooo cac0dcaf7f Merge pull request #308 from MikeWallaceDev/fix_readd_russian_language
fix: put back Russian language
2022-02-06 11:42:13 +08:00
Nathan.fooo c5aefeb45e Merge pull request #307 from MikeWallaceDev/fix_makefile_for_commitlint
fix: makefile for commitlint
2022-02-06 11:41:30 +08:00
Gustavo Sanchez e1f6e483e7 Merge branch 'main' into main 2022-02-05 16:35:25 -04:00
MikeWallaceDev 1796d0a448 fix: put back Russian language
set EasyLocalization to not save language locally.
2022-02-05 13:13:48 -05:00
MikeWallaceDev f1a8919772 fix: removed comments 2022-02-05 12:39:35 -05:00
MikeWallaceDev 28e3cb35b8 fix: makefile for commitlint
Fixed the Linux part.
2022-02-05 12:32:12 -05:00
appflowy 62bafce0b2 fix: fallback to supported locale if easy_localization doesn't support device locale 2022-02-05 22:01:51 +08:00
appflowy e9ba1e1886 fix: fallback to supported locale if easy_localization doesn't support device locale 2022-02-05 21:50:49 +08:00
appflowy 0d47397851 feat: config commitlint & ignore commitlint auto generated files 2022-02-05 16:34:29 +08:00
appflowy 592e91bed4 style: supportedLocales list 2022-02-05 11:23:10 +08:00
appflowy 0758db971b refactor: remove unuse imports 2022-02-05 11:16:46 +08:00
appflowy 662220ab8a fix: add toolbar tooltip language display issue 2022-02-05 11:16:46 +08:00
appflowy 18407a0e47 fix: new doc button's langauge display issue 2022-02-05 11:16:46 +08:00
Daniil Golubev cb57d20bfb Added russian translations (#287)
* Added russian translations

* Register russian locale
2022-02-04 21:46:57 -05:00
appflowy a6f675c1d9 fix: locale data deserializere error 2022-02-05 10:27:43 +08:00
appflowy ec4d69e5b8 fix: collapse button display color in dark mode 2022-02-05 10:26:51 +08:00
Nathan.fooo e65a320c00 Merge pull request #306 from MikeWallaceDev/refactor_languange_remove_enum
Refactored Language settings to remove AppLanguage enum
2022-02-05 09:39:51 +08:00
MikeWallaceDev 5519dcd525 refactor: language settings to remove applanguage enum
Fixes: #290
app now uses Locale directly
list of languages is now generated from EasyLocalization
2022-02-04 20:09:41 -05:00
Nathan.fooo 92b3f3e769 Merge pull request #303 from AppFlowy-IO/feat/commit_lint
Feat/commit lint
2022-02-04 20:27:42 +08:00
appflowy ef1d10b377 ci: add commit lint 2022-02-04 15:55:06 +08:00
appflowy ea0179536d fix: show_menu icon on dark mode 2022-02-04 15:54:36 +08:00
Nathan.fooo b21498dc9b Merge pull request #297 from lays147/fix-dockerfile
fix appflowy version in dockerfile
2022-02-03 09:22:37 +08:00
Gustavo Sanchez 062873a1fe Add i18n support for Spanish (Venezuela) 2022-02-02 19:17:34 -04:00
Lays Rodrigues 177ed8d51a fix appflowy version in dockerfile
Signed-off-by: Lays Rodrigues <laysrodriguessilva@gmail.com>
2022-02-02 17:22:29 -03:00
appflowy 728d60239a added reset appearance setting 2022-02-01 12:15:11 +08:00
appflowy df5e178c6c remove unuse codes 2022-02-01 11:29:11 +08:00
appflowy be806e301c read device locale as default locale setting 2022-02-01 09:12:59 +08:00
appflowy 8127e47cea remove redundant interfaces 2022-01-31 10:18:34 +08:00
appflowy 99cadf98d2 remove app interface 2022-01-31 10:18:34 +08:00
appflowy aaca3ba90d remove workspace interface 2022-01-31 10:18:34 +08:00
appflowy 6e8c3c821a remove splash interface 2022-01-31 10:18:34 +08:00
appflowy f709bb6a6d remove iAuth interface 2022-01-31 10:18:34 +08:00
Nathan.fooo 4aa51a933d Merge pull request #292 from FahimFBA/fba-improvement-on-readme
Improved the project's README
2022-01-31 07:59:08 +08:00
FahimFBA df642b54f6 Improved the project's README
Removed the last `.` after **Twitter**.

Closing #291
2022-01-31 01:09:08 +06:00
Nathan.fooo 204c0a90f2 Merge pull request #288 from NewShi/feat/once_cell_perf
feat: use once_cell for perf.
2022-01-30 18:03:26 +08:00
NewPan 2090c36f71 feat: use once_cell for perf. 2022-01-30 15:17:30 +08:00
appflowy fcc6f51b3b rename folder event 2022-01-30 10:33:21 +08:00
appflowy a48031df7c return stream subscription 2022-01-30 10:33:05 +08:00
Nathan.fooo 442bf57e44 Merge pull request #285 from AppFlowy-IO/revert-282-feat/once_cell_perf
Revert "feat: use once_cell for perf."
2022-01-30 09:11:15 +08:00
Nathan.fooo 195bb9edcb Revert "feat: use once_cell for perf." 2022-01-30 09:10:26 +08:00
Nathan.fooo fccd8ad4b9 Merge pull request #282 from newyjp/feat/once_cell_perf
feat: use once_cell for perf.
2022-01-29 23:14:54 +08:00
appflowy 0159414cac set default theme: light 2022-01-29 22:56:20 +08:00
appflowy 3a1136a8fb update setting icon 2022-01-29 22:55:44 +08:00
appflowy 513423a9be fix undo redo issue 2022-01-29 22:47:09 +08:00
NewPan 3e3ac9503c feat: use once_cell for perf. 2022-01-29 22:32:25 +08:00
appflowy 5a3099e323 fix apps refresh issue and share button layout issue 2022-01-29 22:22:34 +08:00
Nathan.fooo 68d4c6dbdb Merge pull request #279 from Hari-07/language_switcher
Language switcher
2022-01-29 14:08:08 +08:00
appflowy 595cfed892 added missing translation 2022-01-29 10:50:14 +08:00
appflowy d7b936a017 fixed language switching issue 2022-01-29 09:24:04 +08:00
Harinandan 835a64ca75 Added language to be observed to application widget 2022-01-28 22:10:11 +05:30
Harinandan 214946cbbc Created UI for Langauge Switching 2022-01-28 22:09:32 +05:30
Harinandan 8e14f8b9f1 Added language to appearance model 2022-01-28 22:09:15 +05:30
Harinandan 95247bc5fb Refactored Language file 2022-01-28 22:08:57 +05:30
Harinandan 578bf963f7 Added language options to Appearance Model 2022-01-28 21:10:13 +05:30
Harinandan 6ea43cd5e5 Created AppLanguage class 2022-01-28 21:03:03 +05:30
appflowy 1c6b78e7d4 fix link button color on dark mode 2022-01-28 22:48:15 +08:00
appflowy beb844da17 fix trash_page display issues on dark mode 2022-01-28 21:38:19 +08:00
appflowy ef8624e87c update dark mode bg3 color 2022-01-28 21:32:45 +08:00
appflowy 564af73076 fix view listen issue because of the notifier didn't dispose. 2022-01-28 21:29:09 +08:00
appflowy 814f9f4c19 save language 2022-01-28 18:48:09 +08:00
appflowy 1c2c1e6250 save theme setting 2022-01-28 18:38:13 +08:00
appflowy 8449f736e7 add user appearance setting 2022-01-28 18:38:09 +08:00
AppFlowy.IO 80242afb93 Merge pull request #277 from MikeWallaceDev/rename_translation_files
Renamed language files to correct format (using a dash)
2022-01-28 09:46:53 +08:00
Mike Wallace 17e82f98d5 Merge branch 'main' into rename_translation_files 2022-01-27 19:57:30 -05:00
AppFlowy.IO 774d9ddcf6 Merge pull request #276 from MikeWallaceDev/add_french_translation
Add French Canadian translation
2022-01-28 08:54:51 +08:00
AppFlowy.IO df0e128810 Merge pull request #275 from MikeWallaceDev/fix_permissions
changed permissions from 755 to 644
2022-01-28 08:47:30 +08:00
MikeWallaceDev e98972cebc Renamed language files to correct format (using a dash) 2022-01-27 19:16:17 -05:00
MikeWallaceDev c9c2ea74ad Add French Canadian translation 2022-01-27 19:02:37 -05:00
MikeWallaceDev e77e6d275f changed permissions from 755 to 644 2022-01-27 14:18:41 -05:00
appflowy 2fa99a563c rename flowy-core to flowy-folder that manages the workspace,app,view 2022-01-27 20:43:43 +08:00
appflowy 17955bcf43 update version to 0.0.3 2022-01-27 20:10:24 +08:00
appflowy eff62b24fb fix under_line and strike_through line issue 2022-01-27 16:40:38 +08:00
appflowy 6b314ea283 fix dark mode theme color 2022-01-27 16:15:46 +08:00
appflowy 75bc7495bd fix folder editor not initialize after hot reload 2022-01-27 15:34:31 +08:00
appflowy c95fdc4782 format log and fix duplicate write issue 2022-01-27 14:07:13 +08:00
AppFlowy.IO 9f54be3fcc Merge pull request #273 from AppFlowy-IO/revision_merging_opti
Optimize revision merging: compact multiple revisions into one
2022-01-27 10:59:19 +08:00
appflowy 8eaec5e58c fix compact bugs & update unit tests 2022-01-27 10:20:09 +08:00
AppFlowy.IO cc86089715 Merge pull request #271 from MikeWallaceDev/remove_duplicate_documentation
Removed duplicate documentation now found on Gitbook
2022-01-27 10:13:00 +08:00
AppFlowy.IO f0f4bc0b30 Merge pull request #268 from Discreater/fix_win_multi_VS
fix windows build with multiple visual studio installations
2022-01-27 10:11:54 +08:00
MikeWallaceDev 1cd1d49c07 Removed duplicate documentation now found on Gitbook
CONTRIBUTING.md now points to Gitbook
2022-01-25 14:40:39 -05:00
appflowy 4cdf3e3e3e compact the revsions 2022-01-25 22:51:32 +08:00
appflowy 61dd68199e refactor sync seq 2022-01-25 19:45:41 +08:00
appflowy 49f1a96cda reduce backend unit test loop time 2022-01-25 15:52:22 +08:00
AppFlowy.IO d333f754c2 Merge pull request #269 from MikeWallaceDev/fix_italian_translation
Fix Italian translation
2022-01-24 16:32:50 -08:00
MikeWallaceDev 44af890f05 Fix Italian translation
settings were not in the correct json group.
2022-01-24 15:17:45 -05:00
appflowy 353bdc592b use flowy_unit_test to make backend test work 2022-01-24 21:54:33 +08:00
appflowy 22c8850cea comment out ack code for later use. 2022-01-24 21:25:46 +08:00
appflowy d97abcc99f rm unuse code & rename folder -> client_folder 2022-01-24 21:17:31 +08:00
appflowy f90e3b63cd config backend log level from env 2022-01-24 20:20:13 +08:00
appflowy 48e9e75cc7 revert flutter quill to v0.0.2 2022-01-24 20:12:04 +08:00
appflowy 7f8c0ed53f add missing it_IT.json from https://github.com/AppFlowy-IO/appflowy/pull/265/files 2022-01-24 18:17:20 +08:00
appflowy bba8f8ae01 fix fmt and clippy warnings 2022-01-24 17:56:58 +08:00
appflowy a9eec5baed solver conflicts 2022-01-24 17:32:40 +08:00
appflowy 24c1817c8d config web socket 2022-01-24 16:27:40 +08:00
Discreater d5ffeb3c8a fix windows build with multiple visual studio installations 2022-01-24 00:52:39 +08:00
appflowy 10d99bdd8b fix init folder manager bugs 2022-01-23 22:33:47 +08:00
AppFlowy.IO 8fa3590661 Merge pull request #267 from AppFlowy-IO/rust_stable_channel
switch to rust stable channel
2022-01-22 20:47:13 -08:00
nathan cfb589dda1 fix format and clippy warnings 2022-01-23 12:14:00 +08:00
nathan dccbd45a00 switch to stable channel 2022-01-23 11:34:41 +08:00
AppFlowy.IO fa91654f68 Merge pull request #266 from AppFlowy-IO/revert-265-main
Revert "Update it_IT.json"
2022-01-22 16:26:58 -08:00
AppFlowy.IO 2031368ac3 Revert "Update it_IT.json" 2022-01-23 08:26:39 +08:00
appflowy 23c4924532 config folder sync on backend 2022-01-22 22:41:24 +08:00
appflowy ccb7d0181f add folder sync test 2022-01-22 20:59:32 +08:00
AppFlowy.IO 1313178924 Merge pull request #265 from fabiograz/main
Update it_IT.json
2022-01-22 03:51:44 -08:00
fabiograz 222067ec5a Update it_IT.json
Replaced literal strings with translation
2022-01-22 01:55:22 +01:00
appflowy 1e66aae051 add server folder manager 2022-01-21 21:41:24 +08:00
AppFlowy.IO 9d8db6e746 Merge pull request #262 from Hari-07/settings-modal
Settings Modal
2022-01-21 05:22:59 -08:00
Harinandan 1c8d5a782b Merge branch 'settings-modal' of github.com:Hari-07/appflowy into settings-modal 2022-01-21 10:40:45 +05:30
Harinandan cae691df9a Moved language generation commands in cmd to seperate lines 2022-01-21 10:40:27 +05:30
MikeWallaceDev 27f900753e Fixed a typo 2022-01-20 22:08:04 -05:00
Mike Wallace dc05a4cc65 Merge branch 'main' into settings-modal 2022-01-20 21:38:22 -05:00
MikeWallaceDev 4da2dadf69 Fixed language generation from build script 2022-01-20 21:32:24 -05:00
Harinandan 33212df63a Fixed problem with translation key gen 2022-01-21 02:54:36 +05:30
appflowy d1c5df4b88 add conflict resolver 2022-01-20 23:51:11 +08:00
AppFlowy.IO 130923af55 Merge pull request #263 from MikeWallaceDev/fix_build_process_on_windows
fixed cargo make to work on Windows
2022-01-20 18:20:28 +08:00
AppFlowy.IO fa006e0b99 Merge pull request #261 from MikeWallaceDev/edit_readme
Update the readme file
2022-01-20 18:20:18 +08:00
MikeWallaceDev 584af6aa71 fixed cargo make to work on Windows 2022-01-19 22:02:16 -08:00
Harinandan 2317f1682c Cleaned up imports 2022-01-20 08:39:46 +05:30
Harinandan 8c17e96c51 Replaced literal strings with translation 2022-01-20 08:37:47 +05:30
MikeWallaceDev ffa9d7bbf4 Update the readme file
Remove installation instructions and point to documentation instead. This removes duplication, and reduces errors.

Change the order of the intro texts

Added cargo-make in the attributions
2022-01-19 21:49:27 -05:00
Harinandan c1ccad104b Fixed adaptive Size issue 2022-01-20 08:13:38 +05:30
Harinandan 907b10b783 Added constrained box 2022-01-19 23:52:12 +05:30
Harinandan fd98b192af Added adaptive theme and change theme button 2022-01-19 14:11:33 +05:30
appflowy 324dc53e5f add folder migration & add folder unit test 2022-01-19 16:00:11 +08:00
Harinandan 0ed1847672 Refactor Settings Menu Element into seperate file 2022-01-19 10:29:02 +05:30
Harinandan 03e58a90d2 Cleanup imports 2022-01-19 10:27:35 +05:30
Harinandan 01d2860948 Basic Setup of Settings Dialog 2022-01-19 10:26:46 +05:30
AppFlowy.IO b2eb964045 Merge pull request #260 from tsuiyuenhong/main
Update README.md
2022-01-19 07:54:55 +08:00
tsuiyuenhong afeda52419 Update README.md 2022-01-18 23:25:03 +08:00
appflowy 44ff74a37c using ot to construct the folder 2022-01-18 22:56:57 +08:00
nathan cfeb408bab lock connectivity_plus version 2022-01-18 21:58:40 +08:00
appflowy 7f1a0adf13 add folder editor 2022-01-17 11:55:36 +08:00
appflowy 3eff006d6d add root folder test 2022-01-16 13:44:14 +08:00
appflowy 6bca483c28 config folder collaboration 2022-01-15 23:58:36 +08:00
appflowy 02201c238c refactor synchoronizer 2022-01-15 11:20:28 +08:00
appflowy 13aba928c3 config folder ws 2022-01-14 21:46:55 +08:00
appflowy 3964508cd8 add flowy-sync crate 2022-01-14 16:25:41 +08:00
appflowy f9b552395b trait for flowy-core persistence 2022-01-14 09:09:36 +08:00
appflowy dac86ef857 refactor flowy-core pb 2022-01-13 14:48:41 +08:00
appflowy 718613de42 flowy-net impl http and local server 2022-01-13 11:15:31 +08:00
AppFlowy.IO 554cfb53e5 Merge pull request #250 from rileyhawk1417/fix_dark_mode
Fixed Dark Mode Bugs
2022-01-12 21:58:04 +08:00
appflowy 0fba8d9195 add server document 2022-01-12 20:48:28 +08:00
appflowy 3c819ead49 stop local websocket before start connecting 2022-01-12 15:40:06 +08:00
appflowy 60e9071685 add some code documentation 2022-01-12 12:40:41 +08:00
appflowy 4bdd9df54c generic cloud storage 2022-01-11 23:15:30 +08:00
appflowy e7aad4045b remove flowy-user unuse files 2022-01-11 13:34:45 +08:00
appflowy 855d396122 refactor cloud service triat 2022-01-10 23:45:59 +08:00
Sean RIley Hawkins 2ae4762de8 Removed unused imports & Refactored 2022-01-10 17:26:46 +02:00
Sean RIley Hawkins 95378dd73a Refactored Values 2022-01-10 17:26:12 +02:00
appflowy 46a3eb57fa rename some structs 2022-01-10 17:39:32 +08:00
Sean RIley Hawkins 5e56f5e0ec Fixed Dark Mode Bugs 2022-01-09 13:22:17 +02:00
appflowy 08a43c03d4 config af log filter 2022-01-09 16:13:08 +08:00
appflowy 7e7254b306 1. fix the potential infinite loop when composing delta. Because of calculating the wrong code unit offset.
2. add test of calculating Chinese character
2022-01-09 11:23:37 +08:00
appflowy c456687a18 1. rename flowy_str functions
2. mv the document_test to flowy_document crate
2022-01-09 11:23:31 +08:00
appflowy 1e0cef41a9 init server with dispatcher's runtime 2022-01-09 11:17:48 +08:00
appflowy 287698be9e enable local ws 2022-01-09 11:17:38 +08:00
Annie f66ea6d224 Merge pull request #248 from fabiograz/main
Update it_IT.json
@fabiograz thanks!
2022-01-08 21:04:55 +08:00
fabiograz 28d8a3a269 Update it_IT.json
Changed:  lightMode, darkMode, instruction1, instruction2,  instruction4
2022-01-07 23:42:12 +01:00
AppFlowy.IO 2a134bcb40 fix light theme issues (#215)
* fix light theme issues
* rm hoverColor in ThemeData
2022-01-06 12:18:35 -05:00
appflowy 956ad1b590 replace tag with ref commit-hash to fix some cache issue 2022-01-06 14:42:17 +08:00
appflowy 1cfcbbc35b add patch for flutter-quill to fix the checkbox customize issue 2022-01-06 14:08:45 +08:00
appflowy 9ca2d60f3f correct the document delta by removing unnecessary op 2022-01-06 12:55:30 +08:00
Mike Wallace b239f28d10 Added Windows script for langage generation (#212) 2022-01-05 14:17:27 -05:00
appflowy 4fd9388b79 fix clippy warnings 2022-01-05 23:28:52 +08:00
appflowy a488944d2c Saving the revision in serial 2022-01-05 23:15:55 +08:00
appflowy 53126c47d1 rename flowy str iterator 2022-01-05 23:06:26 +08:00
appflowy 85ad90fc51 Try to fix quill-editor load document error. Because Document can only contain insert operations 2022-01-05 22:39:07 +08:00
AppFlowy.IO ddd0dec5c3 Merge pull request #211 from AppFlowy-IO/fix_ci
test fix
2022-01-05 11:34:03 +08:00
appflowy 33d82a5104 fix migrate to flutter_bloc 8.0 CI errors 2022-01-05 10:46:17 +08:00
appflowy 2e047de2a2 update flutter_bloc version to 8.0.1 2022-01-04 23:11:51 +08:00
appflowy 1846f86dd7 fix fmt warnings 2022-01-04 22:54:13 +08:00
appflowy b354fb79c8 migrate to flutter_bloc 8.0 2022-01-04 22:44:52 +08:00
appflowy 96f6a1d37c remove unuse code 2022-01-04 22:44:52 +08:00
appflowy 3fd3389f62 add aliases for protobuf struct 2022-01-04 22:44:52 +08:00
AppFlowy.IO 7b772a8a6e Update README.md 2022-01-04 14:23:44 +08:00
AppFlowy.IO 89bff10c84 Update README.md
add generate language files instructions
2022-01-04 11:27:28 +08:00
appflowy af08c55ebf fix fmt warnings 2022-01-03 20:13:48 +08:00
appflowy 661940f728 fix test bugs 2022-01-03 19:50:08 +08:00
appflowy 951584c2ab [backend]: fix reset document bugs 2022-01-03 19:50:08 +08:00
appflowy 1a869c0003 config ping test 2022-01-03 19:50:08 +08:00
appflowy 12e8424e8a send document ping 2022-01-03 19:50:08 +08:00
appflowy df5266d7c9 fix https://github.com/AppFlowy-IO/appflowy/issues/196 2022-01-03 19:50:08 +08:00
appflowy a654623c12 mv sync seq to revision manager 2022-01-03 19:50:08 +08:00
appflowy 09ef0927f7 save create default workspace data 2022-01-03 19:50:08 +08:00
appflowy 45821f00a2 rename some structs 2022-01-03 19:50:08 +08:00
appflowy 282ed9067a remove some passthrough funcs 2022-01-03 19:50:08 +08:00
appflowy f17f0dd6cf fix compile errors 2022-01-03 19:50:08 +08:00
appflowy 152cb17701 fix bugs 2022-01-03 19:50:08 +08:00
appflowy e4e40ebe20 reset document data using transaction 2022-01-03 19:50:08 +08:00
appflowy 049b8828fe generic kv 2022-01-03 19:50:08 +08:00
appflowy a0e6c61f50 config virtual net 2022-01-03 19:50:08 +08:00
appflowy bbc9190bc0 add virtual net 2022-01-03 19:50:08 +08:00
appflowy 0c7c3621d7 separate DocumentWSData into DocumentWSClientData and DocumentWSServerData 2022-01-03 19:50:07 +08:00
appflowy 2b9ce79ed4 refactor flowy-collaboration directories 2022-01-03 19:50:07 +08:00
appflowy 95e0418d97 compare revisions 2022-01-03 19:50:07 +08:00
appflowy e069bfb057 test with batch set and batch get revision 2022-01-03 19:49:25 +08:00
appflowy 463cab6eee fix warnings 2022-01-03 19:49:25 +08:00
appflowy 64ea2d4f31 [backend]: refactor document persistence 2022-01-03 19:49:25 +08:00
appflowy 777082c879 mv revision to flowy-collaborate 2022-01-03 19:49:25 +08:00
appflowy cb4398eab0 config document kv store 2022-01-03 19:49:25 +08:00
appflowy eb601932ea add backend kv store 2022-01-03 19:49:25 +08:00
AppFlowy.IO da4f7f40e7 Merge pull request #209 from Poly-Pixel/update-device-info-plus
Update device_info_plus to version 3.2.1
2022-01-03 19:43:21 +08:00
Poly-Pixel da1ed0c320 Update device_info_plus to version 3.2.1 2022-01-02 13:49:36 -05:00
Mike Wallace dd5d745c31 Theme Toggle Button for AppFlowy. Created by @rileyhawk1417 (#206)
* Added Theme Toggle
* Modified translations
2022-01-02 12:54:49 -05:00
Mike Wallace cd85f3f464 Added a line to update the pacman repository database 2021-12-28 15:10:53 -05:00
Mike Wallace bda6840523 Remove generated files (#202)
* deleted generated directory from file system

* Removed generated language files from source control
Files are now generated when building the app or by launching "Generate Language Files"

added /lib/generated/ to git .ignore
added a task to generate language files
call task from build script

* added pub get to workflow
2021-12-25 20:23:02 -05:00
Poly-Pixel bc645af3e2 Add debug info button (#189)
* Add debug info button

* Get rid of extra line

* Upgrade to device_info_plus 3.2.0 & format debug info

* Remove unused import

* Use locale translation mechanism
2021-12-24 19:10:09 -05:00
Mike Wallace c2196c7dba Update application_widget.dart
changed the default back to light theme.
2021-12-24 13:35:31 -05:00
Sean Riley HawkinsandMikeWallaceDev 6325bd300b [FR] Dark Mode (#185)
* Rewrote to change with light and dark mode 🔧

* Changed files to match theme switches

* Fixed text color switch

* Configured accent color for trash page

* Configured hover color for dark mode

* Configured container colors for dark mode

* Configured text to switch with themes

* Added values to change with theme

* Configured to work with theme colors

* Text not affected by theme

* Theme can be changed here

* Used gray instead of white color

* Rewrote to change with light and dark mode 🔧

* Changed files to match theme switches

* Fixed text color switch

* Configured accent color for trash page

* Configured hover color for dark mode

* Configured container colors for dark mode

* Configured text to switch with themes

* Restored deleted file

* Rewrote to change with light and dark mode 🔧

* Changed files to match theme switches

* Fixed text color switch

* Configured accent color for trash page

* Configured hover color for dark mode

* Configured container colors for dark mode

* Configured text to switch with themes

* Rewrote to change with light and dark mode 🔧

* Changed files to match theme switches

* Configured accent color for trash page

* Removed file

* Used theme.dart colors

* Removed comments and added colors

* Refactored and added hover colors

* removed generated files
fixed warnings

Co-authored-by: MikeWallaceDev <mike@wallacehub.com>
2021-12-24 13:20:48 -05:00
AppFlowy.IO 547be89b72 Merge pull request #197 from MikeWallaceDev/fix_application_menu_size_141
Fix application menu size
2021-12-24 17:08:33 +08:00
Mike Wallace e0e48f1e99 Deleted doc file, it's in the wiki now. (#198)
Move the scripts to the script folder.
2021-12-23 23:47:33 -05:00
Rushi Chaudhari 3d67c0698a Added support for docker image in docs/docker-buildfiles (#164)
* added docker

* updated cleaner dockercompose

* readme

* changed docker readme

* noconfirm removed
2021-12-23 14:30:03 -05:00
MikeWallaceDev 9fc13c7d62 Fixes #141
removed the SizedBox. Leaving the size to adjust automatically depending on the footer's content.
2021-12-23 14:03:51 -05:00
Hari07 7270c578e9 Increased height of ActionCell (#193)
LGTM!
2021-12-22 22:41:19 -05:00
appflowy b25db57fca fix warnings. 2021-12-21 14:00:42 +08:00
appflowy adce96f15b fix generate pb bugs 2021-12-21 14:00:42 +08:00
appflowy d9421f70a0 refactor backend directory 2021-12-21 14:00:41 +08:00
Mike Wallace b04111e5a3 Add files via upload 2021-12-20 22:41:06 -05:00
Mike Wallace b22b8ab3a0 Added two images for the wiki 2021-12-20 21:16:26 -05:00
appflowy b66f46108d disable sync test 2021-12-20 20:59:33 +08:00
appflowy e55b79d3e6 Merge branch 'feat/online2' 2021-12-20 15:38:41 +08:00
appflowy d3a00b14b0 enable local web socket 2021-12-20 15:37:37 +08:00
appflowy ef491f4276 mv lib-sqlite to rust-lib 2021-12-20 14:26:26 +08:00
Pablo Castellano f0b61546fe Fix command in README (#182)
LGTM again!!  :D
2021-12-19 23:09:38 -05:00
appflowy 16c702b1e1 fix listen on websocket error 2021-12-20 12:06:17 +08:00
appflowy 936e133624 rename crates 2021-12-19 21:29:33 +08:00
appflowy 77be3e9c71 send connect message when open the document 2021-12-19 21:17:45 +08:00
fabiograz 79aa20d662 Italian Translation (#176)
* Italian Translation

* Rename it_it.json to it_IT.json

* Add Italian Translation to app
2021-12-19 01:50:43 -05:00
appflowy 987a246c80 send user connect message 2021-12-18 18:35:45 +08:00
AppFlowy.IO baade1f5d4 Merge pull request #179 from MikeWallaceDev/automate_build_sdk_sh
Automate build sdk sh
2021-12-18 12:21:30 +08:00
Mike 7a264dba6a Build system will now detect OS and pass it down to build_sdk.sh.
build_sdk.sh will now automatically choose the correct cargo-make command line based on the OS

# Conflicts:
#	frontend/scripts/build_sdk.sh
2021-12-17 22:48:07 -05:00
Mike fc74b2b962 Build system will now detect OS and pass it down to build_sdk.sh.
build_sdk.sh will now automatically choose the correct cargo-make command line based on the OS
2021-12-17 22:31:01 -05:00
Mike d445aeb304 Build system will now detect OS and pass it down to build_sdk.sh.
build_sdk.sh will now automatically choose the correct cargo-make command line based on the OS
2021-12-17 22:21:11 -05:00
AppFlowy.IO cdb36f9526 Merge pull request #178 from MikeWallaceDev/add_linux_desktop_file
Add linux desktop file
2021-12-18 09:26:44 +08:00
Mike 327fa0c811 Makefile.toml
- Removed duplicate BUILD_FLAG

flutter.toml
task copy-to-product-linux now copies desktop file and icon
- Added create-release-archive task
- Implemented create-release-archive-linux. Windows and Mac remain to be done.

Added appflowy.desktop.temp file.
2021-12-17 14:34:35 -05:00
appflowy 1744938a51 fix bugs 2021-12-18 00:23:26 +08:00
Mike Wallace 913da7ce5b Add files via upload
Added AppFlowy title image
2021-12-16 14:05:42 -05:00
Mike a93d7e1987 Just fixed some grammar 2021-12-16 12:01:26 -05:00
appflowy 405c618d27 rename some struct 2021-12-16 22:24:05 +08:00
Annie 6f5e19d053 Merge pull request #160 from MikeWallaceDev/add_linux_to_readme
Improved the main README.md
2021-12-16 21:37:12 +08:00
appflowy 4a46bf3fa3 refcator web socket message sent logic 2021-12-16 21:31:36 +08:00
Mike 9b85349650 Forgot to hit Ctrl-S on my last change! 2021-12-15 21:09:35 -05:00
Mike b413fade91 Added AppFlowy logo at top of page
Simplified and removed a lot of duplication
Change the order of things to make the contributions go from easy to hardest
There were many redundant sentences. Like explaining what to put in a Bug Report when we already have a template for that. People can see. :D
2021-12-15 20:56:21 -05:00
Mike 72a851bd7e Fixed some grammar 2021-12-15 19:15:51 -05:00
Mike 4a49669cc5 Put the steps for existing translations first, this will be the most used case.
Simplified the wording of the 'add new language' case.
2021-12-15 17:41:02 -05:00
Mike 869399eb16 Added references to the Linux and Windows build instructions
Added temporary instructions for how to install on Linux and Windows
2021-12-15 16:30:50 -05:00
appflowy 511b6658a4 md5 for consistency check 2021-12-15 23:01:50 +08:00
appflowy ef6e777ec0 fix warnings 2021-12-15 16:28:18 +08:00
Annie 446da06212 Merge pull request #139 from naughtz/main
Add i18n/zh-CN support
2021-12-15 08:48:24 +08:00
Naughtz a8b42cbc95 Merge branch 'AppFlowy-IO:main' into main 2021-12-14 21:15:11 +08:00
appflowy 84d5d2c2f1 start ws connect after sign up 2021-12-14 20:50:07 +08:00
AppFlowy.IO c93e73d3d1 Merge pull request #152 from naughtz/Windows10X86_64_verified
build on windows 10 X86_64 verified
2021-12-14 18:22:59 +08:00
AppFlowy.IO 1b1ab4ad26 Merge pull request #150 from slidoooor/main
Fix some spelling errors
2021-12-14 18:22:10 +08:00
appflowy 013d8f753a refactor errors 2021-12-14 18:20:07 +08:00
naughtz 2e24ae65fd build on windows 10 X86_64 verified 2021-12-14 17:34:11 +08:00
appflowy 72a8f7a9e3 mv websocket to flowy-net crate 2021-12-14 15:31:44 +08:00
Hans 75f021744b fix spelling 2021-12-14 12:55:49 +08:00
Hans 6f05d317e9 Fix spelling 2021-12-14 12:52:20 +08:00
naughtz a5facab7e3 Add space between English word and Chinese charactor 2021-12-14 11:54:25 +08:00
Annie 72fef86e28 Merge pull request #142 from MikeWallaceDev/Fix_typo_issue_140
Changed string "Untitles" to "Untitled"
2021-12-14 11:03:03 +08:00
Mike 5946dd0b7b Changed string "Untitles" to "Untitled" 2021-12-13 16:50:04 -05:00
naughtz 8adc4501ef Add i18n/zh-CN support
add language support(chinese)
2021-12-13 23:21:37 +08:00
appflowy 5b7e6690f8 test sync 2021-12-13 22:46:35 +08:00
AppFlowy.IO bf344685e6 Merge pull request #137 from MikeWallaceDev/ExportToMarkdown
Added missing attributes to markdown renderer
2021-12-13 19:40:05 +08:00
appflowy 31086ad4df add mock server 2021-12-13 13:55:44 +08:00
Mike ab214d4a74 Added missing attributes to markdown renderer 2021-12-12 23:37:34 -05:00
appflowy df432d11c3 add flowy-net crate 2021-12-12 21:48:52 +08:00
appflowy dfa9c04f5a mv kv to flowy-database 2021-12-12 21:18:23 +08:00
AppFlowy.IO 54cd9eca8c Merge pull request #135 from MikeWallaceDev/FixBuildSdkSh
Fix build sdk sh
2021-12-12 20:57:41 +08:00
appflowy 0231ad3adf add doc persistence trait 2021-12-12 16:02:58 +08:00
appflowy 90e3ba14f1 mv server's DocManager to flowy_collaboration crate 2021-12-12 12:41:16 +08:00
Mike 94dc76d1a9 Fix build_sdk.sh
Fixed a typo (aarch64 -> x86)
Since I was here : Capitalized the OS names
2021-12-11 23:38:49 -05:00
Mike 66defa85f6 Edited Linux Instructions
Fixed the numbering (Github doesn't do numbering correctly...)
Added step showing how to start coding in VS Code
Changed server step from Optional to TBD
2021-12-11 23:15:11 -05:00
AppFlowy.IO c2f4ee4cac Merge pull request #133 from MikeWallaceDev/linux-docs
Updated Linux build document
2021-12-11 22:29:02 +08:00
Mike 31ced8bde7 Removed lines concerning yaml backend 2021-12-11 09:07:24 -05:00
appflowy d3bfca10e9 refactor backend editor 2021-12-11 17:48:39 +08:00
appflowy d80061461b add flowy-collaboration crate 2021-12-11 13:47:16 +08:00
AppFlowy.IO 85cc9b60d9 Merge pull request #132 from irfanbacker/translation-doc-patch
Add translation documentation
2021-12-11 10:16:12 +08:00
Mike c8f6f4861b Marked Arch Linux as being verified (however protobuf isn't working yet)
Restructured the steps to better separate concerns
Added instructions for Arch Linux
Highlighted some steps that may be overlooked by someone who already has Flutter installed (or that I found confusing during installation
Moved environment settings to Step 5
2021-12-10 13:16:41 -05:00
Irfan Backer b73f35b18c Add translation guide doc 2021-12-10 23:31:30 +05:30
appflowy 69ee8aff55 rename flowy-workspace-infra 2021-12-10 22:48:30 +08:00
appflowy aeb448c4de mock websocket 2021-12-10 22:18:44 +08:00
appflowy 34441ee076 add test 2021-12-10 15:15:33 +08:00
appflowy d283d29202 [flutter]: switch to stable channel 2021-12-10 14:43:57 +08:00
appflowy 45d9a0918f add user_id in revision 2021-12-10 11:22:21 +08:00
appflowy 3fa0f97e74 add pb generation log 2021-12-10 11:22:14 +08:00
appflowy 909406bf08 fix bugs & add unit test 2021-12-10 11:22:07 +08:00
appflowy 0172fc71db stop sync after close the view 2021-12-10 11:22:00 +08:00
appflowy 6b338d4cc5 add feature flowy_unit_test 2021-12-10 11:21:53 +08:00
appflowy 7ac55f29db refactor tests 2021-12-10 11:21:45 +08:00
appflowy 4450d4410b send revision periodically 2021-12-10 11:21:39 +08:00
appflowy 23f4684d3f add revision cache layer 2021-12-10 11:21:31 +08:00
appflowy 8a9a23ddbe add rich_text crate 2021-12-10 11:21:25 +08:00
appflowy 2f413a8e67 generic lib-ot 2021-12-10 11:21:17 +08:00
appflowy 8457682092 refactor backend dir hierarchi 2021-12-10 11:21:06 +08:00
appflowy 6298a0d96d add core 2021-12-10 11:20:52 +08:00
appflowy 29c14949cb reanme flowy-workspace to flowy-core 2021-12-10 11:20:29 +08:00
appflowy cea83238eb update ignore 2021-12-10 11:20:21 +08:00
AppFlowy.IO e28b1ab8b3 Merge pull request #129 from irfanbacker/i18n-patch
Add i18n support
2021-12-08 08:56:58 +08:00
Irfan Backer 2aaa076592 Add default en translation for i18n 2021-12-07 23:01:23 +05:30
Irfan Backer b8ce9b9afb Setup basic i18n configs 2021-12-07 22:58:50 +05:30
Annie 90cac1819a Merge pull request #123 from muzimuzhi/patch-1
docs: s/APGL/AGPL/
2021-12-06 15:06:27 +08:00
muzimuzhi a519e96b17 docs: s/APGL/AGPL/ 2021-12-06 14:37:37 +08:00
appflowy a935f25344 fix build linux github action 2021-12-06 08:41:14 +08:00
appflowy 5a89655982 setup flowy sdk server configuration 2021-12-06 08:35:17 +08:00
AppFlowy.IO 52d510691f Create ci.yaml 2021-12-06 00:45:07 +08:00
AppFlowy.IO ee9884ba34 Update ci.yaml 2021-12-06 00:44:51 +08:00
appflowy 90b5eca5d9 fix compile errors 2021-12-05 14:06:10 +08:00
appflowy bb07eeb2e2 move network state to lib-infra 2021-12-05 14:06:10 +08:00
Annie b701abed12 Merge pull request #120 from factotvm/capital-improvements
Correct the capitalization of GitHub
2021-12-05 10:50:56 +08:00
Daniel Thompson 2e7ab3000f Correct the capitalization of GitHub
To accomplish this task, I ran the following command (on macOS):

    find . -type f -print0 | xargs -0 sed -i '' 's/Github/GitHub/g'

GitHub, for better or worse, decided that the way their company is
spelled is with a capital "G" and a capital "H" and it's their name so
they get to do that if they want.

When I went to check out AppFlowy's web site, I noticed that GitHub
wasn't spelled correctly, and for me, this made the project feel less
than polished and myself reluctant to try it out. However, there is only
one way to find out about the project: I [opened a ticket]. And BAM! It
was resolved in mere hours by @annieappflowy. Nice.

With fresh motivation to check out the project, I downloaded the app
and...found myself staring at the same issue on the first screen of the
app. Well, as I was a bit flippant with the issue I opened up for the
web site misspellings, I decided to fix this one myself.

[opened a ticket]: https://github.com/AppFlowy-IO/appflowy/issues/118
2021-12-04 20:52:12 -05:00
appflowy ce8805aff8 fix wanrings 2021-12-04 23:54:14 +08:00
appflowy 31efacb274 monitor network state 2021-12-04 22:31:30 +08:00
appflowy 63082418be fix generate pb issues 2021-12-04 17:31:43 +08:00
appflowy c649673b2b rename flowy-dispatch structs 2021-12-04 11:26:17 +08:00
appflowy 76691e3e8c rename ffi func 2021-12-04 10:27:08 +08:00
appflowy e7cc11cc44 rename some structs 2021-12-03 22:40:56 +08:00
appflowy 6fa7b0632a optimaze docker image size 2021-12-03 18:13:38 +08:00
appflowy 2514a65617 add rust-toolchain of backend 2021-12-03 18:13:38 +08:00
AppFlowy.IO 643bb25e2b Update README.md 2021-12-03 12:49:05 +08:00
AppFlowy.IO 67ef72ee41 Merge pull request #110 from 0xN0x/main
Update emojis to 13.1
2021-12-03 10:56:16 +08:00
AppFlowy.IO 719c2d10c7 Merge pull request #115 from pratikbalar/main
ci: correct spell, github-actions based  ...
2021-12-03 10:55:07 +08:00
Pratik Balar 0999263902 ci: correct spell, github-actions based ...
- github-actions based flutter checkout
- fix 80 column ruler.
2021-12-02 23:20:03 +05:30
AppFlowy.IO 83b30a2185 set POSTGRES_PORT to 5433 2021-12-02 22:40:24 +08:00
AppFlowy.IO 31d3ffb664 Update backend_general.yml 2021-12-02 22:22:46 +08:00
appflowy 739333c29c fix clippy warnings of backend 2021-12-02 21:55:23 +08:00
appflowy 24ea68c605 build backend docker image 2021-12-02 21:55:23 +08:00
AppFlowy.IO 06a91b02fb Update backend_general.yml 2021-12-02 16:40:49 +08:00
AppFlowy.IO 6653385a85 Merge pull request #108 from stephengroat/patch-3
Add brew install instructions
2021-12-02 16:29:31 +08:00
appflowy 6e51173335 build docker 2021-12-02 16:28:50 +08:00
Annie b17a3f50db Update ReadMe.md
included a link to the Troubleshooting page
2021-12-02 15:31:40 +08:00
appflowy cb802c3162 update backend_general ci 2021-12-02 00:12:35 +08:00
AppFlowy.IO 76c1cd70a5 Update backend_general.yml 2021-12-01 23:44:38 +08:00
appflowy 8f582faffe add docker-compose 2021-12-01 23:29:51 +08:00
AppFlowy.IO 5f064b8118 Update backend_general.yml 2021-12-01 20:51:17 +08:00
AppFlowy.IO e46326f775 Rename dart_general.yml to frontend_dart.yml 2021-12-01 20:34:07 +08:00
AppFlowy.IO cdc6da835e Rename rust_general.yml to frontend_rust.yml 2021-12-01 20:33:44 +08:00
AppFlowy.IO 10febe2497 Update dart_general.yml 2021-12-01 20:32:17 +08:00
AppFlowy.IO d1364354ff Update rust_general.yml 2021-12-01 20:31:56 +08:00
appflowy 488ba00456 update backend_general ci 2021-12-01 17:54:14 +08:00
appflowy e1ed027b9c update backend scripts 2021-12-01 17:39:23 +08:00
appflowy 6504863586 update backend scripts 2021-12-01 17:23:37 +08:00
N0x d33f646790 Update emojis to 13.1 2021-12-01 10:16:54 +01:00
appflowy d6b5e4c404 update backend scripts 2021-12-01 17:15:46 +08:00
appflowy 6b7a46e781 update backend scripts 2021-12-01 17:09:58 +08:00
AppFlowy.IO aa86a44af8 Update ci.yaml 2021-12-01 17:03:26 +08:00
appflowy 8259752958 update backend scripts 2021-12-01 17:01:15 +08:00
AppFlowy.IO 826be05494 Update backend_general.yml 2021-12-01 16:47:15 +08:00
appflowy 2d058ea100 config docker ci 2021-12-01 16:44:58 +08:00
AppFlowy.IO d8171238f2 Create backend_general.yml 2021-12-01 11:22:32 +08:00
appflowy 28f0288526 update rust_general ci 2021-12-01 11:11:36 +08:00
appflowy d822f036e0 speed up ci 2021-12-01 11:08:37 +08:00
AppFlowy.IO e763525c58 Update rust_general.yml 2021-12-01 11:03:52 +08:00
appflowy f22cf6349b update ci 2021-12-01 11:01:03 +08:00
AppFlowy.IO 079f18d727 Update rust_general.yml 2021-12-01 10:31:50 +08:00
Stephen 321de104fe Add brew install instructions
https://github.com/Homebrew/homebrew-cask/pull/115114
2021-11-30 11:44:13 -08:00
AppFlowy.IO 841d5e6fd0 Update rust_general.yml 2021-11-30 18:08:01 +08:00
AppFlowy.IO 57f8226b38 Update rust_general.yml 2021-11-30 17:55:25 +08:00
AppFlowy.IO 3363952a23 Update rust_general.yml 2021-11-30 15:40:11 +08:00
AppFlowy.IO 0c1263cb78 Update dart_general.yml 2021-11-30 15:35:15 +08:00
appflowy c4088622f8 rust fmt 2021-11-29 22:01:46 +08:00
appflowy 8c54949271 rust fmt 2021-11-29 22:01:46 +08:00
AppFlowy.IO 1239c9026e Update rust_general.yml 2021-11-29 21:55:28 +08:00
AppFlowy.IO 964aec8066 Update rust_general.yml 2021-11-29 21:50:36 +08:00
AppFlowy.IO 8940f87935 Create dart_general.yml 2021-11-29 21:49:22 +08:00
AppFlowy.IO fc82b2b7e1 Rename general.yml to rust_general.yml 2021-11-29 21:47:40 +08:00
AppFlowy.IO c8a7fb2e2b Update ci.yaml 2021-11-29 21:46:27 +08:00
AppFlowy.IO ed117c4d31 Create general.yml 2021-11-29 21:46:04 +08:00
appflowy f9bfe94a6b fix flowy_tool issues 2021-11-29 20:08:02 +08:00
AppFlowy.IO 180b0cd568 Merge pull request #101 from pdckxd/main
[Instruction] Slightly update steps of BUILD_ON_WINDOWS.md
2021-11-28 23:13:42 +08:00
Alex to 172e1ab1de [Instruction] Slightly update steps of BUILD_ON_WINDOWS.md
1. doc\BUILD_ON_WINDOWS.md
  - rustup.exe with parameter to install rust without prompt
2. frontend/scripts/makefile/protobuf.toml
  - add a sub task to check if protoc is presented in PATH
2021-11-28 20:34:03 +08:00
appflowy 271cd0dd61 mv lib-sqlite to shared-lib 2021-11-27 21:59:20 +08:00
appflowy 3abd5b953e fix clippy warnings 2021-11-27 19:20:22 +08:00
AppFlowy.IO 8d9cde17a9 Update ci.yaml 2021-11-27 10:14:58 +08:00
AppFlowy.IO f8f5b7c233 Update ci.yaml 2021-11-27 10:09:38 +08:00
AppFlowy.IO b83ff2c3c5 Update ci.yaml 2021-11-27 09:58:56 +08:00
AppFlowy.IO 3d93308293 Update ci.yaml
add Clippy check
2021-11-27 09:55:28 +08:00
AppFlowy.IO d010211028 Update ci.yaml
add flutter analyze actions
2021-11-27 09:32:10 +08:00
appflowy f59cf4eb71 remove deprecated flowy_editor 2021-11-26 23:07:35 +08:00
AppFlowy.IO 784d518632 Merge pull request #96 from ljshwyykl/main
env file
2021-11-26 23:01:48 +08:00
ljshwyykl 3648a42054 fix conflicts 2021-11-26 09:48:22 +08:00
appflowy b37e636da3 add Cargo.lock to git 2021-11-25 21:13:10 +08:00
ljshwyykl 0f48d5da53 build doc 2021-11-25 19:33:35 +08:00
ljshwyykl 35d3224d08 .gitignore 2021-11-25 19:26:16 +08:00
ljshwyykl e2c2a6602a env file 2021-11-25 19:20:03 +08:00
AppFlowy.IO 08de5da716 Merge pull request #92 from pratikbalar/patch-2 2021-11-25 08:25:39 +08:00
AppFlowy.IO ac32760bfc Merge pull request #93 from pdckxd/main 2021-11-25 08:21:12 +08:00
AppFlowy.IO 688ca90ec8 Merge pull request #94 from raydzast/patch-1 2021-11-25 08:20:51 +08:00
Stanislav 038bf41077 Add unzip to requirements
When running Step #3 `flutter channel dev` got:
```Missing "unzip" tool. Unable to extract Dart SDK.
Consider running "sudo apt-get install unzip".```
2021-11-24 22:08:28 +03:00
AppFlowy.IO 4a72b7a87c Update README.md 2021-11-24 23:04:43 +08:00
Alex to ba5d66cea0 [Instruction] Enhance BUILD_ON_WINDOWS.md to remove choco dependency
1. doc\BUILD_ON_WINDOWS.md
2. frontend\scripts\makefile\env.toml
  - break down install_targets task into 3 platform specific tasks
  - only install necessary targets for specfic platform
2021-11-24 14:07:06 +08:00
Pratik 2c8cce99e8 ci: integrate better with ghactions 2021-11-24 11:21:40 +05:30
AppFlowy.IO a0c59fd61d Merge pull request #90 from Hari-07/tooltip
Implemented tooltip on toolbar buttons
2021-11-24 10:51:35 +08:00
Harinandan 542622c512 Merge branch 'main' of github.com:Hari-07/appflowy 2021-11-23 21:12:25 +05:30
Harinandan 513df69042 Added tooltip to toolbar buttons 2021-11-23 21:11:49 +05:30
Hari07 5c5f0f6a1e Merge branch 'AppFlowy-IO:main' into main 2021-11-23 21:08:02 +05:30
AppFlowy.IO 627aac9a15 Merge pull request #87 from pdckxd/main
fix path issue in .gitignore
2021-11-23 20:43:29 +08:00
Alex Chen 870aa61080 fix path issue in .gitignore 2021-11-23 20:05:26 +08:00
appflowy f45608163c update native protobuf tool version 2021-11-23 20:04:57 +08:00
AppFlowy.IO fd07d64a7b Merge pull request #84 from pdckxd/main
Untrack auto generated files under windows/flutter/. Add below files …
2021-11-23 19:42:42 +08:00
Alex to 93b7cf481b Untrack auto generated files under windows/flutter/. Add below files into .gitignore
windows/flutter/generated_plugin_registrant.cc
windows/flutter/generated_plugin_registrant.h
windows/flutter/generated_plugins.cmake
2021-11-23 19:38:39 +08:00
AppFlowy.IO ce077c059e Update ci.yaml 2021-11-23 19:05:37 +08:00
appflowy 054fa4c952 rename some tasks' name 2021-11-23 18:15:33 +08:00
appflowy ce126fe08d [rust]: fix some unuse warniings 2021-11-23 18:15:33 +08:00
AppFlowy.IO 7b47fb5c7f Update ci.yaml 2021-11-23 17:53:08 +08:00
AppFlowy.IO 0d28267386 Update ci.yaml 2021-11-23 17:29:52 +08:00
AppFlowy.IO 76c8aa82ad Update ci.yaml
git clone flutter from dev branch
2021-11-23 17:17:16 +08:00
AppFlowy.IO 8acdb82612 Update ci.yaml
fix build issues
2021-11-23 17:10:05 +08:00
AppFlowy.IO 6c9fa781cf Merge pull request #85 from pratikbalar/patch-1
ci: flutter git clone depth 1
2021-11-23 17:00:14 +08:00
AppFlowy.IO 7288224c3e Update ci.yaml 2021-11-23 16:54:40 +08:00
Pratik 9790251aa2 ci: add depth 1 in flutter git clone 2021-11-23 14:22:42 +05:30
appflowy 1ee5a9402b remove install_protobuf task from the flowy_dev 2021-11-23 16:41:05 +08:00
appflowy b2f3570bbf print the flutter and rust env 2021-11-23 15:30:21 +08:00
Harinandan fe88e100e2 Added fix for cursor appearing below highlights 2021-11-23 12:22:43 +05:30
AppFlowy.IO 0f0dd5755d Merge pull request #79 from pdckxd/main
[Build] Enhance windows build instruction and cargo make scripts
2021-11-23 14:27:50 +08:00
appflowy 5703d7ea9f update flutter-quill remote address 2021-11-23 14:26:32 +08:00
appflowy 08635f1984 specify nightly toolchain for rustup-init 2021-11-23 14:26:32 +08:00
Alex Chen dd92d0faf4 [Build] Enhance windows build instruction and cargo make scripts
1. doc\BUILD_ON_WINDOWS.md
  - add command for building development version
2. .vscode\tasks.json
  - Enable vscode to launch debug session on windows
3. frontend\scripts\makefile\env.toml
  - Fix "Command : dart not found." on windows
4. frontend\Makefile.toml
  - Change profile name "env.development-windows" to "env.development-desktop-windows-x86"
2021-11-23 08:28:59 +08:00
AppFlowy.IO 91d9516dc7 Update ci.yaml 2021-11-22 21:24:36 +08:00
AppFlowy.IO db5d9aa891 Merge pull request #74 from ljshwyykl/patch-2
add Table Struct
2021-11-22 21:23:44 +08:00
AppFlowy.IO b8eedf70c3 Merge pull request #76 from notd5a-alt/patch
Decapitalized icon names and 4 references.
2021-11-22 21:09:45 +08:00
notd5a-alt 838c85c5f2 changed 2 references to HIde and Show into hide and show 2021-11-22 12:13:45 +00:00
notd5a-alt 9fc5d628b0 changed icon names, removed capitalization and spaces to avoid future problems 2021-11-22 11:53:35 +00:00
ljshwyykl a216c52416 add Table Struct
add Table Struct
2021-11-22 18:49:20 +08:00
AppFlowy.IO 538d8916c7 Merge pull request #73 from AppFlowy-IO/annieappflowy-patch-docs
Update BUILD_ON_LINUX.md
2021-11-22 17:22:59 +08:00
Annie 9d5eafc97b Update BUILD_ON_LINUX.md
increase readability
2021-11-22 17:15:45 +08:00
AppFlowy.IO 24ca6259da Merge pull request #70 from ljshwyykl/patch-1
add install sqlx-cli
2021-11-22 11:42:53 +08:00
ljshwyykl 7bf0d8e230 add install sqlx-cli
add install sqlx-cli
2021-11-22 10:25:25 +08:00
appflowy 0548546881 [rust]: update actix beta version 2021-11-22 09:04:52 +08:00
AppFlowy.IO 0bbf9c3ef1 Merge pull request #66 from vnepogodin/main
fix backend build
2021-11-22 09:01:46 +08:00
appflowy 9453f8a4b7 [rust]: remove vecdeque_binary_search feature 2021-11-22 08:44:02 +08:00
AppFlowy.IO 19521bf695 Update ci.yaml
add backend ci
2021-11-22 08:29:42 +08:00
AppFlowy.IO 4e9472c3e8 Merge pull request #55 from stephengroat/patch-2
add linux build
2021-11-22 08:26:29 +08:00
Stephen 32949d0395 try without protobuf 2021-11-21 08:26:33 -08:00
Vladislav Nepogodin f21cd52f26 fix backend build 2021-11-21 19:44:22 +04:00
appflowy e66c8ac78e Revert "fix the docker build"
This reverts commit 09358570b3.
2021-11-21 21:01:24 +08:00
AppFlowy.IO 6c958cf43d Merge pull request #60 from vnepogodin/main
fix the docker build
2021-11-21 20:11:40 +08:00
Vladislav Nepogodin 09358570b3 fix the docker build
use source from github repo
2021-11-21 15:28:07 +04:00
AppFlowy.IO 1517202889 Merge pull request #54 from pdckxd/main
[Build] Fix build instruction to meet the update of folder structure …
2021-11-21 13:52:15 +08:00
appflowy a535b8585f mark caro make pb as optional action 2021-11-21 13:50:31 +08:00
Stephen 4324897054 add to github path 2021-11-20 20:38:37 -08:00
Stephen 169f1e2c44 add another relative path
not sure why
2021-11-20 20:23:16 -08:00
Stephen e713a6dfc6 move installs 2021-11-20 20:03:15 -08:00
Stephen ccf7ff8888 cleanup build steps 2021-11-20 19:53:26 -08:00
Stephen ac9a89fdca install dart 2021-11-20 19:47:31 -08:00
Stephen d4432eabb9 move to frontend 2021-11-20 19:31:37 -08:00
Stephen b0ab6bdd4b try bash syntax 2021-11-20 19:15:01 -08:00
Stephen a008cb6bd5 try passing arg to sh 2021-11-20 19:13:04 -08:00
Stephen c6524b273f apt-get update 2021-11-20 19:09:43 -08:00
Stephen 35f4aa64c4 fix runner type to ubuntu 2021-11-20 19:08:41 -08:00
Stephen 673afa1fcb add linux build 2021-11-20 19:06:24 -08:00
Alex Chen 702a04ab24 [Build] Fix build instruction to meet the update of folder structure update
1. frontend/scripts/flowy-tool/Cargo.toml
  - fix flowy-ast module path
2. frontend/scripts/makefile/protobuf.toml
  - fix derive_meta path
2021-11-21 09:34:32 +08:00
Annie 4beeffbc37 Update CONTRIBUTING.md 2021-11-20 20:49:48 +08:00
AppFlowy.IO d4fc1b9126 Merge pull request #51 from TarunavBA/patch-1
Update README.md
2021-11-20 17:56:31 +08:00
Tarunav BA 502229adb8 Update README.md
Change from Visual Studio to Visual Studio code as in the screenshot.
2021-11-20 15:08:33 +05:30
AppFlowy.IO e5d8581091 Merge pull request #49 from pdckxd/main
[Build] Fix Linux build instruction
2021-11-20 14:56:53 +08:00
Alex Chen 4b1010fb13 Merge branch 'AppFlowy-IO:main' into main 2021-11-20 14:42:54 +08:00
AppFlowy.IO 910a70fb41 Update ci.yaml 2021-11-20 14:41:27 +08:00
AppFlowy.IO 01cc16d50f Merge pull request #48 from rayrrr/patch-1
Rename BUILD_ON_WNIDOWS.md to BUILD_ON_WINDOWS.md
2021-11-20 14:39:16 +08:00
Alex Chen 0dcaa6be2f [Build] Fix Linux build instruction
1. BUILD_ON_LINUX.md
  - Remove brew dependency
  - Update command for development in step 9 & 10
2. Fix file name typo for BUILD_ON_WINDOWS.md
2021-11-20 14:35:44 +08:00
Ray d3dd3e229d Rename BUILD_ON_WNIDOWS.md to BUILD_ON_WINDOWS.md
tiny typo fix :)
2021-11-20 01:31:39 -05:00
AppFlowy.IO 7f70036951 Update ci.yaml 2021-11-20 14:30:32 +08:00
AppFlowy.IO 81511764c4 Delete integration_test.yml 2021-11-20 14:30:25 +08:00
appflowy 704035e070 [flutter]: lock flutter package big version 2021-11-20 14:19:38 +08:00
appflowy 3038dc3c93 update README 2021-11-20 13:20:24 +08:00
AppFlowy.IO 2a1c5a3420 Merge pull request #44 from myl7/bump-sqlxcli
Bump sqlx-cli version to fix its compiling error when installing
2021-11-20 12:36:46 +08:00
appflowy 0888e7afbd update script description 2021-11-20 12:12:41 +08:00
myl7 7d5c002952 Bump sqlx-cli version to fix its compiling error when installing 2021-11-20 11:27:02 +08:00
AppFlowy.IO 461a4ddb3f Update and rename frontend_test.yml to integration_test.yml 2021-11-20 10:56:37 +08:00
AppFlowy.IO 89bbd5b893 Update frontend_test.yml 2021-11-20 10:54:51 +08:00
appflowy 8e994a954e add shared-lib folder 2021-11-20 10:52:39 +08:00
AppFlowy.IO be23b4cc5a Create frontend_test.yml 2021-11-20 09:53:37 +08:00
AppFlowy.IO 8fc2089d51 Update ci.yaml 2021-11-20 09:49:48 +08:00
appflowy 55c05364dd Merge branch 'develop' 2021-11-20 09:35:16 +08:00
appflowy 8f1d62f115 add frontend folder 2021-11-20 09:34:43 +08:00
appflowy f93f012bc8 [rust]: rm flowy-net 2021-11-20 08:35:04 +08:00
annie 0fc09dcb53 Merge branch 'main' of github.com:AppFlowy-IO/appflowy_client into main 2021-11-19 22:43:03 +08:00
annie 447766f9cb [flutter]: support debug on linux-aarch64 2021-11-19 22:40:57 +08:00
AppFlowy.IO c25153e666 Merge pull request #35 from Xoshbin/patch-1
Fixed a typo
2021-11-19 19:35:40 +08:00
annie 8660ade554 [flutter]: add aarch64 script 2021-11-19 17:34:49 +08:00
Khoshbin Ali Ahmed f474476e24 Fixed a typo 2021-11-19 10:23:58 +03:00
appflowy a06a2b9e5b [rust]: update flowy-log name 2021-11-19 15:04:56 +08:00
appflowy ba67652e29 [rust]: update dart-notify crate name 2021-11-19 15:00:51 +08:00
appflowy 2449e9352c [rust]: Crates start with lib consider as foundation libs 2021-11-19 14:38:11 +08:00
appflowy 80d1b3072d [rust]: rename backend test code 2021-11-19 14:16:35 +08:00
appflowy 7bd2773cf2 [rust]: fix test crate issues 2021-11-19 14:16:28 +08:00
appflowy c64ef55d60 [rust]: rename some flowy-xx to lib-xx 2021-11-19 14:16:22 +08:00
appflowy 91c9f2c62f [rust]: rename some crates 2021-11-19 14:16:15 +08:00
appflowy 7c60626049 [rust]: refactor flowy-document crate 2021-11-19 14:16:07 +08:00
appflowy 49cbc6c1b3 [flutter]: revert to remote files 2021-11-19 14:03:36 +08:00
appflowy 9474f1f722 [flutter]: delete conflict files 2021-11-19 14:03:17 +08:00
AppFlowy.IO 5076a6cb38 Merge pull request #34 from pdckxd/main
LGTM!
2021-11-19 12:43:39 +08:00
Alex to d965d26e60 Enable Linux build
1. BUILD_ON_LINUX.md is instruction of building Linux version
2. Update toml files in scripts/makefile/ and /Makefile.toml to support Linux

Building Windows/Linux release version is verified
Didn't get chance to verify building macos version
2021-11-19 12:09:56 +08:00
AppFlowy.IO 2b9367aa40 Merge pull request #29 from akshay-rirev/patch-1
[DOCS] Added Command line source update command
2021-11-19 07:59:39 +08:00
Akshay Bengani Rirev 0b6d52cb46 [DOCS] Added Command line source update command 2021-11-18 23:06:42 +05:30
annie b7a40a7cda Merge branch 'main' of https://github.com/AppFlowy-IO/appflowy 2021-11-18 16:19:40 +08:00
annie 58078c26db [flutter]: support dev build window 2021-11-18 16:18:20 +08:00
AppFlowy.IO 5a1e059a78 Merge pull request #22 from pdckxd/main
Fix task dependency order problem. Extract step of "vcpkg install sql…
2021-11-18 00:00:31 +08:00
Alex to fc5e82d169 Fix task dependency order problem. Extract step of "vcpkg install sqlite3:x64-windows-static-md" from task "install_diesel.windows" 2021-11-17 23:43:49 +08:00
annie 93ce7d3b7d [flutter]: add appflowy icon to windows platform 2021-11-17 23:14:27 +08:00
AppFlowy.IO 6536098b38 Merge pull request #21 from pdckxd/main
#19 - [FR] Successfully to build workable version for windows (Rust t…
2021-11-17 22:07:42 +08:00
Alex to 5ee37972ef #19 - [FR] Successfully to build workable version for windows (Rust target: x86_64-pc-windows-msvc), request to contribute
1. scripts\flowy-tool\Cargo.toml
  - Remove shell dependency which does not support windows
2. scripts\makefile\env.toml
  - Enhance environment checking for building app on windows
3. scripts\flowy-tool\src\util\file.rs
  - Trim unnecessary prefix "\\?\" for std::fs::canonicalize(root) on windows
4.  scripts\makefile\flutter.toml
  - add dependency for "tasks.appflowy-windows" to copy dart_ffi.dll from rust build folder to flutter build folder
5. scripts\flowy-tool\src\proto\proto_gen.rs
  - Remove dir by using platform independent code rather than calling *nix shell command
6. scripts\makefile\protobuf.toml
  - tasks.gen_dart_event: call duckscript to gen_dart_event on windows platform
2021-11-17 21:45:18 +08:00
annie 59922b95a9 [flutter]: update windows crate type 2021-11-17 17:52:49 +08:00
appflowy 89ba4195e5 [flutter]: fix some warnings 2021-11-17 14:28:21 +08:00
appflowy f94f3f2d6a [flutter]: ignore podfile.lock 2021-11-17 14:27:37 +08:00
appflowy 74239d65cb [rust]: windows config 2021-11-17 14:18:21 +08:00
annie 19968010af [flutter]: format time of trash cell 2021-11-16 21:38:50 +08:00
AppFlowy.IO 796a0a9f41 Merge pull request #14 from stephengroat/patch-1
Use brewfile
2021-11-16 16:44:09 +08:00
Stephen 3cfa7d0c68 unpin protobuf version
3.13 no longer available
2021-11-16 00:34:20 -08:00
Stephen e334cde639 try using rustup-init for rust install 2021-11-16 00:25:45 -08:00
Stephen 1cdf5aea53 add rustup-init 2021-11-16 00:23:54 -08:00
Stephen ce8979afe8 Create Brewfile 2021-11-16 00:20:21 -08:00
Stephen df053fbc48 use brew bundle 2021-11-16 00:19:49 -08:00
Stephen fcb8d49cf9 remove brew install from env.toml 2021-11-16 00:18:48 -08:00
appflowy a72dc5d2ec [flutter]: disable copy-to-sys-tmpdir task 2021-11-16 14:23:48 +08:00
AppFlowy.IO 418812d61d Merge pull request #9 from stephengroat/patch-1
Thanks, the pipeline will be set up very soon.
2021-11-16 12:56:53 +08:00
Stephen a2854297b3 Create ci.yaml 2021-11-15 20:32:43 -08:00
appflowy 92ab7eac17 [rust]: fix scripts errors 2021-11-15 22:14:47 +08:00
appflowy 96560d2b3e [flutter]: update appflowy desktop bundle identifier 2021-11-15 21:39:37 +08:00
appflowy f7d66a1e59 [flutter]: update version 2021-11-15 18:23:04 +08:00
appflowy 706f64c9dd [flutter]: build flowy sdk as static lib 2021-11-15 18:23:04 +08:00
appflowy d2a8f89668 [flutter]: release build with x86 2021-11-15 18:23:04 +08:00
appflowy b0a818b813 [flutter]: update build script 2021-11-15 18:23:04 +08:00
appflowy 259a61378d [flutter]: config window build script 2021-11-15 18:23:04 +08:00
appflowy 0e8ebe1e4d [flutter]: update build script 2021-11-15 18:23:04 +08:00
Annie 118219e5b3 Update formatting easier copy cds 2021-11-15 11:09:46 +08:00
AppFlowy.IO d160c35e29 Merge pull request #5 from LeonardoRosaa/main
Documentation: does make easier copies of some command lines codes
2021-11-15 10:41:53 +08:00
Leonardo Rosa 51a7cc9dee Update README.md 2021-11-14 14:46:19 -03:00
Annie b51b12ab7d Update ABOUT_APPFLOWY.md 2021-11-14 16:12:42 +08:00
Annie 95a5c06e30 Update roadmap.md 2021-11-14 13:39:04 +08:00
Annie 2e03e03c77 Update ABOUT_APPFLOWY.md 2021-11-14 13:37:56 +08:00
AppFlowy.IO b36de8b8c8 Update README.md 2021-11-13 23:23:04 +08:00
appflowy 6cdbb459fa [flutter]: update default page title 2021-11-13 14:51:06 +08:00
appflowy 7f11b01480 [flutter]: add licenses 2021-11-13 14:51:06 +08:00
appflowy b63a6e8abc [flutter]: update avatar config 2021-11-13 14:51:06 +08:00
AppFlowy.IO 4661e32053 Update README.md 2021-11-13 14:50:08 +08:00
2447 changed files with 93056 additions and 75594 deletions

No files matched your search

+4 -7
View File
@@ -1,7 +1,4 @@
.env
.dockerignore
doc/
scripts/
rust-lib/target/
backend/target/
app_flowy/
frontend/app_flowy/
frontend/scripts/
frontend/rust-lib/target
shared-lib/target/
Executable → Regular
+1 -1
View File
@@ -11,7 +11,7 @@ function file_too_large(){
cat <<HEREDOC
File $filename is $filesize MB, which is larger than github's maximum
file size (1 MB). We will not be able to push this file to Github.
file size (1 MB). We will not be able to push this file to GitHub.
Commit aborted
HEREDOC
Executable → Regular
View File
File mode changed.
+84
View File
@@ -0,0 +1,84 @@
name: CI
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
flutter_profile: development-linux-x86
- os: macos-latest
flutter_profile: development-mac
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 'stable-2022-01-20'
- id: flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
- name: Cache Rust
uses: actions/cache@v2
with:
path: |
frontend/rust-lib/target
shared-lib/target
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
- name: Setup Environment
run: |
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
elif [ "$RUNNER_OS" == "macOS" ]; then
echo 'do nothing'
fi
shell: bash
- name: Deps
working-directory: frontend
run: |
cargo install cargo-make
cargo install duckscript_cli
cargo make flowy_dev
- name: Config Flutter
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
flutter config --enable-linux-desktop
elif [ "$RUNNER_OS" == "macOS" ]; then
flutter config --enable-macos-desktop
fi
shell: bash
- name: Build
working-directory: frontend
run: |
cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev
+12
View File
@@ -0,0 +1,12 @@
name: Commit messages lint
on: [pull_request, push]
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
+38
View File
@@ -0,0 +1,38 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Flutter lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
flutter-analyze:
name: flutter analyze
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Deps Flutter
run: flutter packages pub get
working-directory: frontend/app_flowy
- name: Code Generation
working-directory: frontend/app_flowy
run: |
flutter packages pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
flutter packages pub run build_runner build --delete-conflicting-outputs
- name: Run Flutter Analyzer
working-directory: frontend/app_flowy
run: flutter analyze
+74
View File
@@ -0,0 +1,74 @@
name: Unit test(Flutter)
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
env:
CARGO_TERM_COLOR: always
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 'stable-2022-01-20'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
- name: Cache Rust
uses: actions/cache@v2
with:
path: |
frontend/rust-lib/target
shared-lib/target
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
- name: Deps Flutter
working-directory: frontend/app_flowy
run: |
flutter config --enable-linux-desktop
- name: Deps Rust
working-directory: frontend
run: |
cargo install cargo-make
cargo install duckscript_cli
cargo make flowy_dev
- name: Code Generation
working-directory: frontend/app_flowy
run: |
flutter packages pub get
flutter packages pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
flutter packages pub run build_runner build --delete-conflicting-outputs
- name: Build FlowySDK
working-directory: frontend
run: |
cargo make --profile development-linux-x86 flowy-sdk-dev
- name: Run bloc tests
working-directory: frontend/app_flowy
run: |
flutter pub get
flutter test
+128
View File
@@ -0,0 +1,128 @@
name: release
on:
push:
tags:
- '*'
jobs:
create-release:
runs-on: ubuntu-latest
env:
RELEASE_NOTES_PATH: /tmp/release_notes
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build release notes
run: |
touch ${{ env.RELEASE_NOTES_PATH }}
cat CHANGELOG.md | sed -e '/./{H;$!d;}' -e "x;/##\ Version\ ${{ github.ref_name }}/"'!d;' >> ${{ env.RELEASE_NOTES_PATH }}
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: ${{ env.RELEASE_NOTES_PATH }}
build-linux-x86:
runs-on: ubuntu-latest
needs: create-release
env:
LINUX_APP_RELEASE_PATH: frontend/app_flowy/product/${{ github.ref_name }}/linux/Release
LINUX_ZIP_NAME: AppFlowy-linux-x86.tar.gz
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup environment - Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: 'stable-2022-01-20'
- name: Setup environment - Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Pre build
working-directory: frontend
run: |
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
sudo apt-get update
sudo apt-get install -y build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
source $HOME/.cargo/env
cargo install --force cargo-make
cargo install --force duckscript_cli
cargo make flowy_dev
- name: Build Linux app
working-directory: frontend
run: |
flutter config --enable-linux-desktop
cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-linux-x86 appflowy
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_ZIP_NAME }}
asset_name: ${{ env.LINUX_ZIP_NAME }}
asset_content_type: application/octet-stream
build-macos-x86_64:
runs-on: macos-latest
needs: create-release
env:
MACOS_APP_RELEASE_PATH: frontend/app_flowy/product/${{ github.ref_name }}/macos/Release
MACOS_X86_ZIP_NAME: Appflowy-macos-x86_64.zip
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup environment - Rust and Cargo
uses: actions-rs/toolchain@v1
with:
toolchain: 'stable-2022-01-20'
- name: Setup environment - Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Pre build
working-directory: frontend
run: |
source $HOME/.cargo/env
cargo install --force cargo-make
cargo install --force duckscript_cli
cargo make flowy_dev
- name: Build macOS app for x86_64
working-directory: frontend
run: |
flutter config --enable-macos-desktop
cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-mac-x86 appflowy
- name: Archive macOS app
working-directory: ${{ env.MACOS_APP_RELEASE_PATH }}
run: zip -qr ${{ env.MACOS_X86_ZIP_NAME }} AppFlowy.app
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.MACOS_APP_RELEASE_PATH }}/${{ env.MACOS_X86_ZIP_NAME }}
asset_name: ${{ env.MACOS_X86_ZIP_NAME }}
asset_content_type: application/octet-stream
+35
View File
@@ -0,0 +1,35 @@
name: release_docker
on:
push:
branches:
- 'main'
tags:
- '*'
jobs:
build-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./frontend/scripts/docker-buildfiles/Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
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
+41
View File
@@ -0,0 +1,41 @@
name: Rust lint
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
rust-fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 'stable-2022-01-20'
override: true
- run: rustup component add rustfmt
working-directory: frontend/rust-lib
- run: cargo fmt --all -- --check
working-directory: frontend/rust-lib/
rust-clippy:
runs-on: ubuntu-latest
name: Clippy
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 'stable-2022-01-20'
override: true
- run: rustup component add clippy
working-directory: frontend/rust-lib
- run: cargo clippy --no-default-features
working-directory: frontend/rust-lib
+51
View File
@@ -0,0 +1,51 @@
name: Unit test(Rust)
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
env:
CARGO_TERM_COLOR: always
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- id: rust_toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 'stable-2022-01-20'
- name: Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
- name: Cache Rust
uses: actions/cache@v2
with:
path: |
frontend/rust-lib/target
shared-lib/target
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
- name: Install cargo-make
working-directory: frontend
run: cargo install cargo-make
- name: Run rust-lib tests
working-directory: frontend/rust-lib
run: cargo test --no-default-features
- name: Run shared-lib tests
working-directory: shared-lib
run: cargo test --no-default-features
+19
View File
@@ -0,0 +1,19 @@
name: Translation Notify
on:
push:
branches: [ main ]
paths:
- "frontend/app_flowy/assets/translations/en.json"
pull_request:
branches: [ main ]
paths:
- "frontend/app_flowy/assets/translations/en.json"
jobs:
Discord-Notify:
runs-on: ubuntu-latest
steps:
- uses: Ilshidur/action-discord@0.3.2
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: '@appflowytranslators English UI strings has been updated.'
+10 -5
View File
@@ -1,15 +1,20 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# backend
/target/
# These are backup files generated by rustfmt
**/*.rs.bk
**/target/
**/*.db
.idea/
/flowy-test/
.ruby-version
**/temp/**
.ruby-version
package-lock.json
yarn.lock
node_modules
**/.proto_cache
**/.cache
**/.DS_Store
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no -- commitlint --edit
+8 -7
View File
@@ -1,17 +1,18 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ProtoBuf_Gen" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run --manifest-path $PROJECT_DIR$/scripts/flowy-tool/Cargo.toml -- pb-gen --rust_source=$PROJECT_DIR$/rust-lib/ --derive_meta=$PROJECT_DIR$/rust-lib/flowy-derive/src/derive_cache/derive_cache.rs --flutter_package_lib=$PROJECT_DIR$/app_flowy/packages/flowy_sdk/lib" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<option name="command" value="run --manifest-path ${flowy_tool} -- pb-gen --rust_sources=${rust_lib},${shared_lib} --derive_meta=${derive_meta} --flutter_package_lib=${flutter_package_lib}" />
<option name="workingDirectory" value="file://$PROJECT_DIR$/frontend" />
<option name="channel" value="DEFAULT" />
<option name="allFeatures" value="false" />
<option name="emulateTerminal" value="false" />
<option name="backtrace" value="SHORT" />
<envs>
<env name="rust_source" value="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/" />
<env name="build_cache" value="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-derive/src/auto_gen_file/category_from_str.rs" />
<env name="proto_file_output" value="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-protobuf/define" />
<env name="rust_mod_dir" value="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/flowy-protobuf/src/" />
<env name="flutter_mod_dir" value="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/flutter-lib/packages/flowy_protobuf/lib/" />
<env name="flowy_tool" value="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/scripts/flowy-tool/Cargo.toml" />
<env name="rust_lib" value="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/" />
<env name="shared_lib" value="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/../shared_lib" />
<env name="flutter_lib" value="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages" />
<env name="derive_meta" value="${shared_lib}/flowy-derive/src/derive_cache/derive_cache.rs" />
<env name="flutter_package_lib" value="${flutter_lib}/flowy_sdk/lib" />
</envs>
<option name="isRedirectInput" value="false" />
<option name="redirectInputPath" value="" />
+1 -1
View File
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="dart-event" type="CargoCommandRunConfiguration" factoryName="Cargo Command">
<option name="command" value="run --manifest-path $PROJECT_DIR$/scripts/flowy-tool/Cargo.toml -- dart-event --rust_source=$PROJECT_DIR$/rust-lib/ --output=$PROJECT_DIR$/app_flowy/packages/flowy_sdk/lib/dispatch/code_gen.dart" />
<option name="command" value="run --manifest-path $PROJECT_DIR$/scripts/flowy-tool/Cargo.toml -- dart-event --rust_source=$PROJECT_DIR$/rust-lib/ --output=$PROJECT_DIR$/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event.dart" />
<option name="workingDirectory" value="file://$PROJECT_DIR$" />
<option name="channel" value="DEFAULT" />
<option name="allFeatures" value="false" />
+27
View File
@@ -0,0 +1,27 @@
# Release Notes
## Version 0.0.4 - beta.1 - 2022-04-08
v0.0.4 - beta.1 is pre-release
New features
- Table-view database
- supported column types: Text, Checbox, Single-select, Multi-select, Numbers
- hide / delete columns
- insert rows
## Version 0.0.3 - 2022-02-23
v0.0.3 is production ready, available on Linux, macOS, and Windows
New features
- Dark Mode
- Support new languages: French, Italian, Russian, Simplified Chinese, Spanish
- Add Settings: Toggle on Dark Mode; Select a language
- Show device info
- Add tooltip on toolbar icons
Bug fixes and improvements
- Increased height of action
- CPU performance issue
- Fix potential data parser error
- More foundation work for online collaboration
-13
View File
@@ -1,13 +0,0 @@
.PHONY: flowy_dev install_cargo_make
flowy_dev: install_cargo_make
cargo make flowy_dev
install_cargo_make:
cargo install --force cargo-make
install_rust:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y
echo 'export PATH="$$HOME/.cargo/bin:$$PATH"' >> ~/.bash_profile
source ~/.bash_profile
+27 -88
View File
@@ -1,96 +1,35 @@
extend = [
{ path = "scripts/makefile/desktop.toml" },
{ path = "scripts/makefile/protobuf.toml" },
{ path = "scripts/makefile/tests.toml" },
{ path = "scripts/makefile/docker.toml" },
{ path = "scripts/makefile/env.toml" },
{ path = "scripts/makefile/flutter.toml" },
]
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CARGO_MAKE_CRATE_FS_NAME = "dart_ffi"
CARGO_MAKE_CRATE_NAME = "dart-ffi"
VERSION = "0.0.1"
FEATURES = "flutter,http_server"
PRODUCT_NAME = "AppFlowy"
#CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html
[env.development-mac]
DEV = true
PROD = false
TARGET_OS = "macos"
DESKTOP_TARGET = "x86_64-apple-darwin"
CRATE_TYPE = "cdylib"
BUILD_FLAG = "debug"
FLUTTER_PLATFORM = "macos"
FLUTTER_OUTPUT_DIR = "Debug"
FEATURES = "flutter"
PRODUCT_EXT = "app"
[env.production-mac]
DEV = false
PROD = true
TARGET_OS = "macos"
DESKTOP_TARGET = "x86_64-apple-darwin"
CRATE_TYPE = "cdylib"
BUILD_FLAG = "release"
FLUTTER_PLATFORM = "macos"
FLUTTER_OUTPUT_DIR = "Release"
FEATURES = "flutter"
PRODUCT_EXT = "app"
[env.production-ios]
DEV = false
PROD = true
TARGET_OS = "ios"
CRATE_TYPE = "staticlib"
BUILD_FLAG = "release"
FLUTTER_PLATFORM = "ios"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "ipa"
[env.production-android]
DEV = false
PROD = true
TARGET_OS = "android"
CRATE_TYPE = "cdylib"
BUILD_FLAG = "release"
FLUTTER_PLATFORM = "apk"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "apk"
[env.production-win]
DEV = false
PROD = true
TARGET_OS = "windows"
CRATE_TYPE = "cdylib"
BUILD_FLAG = "release"
FLUTTER_PLATFORM = "apk"
FLUTTER_OUTPUT_DIR = "Release"
PRODUCT_EXT = "exe"
[tasks.setup-crate-type]
private = true
[tasks.install-commitlint.mac]
script = [
"""
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
val = replace ${toml} "rlib" ${CRATE_TYPE}
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
assert ${result}
""",
brew install npm
yarn install
yarn husky install
""",
]
script_runner = "@shell"
[tasks.install-commitlint.windows]
script = [
"""
echo "WIP"
""",
]
script_runner = "@duckscript"
[tasks.restore-crate-type]
private = true
[tasks.install-commitlint.linux]
script = [
"""
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
val = replace ${toml} ${CRATE_TYPE} "rlib"
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
assert ${result}
""",
if command -v apt &> /dev/null
then
echo "Installing node.js and yarn (sudo apt install nodejs yarn)"
sudo apt install nodejs yarn
else
echo "Installing node.js and yarn (sudo pacman -S nodejs yarn)"
sudo pacman -S nodejs yarn
fi
yarn install
yarn husky install
""",
]
script_runner = "@duckscript"
script_runner = "@shell"
+18 -43
View File
@@ -2,29 +2,32 @@
<b>
<a href="https://www.appflowy.io">AppFlowy.IO</a><br>
</b>
⭐️ The Open Source Notion Alternative ⭐️ <br>
⭐️ The Open Source Alternative To Notion ⭐️ <br>
</h1>
<p align="center">
You are in charge of your data and customizations.
</p>
<p align="center">
<a href="https://discord.gg/9Q2xaN37tV"><img src="https://img.shields.io/badge/AppFlowy.IO-discord-orange"></a>
<a href="https://github.com/AppFlowy-IO/appflowy"><img src="https://img.shields.io/github/stars/AppFlowy-IO/appflowy.svg?style=flat&logo=github&colorB=deeppink&label=stars"></a>
<a href="https://github.com/AppFlowy-IO/appflowy"><img src="https://img.shields.io/github/forks/AppFlowy-IO/appflowy.svg"></a>
<a href="https://opensource.org/licenses/AGPL-3.0"><img src="https://img.shields.io/badge/license-AGPL-purple.svg" alt="License: AGPL"></a>
<div align="center">
![GitHub stars](https://img.shields.io/github/stars/{AppFlowy-IO}/{appflowy}.svg)
</div>
</p>
<p align="center">
<a href="http://www.appflowy.io"><b>Website</b></a> •
<a href="https://discord.gg/9Q2xaN37tV"><b>Discord</b></a> •
<a href="https://twitter.com/appflowy"><b>Twitter</b></a> •
</p>
<a href="https://twitter.com/appflowy"><b>Twitter</b></a>
</p>
<p align="center"><img src="https://github.com/AppFlowy-IO/appflowy/blob/main/doc/imgs/welcome.png" alt="The Open Source Notion Alternative." width="1000px" /></p>
<p align="center"><img src="https://github.com/AppFlowy-IO/appflowy/blob/main/doc/imgs/welcome.png" alt="The Open Source Alternative To Notion." width="1000px" /></p>
## User Installation
Please view the [documentation](https://appflowy.gitbook.io/docs/essential-documentation/install-appflowy/installation-methods) for OS specific installation instructions.
## Built With
@@ -36,37 +39,8 @@ 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" width="1000px" /></p>
## Getting Started
How to build on MacOS, please follow these simple steps.
**Step 1:**
* git clone [https://github.com/AppFlowy-IO/appflowy.git](https://github.com/AppFlowy-IO/appflowy.git)
**Step 2:**
- `cd appflowy`
- `make install_rust`
- `make install_cargo_make`
- `cargo make install_targets`
>
>
> 🚀 Skip install_rust or install_cargo_make if you already installed it.
> FYI, AppFlowy uses [https://github.com/sagiegurari/cargo-make](https://github.com/sagiegurari/cargo-make) to construct the build scripts
**Step 3:**
Follow the instructions [here](https://flutter.dev/docs/get-started/install) to install Flutter. As AppFlowy uses the `dev` channel, you need to switch the channel. Just type:
* `flutter channel dev`
**Step 4:**
* Open the `app_flowy` folder located at xx/appflowy/app_flowy with Visual Studio or other IDEs at your disposal.
* Go to the Run and Debug tab and then click the run button.
![Run the project](https://github.com/AppFlowy-IO/appflowy/blob/main/doc/imgs/run.png)
## Getting Started with development
Please view the [documentation](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy) for OS specific development instructions
## Roadmap
@@ -76,11 +50,11 @@ If you'd like to propose a feature, submit an issue [here](https://github.com/Ap
## **Releases**
Please see the [changelog](https://www.appflowy.io/whatsnew) for more details about a given release.
Please see the [changelog](https://www.appflowy.io/whatsnew) for more details about a given release.
## 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.md](https://github.com/AppFlowy-IO/appflowy/blob/main/doc/CONTRIBUTING.md) for details.
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.md](https://github.com/AppFlowy-IO/appflowy/blob/main/doc/CONTRIBUTING.md) for details.
## Why Are We Building This?
@@ -105,10 +79,11 @@ To be honest, we do not claim to outperform Notion in terms of functionality and
## License
Distributed under the AGPLv3 License. See `LICENSE.md` for more information.
Distributed under the AGPLv3 License. See `LICENSE.md` for more information.
## Acknowledgements
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)
-26
View File
@@ -1,26 +0,0 @@
{
"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": [
{
"type": "shell",
"command": "sh ./scripts/build_sdk.sh",
"group": "build",
"options": {
"cwd": "${workspaceFolder}/../"
},
// "problemMatcher": [
// "$rustc"
// ],
"label": "build_flowy_sdk"
},
]
}
@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.2304 4.2561H10.0184L8.02638 7.9401H8.00238L5.99838 4.2561H4.78638L7.06638 8.2401H5.43438V8.9601H7.47438L7.48638 8.9841V9.8241H5.43438V10.5321H7.48638V12.5001H8.53038V10.5321H10.4984V9.8241H8.53038V8.9841L8.54238 8.9601H10.4984V8.2401H8.95038L11.2304 4.2561Z" fill="#333333"/>
</svg>

Before

Width:  |  Height:  |  Size: 392 B

-40
View File
@@ -1,40 +0,0 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:get_it/get_it.dart';
class LaunchContext {
GetIt getIt;
IntegrationEnv env;
LaunchContext(this.getIt, this.env);
}
enum LaunchTaskType {
dataProcessing,
appLauncher,
}
/// The interface of an app launch task, which will trigger
/// some nonresident indispensable task in app launching task.
abstract class LaunchTask {
LaunchTaskType get type => LaunchTaskType.dataProcessing;
Future<void> initialize(LaunchContext context);
}
class AppLauncher {
List<LaunchTask> tasks;
IntegrationEnv env;
GetIt getIt;
AppLauncher(this.env, this.getIt) : tasks = List.from([]);
void addTask(LaunchTask task) {
tasks.add(task);
}
void launch() async {
final context = LaunchContext(getIt, env);
for (var task in tasks) {
await task.initialize(context);
}
}
}
//test git hooks
@@ -1,80 +0,0 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:window_size/window_size.dart';
import 'package:app_flowy/startup/launcher.dart';
import 'package:bloc/bloc.dart';
import 'package:flowy_log/flowy_log.dart';
class AppWidgetTask extends LaunchTask {
@override
LaunchTaskType get type => LaunchTaskType.appLauncher;
@override
Future<void> initialize(LaunchContext context) {
final widget = context.getIt<EntryPoint>().create();
final app = ApplicationWidget(child: widget);
Bloc.observer = ApplicationBlocObserver();
runApp(app);
return Future(() => {});
}
}
class ApplicationWidget extends StatelessWidget {
final Widget child;
const ApplicationWidget({
Key? key,
required this.child,
}) : super(key: key);
@override
Widget build(BuildContext context) {
const ratio = 1.73;
const minWidth = 800.0;
setWindowMinSize(const Size(minWidth, minWidth / ratio));
// const launchWidth = 1310.0;
// setWindowFrame(const Rect.fromLTWH(0, 0, launchWidth, launchWidth / ratio));
final theme = AppTheme.fromType(ThemeType.light);
return Provider.value(
value: theme,
child: MaterialApp(
builder: overlayManagerBuilder(),
debugShowCheckedModeBanner: false,
theme: theme.themeData,
navigatorKey: AppGlobals.rootNavKey,
home: child,
),
);
}
}
class AppGlobals {
static GlobalKey<NavigatorState> rootNavKey = GlobalKey();
static NavigatorState get nav => rootNavKey.currentState!;
}
class ApplicationBlocObserver extends BlocObserver {
@override
// ignore: unnecessary_overrides
void onTransition(Bloc bloc, Transition transition) {
// Log.debug("[current]: ${transition.currentState} \n\n[next]: ${transition.nextState}");
//Log.debug("${transition.nextState}");
super.onTransition(bloc, transition);
}
@override
void onError(BlocBase bloc, Object error, StackTrace stackTrace) {
Log.debug(error);
super.onError(bloc, error, stackTrace);
}
@override
void onEvent(Bloc bloc, Object? event) {
Log.debug("$event");
super.onEvent(bloc, event);
}
}
-2
View File
@@ -1,2 +0,0 @@
export 'application_task.dart';
export 'sdk_task.dart';
-33
View File
@@ -1,33 +0,0 @@
import 'dart:io';
import 'package:app_flowy/startup/launcher.dart';
import 'package:app_flowy/startup/startup.dart';
import 'package:path_provider/path_provider.dart';
import 'package:flowy_sdk/flowy_sdk.dart';
import 'package:flutter/material.dart';
class RustSDKInitTask extends LaunchTask {
@override
LaunchTaskType get type => LaunchTaskType.dataProcessing;
@override
Future<void> initialize(LaunchContext context) async {
WidgetsFlutterBinding.ensureInitialized();
Directory directory = await getApplicationDocumentsDirectory();
final documentPath = directory.path;
return Directory('$documentPath/flowy').create().then((Directory directory) async {
switch (context.env) {
case IntegrationEnv.dev:
// await context.getIt<FlowySDK>().init(Directory('./temp/flowy_dev'));
await context.getIt<FlowySDK>().init(directory);
break;
case IntegrationEnv.pro:
await context.getIt<FlowySDK>().init(directory);
break;
default:
assert(false, 'Unsupported env');
}
});
}
}
@@ -1,771 +0,0 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'sign_in_bloc.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
/// @nodoc
class _$SignInEventTearOff {
const _$SignInEventTearOff();
SignedInWithUserEmailAndPassword signedInWithUserEmailAndPassword() {
return const SignedInWithUserEmailAndPassword();
}
EmailChanged emailChanged(String email) {
return EmailChanged(
email,
);
}
PasswordChanged passwordChanged(String password) {
return PasswordChanged(
password,
);
}
}
/// @nodoc
const $SignInEvent = _$SignInEventTearOff();
/// @nodoc
mixin _$SignInEvent {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() signedInWithUserEmailAndPassword,
required TResult Function(String email) emailChanged,
required TResult Function(String password) passwordChanged,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? signedInWithUserEmailAndPassword,
TResult Function(String email)? emailChanged,
TResult Function(String password)? passwordChanged,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? signedInWithUserEmailAndPassword,
TResult Function(String email)? emailChanged,
TResult Function(String password)? passwordChanged,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(SignedInWithUserEmailAndPassword value)
signedInWithUserEmailAndPassword,
required TResult Function(EmailChanged value) emailChanged,
required TResult Function(PasswordChanged value) passwordChanged,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(SignedInWithUserEmailAndPassword value)?
signedInWithUserEmailAndPassword,
TResult Function(EmailChanged value)? emailChanged,
TResult Function(PasswordChanged value)? passwordChanged,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(SignedInWithUserEmailAndPassword value)?
signedInWithUserEmailAndPassword,
TResult Function(EmailChanged value)? emailChanged,
TResult Function(PasswordChanged value)? passwordChanged,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $SignInEventCopyWith<$Res> {
factory $SignInEventCopyWith(
SignInEvent value, $Res Function(SignInEvent) then) =
_$SignInEventCopyWithImpl<$Res>;
}
/// @nodoc
class _$SignInEventCopyWithImpl<$Res> implements $SignInEventCopyWith<$Res> {
_$SignInEventCopyWithImpl(this._value, this._then);
final SignInEvent _value;
// ignore: unused_field
final $Res Function(SignInEvent) _then;
}
/// @nodoc
abstract class $SignedInWithUserEmailAndPasswordCopyWith<$Res> {
factory $SignedInWithUserEmailAndPasswordCopyWith(
SignedInWithUserEmailAndPassword value,
$Res Function(SignedInWithUserEmailAndPassword) then) =
_$SignedInWithUserEmailAndPasswordCopyWithImpl<$Res>;
}
/// @nodoc
class _$SignedInWithUserEmailAndPasswordCopyWithImpl<$Res>
extends _$SignInEventCopyWithImpl<$Res>
implements $SignedInWithUserEmailAndPasswordCopyWith<$Res> {
_$SignedInWithUserEmailAndPasswordCopyWithImpl(
SignedInWithUserEmailAndPassword _value,
$Res Function(SignedInWithUserEmailAndPassword) _then)
: super(_value, (v) => _then(v as SignedInWithUserEmailAndPassword));
@override
SignedInWithUserEmailAndPassword get _value =>
super._value as SignedInWithUserEmailAndPassword;
}
/// @nodoc
class _$SignedInWithUserEmailAndPassword
implements SignedInWithUserEmailAndPassword {
const _$SignedInWithUserEmailAndPassword();
@override
String toString() {
return 'SignInEvent.signedInWithUserEmailAndPassword()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is SignedInWithUserEmailAndPassword);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() signedInWithUserEmailAndPassword,
required TResult Function(String email) emailChanged,
required TResult Function(String password) passwordChanged,
}) {
return signedInWithUserEmailAndPassword();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? signedInWithUserEmailAndPassword,
TResult Function(String email)? emailChanged,
TResult Function(String password)? passwordChanged,
}) {
return signedInWithUserEmailAndPassword?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? signedInWithUserEmailAndPassword,
TResult Function(String email)? emailChanged,
TResult Function(String password)? passwordChanged,
required TResult orElse(),
}) {
if (signedInWithUserEmailAndPassword != null) {
return signedInWithUserEmailAndPassword();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(SignedInWithUserEmailAndPassword value)
signedInWithUserEmailAndPassword,
required TResult Function(EmailChanged value) emailChanged,
required TResult Function(PasswordChanged value) passwordChanged,
}) {
return signedInWithUserEmailAndPassword(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(SignedInWithUserEmailAndPassword value)?
signedInWithUserEmailAndPassword,
TResult Function(EmailChanged value)? emailChanged,
TResult Function(PasswordChanged value)? passwordChanged,
}) {
return signedInWithUserEmailAndPassword?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(SignedInWithUserEmailAndPassword value)?
signedInWithUserEmailAndPassword,
TResult Function(EmailChanged value)? emailChanged,
TResult Function(PasswordChanged value)? passwordChanged,
required TResult orElse(),
}) {
if (signedInWithUserEmailAndPassword != null) {
return signedInWithUserEmailAndPassword(this);
}
return orElse();
}
}
abstract class SignedInWithUserEmailAndPassword implements SignInEvent {
const factory SignedInWithUserEmailAndPassword() =
_$SignedInWithUserEmailAndPassword;
}
/// @nodoc
abstract class $EmailChangedCopyWith<$Res> {
factory $EmailChangedCopyWith(
EmailChanged value, $Res Function(EmailChanged) then) =
_$EmailChangedCopyWithImpl<$Res>;
$Res call({String email});
}
/// @nodoc
class _$EmailChangedCopyWithImpl<$Res> extends _$SignInEventCopyWithImpl<$Res>
implements $EmailChangedCopyWith<$Res> {
_$EmailChangedCopyWithImpl(
EmailChanged _value, $Res Function(EmailChanged) _then)
: super(_value, (v) => _then(v as EmailChanged));
@override
EmailChanged get _value => super._value as EmailChanged;
@override
$Res call({
Object? email = freezed,
}) {
return _then(EmailChanged(
email == freezed
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
class _$EmailChanged implements EmailChanged {
const _$EmailChanged(this.email);
@override
final String email;
@override
String toString() {
return 'SignInEvent.emailChanged(email: $email)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is EmailChanged &&
(identical(other.email, email) ||
const DeepCollectionEquality().equals(other.email, email)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(email);
@JsonKey(ignore: true)
@override
$EmailChangedCopyWith<EmailChanged> get copyWith =>
_$EmailChangedCopyWithImpl<EmailChanged>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() signedInWithUserEmailAndPassword,
required TResult Function(String email) emailChanged,
required TResult Function(String password) passwordChanged,
}) {
return emailChanged(email);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? signedInWithUserEmailAndPassword,
TResult Function(String email)? emailChanged,
TResult Function(String password)? passwordChanged,
}) {
return emailChanged?.call(email);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? signedInWithUserEmailAndPassword,
TResult Function(String email)? emailChanged,
TResult Function(String password)? passwordChanged,
required TResult orElse(),
}) {
if (emailChanged != null) {
return emailChanged(email);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(SignedInWithUserEmailAndPassword value)
signedInWithUserEmailAndPassword,
required TResult Function(EmailChanged value) emailChanged,
required TResult Function(PasswordChanged value) passwordChanged,
}) {
return emailChanged(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(SignedInWithUserEmailAndPassword value)?
signedInWithUserEmailAndPassword,
TResult Function(EmailChanged value)? emailChanged,
TResult Function(PasswordChanged value)? passwordChanged,
}) {
return emailChanged?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(SignedInWithUserEmailAndPassword value)?
signedInWithUserEmailAndPassword,
TResult Function(EmailChanged value)? emailChanged,
TResult Function(PasswordChanged value)? passwordChanged,
required TResult orElse(),
}) {
if (emailChanged != null) {
return emailChanged(this);
}
return orElse();
}
}
abstract class EmailChanged implements SignInEvent {
const factory EmailChanged(String email) = _$EmailChanged;
String get email => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$EmailChangedCopyWith<EmailChanged> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $PasswordChangedCopyWith<$Res> {
factory $PasswordChangedCopyWith(
PasswordChanged value, $Res Function(PasswordChanged) then) =
_$PasswordChangedCopyWithImpl<$Res>;
$Res call({String password});
}
/// @nodoc
class _$PasswordChangedCopyWithImpl<$Res>
extends _$SignInEventCopyWithImpl<$Res>
implements $PasswordChangedCopyWith<$Res> {
_$PasswordChangedCopyWithImpl(
PasswordChanged _value, $Res Function(PasswordChanged) _then)
: super(_value, (v) => _then(v as PasswordChanged));
@override
PasswordChanged get _value => super._value as PasswordChanged;
@override
$Res call({
Object? password = freezed,
}) {
return _then(PasswordChanged(
password == freezed
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
class _$PasswordChanged implements PasswordChanged {
const _$PasswordChanged(this.password);
@override
final String password;
@override
String toString() {
return 'SignInEvent.passwordChanged(password: $password)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is PasswordChanged &&
(identical(other.password, password) ||
const DeepCollectionEquality()
.equals(other.password, password)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(password);
@JsonKey(ignore: true)
@override
$PasswordChangedCopyWith<PasswordChanged> get copyWith =>
_$PasswordChangedCopyWithImpl<PasswordChanged>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() signedInWithUserEmailAndPassword,
required TResult Function(String email) emailChanged,
required TResult Function(String password) passwordChanged,
}) {
return passwordChanged(password);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? signedInWithUserEmailAndPassword,
TResult Function(String email)? emailChanged,
TResult Function(String password)? passwordChanged,
}) {
return passwordChanged?.call(password);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? signedInWithUserEmailAndPassword,
TResult Function(String email)? emailChanged,
TResult Function(String password)? passwordChanged,
required TResult orElse(),
}) {
if (passwordChanged != null) {
return passwordChanged(password);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(SignedInWithUserEmailAndPassword value)
signedInWithUserEmailAndPassword,
required TResult Function(EmailChanged value) emailChanged,
required TResult Function(PasswordChanged value) passwordChanged,
}) {
return passwordChanged(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(SignedInWithUserEmailAndPassword value)?
signedInWithUserEmailAndPassword,
TResult Function(EmailChanged value)? emailChanged,
TResult Function(PasswordChanged value)? passwordChanged,
}) {
return passwordChanged?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(SignedInWithUserEmailAndPassword value)?
signedInWithUserEmailAndPassword,
TResult Function(EmailChanged value)? emailChanged,
TResult Function(PasswordChanged value)? passwordChanged,
required TResult orElse(),
}) {
if (passwordChanged != null) {
return passwordChanged(this);
}
return orElse();
}
}
abstract class PasswordChanged implements SignInEvent {
const factory PasswordChanged(String password) = _$PasswordChanged;
String get password => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$PasswordChangedCopyWith<PasswordChanged> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
class _$SignInStateTearOff {
const _$SignInStateTearOff();
_SignInState call(
{String? email,
String? password,
required bool isSubmitting,
required Option<String> passwordError,
required Option<String> emailError,
required Option<Either<UserProfile, UserError>> successOrFail}) {
return _SignInState(
email: email,
password: password,
isSubmitting: isSubmitting,
passwordError: passwordError,
emailError: emailError,
successOrFail: successOrFail,
);
}
}
/// @nodoc
const $SignInState = _$SignInStateTearOff();
/// @nodoc
mixin _$SignInState {
String? get email => throw _privateConstructorUsedError;
String? get password => throw _privateConstructorUsedError;
bool get isSubmitting => throw _privateConstructorUsedError;
Option<String> get passwordError => throw _privateConstructorUsedError;
Option<String> get emailError => throw _privateConstructorUsedError;
Option<Either<UserProfile, UserError>> get successOrFail =>
throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$SignInStateCopyWith<SignInState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $SignInStateCopyWith<$Res> {
factory $SignInStateCopyWith(
SignInState value, $Res Function(SignInState) then) =
_$SignInStateCopyWithImpl<$Res>;
$Res call(
{String? email,
String? password,
bool isSubmitting,
Option<String> passwordError,
Option<String> emailError,
Option<Either<UserProfile, UserError>> successOrFail});
}
/// @nodoc
class _$SignInStateCopyWithImpl<$Res> implements $SignInStateCopyWith<$Res> {
_$SignInStateCopyWithImpl(this._value, this._then);
final SignInState _value;
// ignore: unused_field
final $Res Function(SignInState) _then;
@override
$Res call({
Object? email = freezed,
Object? password = freezed,
Object? isSubmitting = freezed,
Object? passwordError = freezed,
Object? emailError = freezed,
Object? successOrFail = freezed,
}) {
return _then(_value.copyWith(
email: email == freezed
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String?,
password: password == freezed
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String?,
isSubmitting: isSubmitting == freezed
? _value.isSubmitting
: isSubmitting // ignore: cast_nullable_to_non_nullable
as bool,
passwordError: passwordError == freezed
? _value.passwordError
: passwordError // ignore: cast_nullable_to_non_nullable
as Option<String>,
emailError: emailError == freezed
? _value.emailError
: emailError // ignore: cast_nullable_to_non_nullable
as Option<String>,
successOrFail: successOrFail == freezed
? _value.successOrFail
: successOrFail // ignore: cast_nullable_to_non_nullable
as Option<Either<UserProfile, UserError>>,
));
}
}
/// @nodoc
abstract class _$SignInStateCopyWith<$Res>
implements $SignInStateCopyWith<$Res> {
factory _$SignInStateCopyWith(
_SignInState value, $Res Function(_SignInState) then) =
__$SignInStateCopyWithImpl<$Res>;
@override
$Res call(
{String? email,
String? password,
bool isSubmitting,
Option<String> passwordError,
Option<String> emailError,
Option<Either<UserProfile, UserError>> successOrFail});
}
/// @nodoc
class __$SignInStateCopyWithImpl<$Res> extends _$SignInStateCopyWithImpl<$Res>
implements _$SignInStateCopyWith<$Res> {
__$SignInStateCopyWithImpl(
_SignInState _value, $Res Function(_SignInState) _then)
: super(_value, (v) => _then(v as _SignInState));
@override
_SignInState get _value => super._value as _SignInState;
@override
$Res call({
Object? email = freezed,
Object? password = freezed,
Object? isSubmitting = freezed,
Object? passwordError = freezed,
Object? emailError = freezed,
Object? successOrFail = freezed,
}) {
return _then(_SignInState(
email: email == freezed
? _value.email
: email // ignore: cast_nullable_to_non_nullable
as String?,
password: password == freezed
? _value.password
: password // ignore: cast_nullable_to_non_nullable
as String?,
isSubmitting: isSubmitting == freezed
? _value.isSubmitting
: isSubmitting // ignore: cast_nullable_to_non_nullable
as bool,
passwordError: passwordError == freezed
? _value.passwordError
: passwordError // ignore: cast_nullable_to_non_nullable
as Option<String>,
emailError: emailError == freezed
? _value.emailError
: emailError // ignore: cast_nullable_to_non_nullable
as Option<String>,
successOrFail: successOrFail == freezed
? _value.successOrFail
: successOrFail // ignore: cast_nullable_to_non_nullable
as Option<Either<UserProfile, UserError>>,
));
}
}
/// @nodoc
class _$_SignInState implements _SignInState {
const _$_SignInState(
{this.email,
this.password,
required this.isSubmitting,
required this.passwordError,
required this.emailError,
required this.successOrFail});
@override
final String? email;
@override
final String? password;
@override
final bool isSubmitting;
@override
final Option<String> passwordError;
@override
final Option<String> emailError;
@override
final Option<Either<UserProfile, UserError>> successOrFail;
@override
String toString() {
return 'SignInState(email: $email, password: $password, isSubmitting: $isSubmitting, passwordError: $passwordError, emailError: $emailError, successOrFail: $successOrFail)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _SignInState &&
(identical(other.email, email) ||
const DeepCollectionEquality().equals(other.email, email)) &&
(identical(other.password, password) ||
const DeepCollectionEquality()
.equals(other.password, password)) &&
(identical(other.isSubmitting, isSubmitting) ||
const DeepCollectionEquality()
.equals(other.isSubmitting, isSubmitting)) &&
(identical(other.passwordError, passwordError) ||
const DeepCollectionEquality()
.equals(other.passwordError, passwordError)) &&
(identical(other.emailError, emailError) ||
const DeepCollectionEquality()
.equals(other.emailError, emailError)) &&
(identical(other.successOrFail, successOrFail) ||
const DeepCollectionEquality()
.equals(other.successOrFail, successOrFail)));
}
@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(email) ^
const DeepCollectionEquality().hash(password) ^
const DeepCollectionEquality().hash(isSubmitting) ^
const DeepCollectionEquality().hash(passwordError) ^
const DeepCollectionEquality().hash(emailError) ^
const DeepCollectionEquality().hash(successOrFail);
@JsonKey(ignore: true)
@override
_$SignInStateCopyWith<_SignInState> get copyWith =>
__$SignInStateCopyWithImpl<_SignInState>(this, _$identity);
}
abstract class _SignInState implements SignInState {
const factory _SignInState(
{String? email,
String? password,
required bool isSubmitting,
required Option<String> passwordError,
required Option<String> emailError,
required Option<Either<UserProfile, UserError>> successOrFail}) =
_$_SignInState;
@override
String? get email => throw _privateConstructorUsedError;
@override
String? get password => throw _privateConstructorUsedError;
@override
bool get isSubmitting => throw _privateConstructorUsedError;
@override
Option<String> get passwordError => throw _privateConstructorUsedError;
@override
Option<String> get emailError => throw _privateConstructorUsedError;
@override
Option<Either<UserProfile, UserError>> get successOrFail =>
throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$SignInStateCopyWith<_SignInState> get copyWith =>
throw _privateConstructorUsedError;
}
File diff suppressed because it is too large. Load diff
@@ -1,312 +0,0 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'splash_bloc.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
/// @nodoc
class _$SplashEventTearOff {
const _$SplashEventTearOff();
_GetUser getUser() {
return const _GetUser();
}
}
/// @nodoc
const $SplashEvent = _$SplashEventTearOff();
/// @nodoc
mixin _$SplashEvent {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() getUser,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? getUser,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? getUser,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_GetUser value) getUser,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_GetUser value)? getUser,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_GetUser value)? getUser,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $SplashEventCopyWith<$Res> {
factory $SplashEventCopyWith(
SplashEvent value, $Res Function(SplashEvent) then) =
_$SplashEventCopyWithImpl<$Res>;
}
/// @nodoc
class _$SplashEventCopyWithImpl<$Res> implements $SplashEventCopyWith<$Res> {
_$SplashEventCopyWithImpl(this._value, this._then);
final SplashEvent _value;
// ignore: unused_field
final $Res Function(SplashEvent) _then;
}
/// @nodoc
abstract class _$GetUserCopyWith<$Res> {
factory _$GetUserCopyWith(_GetUser value, $Res Function(_GetUser) then) =
__$GetUserCopyWithImpl<$Res>;
}
/// @nodoc
class __$GetUserCopyWithImpl<$Res> extends _$SplashEventCopyWithImpl<$Res>
implements _$GetUserCopyWith<$Res> {
__$GetUserCopyWithImpl(_GetUser _value, $Res Function(_GetUser) _then)
: super(_value, (v) => _then(v as _GetUser));
@override
_GetUser get _value => super._value as _GetUser;
}
/// @nodoc
class _$_GetUser implements _GetUser {
const _$_GetUser();
@override
String toString() {
return 'SplashEvent.getUser()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is _GetUser);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() getUser,
}) {
return getUser();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? getUser,
}) {
return getUser?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? getUser,
required TResult orElse(),
}) {
if (getUser != null) {
return getUser();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_GetUser value) getUser,
}) {
return getUser(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_GetUser value)? getUser,
}) {
return getUser?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_GetUser value)? getUser,
required TResult orElse(),
}) {
if (getUser != null) {
return getUser(this);
}
return orElse();
}
}
abstract class _GetUser implements SplashEvent {
const factory _GetUser() = _$_GetUser;
}
/// @nodoc
class _$SplashStateTearOff {
const _$SplashStateTearOff();
_SplashState call({required AuthState auth}) {
return _SplashState(
auth: auth,
);
}
}
/// @nodoc
const $SplashState = _$SplashStateTearOff();
/// @nodoc
mixin _$SplashState {
AuthState get auth => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$SplashStateCopyWith<SplashState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $SplashStateCopyWith<$Res> {
factory $SplashStateCopyWith(
SplashState value, $Res Function(SplashState) then) =
_$SplashStateCopyWithImpl<$Res>;
$Res call({AuthState auth});
$AuthStateCopyWith<$Res> get auth;
}
/// @nodoc
class _$SplashStateCopyWithImpl<$Res> implements $SplashStateCopyWith<$Res> {
_$SplashStateCopyWithImpl(this._value, this._then);
final SplashState _value;
// ignore: unused_field
final $Res Function(SplashState) _then;
@override
$Res call({
Object? auth = freezed,
}) {
return _then(_value.copyWith(
auth: auth == freezed
? _value.auth
: auth // ignore: cast_nullable_to_non_nullable
as AuthState,
));
}
@override
$AuthStateCopyWith<$Res> get auth {
return $AuthStateCopyWith<$Res>(_value.auth, (value) {
return _then(_value.copyWith(auth: value));
});
}
}
/// @nodoc
abstract class _$SplashStateCopyWith<$Res>
implements $SplashStateCopyWith<$Res> {
factory _$SplashStateCopyWith(
_SplashState value, $Res Function(_SplashState) then) =
__$SplashStateCopyWithImpl<$Res>;
@override
$Res call({AuthState auth});
@override
$AuthStateCopyWith<$Res> get auth;
}
/// @nodoc
class __$SplashStateCopyWithImpl<$Res> extends _$SplashStateCopyWithImpl<$Res>
implements _$SplashStateCopyWith<$Res> {
__$SplashStateCopyWithImpl(
_SplashState _value, $Res Function(_SplashState) _then)
: super(_value, (v) => _then(v as _SplashState));
@override
_SplashState get _value => super._value as _SplashState;
@override
$Res call({
Object? auth = freezed,
}) {
return _then(_SplashState(
auth: auth == freezed
? _value.auth
: auth // ignore: cast_nullable_to_non_nullable
as AuthState,
));
}
}
/// @nodoc
class _$_SplashState implements _SplashState {
const _$_SplashState({required this.auth});
@override
final AuthState auth;
@override
String toString() {
return 'SplashState(auth: $auth)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _SplashState &&
(identical(other.auth, auth) ||
const DeepCollectionEquality().equals(other.auth, auth)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(auth);
@JsonKey(ignore: true)
@override
_$SplashStateCopyWith<_SplashState> get copyWith =>
__$SplashStateCopyWithImpl<_SplashState>(this, _$identity);
}
abstract class _SplashState implements SplashState {
const factory _SplashState({required AuthState auth}) = _$_SplashState;
@override
AuthState get auth => throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$SplashStateCopyWith<_SplashState> get copyWith =>
throw _privateConstructorUsedError;
}
-11
View File
@@ -1,11 +0,0 @@
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'auth_state.freezed.dart';
@freezed
abstract class AuthState with _$AuthState {
const factory AuthState.authenticated(UserProfile userProfile) =
Authenticated;
const factory AuthState.unauthenticated(UserError error) = Unauthenticated;
const factory AuthState.initial() = _Initial;
}
@@ -1,487 +0,0 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'auth_state.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
/// @nodoc
class _$AuthStateTearOff {
const _$AuthStateTearOff();
Authenticated authenticated(UserProfile userProfile) {
return Authenticated(
userProfile,
);
}
Unauthenticated unauthenticated(UserError error) {
return Unauthenticated(
error,
);
}
_Initial initial() {
return const _Initial();
}
}
/// @nodoc
const $AuthState = _$AuthStateTearOff();
/// @nodoc
mixin _$AuthState {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(UserProfile userProfile) authenticated,
required TResult Function(UserError error) unauthenticated,
required TResult Function() initial,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(UserProfile userProfile)? authenticated,
TResult Function(UserError error)? unauthenticated,
TResult Function()? initial,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(UserProfile userProfile)? authenticated,
TResult Function(UserError error)? unauthenticated,
TResult Function()? initial,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Authenticated value) authenticated,
required TResult Function(Unauthenticated value) unauthenticated,
required TResult Function(_Initial value) initial,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Authenticated value)? authenticated,
TResult Function(Unauthenticated value)? unauthenticated,
TResult Function(_Initial value)? initial,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Authenticated value)? authenticated,
TResult Function(Unauthenticated value)? unauthenticated,
TResult Function(_Initial value)? initial,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $AuthStateCopyWith<$Res> {
factory $AuthStateCopyWith(AuthState value, $Res Function(AuthState) then) =
_$AuthStateCopyWithImpl<$Res>;
}
/// @nodoc
class _$AuthStateCopyWithImpl<$Res> implements $AuthStateCopyWith<$Res> {
_$AuthStateCopyWithImpl(this._value, this._then);
final AuthState _value;
// ignore: unused_field
final $Res Function(AuthState) _then;
}
/// @nodoc
abstract class $AuthenticatedCopyWith<$Res> {
factory $AuthenticatedCopyWith(
Authenticated value, $Res Function(Authenticated) then) =
_$AuthenticatedCopyWithImpl<$Res>;
$Res call({UserProfile userProfile});
}
/// @nodoc
class _$AuthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res>
implements $AuthenticatedCopyWith<$Res> {
_$AuthenticatedCopyWithImpl(
Authenticated _value, $Res Function(Authenticated) _then)
: super(_value, (v) => _then(v as Authenticated));
@override
Authenticated get _value => super._value as Authenticated;
@override
$Res call({
Object? userProfile = freezed,
}) {
return _then(Authenticated(
userProfile == freezed
? _value.userProfile
: userProfile // ignore: cast_nullable_to_non_nullable
as UserProfile,
));
}
}
/// @nodoc
class _$Authenticated implements Authenticated {
const _$Authenticated(this.userProfile);
@override
final UserProfile userProfile;
@override
String toString() {
return 'AuthState.authenticated(userProfile: $userProfile)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is Authenticated &&
(identical(other.userProfile, userProfile) ||
const DeepCollectionEquality()
.equals(other.userProfile, userProfile)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(userProfile);
@JsonKey(ignore: true)
@override
$AuthenticatedCopyWith<Authenticated> get copyWith =>
_$AuthenticatedCopyWithImpl<Authenticated>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(UserProfile userProfile) authenticated,
required TResult Function(UserError error) unauthenticated,
required TResult Function() initial,
}) {
return authenticated(userProfile);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(UserProfile userProfile)? authenticated,
TResult Function(UserError error)? unauthenticated,
TResult Function()? initial,
}) {
return authenticated?.call(userProfile);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(UserProfile userProfile)? authenticated,
TResult Function(UserError error)? unauthenticated,
TResult Function()? initial,
required TResult orElse(),
}) {
if (authenticated != null) {
return authenticated(userProfile);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Authenticated value) authenticated,
required TResult Function(Unauthenticated value) unauthenticated,
required TResult Function(_Initial value) initial,
}) {
return authenticated(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Authenticated value)? authenticated,
TResult Function(Unauthenticated value)? unauthenticated,
TResult Function(_Initial value)? initial,
}) {
return authenticated?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Authenticated value)? authenticated,
TResult Function(Unauthenticated value)? unauthenticated,
TResult Function(_Initial value)? initial,
required TResult orElse(),
}) {
if (authenticated != null) {
return authenticated(this);
}
return orElse();
}
}
abstract class Authenticated implements AuthState {
const factory Authenticated(UserProfile userProfile) = _$Authenticated;
UserProfile get userProfile => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$AuthenticatedCopyWith<Authenticated> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $UnauthenticatedCopyWith<$Res> {
factory $UnauthenticatedCopyWith(
Unauthenticated value, $Res Function(Unauthenticated) then) =
_$UnauthenticatedCopyWithImpl<$Res>;
$Res call({UserError error});
}
/// @nodoc
class _$UnauthenticatedCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res>
implements $UnauthenticatedCopyWith<$Res> {
_$UnauthenticatedCopyWithImpl(
Unauthenticated _value, $Res Function(Unauthenticated) _then)
: super(_value, (v) => _then(v as Unauthenticated));
@override
Unauthenticated get _value => super._value as Unauthenticated;
@override
$Res call({
Object? error = freezed,
}) {
return _then(Unauthenticated(
error == freezed
? _value.error
: error // ignore: cast_nullable_to_non_nullable
as UserError,
));
}
}
/// @nodoc
class _$Unauthenticated implements Unauthenticated {
const _$Unauthenticated(this.error);
@override
final UserError error;
@override
String toString() {
return 'AuthState.unauthenticated(error: $error)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is Unauthenticated &&
(identical(other.error, error) ||
const DeepCollectionEquality().equals(other.error, error)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(error);
@JsonKey(ignore: true)
@override
$UnauthenticatedCopyWith<Unauthenticated> get copyWith =>
_$UnauthenticatedCopyWithImpl<Unauthenticated>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(UserProfile userProfile) authenticated,
required TResult Function(UserError error) unauthenticated,
required TResult Function() initial,
}) {
return unauthenticated(error);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(UserProfile userProfile)? authenticated,
TResult Function(UserError error)? unauthenticated,
TResult Function()? initial,
}) {
return unauthenticated?.call(error);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(UserProfile userProfile)? authenticated,
TResult Function(UserError error)? unauthenticated,
TResult Function()? initial,
required TResult orElse(),
}) {
if (unauthenticated != null) {
return unauthenticated(error);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Authenticated value) authenticated,
required TResult Function(Unauthenticated value) unauthenticated,
required TResult Function(_Initial value) initial,
}) {
return unauthenticated(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Authenticated value)? authenticated,
TResult Function(Unauthenticated value)? unauthenticated,
TResult Function(_Initial value)? initial,
}) {
return unauthenticated?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Authenticated value)? authenticated,
TResult Function(Unauthenticated value)? unauthenticated,
TResult Function(_Initial value)? initial,
required TResult orElse(),
}) {
if (unauthenticated != null) {
return unauthenticated(this);
}
return orElse();
}
}
abstract class Unauthenticated implements AuthState {
const factory Unauthenticated(UserError error) = _$Unauthenticated;
UserError get error => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$UnauthenticatedCopyWith<Unauthenticated> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$InitialCopyWith<$Res> {
factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) =
__$InitialCopyWithImpl<$Res>;
}
/// @nodoc
class __$InitialCopyWithImpl<$Res> extends _$AuthStateCopyWithImpl<$Res>
implements _$InitialCopyWith<$Res> {
__$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then)
: super(_value, (v) => _then(v as _Initial));
@override
_Initial get _value => super._value as _Initial;
}
/// @nodoc
class _$_Initial implements _Initial {
const _$_Initial();
@override
String toString() {
return 'AuthState.initial()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is _Initial);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(UserProfile userProfile) authenticated,
required TResult Function(UserError error) unauthenticated,
required TResult Function() initial,
}) {
return initial();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(UserProfile userProfile)? authenticated,
TResult Function(UserError error)? unauthenticated,
TResult Function()? initial,
}) {
return initial?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(UserProfile userProfile)? authenticated,
TResult Function(UserError error)? unauthenticated,
TResult Function()? initial,
required TResult orElse(),
}) {
if (initial != null) {
return initial();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Authenticated value) authenticated,
required TResult Function(Unauthenticated value) unauthenticated,
required TResult Function(_Initial value) initial,
}) {
return initial(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Authenticated value)? authenticated,
TResult Function(Unauthenticated value)? unauthenticated,
TResult Function(_Initial value)? initial,
}) {
return initial?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Authenticated value)? authenticated,
TResult Function(Unauthenticated value)? unauthenticated,
TResult Function(_Initial value)? initial,
required TResult orElse(),
}) {
if (initial != null) {
return initial(this);
}
return orElse();
}
}
abstract class _Initial implements AuthState {
const factory _Initial() = _$_Initial;
}
-26
View File
@@ -1,26 +0,0 @@
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/protobuf.dart';
import 'package:flutter/material.dart';
class NewUser {
UserProfile profile;
String workspaceId;
NewUser({
required this.profile,
required this.workspaceId,
});
}
abstract class IAuth {
Future<Either<UserProfile, UserError>> signIn(String? email, String? password);
Future<Either<UserProfile, UserError>> signUp(String? name, String? password, String? email);
Future<Either<Unit, UserError>> signOut();
}
abstract class IAuthRouter {
void pushWelcomeScreen(BuildContext context, UserProfile userProfile);
void pushSignUpScreen(BuildContext context);
void pushForgetPasswordScreen(BuildContext context);
void pushHomeScreen(BuildContext context, UserProfile profile, CurrentWorkspaceSetting workspaceSetting);
}
-25
View File
@@ -1,25 +0,0 @@
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/protobuf.dart';
import 'package:flutter/widgets.dart';
import 'auth_state.dart';
abstract class ISplashUser {
Future<AuthState> currentUserProfile();
}
abstract class ISplashUserWatch {
void startWatching({
void Function(AuthState)? authStateCallback,
});
Future<void> stopWatching();
}
abstract class ISplashRoute {
void pushSignInScreen(BuildContext context);
void pushSkipLoginScreen(BuildContext context);
Future<void> pushWelcomeScreen(BuildContext context, UserProfile profile);
void pushHomeScreen(BuildContext context, UserProfile profile, CurrentWorkspaceSetting workspaceSetting);
}
@@ -1,40 +0,0 @@
import 'package:app_flowy/user/application/sign_in_bloc.dart';
import 'package:app_flowy/user/application/sign_up_bloc.dart';
import 'package:app_flowy/user/application/splash_bloc.dart';
import 'package:app_flowy/user/domain/i_auth.dart';
import 'package:app_flowy/user/domain/i_splash.dart';
import 'package:app_flowy/user/infrastructure/repos/auth_repo.dart';
import 'package:app_flowy/user/infrastructure/i_auth_impl.dart';
import 'package:app_flowy/user/infrastructure/i_splash_impl.dart';
import 'package:app_flowy/workspace/application/edit_pannel/edit_pannel_bloc.dart';
import 'package:app_flowy/workspace/application/home/home_bloc.dart';
import 'package:app_flowy/workspace/application/home/home_listen_bloc.dart';
import 'package:app_flowy/workspace/domain/i_user.dart';
import 'package:app_flowy/workspace/infrastructure/i_user_impl.dart';
import 'package:get_it/get_it.dart';
class UserDepsResolver {
static Future<void> resolve(GetIt getIt) async {
getIt.registerFactory<AuthRepository>(() => AuthRepository());
//Interface implementation
getIt.registerFactory<IAuth>(() => AuthImpl(repo: getIt<AuthRepository>()));
getIt.registerFactory<IAuthRouter>(() => AuthRouterImpl());
//Bloc
getIt.registerFactory<SignInBloc>(() => SignInBloc(getIt<IAuth>()));
getIt.registerFactory<SignUpBloc>(() => SignUpBloc(getIt<IAuth>()));
getIt.registerFactory<ISplashUser>(() => SplashUserImpl());
getIt.registerFactory<ISplashRoute>(() => SplashRoute());
getIt.registerFactory<HomeBloc>(() => HomeBloc());
getIt.registerFactory<EditPannelBloc>(() => EditPannelBloc());
getIt.registerFactory<SplashBloc>(() => SplashBloc(getIt<ISplashUser>()));
getIt.registerFactoryParam<HomeListenBloc, UserProfile, void>(
(user, _) => HomeListenBloc(
getIt<IUserListener>(param1: user),
),
);
}
}
@@ -1,63 +0,0 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/user/domain/i_splash.dart';
import 'package:app_flowy/user/presentation/sign_up_screen.dart';
import 'package:app_flowy/workspace/presentation/home/home_screen.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_infra/time/duration.dart';
import 'package:flowy_infra_ui/widget/route/animation.dart';
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
import 'package:app_flowy/user/domain/i_auth.dart';
import 'package:app_flowy/user/infrastructure/repos/auth_repo.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/protobuf.dart';
import 'package:flutter/material.dart';
class AuthImpl extends IAuth {
AuthRepository repo;
AuthImpl({
required this.repo,
});
@override
Future<Either<UserProfile, UserError>> signIn(String? email, String? password) {
return repo.signIn(email: email, password: password);
}
@override
Future<Either<UserProfile, UserError>> signUp(String? name, String? password, String? email) {
return repo.signUp(name: name, password: password, email: email);
}
@override
Future<Either<Unit, UserError>> signOut() {
return repo.signOut();
}
}
class AuthRouterImpl extends IAuthRouter {
@override
void pushForgetPasswordScreen(BuildContext context) {
// TODO: implement showForgetPasswordScreen
}
@override
void pushWelcomeScreen(BuildContext context, UserProfile userProfile) {
getIt<ISplashRoute>().pushWelcomeScreen(context, userProfile);
}
@override
void pushSignUpScreen(BuildContext context) {
Navigator.of(context).push(
PageRoutes.fade(
() => SignUpScreen(router: getIt<IAuthRouter>()),
),
);
}
@override
void pushHomeScreen(BuildContext context, UserProfile profile, CurrentWorkspaceSetting workspaceSetting) {
Navigator.push(
context,
PageRoutes.fade(() => HomeScreen(profile, workspaceSetting), RouteDurations.slow.inMilliseconds * .001),
);
}
}
@@ -1,78 +0,0 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/user/domain/auth_state.dart';
import 'package:app_flowy/user/domain/i_auth.dart';
import 'package:app_flowy/user/domain/i_splash.dart';
import 'package:app_flowy/user/presentation/sign_in_screen.dart';
import 'package:app_flowy/user/presentation/skip_log_in_screen.dart';
import 'package:app_flowy/user/presentation/welcome_screen.dart';
import 'package:app_flowy/workspace/infrastructure/repos/user_repo.dart';
import 'package:app_flowy/workspace/presentation/home/home_screen.dart';
import 'package:flowy_infra/time/duration.dart';
import 'package:flowy_infra_ui/widget/route/animation.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/protobuf.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
class SplashUserImpl implements ISplashUser {
@override
Future<AuthState> currentUserProfile() {
final result = UserEventCheckUser().send();
return result.then((result) {
return result.fold(
(userProfile) {
return AuthState.authenticated(userProfile);
},
(userError) {
return AuthState.unauthenticated(userError);
},
);
});
}
}
class SplashRoute implements ISplashRoute {
@override
Future<void> pushWelcomeScreen(BuildContext context, UserProfile user) async {
final repo = UserRepo(user: user);
final screen = WelcomeScreen(repo: repo);
final workspaceId = await Navigator.of(context).push(
PageRoutes.fade(
() => screen,
RouteDurations.slow.inMilliseconds * .001,
),
);
pushHomeScreen(context, repo.user, workspaceId);
}
@override
void pushHomeScreen(BuildContext context, UserProfile userProfile, CurrentWorkspaceSetting workspaceSetting) {
Navigator.push(
context,
PageRoutes.fade(() => HomeScreen(userProfile, workspaceSetting), RouteDurations.slow.inMilliseconds * .001),
);
}
@override
void pushSignInScreen(BuildContext context) {
Navigator.push(
context,
PageRoutes.fade(() => SignInScreen(router: getIt<IAuthRouter>()), RouteDurations.slow.inMilliseconds * .001),
);
}
@override
void pushSkipLoginScreen(BuildContext context) {
Navigator.push(
context,
PageRoutes.fade(
() => SkipLogInScreen(
router: getIt<IAuthRouter>(),
authManager: getIt<IAuth>(),
),
RouteDurations.slow.inMilliseconds * .001),
);
}
}
@@ -1,125 +0,0 @@
import 'package:app_flowy/workspace/domain/i_app.dart';
import 'package:flowy_log/flowy_log.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/app_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:dartz/dartz.dart';
part 'app_bloc.freezed.dart';
class AppBloc extends Bloc<AppEvent, AppState> {
final IApp appManager;
final IAppListenr listener;
AppBloc({required App app, required this.appManager, required this.listener}) : super(AppState.initial(app));
@override
Stream<AppState> mapEventToState(
AppEvent event,
) async* {
yield* event.map(initial: (e) async* {
listener.start(
viewsChangeCallback: _handleViewsChanged,
updatedCallback: (app) => add(AppEvent.appDidUpdate(app)),
);
yield* _fetchViews();
}, createView: (CreateView value) async* {
final viewOrFailed = await appManager.createView(name: value.name, desc: value.desc, viewType: value.viewType);
yield viewOrFailed.fold(
(view) => state.copyWith(
latestCreatedView: view,
successOrFailure: left(unit),
),
(error) {
Log.error(error);
return state.copyWith(successOrFailure: right(error));
},
);
}, didReceiveViews: (e) async* {
yield* handleDidReceiveViews(e.views);
}, delete: (e) async* {
final result = await appManager.delete();
yield result.fold(
(unit) => state.copyWith(successOrFailure: left(unit)),
(error) => state.copyWith(successOrFailure: right(error)),
);
}, rename: (e) async* {
final result = await appManager.rename(e.newName);
yield result.fold(
(l) => state.copyWith(successOrFailure: left(unit)),
(error) => state.copyWith(successOrFailure: right(error)),
);
}, appDidUpdate: (e) async* {
yield state.copyWith(app: e.app);
});
}
@override
Future<void> close() async {
await listener.stop();
return super.close();
}
void _handleViewsChanged(Either<List<View>, WorkspaceError> result) {
result.fold(
(views) => add(AppEvent.didReceiveViews(views)),
(error) {
Log.error(error);
},
);
}
Stream<AppState> handleDidReceiveViews(List<View> views) async* {
final latestCreatedView = state.latestCreatedView;
AppState newState = state.copyWith(views: views);
if (latestCreatedView != null) {
final index = views.indexWhere((element) => element.id == latestCreatedView.id);
if (index == -1) {
newState = newState.copyWith(latestCreatedView: null);
}
}
yield newState;
}
Stream<AppState> _fetchViews() async* {
final viewsOrFailed = await appManager.getViews();
yield viewsOrFailed.fold(
(apps) => state.copyWith(views: apps),
(error) {
Log.error(error);
return state.copyWith(successOrFailure: right(error));
},
);
}
}
@freezed
class AppEvent with _$AppEvent {
const factory AppEvent.initial() = Initial;
const factory AppEvent.createView(String name, String desc, ViewType viewType) = CreateView;
const factory AppEvent.delete() = Delete;
const factory AppEvent.rename(String newName) = Rename;
const factory AppEvent.didReceiveViews(List<View> views) = ReceiveViews;
const factory AppEvent.appDidUpdate(App app) = AppDidUpdate;
}
@freezed
class AppState with _$AppState {
const factory AppState({
required App app,
required bool isLoading,
required List<View>? views,
View? latestCreatedView,
required Either<Unit, WorkspaceError> successOrFailure,
}) = _AppState;
factory AppState.initial(App app) => AppState(
app: app,
isLoading: false,
views: null,
latestCreatedView: null,
successOrFailure: left(unit),
);
}
File diff suppressed because it is too large. Load diff
@@ -1,159 +0,0 @@
import 'dart:convert';
import 'package:app_flowy/workspace/domain/i_trash.dart';
import 'package:app_flowy/workspace/domain/i_view.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/trash_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:flowy_log/flowy_log.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:app_flowy/workspace/domain/i_doc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:dartz/dartz.dart';
import 'dart:async';
part 'doc_bloc.freezed.dart';
class DocBloc extends Bloc<DocEvent, DocState> {
final View view;
final IDoc docManager;
final IViewListener listener;
final ITrash trasnManager;
late Document document;
StreamSubscription? _subscription;
DocBloc({
required this.view,
required this.docManager,
required this.listener,
required this.trasnManager,
}) : super(DocState.initial());
@override
Stream<DocState> mapEventToState(DocEvent event) async* {
yield* event.map(
initial: _initial,
deleted: (Deleted value) async* {
yield state.copyWith(isDeleted: true);
},
restore: (Restore value) async* {
yield state.copyWith(isDeleted: false);
},
deletePermanently: (DeletePermanently value) async* {
final result = await trasnManager.deleteViews([Tuple2(view.id, TrashType.View)]);
yield result.fold((l) => state.copyWith(forceClose: true), (r) {
return state;
});
},
restorePage: (RestorePage value) async* {
final result = await trasnManager.putback(view.id);
yield result.fold((l) => state.copyWith(isDeleted: false), (r) {
return state;
});
},
);
}
@override
Future<void> close() async {
await listener.stop();
if (_subscription != null) {
await _subscription?.cancel();
}
// docManager.closeDoc();
return super.close();
}
Stream<DocState> _initial(Initial value) async* {
listener.deletedNotifier.addPublishListener((result) {
result.fold(
(view) => add(const DocEvent.deleted()),
(error) {},
);
});
listener.restoredNotifier.addPublishListener((result) {
result.fold(
(view) => add(const DocEvent.restore()),
(error) {},
);
});
listener.start();
final result = await docManager.readDoc();
yield result.fold(
(doc) {
document = _decodeJsonToDocument(doc.data);
_subscription = document.changes.listen((event) {
final delta = event.item2;
final documentDelta = document.toDelta();
_composeDelta(delta, documentDelta);
});
return state.copyWith(loadState: DocLoadState.finish(left(unit)));
},
(err) {
return state.copyWith(loadState: DocLoadState.finish(right(err)));
},
);
}
// Document _decodeListToDocument(Uint8List data) {
// final json = jsonDecode(utf8.decode(data));
// final document = Document.fromJson(json);
// return document;
// }
void _composeDelta(Delta composedDelta, Delta documentDelta) async {
final json = jsonEncode(composedDelta.toJson());
Log.debug("doc_id: $view.id - Send json: $json");
final result = await docManager.composeDelta(json: json);
result.fold((rustDoc) {
// final json = utf8.decode(doc.data);
final rustDelta = Delta.fromJson(jsonDecode(rustDoc.data));
if (documentDelta != rustDelta) {
Log.error("Receive : $rustDelta");
Log.error("Expected : $documentDelta");
}
}, (r) => null);
}
Document _decodeJsonToDocument(String data) {
final json = jsonDecode(data);
final document = Document.fromJson(json);
return document;
}
}
@freezed
class DocEvent with _$DocEvent {
const factory DocEvent.initial() = Initial;
const factory DocEvent.deleted() = Deleted;
const factory DocEvent.restore() = Restore;
const factory DocEvent.restorePage() = RestorePage;
const factory DocEvent.deletePermanently() = DeletePermanently;
}
@freezed
class DocState with _$DocState {
const factory DocState({
required DocLoadState loadState,
required bool isDeleted,
required bool forceClose,
}) = _DocState;
factory DocState.initial() => const DocState(
loadState: _Loading(),
isDeleted: false,
forceClose: false,
);
}
@freezed
class DocLoadState with _$DocLoadState {
const factory DocLoadState.loading() = _Loading;
const factory DocLoadState.finish(Either<Unit, WorkspaceError> successOrFail) = _Finish;
}
File diff suppressed because it is too large. Load diff
@@ -1,867 +0,0 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'share_bloc.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
/// @nodoc
class _$DocShareEventTearOff {
const _$DocShareEventTearOff();
ShareMarkdown shareMarkdown() {
return const ShareMarkdown();
}
ShareText shareText() {
return const ShareText();
}
ShareLink shareLink() {
return const ShareLink();
}
}
/// @nodoc
const $DocShareEvent = _$DocShareEventTearOff();
/// @nodoc
mixin _$DocShareEvent {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() shareMarkdown,
required TResult Function() shareText,
required TResult Function() shareLink,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? shareMarkdown,
TResult Function()? shareText,
TResult Function()? shareLink,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? shareMarkdown,
TResult Function()? shareText,
TResult Function()? shareLink,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ShareMarkdown value) shareMarkdown,
required TResult Function(ShareText value) shareText,
required TResult Function(ShareLink value) shareLink,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(ShareMarkdown value)? shareMarkdown,
TResult Function(ShareText value)? shareText,
TResult Function(ShareLink value)? shareLink,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ShareMarkdown value)? shareMarkdown,
TResult Function(ShareText value)? shareText,
TResult Function(ShareLink value)? shareLink,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $DocShareEventCopyWith<$Res> {
factory $DocShareEventCopyWith(
DocShareEvent value, $Res Function(DocShareEvent) then) =
_$DocShareEventCopyWithImpl<$Res>;
}
/// @nodoc
class _$DocShareEventCopyWithImpl<$Res>
implements $DocShareEventCopyWith<$Res> {
_$DocShareEventCopyWithImpl(this._value, this._then);
final DocShareEvent _value;
// ignore: unused_field
final $Res Function(DocShareEvent) _then;
}
/// @nodoc
abstract class $ShareMarkdownCopyWith<$Res> {
factory $ShareMarkdownCopyWith(
ShareMarkdown value, $Res Function(ShareMarkdown) then) =
_$ShareMarkdownCopyWithImpl<$Res>;
}
/// @nodoc
class _$ShareMarkdownCopyWithImpl<$Res>
extends _$DocShareEventCopyWithImpl<$Res>
implements $ShareMarkdownCopyWith<$Res> {
_$ShareMarkdownCopyWithImpl(
ShareMarkdown _value, $Res Function(ShareMarkdown) _then)
: super(_value, (v) => _then(v as ShareMarkdown));
@override
ShareMarkdown get _value => super._value as ShareMarkdown;
}
/// @nodoc
class _$ShareMarkdown implements ShareMarkdown {
const _$ShareMarkdown();
@override
String toString() {
return 'DocShareEvent.shareMarkdown()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is ShareMarkdown);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() shareMarkdown,
required TResult Function() shareText,
required TResult Function() shareLink,
}) {
return shareMarkdown();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? shareMarkdown,
TResult Function()? shareText,
TResult Function()? shareLink,
}) {
return shareMarkdown?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? shareMarkdown,
TResult Function()? shareText,
TResult Function()? shareLink,
required TResult orElse(),
}) {
if (shareMarkdown != null) {
return shareMarkdown();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ShareMarkdown value) shareMarkdown,
required TResult Function(ShareText value) shareText,
required TResult Function(ShareLink value) shareLink,
}) {
return shareMarkdown(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(ShareMarkdown value)? shareMarkdown,
TResult Function(ShareText value)? shareText,
TResult Function(ShareLink value)? shareLink,
}) {
return shareMarkdown?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ShareMarkdown value)? shareMarkdown,
TResult Function(ShareText value)? shareText,
TResult Function(ShareLink value)? shareLink,
required TResult orElse(),
}) {
if (shareMarkdown != null) {
return shareMarkdown(this);
}
return orElse();
}
}
abstract class ShareMarkdown implements DocShareEvent {
const factory ShareMarkdown() = _$ShareMarkdown;
}
/// @nodoc
abstract class $ShareTextCopyWith<$Res> {
factory $ShareTextCopyWith(ShareText value, $Res Function(ShareText) then) =
_$ShareTextCopyWithImpl<$Res>;
}
/// @nodoc
class _$ShareTextCopyWithImpl<$Res> extends _$DocShareEventCopyWithImpl<$Res>
implements $ShareTextCopyWith<$Res> {
_$ShareTextCopyWithImpl(ShareText _value, $Res Function(ShareText) _then)
: super(_value, (v) => _then(v as ShareText));
@override
ShareText get _value => super._value as ShareText;
}
/// @nodoc
class _$ShareText implements ShareText {
const _$ShareText();
@override
String toString() {
return 'DocShareEvent.shareText()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is ShareText);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() shareMarkdown,
required TResult Function() shareText,
required TResult Function() shareLink,
}) {
return shareText();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? shareMarkdown,
TResult Function()? shareText,
TResult Function()? shareLink,
}) {
return shareText?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? shareMarkdown,
TResult Function()? shareText,
TResult Function()? shareLink,
required TResult orElse(),
}) {
if (shareText != null) {
return shareText();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ShareMarkdown value) shareMarkdown,
required TResult Function(ShareText value) shareText,
required TResult Function(ShareLink value) shareLink,
}) {
return shareText(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(ShareMarkdown value)? shareMarkdown,
TResult Function(ShareText value)? shareText,
TResult Function(ShareLink value)? shareLink,
}) {
return shareText?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ShareMarkdown value)? shareMarkdown,
TResult Function(ShareText value)? shareText,
TResult Function(ShareLink value)? shareLink,
required TResult orElse(),
}) {
if (shareText != null) {
return shareText(this);
}
return orElse();
}
}
abstract class ShareText implements DocShareEvent {
const factory ShareText() = _$ShareText;
}
/// @nodoc
abstract class $ShareLinkCopyWith<$Res> {
factory $ShareLinkCopyWith(ShareLink value, $Res Function(ShareLink) then) =
_$ShareLinkCopyWithImpl<$Res>;
}
/// @nodoc
class _$ShareLinkCopyWithImpl<$Res> extends _$DocShareEventCopyWithImpl<$Res>
implements $ShareLinkCopyWith<$Res> {
_$ShareLinkCopyWithImpl(ShareLink _value, $Res Function(ShareLink) _then)
: super(_value, (v) => _then(v as ShareLink));
@override
ShareLink get _value => super._value as ShareLink;
}
/// @nodoc
class _$ShareLink implements ShareLink {
const _$ShareLink();
@override
String toString() {
return 'DocShareEvent.shareLink()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is ShareLink);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() shareMarkdown,
required TResult Function() shareText,
required TResult Function() shareLink,
}) {
return shareLink();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? shareMarkdown,
TResult Function()? shareText,
TResult Function()? shareLink,
}) {
return shareLink?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? shareMarkdown,
TResult Function()? shareText,
TResult Function()? shareLink,
required TResult orElse(),
}) {
if (shareLink != null) {
return shareLink();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(ShareMarkdown value) shareMarkdown,
required TResult Function(ShareText value) shareText,
required TResult Function(ShareLink value) shareLink,
}) {
return shareLink(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(ShareMarkdown value)? shareMarkdown,
TResult Function(ShareText value)? shareText,
TResult Function(ShareLink value)? shareLink,
}) {
return shareLink?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(ShareMarkdown value)? shareMarkdown,
TResult Function(ShareText value)? shareText,
TResult Function(ShareLink value)? shareLink,
required TResult orElse(),
}) {
if (shareLink != null) {
return shareLink(this);
}
return orElse();
}
}
abstract class ShareLink implements DocShareEvent {
const factory ShareLink() = _$ShareLink;
}
/// @nodoc
class _$DocShareStateTearOff {
const _$DocShareStateTearOff();
_Initial initial() {
return const _Initial();
}
_Loading loading() {
return const _Loading();
}
_Finish finish(Either<ExportData, WorkspaceError> successOrFail) {
return _Finish(
successOrFail,
);
}
}
/// @nodoc
const $DocShareState = _$DocShareStateTearOff();
/// @nodoc
mixin _$DocShareState {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function() loading,
required TResult Function(Either<ExportData, WorkspaceError> successOrFail)
finish,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? loading,
TResult Function(Either<ExportData, WorkspaceError> successOrFail)? finish,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? loading,
TResult Function(Either<ExportData, WorkspaceError> successOrFail)? finish,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Initial value) initial,
required TResult Function(_Loading value) loading,
required TResult Function(_Finish value) finish,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_Loading value)? loading,
TResult Function(_Finish value)? finish,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_Loading value)? loading,
TResult Function(_Finish value)? finish,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $DocShareStateCopyWith<$Res> {
factory $DocShareStateCopyWith(
DocShareState value, $Res Function(DocShareState) then) =
_$DocShareStateCopyWithImpl<$Res>;
}
/// @nodoc
class _$DocShareStateCopyWithImpl<$Res>
implements $DocShareStateCopyWith<$Res> {
_$DocShareStateCopyWithImpl(this._value, this._then);
final DocShareState _value;
// ignore: unused_field
final $Res Function(DocShareState) _then;
}
/// @nodoc
abstract class _$InitialCopyWith<$Res> {
factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) =
__$InitialCopyWithImpl<$Res>;
}
/// @nodoc
class __$InitialCopyWithImpl<$Res> extends _$DocShareStateCopyWithImpl<$Res>
implements _$InitialCopyWith<$Res> {
__$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then)
: super(_value, (v) => _then(v as _Initial));
@override
_Initial get _value => super._value as _Initial;
}
/// @nodoc
class _$_Initial implements _Initial {
const _$_Initial();
@override
String toString() {
return 'DocShareState.initial()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is _Initial);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function() loading,
required TResult Function(Either<ExportData, WorkspaceError> successOrFail)
finish,
}) {
return initial();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? loading,
TResult Function(Either<ExportData, WorkspaceError> successOrFail)? finish,
}) {
return initial?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? loading,
TResult Function(Either<ExportData, WorkspaceError> successOrFail)? finish,
required TResult orElse(),
}) {
if (initial != null) {
return initial();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Initial value) initial,
required TResult Function(_Loading value) loading,
required TResult Function(_Finish value) finish,
}) {
return initial(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_Loading value)? loading,
TResult Function(_Finish value)? finish,
}) {
return initial?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_Loading value)? loading,
TResult Function(_Finish value)? finish,
required TResult orElse(),
}) {
if (initial != null) {
return initial(this);
}
return orElse();
}
}
abstract class _Initial implements DocShareState {
const factory _Initial() = _$_Initial;
}
/// @nodoc
abstract class _$LoadingCopyWith<$Res> {
factory _$LoadingCopyWith(_Loading value, $Res Function(_Loading) then) =
__$LoadingCopyWithImpl<$Res>;
}
/// @nodoc
class __$LoadingCopyWithImpl<$Res> extends _$DocShareStateCopyWithImpl<$Res>
implements _$LoadingCopyWith<$Res> {
__$LoadingCopyWithImpl(_Loading _value, $Res Function(_Loading) _then)
: super(_value, (v) => _then(v as _Loading));
@override
_Loading get _value => super._value as _Loading;
}
/// @nodoc
class _$_Loading implements _Loading {
const _$_Loading();
@override
String toString() {
return 'DocShareState.loading()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is _Loading);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function() loading,
required TResult Function(Either<ExportData, WorkspaceError> successOrFail)
finish,
}) {
return loading();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? loading,
TResult Function(Either<ExportData, WorkspaceError> successOrFail)? finish,
}) {
return loading?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? loading,
TResult Function(Either<ExportData, WorkspaceError> successOrFail)? finish,
required TResult orElse(),
}) {
if (loading != null) {
return loading();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Initial value) initial,
required TResult Function(_Loading value) loading,
required TResult Function(_Finish value) finish,
}) {
return loading(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_Loading value)? loading,
TResult Function(_Finish value)? finish,
}) {
return loading?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_Loading value)? loading,
TResult Function(_Finish value)? finish,
required TResult orElse(),
}) {
if (loading != null) {
return loading(this);
}
return orElse();
}
}
abstract class _Loading implements DocShareState {
const factory _Loading() = _$_Loading;
}
/// @nodoc
abstract class _$FinishCopyWith<$Res> {
factory _$FinishCopyWith(_Finish value, $Res Function(_Finish) then) =
__$FinishCopyWithImpl<$Res>;
$Res call({Either<ExportData, WorkspaceError> successOrFail});
}
/// @nodoc
class __$FinishCopyWithImpl<$Res> extends _$DocShareStateCopyWithImpl<$Res>
implements _$FinishCopyWith<$Res> {
__$FinishCopyWithImpl(_Finish _value, $Res Function(_Finish) _then)
: super(_value, (v) => _then(v as _Finish));
@override
_Finish get _value => super._value as _Finish;
@override
$Res call({
Object? successOrFail = freezed,
}) {
return _then(_Finish(
successOrFail == freezed
? _value.successOrFail
: successOrFail // ignore: cast_nullable_to_non_nullable
as Either<ExportData, WorkspaceError>,
));
}
}
/// @nodoc
class _$_Finish implements _Finish {
const _$_Finish(this.successOrFail);
@override
final Either<ExportData, WorkspaceError> successOrFail;
@override
String toString() {
return 'DocShareState.finish(successOrFail: $successOrFail)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _Finish &&
(identical(other.successOrFail, successOrFail) ||
const DeepCollectionEquality()
.equals(other.successOrFail, successOrFail)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(successOrFail);
@JsonKey(ignore: true)
@override
_$FinishCopyWith<_Finish> get copyWith =>
__$FinishCopyWithImpl<_Finish>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function() loading,
required TResult Function(Either<ExportData, WorkspaceError> successOrFail)
finish,
}) {
return finish(successOrFail);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? loading,
TResult Function(Either<ExportData, WorkspaceError> successOrFail)? finish,
}) {
return finish?.call(successOrFail);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? loading,
TResult Function(Either<ExportData, WorkspaceError> successOrFail)? finish,
required TResult orElse(),
}) {
if (finish != null) {
return finish(successOrFail);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Initial value) initial,
required TResult Function(_Loading value) loading,
required TResult Function(_Finish value) finish,
}) {
return finish(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_Loading value)? loading,
TResult Function(_Finish value)? finish,
}) {
return finish?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_Loading value)? loading,
TResult Function(_Finish value)? finish,
required TResult orElse(),
}) {
if (finish != null) {
return finish(this);
}
return orElse();
}
}
abstract class _Finish implements DocShareState {
const factory _Finish(Either<ExportData, WorkspaceError> successOrFail) =
_$_Finish;
Either<ExportData, WorkspaceError> get successOrFail =>
throw _privateConstructorUsedError;
@JsonKey(ignore: true)
_$FinishCopyWith<_Finish> get copyWith => throw _privateConstructorUsedError;
}
@@ -1,541 +0,0 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'edit_pannel_bloc.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
/// @nodoc
class _$EditPannelEventTearOff {
const _$EditPannelEventTearOff();
_StartEdit startEdit(EditPannelContext context) {
return _StartEdit(
context,
);
}
_EndEdit endEdit(EditPannelContext context) {
return _EndEdit(
context,
);
}
}
/// @nodoc
const $EditPannelEvent = _$EditPannelEventTearOff();
/// @nodoc
mixin _$EditPannelEvent {
EditPannelContext get context => throw _privateConstructorUsedError;
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(EditPannelContext context) startEdit,
required TResult Function(EditPannelContext context) endEdit,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(EditPannelContext context)? startEdit,
TResult Function(EditPannelContext context)? endEdit,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(EditPannelContext context)? startEdit,
TResult Function(EditPannelContext context)? endEdit,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_StartEdit value) startEdit,
required TResult Function(_EndEdit value) endEdit,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_StartEdit value)? startEdit,
TResult Function(_EndEdit value)? endEdit,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_StartEdit value)? startEdit,
TResult Function(_EndEdit value)? endEdit,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$EditPannelEventCopyWith<EditPannelEvent> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $EditPannelEventCopyWith<$Res> {
factory $EditPannelEventCopyWith(
EditPannelEvent value, $Res Function(EditPannelEvent) then) =
_$EditPannelEventCopyWithImpl<$Res>;
$Res call({EditPannelContext context});
}
/// @nodoc
class _$EditPannelEventCopyWithImpl<$Res>
implements $EditPannelEventCopyWith<$Res> {
_$EditPannelEventCopyWithImpl(this._value, this._then);
final EditPannelEvent _value;
// ignore: unused_field
final $Res Function(EditPannelEvent) _then;
@override
$Res call({
Object? context = freezed,
}) {
return _then(_value.copyWith(
context: context == freezed
? _value.context
: context // ignore: cast_nullable_to_non_nullable
as EditPannelContext,
));
}
}
/// @nodoc
abstract class _$StartEditCopyWith<$Res>
implements $EditPannelEventCopyWith<$Res> {
factory _$StartEditCopyWith(
_StartEdit value, $Res Function(_StartEdit) then) =
__$StartEditCopyWithImpl<$Res>;
@override
$Res call({EditPannelContext context});
}
/// @nodoc
class __$StartEditCopyWithImpl<$Res> extends _$EditPannelEventCopyWithImpl<$Res>
implements _$StartEditCopyWith<$Res> {
__$StartEditCopyWithImpl(_StartEdit _value, $Res Function(_StartEdit) _then)
: super(_value, (v) => _then(v as _StartEdit));
@override
_StartEdit get _value => super._value as _StartEdit;
@override
$Res call({
Object? context = freezed,
}) {
return _then(_StartEdit(
context == freezed
? _value.context
: context // ignore: cast_nullable_to_non_nullable
as EditPannelContext,
));
}
}
/// @nodoc
class _$_StartEdit implements _StartEdit {
const _$_StartEdit(this.context);
@override
final EditPannelContext context;
@override
String toString() {
return 'EditPannelEvent.startEdit(context: $context)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _StartEdit &&
(identical(other.context, context) ||
const DeepCollectionEquality().equals(other.context, context)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(context);
@JsonKey(ignore: true)
@override
_$StartEditCopyWith<_StartEdit> get copyWith =>
__$StartEditCopyWithImpl<_StartEdit>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(EditPannelContext context) startEdit,
required TResult Function(EditPannelContext context) endEdit,
}) {
return startEdit(context);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(EditPannelContext context)? startEdit,
TResult Function(EditPannelContext context)? endEdit,
}) {
return startEdit?.call(context);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(EditPannelContext context)? startEdit,
TResult Function(EditPannelContext context)? endEdit,
required TResult orElse(),
}) {
if (startEdit != null) {
return startEdit(context);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_StartEdit value) startEdit,
required TResult Function(_EndEdit value) endEdit,
}) {
return startEdit(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_StartEdit value)? startEdit,
TResult Function(_EndEdit value)? endEdit,
}) {
return startEdit?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_StartEdit value)? startEdit,
TResult Function(_EndEdit value)? endEdit,
required TResult orElse(),
}) {
if (startEdit != null) {
return startEdit(this);
}
return orElse();
}
}
abstract class _StartEdit implements EditPannelEvent {
const factory _StartEdit(EditPannelContext context) = _$_StartEdit;
@override
EditPannelContext get context => throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$StartEditCopyWith<_StartEdit> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$EndEditCopyWith<$Res>
implements $EditPannelEventCopyWith<$Res> {
factory _$EndEditCopyWith(_EndEdit value, $Res Function(_EndEdit) then) =
__$EndEditCopyWithImpl<$Res>;
@override
$Res call({EditPannelContext context});
}
/// @nodoc
class __$EndEditCopyWithImpl<$Res> extends _$EditPannelEventCopyWithImpl<$Res>
implements _$EndEditCopyWith<$Res> {
__$EndEditCopyWithImpl(_EndEdit _value, $Res Function(_EndEdit) _then)
: super(_value, (v) => _then(v as _EndEdit));
@override
_EndEdit get _value => super._value as _EndEdit;
@override
$Res call({
Object? context = freezed,
}) {
return _then(_EndEdit(
context == freezed
? _value.context
: context // ignore: cast_nullable_to_non_nullable
as EditPannelContext,
));
}
}
/// @nodoc
class _$_EndEdit implements _EndEdit {
const _$_EndEdit(this.context);
@override
final EditPannelContext context;
@override
String toString() {
return 'EditPannelEvent.endEdit(context: $context)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _EndEdit &&
(identical(other.context, context) ||
const DeepCollectionEquality().equals(other.context, context)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(context);
@JsonKey(ignore: true)
@override
_$EndEditCopyWith<_EndEdit> get copyWith =>
__$EndEditCopyWithImpl<_EndEdit>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(EditPannelContext context) startEdit,
required TResult Function(EditPannelContext context) endEdit,
}) {
return endEdit(context);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(EditPannelContext context)? startEdit,
TResult Function(EditPannelContext context)? endEdit,
}) {
return endEdit?.call(context);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(EditPannelContext context)? startEdit,
TResult Function(EditPannelContext context)? endEdit,
required TResult orElse(),
}) {
if (endEdit != null) {
return endEdit(context);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_StartEdit value) startEdit,
required TResult Function(_EndEdit value) endEdit,
}) {
return endEdit(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_StartEdit value)? startEdit,
TResult Function(_EndEdit value)? endEdit,
}) {
return endEdit?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_StartEdit value)? startEdit,
TResult Function(_EndEdit value)? endEdit,
required TResult orElse(),
}) {
if (endEdit != null) {
return endEdit(this);
}
return orElse();
}
}
abstract class _EndEdit implements EditPannelEvent {
const factory _EndEdit(EditPannelContext context) = _$_EndEdit;
@override
EditPannelContext get context => throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$EndEditCopyWith<_EndEdit> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
class _$EditPannelStateTearOff {
const _$EditPannelStateTearOff();
_EditPannelState call(
{required bool isEditing,
required Option<EditPannelContext> editContext}) {
return _EditPannelState(
isEditing: isEditing,
editContext: editContext,
);
}
}
/// @nodoc
const $EditPannelState = _$EditPannelStateTearOff();
/// @nodoc
mixin _$EditPannelState {
bool get isEditing => throw _privateConstructorUsedError;
Option<EditPannelContext> get editContext =>
throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$EditPannelStateCopyWith<EditPannelState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $EditPannelStateCopyWith<$Res> {
factory $EditPannelStateCopyWith(
EditPannelState value, $Res Function(EditPannelState) then) =
_$EditPannelStateCopyWithImpl<$Res>;
$Res call({bool isEditing, Option<EditPannelContext> editContext});
}
/// @nodoc
class _$EditPannelStateCopyWithImpl<$Res>
implements $EditPannelStateCopyWith<$Res> {
_$EditPannelStateCopyWithImpl(this._value, this._then);
final EditPannelState _value;
// ignore: unused_field
final $Res Function(EditPannelState) _then;
@override
$Res call({
Object? isEditing = freezed,
Object? editContext = freezed,
}) {
return _then(_value.copyWith(
isEditing: isEditing == freezed
? _value.isEditing
: isEditing // ignore: cast_nullable_to_non_nullable
as bool,
editContext: editContext == freezed
? _value.editContext
: editContext // ignore: cast_nullable_to_non_nullable
as Option<EditPannelContext>,
));
}
}
/// @nodoc
abstract class _$EditPannelStateCopyWith<$Res>
implements $EditPannelStateCopyWith<$Res> {
factory _$EditPannelStateCopyWith(
_EditPannelState value, $Res Function(_EditPannelState) then) =
__$EditPannelStateCopyWithImpl<$Res>;
@override
$Res call({bool isEditing, Option<EditPannelContext> editContext});
}
/// @nodoc
class __$EditPannelStateCopyWithImpl<$Res>
extends _$EditPannelStateCopyWithImpl<$Res>
implements _$EditPannelStateCopyWith<$Res> {
__$EditPannelStateCopyWithImpl(
_EditPannelState _value, $Res Function(_EditPannelState) _then)
: super(_value, (v) => _then(v as _EditPannelState));
@override
_EditPannelState get _value => super._value as _EditPannelState;
@override
$Res call({
Object? isEditing = freezed,
Object? editContext = freezed,
}) {
return _then(_EditPannelState(
isEditing: isEditing == freezed
? _value.isEditing
: isEditing // ignore: cast_nullable_to_non_nullable
as bool,
editContext: editContext == freezed
? _value.editContext
: editContext // ignore: cast_nullable_to_non_nullable
as Option<EditPannelContext>,
));
}
}
/// @nodoc
class _$_EditPannelState implements _EditPannelState {
const _$_EditPannelState(
{required this.isEditing, required this.editContext});
@override
final bool isEditing;
@override
final Option<EditPannelContext> editContext;
@override
String toString() {
return 'EditPannelState(isEditing: $isEditing, editContext: $editContext)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _EditPannelState &&
(identical(other.isEditing, isEditing) ||
const DeepCollectionEquality()
.equals(other.isEditing, isEditing)) &&
(identical(other.editContext, editContext) ||
const DeepCollectionEquality()
.equals(other.editContext, editContext)));
}
@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(isEditing) ^
const DeepCollectionEquality().hash(editContext);
@JsonKey(ignore: true)
@override
_$EditPannelStateCopyWith<_EditPannelState> get copyWith =>
__$EditPannelStateCopyWithImpl<_EditPannelState>(this, _$identity);
}
abstract class _EditPannelState implements EditPannelState {
const factory _EditPannelState(
{required bool isEditing,
required Option<EditPannelContext> editContext}) = _$_EditPannelState;
@override
bool get isEditing => throw _privateConstructorUsedError;
@override
Option<EditPannelContext> get editContext =>
throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$EditPannelStateCopyWith<_EditPannelState> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -1,851 +0,0 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'home_bloc.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
/// @nodoc
class _$HomeEventTearOff {
const _$HomeEventTearOff();
_ShowLoading showLoading(bool isLoading) {
return _ShowLoading(
isLoading,
);
}
_ForceCollapse forceCollapse(bool forceCollapse) {
return _ForceCollapse(
forceCollapse,
);
}
_ShowEditPannel setEditPannel(EditPannelContext editContext) {
return _ShowEditPannel(
editContext,
);
}
_DismissEditPannel dismissEditPannel() {
return const _DismissEditPannel();
}
}
/// @nodoc
const $HomeEvent = _$HomeEventTearOff();
/// @nodoc
mixin _$HomeEvent {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(bool isLoading) showLoading,
required TResult Function(bool forceCollapse) forceCollapse,
required TResult Function(EditPannelContext editContext) setEditPannel,
required TResult Function() dismissEditPannel,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_ShowLoading value) showLoading,
required TResult Function(_ForceCollapse value) forceCollapse,
required TResult Function(_ShowEditPannel value) setEditPannel,
required TResult Function(_DismissEditPannel value) dismissEditPannel,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $HomeEventCopyWith<$Res> {
factory $HomeEventCopyWith(HomeEvent value, $Res Function(HomeEvent) then) =
_$HomeEventCopyWithImpl<$Res>;
}
/// @nodoc
class _$HomeEventCopyWithImpl<$Res> implements $HomeEventCopyWith<$Res> {
_$HomeEventCopyWithImpl(this._value, this._then);
final HomeEvent _value;
// ignore: unused_field
final $Res Function(HomeEvent) _then;
}
/// @nodoc
abstract class _$ShowLoadingCopyWith<$Res> {
factory _$ShowLoadingCopyWith(
_ShowLoading value, $Res Function(_ShowLoading) then) =
__$ShowLoadingCopyWithImpl<$Res>;
$Res call({bool isLoading});
}
/// @nodoc
class __$ShowLoadingCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res>
implements _$ShowLoadingCopyWith<$Res> {
__$ShowLoadingCopyWithImpl(
_ShowLoading _value, $Res Function(_ShowLoading) _then)
: super(_value, (v) => _then(v as _ShowLoading));
@override
_ShowLoading get _value => super._value as _ShowLoading;
@override
$Res call({
Object? isLoading = freezed,
}) {
return _then(_ShowLoading(
isLoading == freezed
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
class _$_ShowLoading implements _ShowLoading {
const _$_ShowLoading(this.isLoading);
@override
final bool isLoading;
@override
String toString() {
return 'HomeEvent.showLoading(isLoading: $isLoading)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _ShowLoading &&
(identical(other.isLoading, isLoading) ||
const DeepCollectionEquality()
.equals(other.isLoading, isLoading)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(isLoading);
@JsonKey(ignore: true)
@override
_$ShowLoadingCopyWith<_ShowLoading> get copyWith =>
__$ShowLoadingCopyWithImpl<_ShowLoading>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(bool isLoading) showLoading,
required TResult Function(bool forceCollapse) forceCollapse,
required TResult Function(EditPannelContext editContext) setEditPannel,
required TResult Function() dismissEditPannel,
}) {
return showLoading(isLoading);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
}) {
return showLoading?.call(isLoading);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
required TResult orElse(),
}) {
if (showLoading != null) {
return showLoading(isLoading);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_ShowLoading value) showLoading,
required TResult Function(_ForceCollapse value) forceCollapse,
required TResult Function(_ShowEditPannel value) setEditPannel,
required TResult Function(_DismissEditPannel value) dismissEditPannel,
}) {
return showLoading(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
}) {
return showLoading?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
required TResult orElse(),
}) {
if (showLoading != null) {
return showLoading(this);
}
return orElse();
}
}
abstract class _ShowLoading implements HomeEvent {
const factory _ShowLoading(bool isLoading) = _$_ShowLoading;
bool get isLoading => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
_$ShowLoadingCopyWith<_ShowLoading> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$ForceCollapseCopyWith<$Res> {
factory _$ForceCollapseCopyWith(
_ForceCollapse value, $Res Function(_ForceCollapse) then) =
__$ForceCollapseCopyWithImpl<$Res>;
$Res call({bool forceCollapse});
}
/// @nodoc
class __$ForceCollapseCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res>
implements _$ForceCollapseCopyWith<$Res> {
__$ForceCollapseCopyWithImpl(
_ForceCollapse _value, $Res Function(_ForceCollapse) _then)
: super(_value, (v) => _then(v as _ForceCollapse));
@override
_ForceCollapse get _value => super._value as _ForceCollapse;
@override
$Res call({
Object? forceCollapse = freezed,
}) {
return _then(_ForceCollapse(
forceCollapse == freezed
? _value.forceCollapse
: forceCollapse // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
class _$_ForceCollapse implements _ForceCollapse {
const _$_ForceCollapse(this.forceCollapse);
@override
final bool forceCollapse;
@override
String toString() {
return 'HomeEvent.forceCollapse(forceCollapse: $forceCollapse)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _ForceCollapse &&
(identical(other.forceCollapse, forceCollapse) ||
const DeepCollectionEquality()
.equals(other.forceCollapse, forceCollapse)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(forceCollapse);
@JsonKey(ignore: true)
@override
_$ForceCollapseCopyWith<_ForceCollapse> get copyWith =>
__$ForceCollapseCopyWithImpl<_ForceCollapse>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(bool isLoading) showLoading,
required TResult Function(bool forceCollapse) forceCollapse,
required TResult Function(EditPannelContext editContext) setEditPannel,
required TResult Function() dismissEditPannel,
}) {
return forceCollapse(this.forceCollapse);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
}) {
return forceCollapse?.call(this.forceCollapse);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
required TResult orElse(),
}) {
if (forceCollapse != null) {
return forceCollapse(this.forceCollapse);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_ShowLoading value) showLoading,
required TResult Function(_ForceCollapse value) forceCollapse,
required TResult Function(_ShowEditPannel value) setEditPannel,
required TResult Function(_DismissEditPannel value) dismissEditPannel,
}) {
return forceCollapse(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
}) {
return forceCollapse?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
required TResult orElse(),
}) {
if (forceCollapse != null) {
return forceCollapse(this);
}
return orElse();
}
}
abstract class _ForceCollapse implements HomeEvent {
const factory _ForceCollapse(bool forceCollapse) = _$_ForceCollapse;
bool get forceCollapse => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
_$ForceCollapseCopyWith<_ForceCollapse> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$ShowEditPannelCopyWith<$Res> {
factory _$ShowEditPannelCopyWith(
_ShowEditPannel value, $Res Function(_ShowEditPannel) then) =
__$ShowEditPannelCopyWithImpl<$Res>;
$Res call({EditPannelContext editContext});
}
/// @nodoc
class __$ShowEditPannelCopyWithImpl<$Res> extends _$HomeEventCopyWithImpl<$Res>
implements _$ShowEditPannelCopyWith<$Res> {
__$ShowEditPannelCopyWithImpl(
_ShowEditPannel _value, $Res Function(_ShowEditPannel) _then)
: super(_value, (v) => _then(v as _ShowEditPannel));
@override
_ShowEditPannel get _value => super._value as _ShowEditPannel;
@override
$Res call({
Object? editContext = freezed,
}) {
return _then(_ShowEditPannel(
editContext == freezed
? _value.editContext
: editContext // ignore: cast_nullable_to_non_nullable
as EditPannelContext,
));
}
}
/// @nodoc
class _$_ShowEditPannel implements _ShowEditPannel {
const _$_ShowEditPannel(this.editContext);
@override
final EditPannelContext editContext;
@override
String toString() {
return 'HomeEvent.setEditPannel(editContext: $editContext)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _ShowEditPannel &&
(identical(other.editContext, editContext) ||
const DeepCollectionEquality()
.equals(other.editContext, editContext)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(editContext);
@JsonKey(ignore: true)
@override
_$ShowEditPannelCopyWith<_ShowEditPannel> get copyWith =>
__$ShowEditPannelCopyWithImpl<_ShowEditPannel>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(bool isLoading) showLoading,
required TResult Function(bool forceCollapse) forceCollapse,
required TResult Function(EditPannelContext editContext) setEditPannel,
required TResult Function() dismissEditPannel,
}) {
return setEditPannel(editContext);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
}) {
return setEditPannel?.call(editContext);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
required TResult orElse(),
}) {
if (setEditPannel != null) {
return setEditPannel(editContext);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_ShowLoading value) showLoading,
required TResult Function(_ForceCollapse value) forceCollapse,
required TResult Function(_ShowEditPannel value) setEditPannel,
required TResult Function(_DismissEditPannel value) dismissEditPannel,
}) {
return setEditPannel(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
}) {
return setEditPannel?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
required TResult orElse(),
}) {
if (setEditPannel != null) {
return setEditPannel(this);
}
return orElse();
}
}
abstract class _ShowEditPannel implements HomeEvent {
const factory _ShowEditPannel(EditPannelContext editContext) =
_$_ShowEditPannel;
EditPannelContext get editContext => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
_$ShowEditPannelCopyWith<_ShowEditPannel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class _$DismissEditPannelCopyWith<$Res> {
factory _$DismissEditPannelCopyWith(
_DismissEditPannel value, $Res Function(_DismissEditPannel) then) =
__$DismissEditPannelCopyWithImpl<$Res>;
}
/// @nodoc
class __$DismissEditPannelCopyWithImpl<$Res>
extends _$HomeEventCopyWithImpl<$Res>
implements _$DismissEditPannelCopyWith<$Res> {
__$DismissEditPannelCopyWithImpl(
_DismissEditPannel _value, $Res Function(_DismissEditPannel) _then)
: super(_value, (v) => _then(v as _DismissEditPannel));
@override
_DismissEditPannel get _value => super._value as _DismissEditPannel;
}
/// @nodoc
class _$_DismissEditPannel implements _DismissEditPannel {
const _$_DismissEditPannel();
@override
String toString() {
return 'HomeEvent.dismissEditPannel()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is _DismissEditPannel);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function(bool isLoading) showLoading,
required TResult Function(bool forceCollapse) forceCollapse,
required TResult Function(EditPannelContext editContext) setEditPannel,
required TResult Function() dismissEditPannel,
}) {
return dismissEditPannel();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
}) {
return dismissEditPannel?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function(bool isLoading)? showLoading,
TResult Function(bool forceCollapse)? forceCollapse,
TResult Function(EditPannelContext editContext)? setEditPannel,
TResult Function()? dismissEditPannel,
required TResult orElse(),
}) {
if (dismissEditPannel != null) {
return dismissEditPannel();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_ShowLoading value) showLoading,
required TResult Function(_ForceCollapse value) forceCollapse,
required TResult Function(_ShowEditPannel value) setEditPannel,
required TResult Function(_DismissEditPannel value) dismissEditPannel,
}) {
return dismissEditPannel(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
}) {
return dismissEditPannel?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_ShowLoading value)? showLoading,
TResult Function(_ForceCollapse value)? forceCollapse,
TResult Function(_ShowEditPannel value)? setEditPannel,
TResult Function(_DismissEditPannel value)? dismissEditPannel,
required TResult orElse(),
}) {
if (dismissEditPannel != null) {
return dismissEditPannel(this);
}
return orElse();
}
}
abstract class _DismissEditPannel implements HomeEvent {
const factory _DismissEditPannel() = _$_DismissEditPannel;
}
/// @nodoc
class _$HomeStateTearOff {
const _$HomeStateTearOff();
_HomeState call(
{required bool isLoading,
required bool forceCollapse,
required Option<EditPannelContext> editContext}) {
return _HomeState(
isLoading: isLoading,
forceCollapse: forceCollapse,
editContext: editContext,
);
}
}
/// @nodoc
const $HomeState = _$HomeStateTearOff();
/// @nodoc
mixin _$HomeState {
bool get isLoading => throw _privateConstructorUsedError;
bool get forceCollapse => throw _privateConstructorUsedError;
Option<EditPannelContext> get editContext =>
throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$HomeStateCopyWith<HomeState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $HomeStateCopyWith<$Res> {
factory $HomeStateCopyWith(HomeState value, $Res Function(HomeState) then) =
_$HomeStateCopyWithImpl<$Res>;
$Res call(
{bool isLoading,
bool forceCollapse,
Option<EditPannelContext> editContext});
}
/// @nodoc
class _$HomeStateCopyWithImpl<$Res> implements $HomeStateCopyWith<$Res> {
_$HomeStateCopyWithImpl(this._value, this._then);
final HomeState _value;
// ignore: unused_field
final $Res Function(HomeState) _then;
@override
$Res call({
Object? isLoading = freezed,
Object? forceCollapse = freezed,
Object? editContext = freezed,
}) {
return _then(_value.copyWith(
isLoading: isLoading == freezed
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
forceCollapse: forceCollapse == freezed
? _value.forceCollapse
: forceCollapse // ignore: cast_nullable_to_non_nullable
as bool,
editContext: editContext == freezed
? _value.editContext
: editContext // ignore: cast_nullable_to_non_nullable
as Option<EditPannelContext>,
));
}
}
/// @nodoc
abstract class _$HomeStateCopyWith<$Res> implements $HomeStateCopyWith<$Res> {
factory _$HomeStateCopyWith(
_HomeState value, $Res Function(_HomeState) then) =
__$HomeStateCopyWithImpl<$Res>;
@override
$Res call(
{bool isLoading,
bool forceCollapse,
Option<EditPannelContext> editContext});
}
/// @nodoc
class __$HomeStateCopyWithImpl<$Res> extends _$HomeStateCopyWithImpl<$Res>
implements _$HomeStateCopyWith<$Res> {
__$HomeStateCopyWithImpl(_HomeState _value, $Res Function(_HomeState) _then)
: super(_value, (v) => _then(v as _HomeState));
@override
_HomeState get _value => super._value as _HomeState;
@override
$Res call({
Object? isLoading = freezed,
Object? forceCollapse = freezed,
Object? editContext = freezed,
}) {
return _then(_HomeState(
isLoading: isLoading == freezed
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
forceCollapse: forceCollapse == freezed
? _value.forceCollapse
: forceCollapse // ignore: cast_nullable_to_non_nullable
as bool,
editContext: editContext == freezed
? _value.editContext
: editContext // ignore: cast_nullable_to_non_nullable
as Option<EditPannelContext>,
));
}
}
/// @nodoc
class _$_HomeState implements _HomeState {
const _$_HomeState(
{required this.isLoading,
required this.forceCollapse,
required this.editContext});
@override
final bool isLoading;
@override
final bool forceCollapse;
@override
final Option<EditPannelContext> editContext;
@override
String toString() {
return 'HomeState(isLoading: $isLoading, forceCollapse: $forceCollapse, editContext: $editContext)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _HomeState &&
(identical(other.isLoading, isLoading) ||
const DeepCollectionEquality()
.equals(other.isLoading, isLoading)) &&
(identical(other.forceCollapse, forceCollapse) ||
const DeepCollectionEquality()
.equals(other.forceCollapse, forceCollapse)) &&
(identical(other.editContext, editContext) ||
const DeepCollectionEquality()
.equals(other.editContext, editContext)));
}
@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(isLoading) ^
const DeepCollectionEquality().hash(forceCollapse) ^
const DeepCollectionEquality().hash(editContext);
@JsonKey(ignore: true)
@override
_$HomeStateCopyWith<_HomeState> get copyWith =>
__$HomeStateCopyWithImpl<_HomeState>(this, _$identity);
}
abstract class _HomeState implements HomeState {
const factory _HomeState(
{required bool isLoading,
required bool forceCollapse,
required Option<EditPannelContext> editContext}) = _$_HomeState;
@override
bool get isLoading => throw _privateConstructorUsedError;
@override
bool get forceCollapse => throw _privateConstructorUsedError;
@override
Option<EditPannelContext> get editContext =>
throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$HomeStateCopyWith<_HomeState> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -1,767 +0,0 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'home_listen_bloc.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
/// @nodoc
class _$HomeListenEventTearOff {
const _$HomeListenEventTearOff();
_Started started() {
return const _Started();
}
_Stop stop() {
return const _Stop();
}
_Unauthorized unauthorized(String msg) {
return _Unauthorized(
msg,
);
}
}
/// @nodoc
const $HomeListenEvent = _$HomeListenEventTearOff();
/// @nodoc
mixin _$HomeListenEvent {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() started,
required TResult Function() stop,
required TResult Function(String msg) unauthorized,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? started,
TResult Function()? stop,
TResult Function(String msg)? unauthorized,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? started,
TResult Function()? stop,
TResult Function(String msg)? unauthorized,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Started value) started,
required TResult Function(_Stop value) stop,
required TResult Function(_Unauthorized value) unauthorized,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Started value)? started,
TResult Function(_Stop value)? stop,
TResult Function(_Unauthorized value)? unauthorized,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Started value)? started,
TResult Function(_Stop value)? stop,
TResult Function(_Unauthorized value)? unauthorized,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $HomeListenEventCopyWith<$Res> {
factory $HomeListenEventCopyWith(
HomeListenEvent value, $Res Function(HomeListenEvent) then) =
_$HomeListenEventCopyWithImpl<$Res>;
}
/// @nodoc
class _$HomeListenEventCopyWithImpl<$Res>
implements $HomeListenEventCopyWith<$Res> {
_$HomeListenEventCopyWithImpl(this._value, this._then);
final HomeListenEvent _value;
// ignore: unused_field
final $Res Function(HomeListenEvent) _then;
}
/// @nodoc
abstract class _$StartedCopyWith<$Res> {
factory _$StartedCopyWith(_Started value, $Res Function(_Started) then) =
__$StartedCopyWithImpl<$Res>;
}
/// @nodoc
class __$StartedCopyWithImpl<$Res> extends _$HomeListenEventCopyWithImpl<$Res>
implements _$StartedCopyWith<$Res> {
__$StartedCopyWithImpl(_Started _value, $Res Function(_Started) _then)
: super(_value, (v) => _then(v as _Started));
@override
_Started get _value => super._value as _Started;
}
/// @nodoc
class _$_Started implements _Started {
const _$_Started();
@override
String toString() {
return 'HomeListenEvent.started()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is _Started);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() started,
required TResult Function() stop,
required TResult Function(String msg) unauthorized,
}) {
return started();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? started,
TResult Function()? stop,
TResult Function(String msg)? unauthorized,
}) {
return started?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? started,
TResult Function()? stop,
TResult Function(String msg)? unauthorized,
required TResult orElse(),
}) {
if (started != null) {
return started();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Started value) started,
required TResult Function(_Stop value) stop,
required TResult Function(_Unauthorized value) unauthorized,
}) {
return started(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Started value)? started,
TResult Function(_Stop value)? stop,
TResult Function(_Unauthorized value)? unauthorized,
}) {
return started?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Started value)? started,
TResult Function(_Stop value)? stop,
TResult Function(_Unauthorized value)? unauthorized,
required TResult orElse(),
}) {
if (started != null) {
return started(this);
}
return orElse();
}
}
abstract class _Started implements HomeListenEvent {
const factory _Started() = _$_Started;
}
/// @nodoc
abstract class _$StopCopyWith<$Res> {
factory _$StopCopyWith(_Stop value, $Res Function(_Stop) then) =
__$StopCopyWithImpl<$Res>;
}
/// @nodoc
class __$StopCopyWithImpl<$Res> extends _$HomeListenEventCopyWithImpl<$Res>
implements _$StopCopyWith<$Res> {
__$StopCopyWithImpl(_Stop _value, $Res Function(_Stop) _then)
: super(_value, (v) => _then(v as _Stop));
@override
_Stop get _value => super._value as _Stop;
}
/// @nodoc
class _$_Stop implements _Stop {
const _$_Stop();
@override
String toString() {
return 'HomeListenEvent.stop()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is _Stop);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() started,
required TResult Function() stop,
required TResult Function(String msg) unauthorized,
}) {
return stop();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? started,
TResult Function()? stop,
TResult Function(String msg)? unauthorized,
}) {
return stop?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? started,
TResult Function()? stop,
TResult Function(String msg)? unauthorized,
required TResult orElse(),
}) {
if (stop != null) {
return stop();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Started value) started,
required TResult Function(_Stop value) stop,
required TResult Function(_Unauthorized value) unauthorized,
}) {
return stop(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Started value)? started,
TResult Function(_Stop value)? stop,
TResult Function(_Unauthorized value)? unauthorized,
}) {
return stop?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Started value)? started,
TResult Function(_Stop value)? stop,
TResult Function(_Unauthorized value)? unauthorized,
required TResult orElse(),
}) {
if (stop != null) {
return stop(this);
}
return orElse();
}
}
abstract class _Stop implements HomeListenEvent {
const factory _Stop() = _$_Stop;
}
/// @nodoc
abstract class _$UnauthorizedCopyWith<$Res> {
factory _$UnauthorizedCopyWith(
_Unauthorized value, $Res Function(_Unauthorized) then) =
__$UnauthorizedCopyWithImpl<$Res>;
$Res call({String msg});
}
/// @nodoc
class __$UnauthorizedCopyWithImpl<$Res>
extends _$HomeListenEventCopyWithImpl<$Res>
implements _$UnauthorizedCopyWith<$Res> {
__$UnauthorizedCopyWithImpl(
_Unauthorized _value, $Res Function(_Unauthorized) _then)
: super(_value, (v) => _then(v as _Unauthorized));
@override
_Unauthorized get _value => super._value as _Unauthorized;
@override
$Res call({
Object? msg = freezed,
}) {
return _then(_Unauthorized(
msg == freezed
? _value.msg
: msg // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
class _$_Unauthorized implements _Unauthorized {
const _$_Unauthorized(this.msg);
@override
final String msg;
@override
String toString() {
return 'HomeListenEvent.unauthorized(msg: $msg)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _Unauthorized &&
(identical(other.msg, msg) ||
const DeepCollectionEquality().equals(other.msg, msg)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(msg);
@JsonKey(ignore: true)
@override
_$UnauthorizedCopyWith<_Unauthorized> get copyWith =>
__$UnauthorizedCopyWithImpl<_Unauthorized>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() started,
required TResult Function() stop,
required TResult Function(String msg) unauthorized,
}) {
return unauthorized(msg);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? started,
TResult Function()? stop,
TResult Function(String msg)? unauthorized,
}) {
return unauthorized?.call(msg);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? started,
TResult Function()? stop,
TResult Function(String msg)? unauthorized,
required TResult orElse(),
}) {
if (unauthorized != null) {
return unauthorized(msg);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Started value) started,
required TResult Function(_Stop value) stop,
required TResult Function(_Unauthorized value) unauthorized,
}) {
return unauthorized(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Started value)? started,
TResult Function(_Stop value)? stop,
TResult Function(_Unauthorized value)? unauthorized,
}) {
return unauthorized?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Started value)? started,
TResult Function(_Stop value)? stop,
TResult Function(_Unauthorized value)? unauthorized,
required TResult orElse(),
}) {
if (unauthorized != null) {
return unauthorized(this);
}
return orElse();
}
}
abstract class _Unauthorized implements HomeListenEvent {
const factory _Unauthorized(String msg) = _$_Unauthorized;
String get msg => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
_$UnauthorizedCopyWith<_Unauthorized> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
class _$HomeListenStateTearOff {
const _$HomeListenStateTearOff();
Loading loading() {
return const Loading();
}
Unauthorized unauthorized(String msg) {
return Unauthorized(
msg,
);
}
}
/// @nodoc
const $HomeListenState = _$HomeListenStateTearOff();
/// @nodoc
mixin _$HomeListenState {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() loading,
required TResult Function(String msg) unauthorized,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? loading,
TResult Function(String msg)? unauthorized,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? loading,
TResult Function(String msg)? unauthorized,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Loading value) loading,
required TResult Function(Unauthorized value) unauthorized,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Loading value)? loading,
TResult Function(Unauthorized value)? unauthorized,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Loading value)? loading,
TResult Function(Unauthorized value)? unauthorized,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $HomeListenStateCopyWith<$Res> {
factory $HomeListenStateCopyWith(
HomeListenState value, $Res Function(HomeListenState) then) =
_$HomeListenStateCopyWithImpl<$Res>;
}
/// @nodoc
class _$HomeListenStateCopyWithImpl<$Res>
implements $HomeListenStateCopyWith<$Res> {
_$HomeListenStateCopyWithImpl(this._value, this._then);
final HomeListenState _value;
// ignore: unused_field
final $Res Function(HomeListenState) _then;
}
/// @nodoc
abstract class $LoadingCopyWith<$Res> {
factory $LoadingCopyWith(Loading value, $Res Function(Loading) then) =
_$LoadingCopyWithImpl<$Res>;
}
/// @nodoc
class _$LoadingCopyWithImpl<$Res> extends _$HomeListenStateCopyWithImpl<$Res>
implements $LoadingCopyWith<$Res> {
_$LoadingCopyWithImpl(Loading _value, $Res Function(Loading) _then)
: super(_value, (v) => _then(v as Loading));
@override
Loading get _value => super._value as Loading;
}
/// @nodoc
class _$Loading implements Loading {
const _$Loading();
@override
String toString() {
return 'HomeListenState.loading()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is Loading);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() loading,
required TResult Function(String msg) unauthorized,
}) {
return loading();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? loading,
TResult Function(String msg)? unauthorized,
}) {
return loading?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? loading,
TResult Function(String msg)? unauthorized,
required TResult orElse(),
}) {
if (loading != null) {
return loading();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Loading value) loading,
required TResult Function(Unauthorized value) unauthorized,
}) {
return loading(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Loading value)? loading,
TResult Function(Unauthorized value)? unauthorized,
}) {
return loading?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Loading value)? loading,
TResult Function(Unauthorized value)? unauthorized,
required TResult orElse(),
}) {
if (loading != null) {
return loading(this);
}
return orElse();
}
}
abstract class Loading implements HomeListenState {
const factory Loading() = _$Loading;
}
/// @nodoc
abstract class $UnauthorizedCopyWith<$Res> {
factory $UnauthorizedCopyWith(
Unauthorized value, $Res Function(Unauthorized) then) =
_$UnauthorizedCopyWithImpl<$Res>;
$Res call({String msg});
}
/// @nodoc
class _$UnauthorizedCopyWithImpl<$Res>
extends _$HomeListenStateCopyWithImpl<$Res>
implements $UnauthorizedCopyWith<$Res> {
_$UnauthorizedCopyWithImpl(
Unauthorized _value, $Res Function(Unauthorized) _then)
: super(_value, (v) => _then(v as Unauthorized));
@override
Unauthorized get _value => super._value as Unauthorized;
@override
$Res call({
Object? msg = freezed,
}) {
return _then(Unauthorized(
msg == freezed
? _value.msg
: msg // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
class _$Unauthorized implements Unauthorized {
const _$Unauthorized(this.msg);
@override
final String msg;
@override
String toString() {
return 'HomeListenState.unauthorized(msg: $msg)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is Unauthorized &&
(identical(other.msg, msg) ||
const DeepCollectionEquality().equals(other.msg, msg)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(msg);
@JsonKey(ignore: true)
@override
$UnauthorizedCopyWith<Unauthorized> get copyWith =>
_$UnauthorizedCopyWithImpl<Unauthorized>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() loading,
required TResult Function(String msg) unauthorized,
}) {
return unauthorized(msg);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? loading,
TResult Function(String msg)? unauthorized,
}) {
return unauthorized?.call(msg);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? loading,
TResult Function(String msg)? unauthorized,
required TResult orElse(),
}) {
if (unauthorized != null) {
return unauthorized(msg);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Loading value) loading,
required TResult Function(Unauthorized value) unauthorized,
}) {
return unauthorized(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Loading value)? loading,
TResult Function(Unauthorized value)? unauthorized,
}) {
return unauthorized?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Loading value)? loading,
TResult Function(Unauthorized value)? unauthorized,
required TResult orElse(),
}) {
if (unauthorized != null) {
return unauthorized(this);
}
return orElse();
}
}
abstract class Unauthorized implements HomeListenState {
const factory Unauthorized(String msg) = _$Unauthorized;
String get msg => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$UnauthorizedCopyWith<Unauthorized> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -1,113 +0,0 @@
import 'dart:async';
import 'package:app_flowy/workspace/domain/i_workspace.dart';
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
import 'package:app_flowy/workspace/presentation/stack_page/blank/blank_page.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_log/flowy_log.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/app_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
part 'menu_bloc.freezed.dart';
class MenuBloc extends Bloc<MenuEvent, MenuState> {
final IWorkspace workspaceManager;
final IWorkspaceListener listener;
MenuBloc({required this.workspaceManager, required this.listener}) : super(MenuState.initial());
@override
Stream<MenuState> mapEventToState(
MenuEvent event,
) async* {
yield* event.map(
initial: (e) async* {
listener.start(addAppCallback: _handleAppsOrFail);
yield* _fetchApps();
},
collapse: (e) async* {
final isCollapse = state.isCollapse;
yield state.copyWith(isCollapse: !isCollapse);
},
openPage: (e) async* {
yield* _performActionOnOpenPage(e);
},
createApp: (CreateApp event) async* {
yield* _performActionOnCreateApp(event);
},
didReceiveApps: (e) async* {
yield e.appsOrFail.fold(
(apps) => state.copyWith(apps: some(apps), successOrFailure: left(unit)),
(err) => state.copyWith(successOrFailure: right(err)),
);
},
);
}
@override
Future<void> close() async {
await listener.stop();
return super.close();
}
Stream<MenuState> _performActionOnOpenPage(OpenPage e) async* {
yield state.copyWith(stackContext: e.context);
}
Stream<MenuState> _performActionOnCreateApp(CreateApp event) async* {
final result = await workspaceManager.createApp(name: event.name, desc: event.desc);
yield result.fold(
(app) => state.copyWith(apps: some([app])),
(error) {
Log.error(error);
return state.copyWith(successOrFailure: right(error));
},
);
}
// ignore: unused_element
Stream<MenuState> _fetchApps() async* {
final appsOrFail = await workspaceManager.getApps();
yield appsOrFail.fold(
(apps) => state.copyWith(apps: some(apps)),
(error) {
Log.error(error);
return state.copyWith(successOrFailure: right(error));
},
);
}
void _handleAppsOrFail(Either<List<App>, WorkspaceError> appsOrFail) {
appsOrFail.fold(
(apps) => add(MenuEvent.didReceiveApps(left(apps))),
(error) => add(MenuEvent.didReceiveApps(right(error))),
);
}
}
@freezed
class MenuEvent with _$MenuEvent {
const factory MenuEvent.initial() = _Initial;
const factory MenuEvent.collapse() = Collapse;
const factory MenuEvent.openPage(HomeStackContext context) = OpenPage;
const factory MenuEvent.createApp(String name, {String? desc}) = CreateApp;
const factory MenuEvent.didReceiveApps(Either<List<App>, WorkspaceError> appsOrFail) = ReceiveApps;
}
@freezed
class MenuState with _$MenuState {
const factory MenuState({
required bool isCollapse,
required Option<List<App>> apps,
required Either<Unit, WorkspaceError> successOrFailure,
required HomeStackContext stackContext,
}) = _MenuState;
factory MenuState.initial() => MenuState(
isCollapse: false,
apps: none(),
successOrFailure: left(unit),
stackContext: BlankStackContext(),
);
}
@@ -1,481 +0,0 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'menu_user_bloc.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
/// @nodoc
class _$MenuUserEventTearOff {
const _$MenuUserEventTearOff();
_Initial initial() {
return const _Initial();
}
_FetchWorkspaces fetchWorkspaces() {
return const _FetchWorkspaces();
}
}
/// @nodoc
const $MenuUserEvent = _$MenuUserEventTearOff();
/// @nodoc
mixin _$MenuUserEvent {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function() fetchWorkspaces,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? fetchWorkspaces,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? fetchWorkspaces,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Initial value) initial,
required TResult Function(_FetchWorkspaces value) fetchWorkspaces,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_FetchWorkspaces value)? fetchWorkspaces,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_FetchWorkspaces value)? fetchWorkspaces,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $MenuUserEventCopyWith<$Res> {
factory $MenuUserEventCopyWith(
MenuUserEvent value, $Res Function(MenuUserEvent) then) =
_$MenuUserEventCopyWithImpl<$Res>;
}
/// @nodoc
class _$MenuUserEventCopyWithImpl<$Res>
implements $MenuUserEventCopyWith<$Res> {
_$MenuUserEventCopyWithImpl(this._value, this._then);
final MenuUserEvent _value;
// ignore: unused_field
final $Res Function(MenuUserEvent) _then;
}
/// @nodoc
abstract class _$InitialCopyWith<$Res> {
factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) =
__$InitialCopyWithImpl<$Res>;
}
/// @nodoc
class __$InitialCopyWithImpl<$Res> extends _$MenuUserEventCopyWithImpl<$Res>
implements _$InitialCopyWith<$Res> {
__$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then)
: super(_value, (v) => _then(v as _Initial));
@override
_Initial get _value => super._value as _Initial;
}
/// @nodoc
class _$_Initial implements _Initial {
const _$_Initial();
@override
String toString() {
return 'MenuUserEvent.initial()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is _Initial);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function() fetchWorkspaces,
}) {
return initial();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? fetchWorkspaces,
}) {
return initial?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? fetchWorkspaces,
required TResult orElse(),
}) {
if (initial != null) {
return initial();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Initial value) initial,
required TResult Function(_FetchWorkspaces value) fetchWorkspaces,
}) {
return initial(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_FetchWorkspaces value)? fetchWorkspaces,
}) {
return initial?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_FetchWorkspaces value)? fetchWorkspaces,
required TResult orElse(),
}) {
if (initial != null) {
return initial(this);
}
return orElse();
}
}
abstract class _Initial implements MenuUserEvent {
const factory _Initial() = _$_Initial;
}
/// @nodoc
abstract class _$FetchWorkspacesCopyWith<$Res> {
factory _$FetchWorkspacesCopyWith(
_FetchWorkspaces value, $Res Function(_FetchWorkspaces) then) =
__$FetchWorkspacesCopyWithImpl<$Res>;
}
/// @nodoc
class __$FetchWorkspacesCopyWithImpl<$Res>
extends _$MenuUserEventCopyWithImpl<$Res>
implements _$FetchWorkspacesCopyWith<$Res> {
__$FetchWorkspacesCopyWithImpl(
_FetchWorkspaces _value, $Res Function(_FetchWorkspaces) _then)
: super(_value, (v) => _then(v as _FetchWorkspaces));
@override
_FetchWorkspaces get _value => super._value as _FetchWorkspaces;
}
/// @nodoc
class _$_FetchWorkspaces implements _FetchWorkspaces {
const _$_FetchWorkspaces();
@override
String toString() {
return 'MenuUserEvent.fetchWorkspaces()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is _FetchWorkspaces);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function() fetchWorkspaces,
}) {
return fetchWorkspaces();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? fetchWorkspaces,
}) {
return fetchWorkspaces?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function()? fetchWorkspaces,
required TResult orElse(),
}) {
if (fetchWorkspaces != null) {
return fetchWorkspaces();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(_Initial value) initial,
required TResult Function(_FetchWorkspaces value) fetchWorkspaces,
}) {
return fetchWorkspaces(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_FetchWorkspaces value)? fetchWorkspaces,
}) {
return fetchWorkspaces?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(_Initial value)? initial,
TResult Function(_FetchWorkspaces value)? fetchWorkspaces,
required TResult orElse(),
}) {
if (fetchWorkspaces != null) {
return fetchWorkspaces(this);
}
return orElse();
}
}
abstract class _FetchWorkspaces implements MenuUserEvent {
const factory _FetchWorkspaces() = _$_FetchWorkspaces;
}
/// @nodoc
class _$MenuUserStateTearOff {
const _$MenuUserStateTearOff();
_MenuUserState call(
{required UserProfile user,
required Option<List<Workspace>> workspaces,
required Either<Unit, String> successOrFailure}) {
return _MenuUserState(
user: user,
workspaces: workspaces,
successOrFailure: successOrFailure,
);
}
}
/// @nodoc
const $MenuUserState = _$MenuUserStateTearOff();
/// @nodoc
mixin _$MenuUserState {
UserProfile get user => throw _privateConstructorUsedError;
Option<List<Workspace>> get workspaces => throw _privateConstructorUsedError;
Either<Unit, String> get successOrFailure =>
throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$MenuUserStateCopyWith<MenuUserState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $MenuUserStateCopyWith<$Res> {
factory $MenuUserStateCopyWith(
MenuUserState value, $Res Function(MenuUserState) then) =
_$MenuUserStateCopyWithImpl<$Res>;
$Res call(
{UserProfile user,
Option<List<Workspace>> workspaces,
Either<Unit, String> successOrFailure});
}
/// @nodoc
class _$MenuUserStateCopyWithImpl<$Res>
implements $MenuUserStateCopyWith<$Res> {
_$MenuUserStateCopyWithImpl(this._value, this._then);
final MenuUserState _value;
// ignore: unused_field
final $Res Function(MenuUserState) _then;
@override
$Res call({
Object? user = freezed,
Object? workspaces = freezed,
Object? successOrFailure = freezed,
}) {
return _then(_value.copyWith(
user: user == freezed
? _value.user
: user // ignore: cast_nullable_to_non_nullable
as UserProfile,
workspaces: workspaces == freezed
? _value.workspaces
: workspaces // ignore: cast_nullable_to_non_nullable
as Option<List<Workspace>>,
successOrFailure: successOrFailure == freezed
? _value.successOrFailure
: successOrFailure // ignore: cast_nullable_to_non_nullable
as Either<Unit, String>,
));
}
}
/// @nodoc
abstract class _$MenuUserStateCopyWith<$Res>
implements $MenuUserStateCopyWith<$Res> {
factory _$MenuUserStateCopyWith(
_MenuUserState value, $Res Function(_MenuUserState) then) =
__$MenuUserStateCopyWithImpl<$Res>;
@override
$Res call(
{UserProfile user,
Option<List<Workspace>> workspaces,
Either<Unit, String> successOrFailure});
}
/// @nodoc
class __$MenuUserStateCopyWithImpl<$Res>
extends _$MenuUserStateCopyWithImpl<$Res>
implements _$MenuUserStateCopyWith<$Res> {
__$MenuUserStateCopyWithImpl(
_MenuUserState _value, $Res Function(_MenuUserState) _then)
: super(_value, (v) => _then(v as _MenuUserState));
@override
_MenuUserState get _value => super._value as _MenuUserState;
@override
$Res call({
Object? user = freezed,
Object? workspaces = freezed,
Object? successOrFailure = freezed,
}) {
return _then(_MenuUserState(
user: user == freezed
? _value.user
: user // ignore: cast_nullable_to_non_nullable
as UserProfile,
workspaces: workspaces == freezed
? _value.workspaces
: workspaces // ignore: cast_nullable_to_non_nullable
as Option<List<Workspace>>,
successOrFailure: successOrFailure == freezed
? _value.successOrFailure
: successOrFailure // ignore: cast_nullable_to_non_nullable
as Either<Unit, String>,
));
}
}
/// @nodoc
class _$_MenuUserState implements _MenuUserState {
const _$_MenuUserState(
{required this.user,
required this.workspaces,
required this.successOrFailure});
@override
final UserProfile user;
@override
final Option<List<Workspace>> workspaces;
@override
final Either<Unit, String> successOrFailure;
@override
String toString() {
return 'MenuUserState(user: $user, workspaces: $workspaces, successOrFailure: $successOrFailure)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _MenuUserState &&
(identical(other.user, user) ||
const DeepCollectionEquality().equals(other.user, user)) &&
(identical(other.workspaces, workspaces) ||
const DeepCollectionEquality()
.equals(other.workspaces, workspaces)) &&
(identical(other.successOrFailure, successOrFailure) ||
const DeepCollectionEquality()
.equals(other.successOrFailure, successOrFailure)));
}
@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(user) ^
const DeepCollectionEquality().hash(workspaces) ^
const DeepCollectionEquality().hash(successOrFailure);
@JsonKey(ignore: true)
@override
_$MenuUserStateCopyWith<_MenuUserState> get copyWith =>
__$MenuUserStateCopyWithImpl<_MenuUserState>(this, _$identity);
}
abstract class _MenuUserState implements MenuUserState {
const factory _MenuUserState(
{required UserProfile user,
required Option<List<Workspace>> workspaces,
required Either<Unit, String> successOrFailure}) = _$_MenuUserState;
@override
UserProfile get user => throw _privateConstructorUsedError;
@override
Option<List<Workspace>> get workspaces => throw _privateConstructorUsedError;
@override
Either<Unit, String> get successOrFailure =>
throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$MenuUserStateCopyWith<_MenuUserState> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -1,94 +0,0 @@
import 'package:app_flowy/workspace/domain/i_trash.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_log/flowy_log.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/trash_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'trash_bloc.freezed.dart';
class TrashBloc extends Bloc<TrashEvent, TrashState> {
final ITrash trasnManager;
final ITrashListener listener;
TrashBloc({required this.trasnManager, required this.listener}) : super(TrashState.init());
@override
Stream<TrashState> mapEventToState(TrashEvent event) async* {
yield* event.map(
initial: (e) async* {
listener.start(_listenTrashUpdated);
final result = await trasnManager.readTrash();
yield result.fold(
(objects) => state.copyWith(objects: objects, successOrFailure: left(unit)),
(error) => state.copyWith(successOrFailure: right(error)),
);
},
didReceiveTrash: (e) async* {
yield state.copyWith(objects: e.trash);
},
putback: (e) async* {
final result = await trasnManager.putback(e.trashId);
yield* _handleResult(result);
},
delete: (e) async* {
final result = await trasnManager.deleteViews([Tuple2(e.trash.id, e.trash.ty)]);
yield* _handleResult(result);
},
deleteAll: (e) async* {
final result = await trasnManager.deleteAll();
yield* _handleResult(result);
},
restoreAll: (e) async* {
final result = await trasnManager.restoreAll();
yield* _handleResult(result);
},
);
}
Stream<TrashState> _handleResult(Either<dynamic, WorkspaceError> result) async* {
yield result.fold(
(l) => state.copyWith(successOrFailure: left(unit)),
(error) => state.copyWith(successOrFailure: right(error)),
);
}
void _listenTrashUpdated(Either<List<Trash>, WorkspaceError> trashOrFailed) {
trashOrFailed.fold(
(trash) {
add(TrashEvent.didReceiveTrash(trash));
},
(error) {
Log.error(error);
},
);
}
@override
Future<void> close() async {
await listener.stop();
return super.close();
}
}
@freezed
class TrashEvent with _$TrashEvent {
const factory TrashEvent.initial() = Initial;
const factory TrashEvent.didReceiveTrash(List<Trash> trash) = ReceiveTrash;
const factory TrashEvent.putback(String trashId) = Putback;
const factory TrashEvent.delete(Trash trash) = Delete;
const factory TrashEvent.restoreAll() = RestoreAll;
const factory TrashEvent.deleteAll() = DeleteAll;
}
@freezed
class TrashState with _$TrashState {
const factory TrashState({
required List<Trash> objects,
required Either<Unit, WorkspaceError> successOrFailure,
}) = _TrashState;
factory TrashState.init() => TrashState(
objects: [],
successOrFailure: left(unit),
);
}
File diff suppressed because it is too large. Load diff
@@ -1,96 +0,0 @@
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:app_flowy/workspace/domain/i_view.dart';
part 'view_bloc.freezed.dart';
class ViewBloc extends Bloc<ViewEvent, ViewState> {
final IView viewManager;
final IViewListener listener;
ViewBloc({
required this.viewManager,
required this.listener,
}) : super(ViewState.init(viewManager.view));
@override
Stream<ViewState> mapEventToState(ViewEvent event) async* {
yield* event.map(
initial: (e) async* {
listener.updatedNotifier.addPublishListener((result) {
add(ViewEvent.viewDidUpdate(result));
});
listener.start();
yield state;
},
setIsEditing: (e) async* {
yield state.copyWith(isEditing: e.isEditing);
},
viewDidUpdate: (e) async* {
yield* _handleViewDidUpdate(e.result);
},
rename: (e) async* {
final result = await viewManager.rename(e.newName);
yield result.fold(
(l) => state.copyWith(successOrFailure: left(unit)),
(error) => state.copyWith(successOrFailure: right(error)),
);
},
delete: (e) async* {
final result = await viewManager.delete();
yield result.fold(
(l) => state.copyWith(successOrFailure: left(unit)),
(error) => state.copyWith(successOrFailure: right(error)),
);
},
duplicate: (e) async* {
final result = await viewManager.duplicate();
yield result.fold(
(l) => state.copyWith(successOrFailure: left(unit)),
(error) => state.copyWith(successOrFailure: right(error)),
);
},
);
}
Stream<ViewState> _handleViewDidUpdate(Either<View, WorkspaceError> result) async* {
yield result.fold(
(view) => state.copyWith(view: view, successOrFailure: left(unit)),
(error) => state.copyWith(successOrFailure: right(error)),
);
}
@override
Future<void> close() async {
await listener.stop();
return super.close();
}
}
@freezed
class ViewEvent with _$ViewEvent {
const factory ViewEvent.initial() = Initial;
const factory ViewEvent.setIsEditing(bool isEditing) = SetEditing;
const factory ViewEvent.rename(String newName) = Rename;
const factory ViewEvent.delete() = Delete;
const factory ViewEvent.duplicate() = Duplicate;
const factory ViewEvent.viewDidUpdate(Either<View, WorkspaceError> result) = ViewDidUpdate;
}
@freezed
class ViewState with _$ViewState {
const factory ViewState({
required View view,
required bool isEditing,
required Either<Unit, WorkspaceError> successOrFailure,
}) = _ViewState;
factory ViewState.init(View view) => ViewState(
view: view,
isEditing: false,
successOrFailure: left(unit),
);
}
File diff suppressed because it is too large. Load diff
@@ -1,107 +0,0 @@
import 'package:app_flowy/workspace/domain/i_user.dart';
import 'package:app_flowy/workspace/infrastructure/repos/user_repo.dart';
import 'package:flowy_log/flowy_log.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/workspace_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:dartz/dartz.dart';
part 'welcome_bloc.freezed.dart';
class WelcomeBloc extends Bloc<WelcomeEvent, WelcomeState> {
final UserRepo repo;
final IUserListener listener;
WelcomeBloc({required this.repo, required this.listener}) : super(WelcomeState.initial());
@override
Stream<WelcomeState> mapEventToState(
WelcomeEvent event,
) async* {
yield* event.map(initial: (e) async* {
listener.workspaceUpdatedNotifier.addPublishListener(_workspacesUpdated);
listener.start();
//
yield* _fetchWorkspaces();
}, openWorkspace: (e) async* {
yield* _openWorkspace(e.workspace);
}, createWorkspace: (e) async* {
yield* _createWorkspace(e.name, e.desc);
}, workspacesReveived: (e) async* {
yield e.workspacesOrFail.fold(
(workspaces) => state.copyWith(workspaces: workspaces, successOrFailure: left(unit)),
(error) => state.copyWith(successOrFailure: right(error)),
);
});
}
@override
Future<void> close() async {
await listener.stop();
super.close();
}
Stream<WelcomeState> _fetchWorkspaces() async* {
final workspacesOrFailed = await repo.getWorkspaces();
yield workspacesOrFailed.fold(
(workspaces) => state.copyWith(workspaces: workspaces, successOrFailure: left(unit)),
(error) {
Log.error(error);
return state.copyWith(successOrFailure: right(error));
},
);
}
Stream<WelcomeState> _openWorkspace(Workspace workspace) async* {
final result = await repo.openWorkspace(workspace.id);
yield result.fold(
(workspaces) => state.copyWith(successOrFailure: left(unit)),
(error) {
Log.error(error);
return state.copyWith(successOrFailure: right(error));
},
);
}
Stream<WelcomeState> _createWorkspace(String name, String desc) async* {
final result = await repo.createWorkspace(name, desc);
yield result.fold(
(workspace) {
return state.copyWith(successOrFailure: left(unit));
},
(error) {
Log.error(error);
return state.copyWith(successOrFailure: right(error));
},
);
}
void _workspacesUpdated(Either<List<Workspace>, WorkspaceError> workspacesOrFail) {
add(WelcomeEvent.workspacesReveived(workspacesOrFail));
}
}
@freezed
class WelcomeEvent with _$WelcomeEvent {
const factory WelcomeEvent.initial() = Initial;
// const factory WelcomeEvent.fetchWorkspaces() = FetchWorkspace;
const factory WelcomeEvent.createWorkspace(String name, String desc) = CreateWorkspace;
const factory WelcomeEvent.openWorkspace(Workspace workspace) = OpenWorkspace;
const factory WelcomeEvent.workspacesReveived(Either<List<Workspace>, WorkspaceError> workspacesOrFail) =
WorkspacesReceived;
}
@freezed
class WelcomeState with _$WelcomeState {
const factory WelcomeState({
required bool isLoading,
required List<Workspace> workspaces,
required Either<Unit, WorkspaceError> successOrFailure,
}) = _WelcomeState;
factory WelcomeState.initial() => WelcomeState(
isLoading: false,
workspaces: List.empty(),
successOrFailure: left(unit),
);
}
@@ -1,891 +0,0 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
part of 'welcome_bloc.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
/// @nodoc
class _$WelcomeEventTearOff {
const _$WelcomeEventTearOff();
Initial initial() {
return const Initial();
}
CreateWorkspace createWorkspace(String name, String desc) {
return CreateWorkspace(
name,
desc,
);
}
OpenWorkspace openWorkspace(Workspace workspace) {
return OpenWorkspace(
workspace,
);
}
WorkspacesReceived workspacesReveived(
Either<List<Workspace>, WorkspaceError> workspacesOrFail) {
return WorkspacesReceived(
workspacesOrFail,
);
}
}
/// @nodoc
const $WelcomeEvent = _$WelcomeEventTearOff();
/// @nodoc
mixin _$WelcomeEvent {
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function(String name, String desc) createWorkspace,
required TResult Function(Workspace workspace) openWorkspace,
required TResult Function(
Either<List<Workspace>, WorkspaceError> workspacesOrFail)
workspacesReveived,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Initial value) initial,
required TResult Function(CreateWorkspace value) createWorkspace,
required TResult Function(OpenWorkspace value) openWorkspace,
required TResult Function(WorkspacesReceived value) workspacesReveived,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
}) =>
throw _privateConstructorUsedError;
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
required TResult orElse(),
}) =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $WelcomeEventCopyWith<$Res> {
factory $WelcomeEventCopyWith(
WelcomeEvent value, $Res Function(WelcomeEvent) then) =
_$WelcomeEventCopyWithImpl<$Res>;
}
/// @nodoc
class _$WelcomeEventCopyWithImpl<$Res> implements $WelcomeEventCopyWith<$Res> {
_$WelcomeEventCopyWithImpl(this._value, this._then);
final WelcomeEvent _value;
// ignore: unused_field
final $Res Function(WelcomeEvent) _then;
}
/// @nodoc
abstract class $InitialCopyWith<$Res> {
factory $InitialCopyWith(Initial value, $Res Function(Initial) then) =
_$InitialCopyWithImpl<$Res>;
}
/// @nodoc
class _$InitialCopyWithImpl<$Res> extends _$WelcomeEventCopyWithImpl<$Res>
implements $InitialCopyWith<$Res> {
_$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then)
: super(_value, (v) => _then(v as Initial));
@override
Initial get _value => super._value as Initial;
}
/// @nodoc
class _$Initial implements Initial {
const _$Initial();
@override
String toString() {
return 'WelcomeEvent.initial()';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) || (other is Initial);
}
@override
int get hashCode => runtimeType.hashCode;
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function(String name, String desc) createWorkspace,
required TResult Function(Workspace workspace) openWorkspace,
required TResult Function(
Either<List<Workspace>, WorkspaceError> workspacesOrFail)
workspacesReveived,
}) {
return initial();
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
}) {
return initial?.call();
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
required TResult orElse(),
}) {
if (initial != null) {
return initial();
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Initial value) initial,
required TResult Function(CreateWorkspace value) createWorkspace,
required TResult Function(OpenWorkspace value) openWorkspace,
required TResult Function(WorkspacesReceived value) workspacesReveived,
}) {
return initial(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
}) {
return initial?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
required TResult orElse(),
}) {
if (initial != null) {
return initial(this);
}
return orElse();
}
}
abstract class Initial implements WelcomeEvent {
const factory Initial() = _$Initial;
}
/// @nodoc
abstract class $CreateWorkspaceCopyWith<$Res> {
factory $CreateWorkspaceCopyWith(
CreateWorkspace value, $Res Function(CreateWorkspace) then) =
_$CreateWorkspaceCopyWithImpl<$Res>;
$Res call({String name, String desc});
}
/// @nodoc
class _$CreateWorkspaceCopyWithImpl<$Res>
extends _$WelcomeEventCopyWithImpl<$Res>
implements $CreateWorkspaceCopyWith<$Res> {
_$CreateWorkspaceCopyWithImpl(
CreateWorkspace _value, $Res Function(CreateWorkspace) _then)
: super(_value, (v) => _then(v as CreateWorkspace));
@override
CreateWorkspace get _value => super._value as CreateWorkspace;
@override
$Res call({
Object? name = freezed,
Object? desc = freezed,
}) {
return _then(CreateWorkspace(
name == freezed
? _value.name
: name // ignore: cast_nullable_to_non_nullable
as String,
desc == freezed
? _value.desc
: desc // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
class _$CreateWorkspace implements CreateWorkspace {
const _$CreateWorkspace(this.name, this.desc);
@override
final String name;
@override
final String desc;
@override
String toString() {
return 'WelcomeEvent.createWorkspace(name: $name, desc: $desc)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is CreateWorkspace &&
(identical(other.name, name) ||
const DeepCollectionEquality().equals(other.name, name)) &&
(identical(other.desc, desc) ||
const DeepCollectionEquality().equals(other.desc, desc)));
}
@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(name) ^
const DeepCollectionEquality().hash(desc);
@JsonKey(ignore: true)
@override
$CreateWorkspaceCopyWith<CreateWorkspace> get copyWith =>
_$CreateWorkspaceCopyWithImpl<CreateWorkspace>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function(String name, String desc) createWorkspace,
required TResult Function(Workspace workspace) openWorkspace,
required TResult Function(
Either<List<Workspace>, WorkspaceError> workspacesOrFail)
workspacesReveived,
}) {
return createWorkspace(name, desc);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
}) {
return createWorkspace?.call(name, desc);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
required TResult orElse(),
}) {
if (createWorkspace != null) {
return createWorkspace(name, desc);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Initial value) initial,
required TResult Function(CreateWorkspace value) createWorkspace,
required TResult Function(OpenWorkspace value) openWorkspace,
required TResult Function(WorkspacesReceived value) workspacesReveived,
}) {
return createWorkspace(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
}) {
return createWorkspace?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
required TResult orElse(),
}) {
if (createWorkspace != null) {
return createWorkspace(this);
}
return orElse();
}
}
abstract class CreateWorkspace implements WelcomeEvent {
const factory CreateWorkspace(String name, String desc) = _$CreateWorkspace;
String get name => throw _privateConstructorUsedError;
String get desc => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$CreateWorkspaceCopyWith<CreateWorkspace> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $OpenWorkspaceCopyWith<$Res> {
factory $OpenWorkspaceCopyWith(
OpenWorkspace value, $Res Function(OpenWorkspace) then) =
_$OpenWorkspaceCopyWithImpl<$Res>;
$Res call({Workspace workspace});
}
/// @nodoc
class _$OpenWorkspaceCopyWithImpl<$Res> extends _$WelcomeEventCopyWithImpl<$Res>
implements $OpenWorkspaceCopyWith<$Res> {
_$OpenWorkspaceCopyWithImpl(
OpenWorkspace _value, $Res Function(OpenWorkspace) _then)
: super(_value, (v) => _then(v as OpenWorkspace));
@override
OpenWorkspace get _value => super._value as OpenWorkspace;
@override
$Res call({
Object? workspace = freezed,
}) {
return _then(OpenWorkspace(
workspace == freezed
? _value.workspace
: workspace // ignore: cast_nullable_to_non_nullable
as Workspace,
));
}
}
/// @nodoc
class _$OpenWorkspace implements OpenWorkspace {
const _$OpenWorkspace(this.workspace);
@override
final Workspace workspace;
@override
String toString() {
return 'WelcomeEvent.openWorkspace(workspace: $workspace)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is OpenWorkspace &&
(identical(other.workspace, workspace) ||
const DeepCollectionEquality()
.equals(other.workspace, workspace)));
}
@override
int get hashCode =>
runtimeType.hashCode ^ const DeepCollectionEquality().hash(workspace);
@JsonKey(ignore: true)
@override
$OpenWorkspaceCopyWith<OpenWorkspace> get copyWith =>
_$OpenWorkspaceCopyWithImpl<OpenWorkspace>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function(String name, String desc) createWorkspace,
required TResult Function(Workspace workspace) openWorkspace,
required TResult Function(
Either<List<Workspace>, WorkspaceError> workspacesOrFail)
workspacesReveived,
}) {
return openWorkspace(workspace);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
}) {
return openWorkspace?.call(workspace);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
required TResult orElse(),
}) {
if (openWorkspace != null) {
return openWorkspace(workspace);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Initial value) initial,
required TResult Function(CreateWorkspace value) createWorkspace,
required TResult Function(OpenWorkspace value) openWorkspace,
required TResult Function(WorkspacesReceived value) workspacesReveived,
}) {
return openWorkspace(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
}) {
return openWorkspace?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
required TResult orElse(),
}) {
if (openWorkspace != null) {
return openWorkspace(this);
}
return orElse();
}
}
abstract class OpenWorkspace implements WelcomeEvent {
const factory OpenWorkspace(Workspace workspace) = _$OpenWorkspace;
Workspace get workspace => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$OpenWorkspaceCopyWith<OpenWorkspace> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $WorkspacesReceivedCopyWith<$Res> {
factory $WorkspacesReceivedCopyWith(
WorkspacesReceived value, $Res Function(WorkspacesReceived) then) =
_$WorkspacesReceivedCopyWithImpl<$Res>;
$Res call({Either<List<Workspace>, WorkspaceError> workspacesOrFail});
}
/// @nodoc
class _$WorkspacesReceivedCopyWithImpl<$Res>
extends _$WelcomeEventCopyWithImpl<$Res>
implements $WorkspacesReceivedCopyWith<$Res> {
_$WorkspacesReceivedCopyWithImpl(
WorkspacesReceived _value, $Res Function(WorkspacesReceived) _then)
: super(_value, (v) => _then(v as WorkspacesReceived));
@override
WorkspacesReceived get _value => super._value as WorkspacesReceived;
@override
$Res call({
Object? workspacesOrFail = freezed,
}) {
return _then(WorkspacesReceived(
workspacesOrFail == freezed
? _value.workspacesOrFail
: workspacesOrFail // ignore: cast_nullable_to_non_nullable
as Either<List<Workspace>, WorkspaceError>,
));
}
}
/// @nodoc
class _$WorkspacesReceived implements WorkspacesReceived {
const _$WorkspacesReceived(this.workspacesOrFail);
@override
final Either<List<Workspace>, WorkspaceError> workspacesOrFail;
@override
String toString() {
return 'WelcomeEvent.workspacesReveived(workspacesOrFail: $workspacesOrFail)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is WorkspacesReceived &&
(identical(other.workspacesOrFail, workspacesOrFail) ||
const DeepCollectionEquality()
.equals(other.workspacesOrFail, workspacesOrFail)));
}
@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(workspacesOrFail);
@JsonKey(ignore: true)
@override
$WorkspacesReceivedCopyWith<WorkspacesReceived> get copyWith =>
_$WorkspacesReceivedCopyWithImpl<WorkspacesReceived>(this, _$identity);
@override
@optionalTypeArgs
TResult when<TResult extends Object?>({
required TResult Function() initial,
required TResult Function(String name, String desc) createWorkspace,
required TResult Function(Workspace workspace) openWorkspace,
required TResult Function(
Either<List<Workspace>, WorkspaceError> workspacesOrFail)
workspacesReveived,
}) {
return workspacesReveived(workspacesOrFail);
}
@override
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
}) {
return workspacesReveived?.call(workspacesOrFail);
}
@override
@optionalTypeArgs
TResult maybeWhen<TResult extends Object?>({
TResult Function()? initial,
TResult Function(String name, String desc)? createWorkspace,
TResult Function(Workspace workspace)? openWorkspace,
TResult Function(Either<List<Workspace>, WorkspaceError> workspacesOrFail)?
workspacesReveived,
required TResult orElse(),
}) {
if (workspacesReveived != null) {
return workspacesReveived(workspacesOrFail);
}
return orElse();
}
@override
@optionalTypeArgs
TResult map<TResult extends Object?>({
required TResult Function(Initial value) initial,
required TResult Function(CreateWorkspace value) createWorkspace,
required TResult Function(OpenWorkspace value) openWorkspace,
required TResult Function(WorkspacesReceived value) workspacesReveived,
}) {
return workspacesReveived(this);
}
@override
@optionalTypeArgs
TResult? mapOrNull<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
}) {
return workspacesReveived?.call(this);
}
@override
@optionalTypeArgs
TResult maybeMap<TResult extends Object?>({
TResult Function(Initial value)? initial,
TResult Function(CreateWorkspace value)? createWorkspace,
TResult Function(OpenWorkspace value)? openWorkspace,
TResult Function(WorkspacesReceived value)? workspacesReveived,
required TResult orElse(),
}) {
if (workspacesReveived != null) {
return workspacesReveived(this);
}
return orElse();
}
}
abstract class WorkspacesReceived implements WelcomeEvent {
const factory WorkspacesReceived(
Either<List<Workspace>, WorkspaceError> workspacesOrFail) =
_$WorkspacesReceived;
Either<List<Workspace>, WorkspaceError> get workspacesOrFail =>
throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$WorkspacesReceivedCopyWith<WorkspacesReceived> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
class _$WelcomeStateTearOff {
const _$WelcomeStateTearOff();
_WelcomeState call(
{required bool isLoading,
required List<Workspace> workspaces,
required Either<Unit, WorkspaceError> successOrFailure}) {
return _WelcomeState(
isLoading: isLoading,
workspaces: workspaces,
successOrFailure: successOrFailure,
);
}
}
/// @nodoc
const $WelcomeState = _$WelcomeStateTearOff();
/// @nodoc
mixin _$WelcomeState {
bool get isLoading => throw _privateConstructorUsedError;
List<Workspace> get workspaces => throw _privateConstructorUsedError;
Either<Unit, WorkspaceError> get successOrFailure =>
throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$WelcomeStateCopyWith<WelcomeState> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $WelcomeStateCopyWith<$Res> {
factory $WelcomeStateCopyWith(
WelcomeState value, $Res Function(WelcomeState) then) =
_$WelcomeStateCopyWithImpl<$Res>;
$Res call(
{bool isLoading,
List<Workspace> workspaces,
Either<Unit, WorkspaceError> successOrFailure});
}
/// @nodoc
class _$WelcomeStateCopyWithImpl<$Res> implements $WelcomeStateCopyWith<$Res> {
_$WelcomeStateCopyWithImpl(this._value, this._then);
final WelcomeState _value;
// ignore: unused_field
final $Res Function(WelcomeState) _then;
@override
$Res call({
Object? isLoading = freezed,
Object? workspaces = freezed,
Object? successOrFailure = freezed,
}) {
return _then(_value.copyWith(
isLoading: isLoading == freezed
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
workspaces: workspaces == freezed
? _value.workspaces
: workspaces // ignore: cast_nullable_to_non_nullable
as List<Workspace>,
successOrFailure: successOrFailure == freezed
? _value.successOrFailure
: successOrFailure // ignore: cast_nullable_to_non_nullable
as Either<Unit, WorkspaceError>,
));
}
}
/// @nodoc
abstract class _$WelcomeStateCopyWith<$Res>
implements $WelcomeStateCopyWith<$Res> {
factory _$WelcomeStateCopyWith(
_WelcomeState value, $Res Function(_WelcomeState) then) =
__$WelcomeStateCopyWithImpl<$Res>;
@override
$Res call(
{bool isLoading,
List<Workspace> workspaces,
Either<Unit, WorkspaceError> successOrFailure});
}
/// @nodoc
class __$WelcomeStateCopyWithImpl<$Res> extends _$WelcomeStateCopyWithImpl<$Res>
implements _$WelcomeStateCopyWith<$Res> {
__$WelcomeStateCopyWithImpl(
_WelcomeState _value, $Res Function(_WelcomeState) _then)
: super(_value, (v) => _then(v as _WelcomeState));
@override
_WelcomeState get _value => super._value as _WelcomeState;
@override
$Res call({
Object? isLoading = freezed,
Object? workspaces = freezed,
Object? successOrFailure = freezed,
}) {
return _then(_WelcomeState(
isLoading: isLoading == freezed
? _value.isLoading
: isLoading // ignore: cast_nullable_to_non_nullable
as bool,
workspaces: workspaces == freezed
? _value.workspaces
: workspaces // ignore: cast_nullable_to_non_nullable
as List<Workspace>,
successOrFailure: successOrFailure == freezed
? _value.successOrFailure
: successOrFailure // ignore: cast_nullable_to_non_nullable
as Either<Unit, WorkspaceError>,
));
}
}
/// @nodoc
class _$_WelcomeState implements _WelcomeState {
const _$_WelcomeState(
{required this.isLoading,
required this.workspaces,
required this.successOrFailure});
@override
final bool isLoading;
@override
final List<Workspace> workspaces;
@override
final Either<Unit, WorkspaceError> successOrFailure;
@override
String toString() {
return 'WelcomeState(isLoading: $isLoading, workspaces: $workspaces, successOrFailure: $successOrFailure)';
}
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _WelcomeState &&
(identical(other.isLoading, isLoading) ||
const DeepCollectionEquality()
.equals(other.isLoading, isLoading)) &&
(identical(other.workspaces, workspaces) ||
const DeepCollectionEquality()
.equals(other.workspaces, workspaces)) &&
(identical(other.successOrFailure, successOrFailure) ||
const DeepCollectionEquality()
.equals(other.successOrFailure, successOrFailure)));
}
@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(isLoading) ^
const DeepCollectionEquality().hash(workspaces) ^
const DeepCollectionEquality().hash(successOrFailure);
@JsonKey(ignore: true)
@override
_$WelcomeStateCopyWith<_WelcomeState> get copyWith =>
__$WelcomeStateCopyWithImpl<_WelcomeState>(this, _$identity);
}
abstract class _WelcomeState implements WelcomeState {
const factory _WelcomeState(
{required bool isLoading,
required List<Workspace> workspaces,
required Either<Unit, WorkspaceError> successOrFailure}) =
_$_WelcomeState;
@override
bool get isLoading => throw _privateConstructorUsedError;
@override
List<Workspace> get workspaces => throw _privateConstructorUsedError;
@override
Either<Unit, WorkspaceError> get successOrFailure =>
throw _privateConstructorUsedError;
@override
@JsonKey(ignore: true)
_$WelcomeStateCopyWith<_WelcomeState> get copyWith =>
throw _privateConstructorUsedError;
}
@@ -1,27 +0,0 @@
import 'package:flowy_infra/image.dart';
import 'package:flutter/material.dart';
enum AppDisclosureAction {
rename,
delete,
}
extension AppDisclosureExtension on AppDisclosureAction {
String get name {
switch (this) {
case AppDisclosureAction.rename:
return 'rename';
case AppDisclosureAction.delete:
return 'delete';
}
}
Widget get icon {
switch (this) {
case AppDisclosureAction.rename:
return svg('editor/edit');
case AppDisclosureAction.delete:
return svg('editor/delete');
}
}
}
@@ -1,32 +0,0 @@
import 'package:flowy_infra/image.dart';
import 'package:flutter/material.dart';
enum ViewDisclosureAction {
rename,
delete,
duplicate,
}
extension ViewDisclosureExtension on ViewDisclosureAction {
String get name {
switch (this) {
case ViewDisclosureAction.rename:
return 'Rename';
case ViewDisclosureAction.delete:
return 'Delete';
case ViewDisclosureAction.duplicate:
return 'Duplicate';
}
}
Widget get icon {
switch (this) {
case ViewDisclosureAction.rename:
return svg('editor/edit');
case ViewDisclosureAction.delete:
return svg('editor/delete');
case ViewDisclosureAction.duplicate:
return svg('editor/copy');
}
}
}
@@ -1,23 +0,0 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
abstract class EditPannelContext extends Equatable {
final String identifier;
final String title;
final Widget child;
const EditPannelContext(
{required this.child, required this.identifier, required this.title});
@override
List<Object> get props => [identifier];
}
class BlankEditPannelContext extends EditPannelContext {
const BlankEditPannelContext()
: super(child: const Text('Blank'), identifier: '1', title: '');
}
class CellEditPannelContext extends EditPannelContext {
const CellEditPannelContext()
: super(child: const Text('shit'), identifier: 'test', title: 'test');
}
-24
View File
@@ -1,24 +0,0 @@
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/app_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/protobuf.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
typedef AppUpdatedCallback = void Function(App app);
typedef AppViewsChangeCallback = void Function(Either<List<View>, WorkspaceError> viewsOrFailed);
abstract class IApp {
Future<Either<List<View>, WorkspaceError>> getViews();
Future<Either<View, WorkspaceError>> createView({required String name, String? desc, required ViewType viewType});
Future<Either<Unit, WorkspaceError>> delete();
Future<Either<Unit, WorkspaceError>> rename(String newName);
}
abstract class IAppListenr {
void start({AppViewsChangeCallback? viewsChangeCallback, AppUpdatedCallback? updatedCallback});
Future<void> stop();
}
-10
View File
@@ -1,10 +0,0 @@
import 'dart:async';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-document-infra/doc.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
abstract class IDoc {
Future<Either<DocDelta, WorkspaceError>> readDoc();
Future<Either<DocDelta, WorkspaceError>> composeDelta({required String json});
Future<Either<Unit, WorkspaceError>> closeDoc();
}
@@ -1,12 +0,0 @@
import 'dart:async';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
abstract class IShare {
Future<Either<ExportData, WorkspaceError>> exportText(String docId);
Future<Either<ExportData, WorkspaceError>> exportMarkdown(String docId);
Future<Either<ExportData, WorkspaceError>> exportURL(String docId);
}
@@ -1,23 +0,0 @@
import 'dart:async';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/trash_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
abstract class ITrash {
Future<Either<List<Trash>, WorkspaceError>> readTrash();
Future<Either<Unit, WorkspaceError>> putback(String trashId);
Future<Either<Unit, WorkspaceError>> deleteViews(List<Tuple2<String, TrashType>> trashList);
Future<Either<Unit, WorkspaceError>> restoreAll();
Future<Either<Unit, WorkspaceError>> deleteAll();
}
typedef TrashUpdatedCallback = void Function(Either<List<Trash>, WorkspaceError> trashOrFailed);
abstract class ITrashListener {
void start(TrashUpdatedCallback updateCallback);
Future<void> stop();
}
@@ -1,31 +0,0 @@
import 'package:dartz/dartz.dart';
import 'package:flowy_infra/notifier.dart';
import 'package:flowy_sdk/protobuf/flowy-user/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/workspace_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
export 'package:flowy_sdk/protobuf/flowy-user/errors.pb.dart';
export 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
abstract class IUser {
UserProfile get user;
Future<Either<UserProfile, UserError>> fetchUserProfile(String userId);
Future<Either<List<Workspace>, WorkspaceError>> fetchWorkspaces();
Future<Either<Unit, WorkspaceError>> deleteWorkspace(String workspaceId);
Future<Either<Unit, UserError>> signOut();
Future<Either<Unit, UserError>> initUser();
}
typedef UserProfileUpdatedNotifierValue = Either<UserProfile, UserError>;
typedef AuthNotifierValue = Either<Unit, UserError>;
typedef WorkspaceUpdatedNotifierValue = Either<List<Workspace>, WorkspaceError>;
abstract class IUserListener {
void start();
PublishNotifier<UserProfileUpdatedNotifierValue> get profileUpdatedNotifier;
PublishNotifier<AuthNotifierValue> get authDidChangedNotifier;
PublishNotifier<WorkspaceUpdatedNotifierValue> get workspaceUpdatedNotifier;
Future<void> stop();
}
@@ -1,32 +0,0 @@
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_infra/notifier.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
typedef ViewUpdatedCallback = void Function(Either<View, WorkspaceError>);
typedef DeleteNotifierValue = Either<View, WorkspaceError>;
typedef UpdateNotifierValue = Either<View, WorkspaceError>;
typedef RestoreNotifierValue = Either<View, WorkspaceError>;
abstract class IView {
View get view;
Future<Either<Unit, WorkspaceError>> delete();
Future<Either<View, WorkspaceError>> rename(String newName);
Future<Either<Unit, WorkspaceError>> duplicate();
}
abstract class IViewListener {
void start();
PublishNotifier<UpdateNotifierValue> get updatedNotifier;
PublishNotifier<DeleteNotifierValue> get deletedNotifier;
PublishNotifier<RestoreNotifierValue> get restoredNotifier;
Future<void> stop();
}
@@ -1,19 +0,0 @@
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/protobuf.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
typedef WorkspaceAppsChangedCallback = void Function(Either<List<App>, WorkspaceError> appsOrFail);
typedef WorkspaceUpdatedCallback = void Function(String name, String desc);
abstract class IWorkspace {
Future<Either<App, WorkspaceError>> createApp({required String name, String? desc});
Future<Either<List<App>, WorkspaceError>> getApps();
}
abstract class IWorkspaceListener {
void start({WorkspaceAppsChangedCallback? addAppCallback, WorkspaceUpdatedCallback? updatedCallback});
Future<void> stop();
}
-25
View File
@@ -1,25 +0,0 @@
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flutter/material.dart';
import 'package:flowy_infra/image.dart';
AssetImage assetImageForViewType(ViewType type) {
final imageName = _imageNameForViewType(type);
return AssetImage('assets/images/$imageName');
}
extension SvgViewType on View {
Widget thumbnail() {
final imageName = _imageNameForViewType(viewType);
final Widget widget = svg(imageName);
return widget;
}
}
String _imageNameForViewType(ViewType type) {
switch (type) {
case ViewType.Doc:
return "file_icon";
default:
return "file_icon";
}
}
@@ -1,124 +0,0 @@
import 'package:flowy_infra/notifier.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/presentation/stack_page/blank/blank_page.dart';
import 'package:app_flowy/workspace/presentation/stack_page/home_stack.dart';
import 'package:app_flowy/workspace/presentation/widgets/prelude.dart';
typedef NavigationCallback = void Function(String id);
abstract class NavigationItem {
Widget get leftBarItem;
Widget? get rightBarItem => null;
String get identifier;
NavigationCallback get action => (id) {
getIt<HomeStackManager>().setStackWithId(id);
};
}
enum HomeStackType {
blank,
doc,
trash,
}
List<HomeStackType> pages = HomeStackType.values.toList();
abstract class HomeStackContext<T, S> with NavigationItem {
List<NavigationItem> get navigationItems;
@override
Widget get leftBarItem;
@override
Widget? get rightBarItem;
@override
String get identifier;
ValueNotifier<T> get isUpdated;
HomeStackType get type;
Widget buildWidget();
void dispose();
}
class HomeStackNotifier extends ChangeNotifier {
HomeStackContext stackContext;
PublishNotifier<bool> collapsedNotifier = PublishNotifier();
Widget get titleWidget => stackContext.leftBarItem;
HomeStackNotifier({HomeStackContext? context}) : stackContext = context ?? BlankStackContext();
set context(HomeStackContext context) {
if (stackContext.identifier == context.identifier) {
return;
}
stackContext.isUpdated.removeListener(notifyListeners);
stackContext.dispose();
stackContext = context;
stackContext.isUpdated.addListener(notifyListeners);
notifyListeners();
}
HomeStackContext get context => stackContext;
}
// HomeStack is initialized as singleton to controll the page stack.
class HomeStackManager {
final HomeStackNotifier _notifier = HomeStackNotifier();
HomeStackManager();
Widget title() {
return _notifier.context.leftBarItem;
}
PublishNotifier<bool> get collapsedNotifier => _notifier.collapsedNotifier;
void setStack(HomeStackContext context) {
_notifier.context = context;
}
void setStackWithId(String id) {}
Widget stackTopBar() {
return MultiProvider(
providers: [
ChangeNotifierProvider.value(value: _notifier),
],
child: Selector<HomeStackNotifier, Widget>(
selector: (context, notifier) => notifier.titleWidget,
builder: (context, widget, child) {
return const HomeTopBar();
},
),
);
}
Widget stackWidget() {
return MultiProvider(
providers: [
ChangeNotifierProvider.value(value: _notifier),
],
child: Consumer(builder: (ctx, HomeStackNotifier notifier, child) {
return FadingIndexedStack(
index: pages.indexOf(notifier.context.type),
children: HomeStackType.values.map((viewType) {
if (viewType == notifier.context.type) {
return notifier.context.buildWidget();
} else {
return const BlankStackPage();
}
}).toList(),
);
}),
);
}
}
@@ -1,30 +0,0 @@
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
import 'package:app_flowy/workspace/presentation/stack_page/blank/blank_page.dart';
import 'package:app_flowy/workspace/presentation/stack_page/doc/doc_stack_page.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
extension ToHomeStackContext on View {
HomeStackContext stackContext() {
switch (viewType) {
case ViewType.Blank:
return BlankStackContext();
case ViewType.Doc:
return DocStackContext(view: this);
default:
return BlankStackContext();
}
}
}
extension ToHomeStackType on View {
HomeStackType stackType() {
switch (viewType) {
case ViewType.Blank:
return HomeStackType.blank;
case ViewType.Doc:
return HomeStackType.doc;
default:
return HomeStackType.blank;
}
}
}
@@ -1,116 +0,0 @@
import 'package:app_flowy/workspace/application/app/app_bloc.dart';
import 'package:app_flowy/workspace/application/doc/doc_bloc.dart';
import 'package:app_flowy/workspace/application/doc/share_bloc.dart';
import 'package:app_flowy/workspace/application/menu/menu_bloc.dart';
import 'package:app_flowy/workspace/application/menu/menu_user_bloc.dart';
import 'package:app_flowy/workspace/application/trash/trash_bloc.dart';
import 'package:app_flowy/workspace/application/view/view_bloc.dart';
import 'package:app_flowy/workspace/application/workspace/welcome_bloc.dart';
import 'package:app_flowy/workspace/domain/i_doc.dart';
import 'package:app_flowy/workspace/domain/i_share.dart';
import 'package:app_flowy/workspace/domain/i_trash.dart';
import 'package:app_flowy/workspace/domain/i_view.dart';
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
import 'package:app_flowy/workspace/infrastructure/i_app_impl.dart';
import 'package:app_flowy/workspace/infrastructure/i_doc_impl.dart';
import 'package:app_flowy/workspace/infrastructure/i_trash_impl.dart';
import 'package:app_flowy/workspace/infrastructure/i_workspace_impl.dart';
import 'package:app_flowy/workspace/infrastructure/repos/app_repo.dart';
import 'package:app_flowy/workspace/infrastructure/repos/doc_repo.dart';
import 'package:app_flowy/workspace/infrastructure/repos/trash_repo.dart';
import 'package:app_flowy/workspace/infrastructure/repos/view_repo.dart';
import 'package:app_flowy/workspace/infrastructure/repos/workspace_repo.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/app_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:get_it/get_it.dart';
import 'i_share_impl.dart';
import 'i_user_impl.dart';
import 'i_view_impl.dart';
import 'repos/share_repo.dart';
class HomeDepsResolver {
static Future<void> resolve(GetIt getIt) async {
//
getIt.registerLazySingleton<HomeStackManager>(() => HomeStackManager());
getIt.registerFactoryParam<WelcomeBloc, UserProfile, void>(
(user, _) => WelcomeBloc(
repo: UserRepo(user: user),
listener: getIt<IUserListener>(param1: user),
),
);
//App
getIt.registerFactoryParam<IApp, String, void>((appId, _) => IAppImpl(repo: AppRepository(appId: appId)));
getIt.registerFactoryParam<IAppListenr, String, void>(
(appId, _) => IAppListenerhImpl(repo: AppListenerRepository(appId: appId)));
//workspace
getIt.registerFactoryParam<IWorkspace, UserProfile, String>(
(user, workspaceId) => IWorkspaceImpl(repo: WorkspaceRepo(user: user, workspaceId: workspaceId)));
getIt.registerFactoryParam<IWorkspaceListener, UserProfile, String>((user, workspaceId) =>
IWorkspaceListenerImpl(repo: WorkspaceListenerRepo(user: user, workspaceId: workspaceId)));
// View
getIt.registerFactoryParam<IView, View, void>((view, _) => IViewImpl(repo: ViewRepository(view: view)));
getIt.registerFactoryParam<IViewListener, View, void>(
(view, _) => IViewListenerImpl(repo: ViewListenerRepository(view: view)));
getIt.registerFactoryParam<ViewBloc, View, void>(
(view, _) => ViewBloc(
viewManager: getIt<IView>(param1: view),
listener: getIt<IViewListener>(param1: view),
),
);
// Doc
getIt.registerFactoryParam<IDoc, String, void>((docId, _) => IDocImpl(repo: DocRepository(docId: docId)));
// User
getIt.registerFactoryParam<IUser, UserProfile, void>((user, _) => IUserImpl(repo: UserRepo(user: user)));
getIt.registerFactoryParam<IUserListener, UserProfile, void>((user, _) => IUserListenerImpl(user: user));
//Menu Bloc
getIt.registerFactoryParam<MenuBloc, UserProfile, String>(
(user, workspaceId) => MenuBloc(
workspaceManager: getIt<IWorkspace>(param1: user, param2: workspaceId),
listener: getIt<IWorkspaceListener>(param1: user, param2: workspaceId),
),
);
getIt.registerFactoryParam<MenuUserBloc, UserProfile, void>(
(user, _) => MenuUserBloc(getIt<IUser>(param1: user), getIt<IUserListener>(param1: user)));
// App
getIt.registerFactoryParam<AppBloc, App, void>(
(app, _) => AppBloc(
app: app,
appManager: getIt<IApp>(param1: app.id),
listener: getIt<IAppListenr>(param1: app.id),
),
);
// Doc
getIt.registerFactoryParam<DocBloc, View, void>(
(view, _) => DocBloc(
view: view,
docManager: getIt<IDoc>(param1: view.id),
listener: getIt<IViewListener>(param1: view),
trasnManager: getIt<ITrash>(),
),
);
// trash
getIt.registerLazySingleton<TrashRepo>(() => TrashRepo());
getIt.registerLazySingleton<TrashListenerRepo>(() => TrashListenerRepo());
getIt.registerFactory<ITrash>(() => ITrashImpl(repo: getIt<TrashRepo>()));
getIt.registerFactory<ITrashListener>(() => ITrashListenerImpl(repo: getIt<TrashListenerRepo>()));
getIt.registerFactory<TrashBloc>(() => TrashBloc(trasnManager: getIt<ITrash>(), listener: getIt<ITrashListener>()));
// share
getIt.registerLazySingleton<ShareRepo>(() => ShareRepo());
getIt.registerFactory<IShare>(() => IShareImpl(repo: getIt<ShareRepo>()));
getIt.registerFactoryParam<DocShareBloc, View, void>(
(view, _) => DocShareBloc(view: view, shareManager: getIt<IShare>()));
}
}
@@ -1,55 +0,0 @@
import 'package:app_flowy/workspace/infrastructure/repos/app_repo.dart';
import 'package:dartz/dartz.dart';
import 'package:app_flowy/workspace/domain/i_app.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
export 'package:app_flowy/workspace/domain/i_app.dart';
class IAppImpl extends IApp {
AppRepository repo;
IAppImpl({
required this.repo,
});
@override
Future<Either<List<View>, WorkspaceError>> getViews() {
return repo.getViews();
}
@override
Future<Either<View, WorkspaceError>> createView({required String name, String? desc, required ViewType viewType}) {
return repo.createView(name, desc ?? "", viewType).then((result) {
return result.fold(
(view) => left(view),
(r) => right(r),
);
});
}
@override
Future<Either<Unit, WorkspaceError>> delete() {
return repo.delete();
}
@override
Future<Either<Unit, WorkspaceError>> rename(String newName) {
return repo.updateApp(name: newName);
}
}
class IAppListenerhImpl extends IAppListenr {
AppListenerRepository repo;
IAppListenerhImpl({
required this.repo,
});
@override
Future<void> stop() async {
await repo.close();
}
@override
void start({AppViewsChangeCallback? viewsChangeCallback, AppUpdatedCallback? updatedCallback}) {
repo.startListening(viewsChanged: viewsChangeCallback, update: updatedCallback);
}
}
@@ -1,36 +0,0 @@
import 'dart:convert';
import 'dart:typed_data';
import 'package:dartz/dartz.dart';
import 'package:app_flowy/workspace/domain/i_doc.dart';
import 'package:app_flowy/workspace/infrastructure/repos/doc_repo.dart';
import 'package:flowy_sdk/protobuf/flowy-document-infra/doc.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
class IDocImpl extends IDoc {
DocRepository repo;
IDocImpl({required this.repo});
@override
Future<Either<Unit, WorkspaceError>> closeDoc() {
return repo.closeDoc();
}
@override
Future<Either<DocDelta, WorkspaceError>> readDoc() async {
final docOrFail = await repo.readDoc();
return docOrFail;
}
@override
Future<Either<DocDelta, WorkspaceError>> composeDelta({required String json}) {
return repo.composeDelta(data: json);
}
}
// ignore: unused_element
Uint8List _encodeJsonText(String? json) {
final data = utf8.encode(json ?? "");
return Uint8List.fromList(data);
}
@@ -1,27 +0,0 @@
import 'package:app_flowy/workspace/domain/i_share.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:dartz/dartz.dart';
import 'repos/share_repo.dart';
class IShareImpl extends IShare {
ShareRepo repo;
IShareImpl({required this.repo});
@override
Future<Either<ExportData, WorkspaceError>> exportText(String docId) {
return repo.export(docId, ExportType.Text);
}
@override
Future<Either<ExportData, WorkspaceError>> exportMarkdown(String docId) {
return repo.export(docId, ExportType.Markdown);
}
@override
Future<Either<ExportData, WorkspaceError>> exportURL(String docId) {
return repo.export(docId, ExportType.Link);
}
}
@@ -1,58 +0,0 @@
import 'package:app_flowy/workspace/domain/i_trash.dart';
import 'package:app_flowy/workspace/infrastructure/repos/trash_repo.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/trash_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
class ITrashImpl implements ITrash {
TrashRepo repo;
ITrashImpl({required this.repo});
@override
Future<Either<List<Trash>, WorkspaceError>> readTrash() {
return repo.readTrash().then((result) {
return result.fold(
(repeatedTrash) => left(repeatedTrash.items),
(err) => right(err),
);
});
}
@override
Future<Either<Unit, WorkspaceError>> putback(String trashId) {
return repo.putback(trashId);
}
@override
Future<Either<Unit, WorkspaceError>> deleteAll() {
return repo.deleteAll();
}
@override
Future<Either<Unit, WorkspaceError>> restoreAll() {
return repo.restoreAll();
}
@override
Future<Either<Unit, WorkspaceError>> deleteViews(List<Tuple2<String, TrashType>> trashList) {
return repo.deleteViews(trashList);
}
}
class ITrashListenerImpl extends ITrashListener {
TrashListenerRepo repo;
ITrashListenerImpl({
required this.repo,
});
@override
Future<void> stop() async {
await repo.close();
}
@override
void start(TrashUpdatedCallback updateCallback) {
repo.startListening(trashUpdated: updateCallback);
}
}
@@ -1,124 +0,0 @@
import 'dart:typed_data';
import 'package:app_flowy/workspace/infrastructure/repos/helper.dart';
import 'package:dartz/dartz.dart';
import 'package:app_flowy/workspace/domain/i_user.dart';
import 'package:app_flowy/workspace/infrastructure/repos/user_repo.dart';
import 'package:flowy_infra/notifier.dart';
import 'package:flowy_sdk/protobuf/flowy-dart-notify/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-user-infra/errors.pb.dart';
// import 'package:flowy_sdk/protobuf/flowy-user/errors.pb.dart' as user_error;
import 'package:flowy_sdk/protobuf/flowy-user/observable.pb.dart' as user;
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/workspace_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/observable.pb.dart';
export 'package:app_flowy/workspace/domain/i_user.dart';
export 'package:app_flowy/workspace/infrastructure/repos/user_repo.dart';
import 'package:flowy_sdk/rust_stream.dart';
import 'dart:async';
class IUserImpl extends IUser {
UserRepo repo;
IUserImpl({
required this.repo,
});
@override
Future<Either<Unit, WorkspaceError>> deleteWorkspace(String workspaceId) {
return repo.deleteWorkspace(workspaceId: workspaceId);
}
@override
Future<Either<UserProfile, UserError>> fetchUserProfile(String userId) {
return repo.fetchUserProfile(userId: userId);
}
@override
Future<Either<Unit, UserError>> signOut() {
return repo.signOut();
}
@override
UserProfile get user => repo.user;
@override
Future<Either<List<Workspace>, WorkspaceError>> fetchWorkspaces() {
return repo.getWorkspaces();
}
@override
Future<Either<Unit, UserError>> initUser() {
return repo.initUser();
}
}
class IUserListenerImpl extends IUserListener {
StreamSubscription<SubscribeObject>? _subscription;
@override
final profileUpdatedNotifier = PublishNotifier<UserProfileUpdatedNotifierValue>();
@override
final authDidChangedNotifier = PublishNotifier<AuthNotifierValue>();
@override
final workspaceUpdatedNotifier = PublishNotifier<WorkspaceUpdatedNotifierValue>();
late WorkspaceNotificationParser _workspaceParser;
late UserNotificationParser _userParser;
late UserProfile _user;
IUserListenerImpl({
required UserProfile user,
}) {
_user = user;
}
@override
void start() {
_workspaceParser = WorkspaceNotificationParser(id: _user.token, callback: _notificationCallback);
_userParser = UserNotificationParser(id: _user.token, callback: _userNotificationCallback);
_subscription = RustStreamReceiver.listen((observable) {
_workspaceParser.parse(observable);
_userParser.parse(observable);
});
}
@override
Future<void> stop() async {
await _subscription?.cancel();
}
void _notificationCallback(WorkspaceNotification ty, Either<Uint8List, WorkspaceError> result) {
switch (ty) {
case WorkspaceNotification.UserCreateWorkspace:
case WorkspaceNotification.UserDeleteWorkspace:
case WorkspaceNotification.WorkspaceListUpdated:
result.fold(
(payload) => workspaceUpdatedNotifier.value = left(RepeatedWorkspace.fromBuffer(payload).items),
(error) => workspaceUpdatedNotifier.value = right(error),
);
break;
case WorkspaceNotification.UserUnauthorized:
result.fold(
(_) {},
(error) => authDidChangedNotifier.value = right(UserError.create()..code = ErrorCode.UserUnauthorized.value),
);
break;
default:
break;
}
}
void _userNotificationCallback(user.UserNotification ty, Either<Uint8List, UserError> result) {
switch (ty) {
case user.UserNotification.UserUnauthorized:
result.fold(
(payload) => profileUpdatedNotifier.value = left(UserProfile.fromBuffer(payload)),
(error) => profileUpdatedNotifier.value = right(error),
);
break;
default:
break;
}
}
}
@@ -1,61 +0,0 @@
import 'package:app_flowy/workspace/domain/i_view.dart';
import 'package:app_flowy/workspace/infrastructure/repos/view_repo.dart';
import 'package:flowy_infra/notifier.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
class IViewImpl extends IView {
ViewRepository repo;
IViewImpl({required this.repo});
@override
View get view => repo.view;
@override
Future<Either<Unit, WorkspaceError>> delete() {
return repo.delete().then((result) {
return result.fold(
(_) => left(unit),
(error) => right(error),
);
});
}
@override
Future<Either<View, WorkspaceError>> rename(String newName) {
return repo.updateView(name: newName);
}
@override
Future<Either<Unit, WorkspaceError>> duplicate() {
return repo.duplicate();
}
}
class IViewListenerImpl extends IViewListener {
final ViewListenerRepository repo;
IViewListenerImpl({
required this.repo,
});
@override
void start() {
repo.start();
}
@override
Future<void> stop() async {
await repo.close();
}
@override
PublishNotifier<DeleteNotifierValue> get deletedNotifier => repo.deletedNotifier;
@override
PublishNotifier<UpdateNotifierValue> get updatedNotifier => repo.updatedNotifier;
@override
PublishNotifier<RestoreNotifierValue> get restoredNotifier => repo.restoredNotifier;
}
@@ -1,46 +0,0 @@
import 'package:app_flowy/workspace/domain/i_workspace.dart';
import 'package:app_flowy/workspace/infrastructure/repos/workspace_repo.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/app_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
export 'package:app_flowy/workspace/domain/i_workspace.dart';
class IWorkspaceImpl extends IWorkspace {
WorkspaceRepo repo;
IWorkspaceImpl({
required this.repo,
});
@override
Future<Either<App, WorkspaceError>> createApp({required String name, String? desc}) {
return repo.createApp(name, desc ?? "");
}
@override
Future<Either<List<App>, WorkspaceError>> getApps() {
return repo.getApps().then((result) {
return result.fold(
(apps) => left(apps),
(error) => right(error),
);
});
}
}
class IWorkspaceListenerImpl extends IWorkspaceListener {
WorkspaceListenerRepo repo;
IWorkspaceListenerImpl({
required this.repo,
});
@override
void start({WorkspaceAppsChangedCallback? addAppCallback, WorkspaceUpdatedCallback? updatedCallback}) {
repo.startListening(appsChanged: addAppCallback, update: updatedCallback);
}
@override
Future<void> stop() async {
await repo.close();
}
}
File diff suppressed because it is too large. Load diff
@@ -1,116 +0,0 @@
import 'dart:async';
import 'dart:typed_data';
import 'package:app_flowy/workspace/domain/i_app.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_log/flowy_log.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-dart-notify/subject.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/app_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/app_query.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/app_update.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pbenum.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/observable.pb.dart';
import 'package:flowy_sdk/rust_stream.dart';
import 'helper.dart';
class AppRepository {
String appId;
AppRepository({
required this.appId,
});
Future<Either<App, WorkspaceError>> getAppDesc() {
final request = QueryAppRequest.create()..appIds.add(appId);
return WorkspaceEventReadApp(request).send();
}
Future<Either<View, WorkspaceError>> createView(String name, String desc, ViewType viewType) {
final request = CreateViewRequest.create()
..belongToId = appId
..name = name
..desc = desc
..viewType = viewType;
return WorkspaceEventCreateView(request).send();
}
Future<Either<List<View>, WorkspaceError>> getViews() {
final request = QueryAppRequest.create()..appIds.add(appId);
return WorkspaceEventReadApp(request).send().then((result) {
return result.fold(
(app) => left(app.belongings.items),
(error) => right(error),
);
});
}
Future<Either<Unit, WorkspaceError>> delete() {
final request = QueryAppRequest.create()..appIds.add(appId);
return WorkspaceEventDeleteApp(request).send();
}
Future<Either<Unit, WorkspaceError>> updateApp({String? name}) {
UpdateAppRequest request = UpdateAppRequest.create()..appId = appId;
if (name != null) {
request.name = name;
}
return WorkspaceEventUpdateApp(request).send();
}
}
class AppListenerRepository {
StreamSubscription<SubscribeObject>? _subscription;
AppViewsChangeCallback? _viewsChanged;
AppUpdatedCallback? _update;
late WorkspaceNotificationParser _parser;
String appId;
AppListenerRepository({
required this.appId,
});
void startListening({AppViewsChangeCallback? viewsChanged, AppUpdatedCallback? update}) {
_viewsChanged = viewsChanged;
_update = update;
_parser = WorkspaceNotificationParser(id: appId, callback: _bservableCallback);
_subscription = RustStreamReceiver.listen((observable) => _parser.parse(observable));
}
void _bservableCallback(WorkspaceNotification ty, Either<Uint8List, WorkspaceError> result) {
switch (ty) {
case WorkspaceNotification.AppViewsChanged:
if (_viewsChanged != null) {
result.fold(
(payload) {
final repeatedView = RepeatedView.fromBuffer(payload);
_viewsChanged!(left(repeatedView.items));
},
(error) => _viewsChanged!(right(error)),
);
}
break;
case WorkspaceNotification.AppUpdated:
if (_update != null) {
result.fold(
(payload) {
final app = App.fromBuffer(payload);
_update!(app);
},
(error) => Log.error(error),
);
}
break;
default:
break;
}
}
Future<void> close() async {
await _subscription?.cancel();
}
}
@@ -1,29 +0,0 @@
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-document-infra/doc.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_query.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
class DocRepository {
final String docId;
DocRepository({
required this.docId,
});
Future<Either<DocDelta, WorkspaceError>> readDoc() {
final request = QueryViewRequest(viewIds: [docId]);
return WorkspaceEventOpenView(request).send();
}
Future<Either<DocDelta, WorkspaceError>> composeDelta({required String data}) {
final request = DocDelta.create()
..docId = docId
..data = data;
return WorkspaceEventApplyDocDelta(request).send();
}
Future<Either<Unit, WorkspaceError>> closeDoc() {
final request = QueryViewRequest(viewIds: [docId]);
return WorkspaceEventCloseView(request).send();
}
}
@@ -1,61 +0,0 @@
import 'dart:typed_data';
import 'package:flowy_sdk/protobuf/flowy-dart-notify/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/observable.pb.dart';
typedef UserNotificationCallback = void Function(UserNotification, Either<Uint8List, UserError>);
class UserNotificationParser extends NotificationParser<UserNotification, UserError> {
UserNotificationParser({required String id, required UserNotificationCallback callback})
: super(
id: id,
callback: callback,
tyParser: (ty) => UserNotification.valueOf(ty),
errorParser: (bytes) => UserError.fromBuffer(bytes),
);
}
typedef NotificationCallback = void Function(WorkspaceNotification, Either<Uint8List, WorkspaceError>);
class WorkspaceNotificationParser extends NotificationParser<WorkspaceNotification, WorkspaceError> {
WorkspaceNotificationParser({String? id, required NotificationCallback callback})
: super(
id: id,
callback: callback,
tyParser: (ty) => WorkspaceNotification.valueOf(ty),
errorParser: (bytes) => WorkspaceError.fromBuffer(bytes),
);
}
class NotificationParser<T, E> {
String? id;
void Function(T, Either<Uint8List, E>) callback;
T? Function(int) tyParser;
E Function(Uint8List) errorParser;
NotificationParser({this.id, required this.callback, required this.errorParser, required this.tyParser});
void parse(SubscribeObject subject) {
if (id != null) {
if (subject.id != id) {
return;
}
}
final ty = tyParser(subject.ty);
if (ty == null) {
return;
}
if (subject.hasError()) {
final bytes = Uint8List.fromList(subject.error);
final error = errorParser(bytes);
callback(ty, right(error));
} else {
final bytes = Uint8List.fromList(subject.payload);
callback(ty, left(bytes));
}
}
}
@@ -1,15 +0,0 @@
import 'dart:async';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
class ShareRepo {
Future<Either<ExportData, WorkspaceError>> export(String docId, ExportType type) {
final request = ExportRequest.create()
..docId = docId
..exportType = type;
return WorkspaceEventExportDocument(request).send();
}
}
@@ -1,76 +0,0 @@
import 'dart:async';
import 'dart:typed_data';
import 'package:app_flowy/workspace/domain/i_trash.dart';
import 'package:app_flowy/workspace/infrastructure/repos/helper.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-dart-notify/subject.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/trash_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/observable.pb.dart';
import 'package:flowy_sdk/rust_stream.dart';
class TrashRepo {
Future<Either<RepeatedTrash, WorkspaceError>> readTrash() {
return WorkspaceEventReadTrash().send();
}
Future<Either<Unit, WorkspaceError>> putback(String trashId) {
final id = TrashIdentifier.create()..id = trashId;
return WorkspaceEventPutbackTrash(id).send();
}
Future<Either<Unit, WorkspaceError>> deleteViews(List<Tuple2<String, TrashType>> trashList) {
final items = trashList.map((trash) {
return TrashIdentifier.create()
..id = trash.value1
..ty = trash.value2;
});
final trashIdentifiers = TrashIdentifiers(items: items);
return WorkspaceEventDeleteTrash(trashIdentifiers).send();
}
Future<Either<Unit, WorkspaceError>> restoreAll() {
return WorkspaceEventRestoreAll().send();
}
Future<Either<Unit, WorkspaceError>> deleteAll() {
return WorkspaceEventDeleteAll().send();
}
}
class TrashListenerRepo {
StreamSubscription<SubscribeObject>? _subscription;
TrashUpdatedCallback? _trashUpdated;
late WorkspaceNotificationParser _parser;
void startListening({TrashUpdatedCallback? trashUpdated}) {
_trashUpdated = trashUpdated;
_parser = WorkspaceNotificationParser(callback: _bservableCallback);
_subscription = RustStreamReceiver.listen((observable) => _parser.parse(observable));
}
void _bservableCallback(WorkspaceNotification ty, Either<Uint8List, WorkspaceError> result) {
switch (ty) {
case WorkspaceNotification.TrashUpdated:
if (_trashUpdated != null) {
result.fold(
(payload) {
final repeatedTrash = RepeatedTrash.fromBuffer(payload);
_trashUpdated!(left(repeatedTrash.items));
},
(error) => _trashUpdated!(right(error)),
);
}
break;
default:
break;
}
}
Future<void> close() async {
await _subscription?.cancel();
}
}
@@ -1,65 +0,0 @@
import 'dart:async';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-user/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/workspace_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/workspace_query.pb.dart';
import 'package:app_flowy/workspace/domain/i_user.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
class UserRepo {
final UserProfile user;
UserRepo({
required this.user,
});
Future<Either<UserProfile, UserError>> fetchUserProfile({required String userId}) {
return UserEventGetUserProfile().send();
}
Future<Either<Unit, WorkspaceError>> deleteWorkspace({required String workspaceId}) {
throw UnimplementedError();
}
Future<Either<Unit, UserError>> signOut() {
return UserEventSignOut().send();
}
Future<Either<Unit, UserError>> initUser() async {
return UserEventInitUser().send();
}
Future<Either<List<Workspace>, WorkspaceError>> getWorkspaces() {
final request = QueryWorkspaceRequest.create();
return WorkspaceEventReadWorkspaces(request).send().then((result) {
return result.fold(
(workspaces) => left(workspaces.items),
(error) => right(error),
);
});
}
Future<Either<Workspace, WorkspaceError>> openWorkspace(String workspaceId) {
final request = QueryWorkspaceRequest.create()..workspaceId = workspaceId;
return WorkspaceEventOpenWorkspace(request).send().then((result) {
return result.fold(
(workspace) => left(workspace),
(error) => right(error),
);
});
}
Future<Either<Workspace, WorkspaceError>> createWorkspace(String name, String desc) {
final request = CreateWorkspaceRequest.create()
..name = name
..desc = desc;
return WorkspaceEventCreateWorkspace(request).send().then((result) {
return result.fold(
(workspace) => left(workspace),
(error) => right(error),
);
});
}
}
@@ -1,105 +0,0 @@
import 'dart:async';
import 'dart:typed_data';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-dart-notify/subject.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_query.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_update.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/observable.pb.dart';
import 'package:flowy_sdk/rust_stream.dart';
import 'package:app_flowy/workspace/domain/i_view.dart';
import 'package:flowy_infra/notifier.dart';
import 'helper.dart';
class ViewRepository {
View view;
ViewRepository({
required this.view,
});
Future<Either<View, WorkspaceError>> readView() {
final request = QueryViewRequest(viewIds: [view.id]);
return WorkspaceEventReadView(request).send();
}
Future<Either<View, WorkspaceError>> updateView({String? name, String? desc}) {
final request = UpdateViewRequest.create()..viewId = view.id;
if (name != null) {
request.name = name;
}
if (desc != null) {
request.desc = desc;
}
return WorkspaceEventUpdateView(request).send();
}
Future<Either<Unit, WorkspaceError>> delete() {
final request = QueryViewRequest.create()..viewIds.add(view.id);
return WorkspaceEventDeleteView(request).send();
}
Future<Either<Unit, WorkspaceError>> duplicate() {
final request = QueryViewRequest.create()..viewIds.add(view.id);
return WorkspaceEventDuplicateView(request).send();
}
}
class ViewListenerRepository {
StreamSubscription<SubscribeObject>? _subscription;
PublishNotifier<UpdateNotifierValue> updatedNotifier = PublishNotifier<UpdateNotifierValue>();
PublishNotifier<DeleteNotifierValue> deletedNotifier = PublishNotifier<DeleteNotifierValue>();
PublishNotifier<RestoreNotifierValue> restoredNotifier = PublishNotifier<RestoreNotifierValue>();
late WorkspaceNotificationParser _parser;
View view;
ViewListenerRepository({
required this.view,
});
void start() {
_parser = WorkspaceNotificationParser(
id: view.id,
callback: (ty, result) {
_handleObservableType(ty, result);
},
);
_subscription = RustStreamReceiver.listen((observable) => _parser.parse(observable));
}
void _handleObservableType(WorkspaceNotification ty, Either<Uint8List, WorkspaceError> result) {
switch (ty) {
case WorkspaceNotification.ViewUpdated:
result.fold(
(payload) => updatedNotifier.value = left(View.fromBuffer(payload)),
(error) => updatedNotifier.value = right(error),
);
break;
case WorkspaceNotification.ViewDeleted:
result.fold(
(payload) => deletedNotifier.value = left(View.fromBuffer(payload)),
(error) => deletedNotifier.value = right(error),
);
break;
case WorkspaceNotification.ViewRestored:
result.fold(
(payload) => restoredNotifier.value = left(View.fromBuffer(payload)),
(error) => restoredNotifier.value = right(error),
);
break;
default:
break;
}
}
Future<void> close() async {
await _subscription?.cancel();
}
}
@@ -1,126 +0,0 @@
import 'dart:async';
import 'dart:typed_data';
import 'package:dartz/dartz.dart';
import 'package:flowy_log/flowy_log.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-dart-notify/subject.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/app_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/workspace_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/workspace_query.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/observable.pb.dart';
import 'package:flowy_sdk/rust_stream.dart';
import 'package:app_flowy/workspace/domain/i_workspace.dart';
import 'helper.dart';
class WorkspaceRepo {
UserProfile user;
String workspaceId;
WorkspaceRepo({
required this.user,
required this.workspaceId,
});
Future<Either<App, WorkspaceError>> createApp(String appName, String desc) {
final request = CreateAppRequest.create()
..name = appName
..workspaceId = workspaceId
..desc = desc;
return WorkspaceEventCreateApp(request).send();
}
Future<Either<Workspace, WorkspaceError>> getWorkspace() {
final request = QueryWorkspaceRequest.create()..workspaceId = workspaceId;
return WorkspaceEventReadWorkspaces(request).send().then((result) {
return result.fold(
(workspaces) {
assert(workspaces.items.length == 1);
if (workspaces.items.isEmpty) {
return right(WorkspaceError.create()..msg = "Workspace not found");
} else {
return left(workspaces.items[0]);
}
},
(error) => right(error),
);
});
}
Future<Either<List<App>, WorkspaceError>> getApps() {
final request = QueryWorkspaceRequest.create()..workspaceId = workspaceId;
return WorkspaceEventReadWorkspaceApps(request).send().then((result) {
return result.fold(
(apps) => left(apps.items),
(error) => right(error),
);
});
}
}
class WorkspaceListenerRepo {
StreamSubscription<SubscribeObject>? _subscription;
WorkspaceAppsChangedCallback? _appsChanged;
WorkspaceUpdatedCallback? _update;
late WorkspaceNotificationParser _parser;
final UserProfile user;
final String workspaceId;
WorkspaceListenerRepo({
required this.user,
required this.workspaceId,
});
void startListening({
WorkspaceAppsChangedCallback? appsChanged,
WorkspaceUpdatedCallback? update,
}) {
_appsChanged = appsChanged;
_update = update;
_parser = WorkspaceNotificationParser(
id: workspaceId,
callback: (ty, result) {
_handleObservableType(ty, result);
},
);
_subscription = RustStreamReceiver.listen((observable) => _parser.parse(observable));
}
void _handleObservableType(WorkspaceNotification ty, Either<Uint8List, WorkspaceError> result) {
switch (ty) {
case WorkspaceNotification.WorkspaceUpdated:
if (_update != null) {
result.fold(
(payload) {
final workspace = Workspace.fromBuffer(payload);
_update!(workspace.name, workspace.desc);
},
(error) => Log.error(error),
);
}
break;
case WorkspaceNotification.WorkspaceAppsChanged:
if (_appsChanged != null) {
result.fold(
(payload) => _appsChanged!(
left(RepeatedApp.fromBuffer(payload).items),
),
(error) => _appsChanged!(right(error)),
);
}
break;
default:
break;
}
}
Future<void> close() async {
await _subscription?.cancel();
}
}
@@ -1,55 +0,0 @@
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart';
class BlankStackContext extends HomeStackContext {
final ValueNotifier<bool> _isUpdated = ValueNotifier<bool>(false);
@override
String get identifier => "1";
@override
Widget get leftBarItem => const FlowyText.medium('Blank page', fontSize: 12);
@override
Widget? get rightBarItem => null;
@override
HomeStackType get type => HomeStackType.blank;
@override
Widget buildWidget() {
return const BlankStackPage();
}
@override
List<NavigationItem> get navigationItems => [this];
@override
ValueNotifier<bool> get isUpdated => _isUpdated;
@override
void dispose() {}
}
class BlankStackPage extends StatefulWidget {
const BlankStackPage({Key? key}) : super(key: key);
@override
State<BlankStackPage> createState() => _BlankStackPageState();
}
class _BlankStackPageState extends State<BlankStackPage> {
@override
Widget build(BuildContext context) {
return SizedBox.expand(
child: Container(
color: Theme.of(context).colorScheme.surface,
child: Padding(
padding: const EdgeInsets.all(10),
child: Container(),
),
),
);
}
}
@@ -1,287 +0,0 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/application/doc/share_bloc.dart';
import 'package:app_flowy/workspace/domain/i_view.dart';
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
import 'package:app_flowy/workspace/domain/view_ext.dart';
import 'package:app_flowy/workspace/infrastructure/repos/view_repo.dart';
import 'package:app_flowy/workspace/presentation/widgets/dialogs.dart';
import 'package:app_flowy/workspace/presentation/widgets/pop_up_action.dart';
import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/widget/rounded_button.dart';
import 'package:flowy_log/flowy_log.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/export.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
import 'package:flutter/material.dart';
import 'package:dartz/dartz.dart' as dartz;
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:clipboard/clipboard.dart';
import 'doc_page.dart';
class DocStackContext extends HomeStackContext<int, ShareActionWrapper> {
View _view;
late IViewListener _listener;
final ValueNotifier<int> _isUpdated = ValueNotifier<int>(0);
DocStackContext({required View view, Key? key}) : _view = view {
_listener = getIt<IViewListener>(param1: view);
_listener.updatedNotifier.addPublishListener((result) {
result.fold(
(newView) {
_view = newView;
_isUpdated.value = _view.hashCode;
},
(error) {},
);
});
_listener.start();
}
@override
Widget get leftBarItem => DocLeftBarItem(view: _view);
@override
Widget? get rightBarItem => DocShareButton(view: _view);
@override
String get identifier => _view.id;
@override
HomeStackType get type => _view.stackType();
@override
Widget buildWidget() => DocPage(view: _view, key: ValueKey(_view.id));
@override
List<NavigationItem> get navigationItems => _makeNavigationItems();
@override
ValueNotifier<int> get isUpdated => _isUpdated;
// List<NavigationItem> get navigationItems => naviStacks.map((stack) {
// return NavigationItemImpl(context: stack);
// }).toList();
List<NavigationItem> _makeNavigationItems() {
return [
this,
];
}
@override
void dispose() {
_listener.stop();
}
}
class DocLeftBarItem extends StatefulWidget {
final View view;
DocLeftBarItem({required this.view, Key? key}) : super(key: ValueKey(view.hashCode));
@override
State<DocLeftBarItem> createState() => _DocLeftBarItemState();
}
class _DocLeftBarItemState extends State<DocLeftBarItem> {
final _controller = TextEditingController();
final _focusNode = FocusNode();
late ViewRepository repo;
@override
void initState() {
repo = ViewRepository(view: widget.view);
_focusNode.addListener(_handleFocusChanged);
super.initState();
}
@override
void dispose() {
_controller.dispose();
_focusNode.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
_controller.text = widget.view.name;
final theme = context.watch<AppTheme>();
return IntrinsicWidth(
key: ValueKey(_controller.text),
child: TextField(
controller: _controller,
focusNode: _focusNode,
scrollPadding: EdgeInsets.zero,
decoration: const InputDecoration(
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
isDense: true,
),
style: TextStyle(
color: theme.shader1,
fontSize: 14,
fontWeight: FontWeight.w500,
overflow: TextOverflow.ellipsis,
),
// cursorColor: widget.cursorColor,
// obscureText: widget.enableObscure,
),
);
}
void _handleFocusChanged() {
if (_controller.text.isEmpty) {
_controller.text = widget.view.name;
return;
}
if (_controller.text != widget.view.name) {
repo.updateView(name: _controller.text);
}
}
}
class DocShareButton extends StatelessWidget {
final View view;
DocShareButton({Key? key, required this.view}) : super(key: ValueKey(view.hashCode));
@override
Widget build(BuildContext context) {
double buttonWidth = 60;
return BlocProvider(
create: (context) => getIt<DocShareBloc>(param1: view),
child: BlocListener<DocShareBloc, DocShareState>(
listener: (context, state) {
state.map(
initial: (_) {},
loading: (_) {},
finish: (state) {
state.successOrFail.fold(
_handleExportData,
_handleExportError,
);
},
);
},
child: BlocBuilder<DocShareBloc, DocShareState>(
builder: (context, state) {
return RoundedTextButton(
title: 'Share',
height: 30,
width: buttonWidth,
fontSize: 12,
borderRadius: Corners.s6Border,
color: Colors.lightBlue,
onPressed: () => _showActionList(context, Offset(-(buttonWidth / 2), 10)),
);
},
),
),
);
}
void _handleExportData(ExportData exportData) {
switch (exportData.exportType) {
case ExportType.Link:
// TODO: Handle this case.
break;
case ExportType.Markdown:
FlutterClipboard.copy(exportData.data).then((value) => Log.info('copied to clipboard'));
break;
case ExportType.Text:
// TODO: Handle this case.
break;
}
}
void _handleExportError(WorkspaceError error) {}
void _showActionList(BuildContext context, Offset offset) {
final actionList = ShareActions(onSelected: (result) {
result.fold(() {}, (action) {
switch (action) {
case ShareAction.markdown:
context.read<DocShareBloc>().add(const DocShareEvent.shareMarkdown());
break;
case ShareAction.copyLink:
showWorkInProgressDialog(context);
break;
}
});
});
actionList.show(
context,
context,
anchorDirection: AnchorDirection.bottomWithCenterAligned,
anchorOffset: offset,
);
}
void showWorkInProgressDialog(BuildContext context) {
const FlowyAlertDialog(title: "Work in progress").show(context);
}
}
class ShareActions with ActionList<ShareActionWrapper> implements FlowyOverlayDelegate {
final Function(dartz.Option<ShareAction>) onSelected;
final _items = ShareAction.values.map((action) => ShareActionWrapper(action)).toList();
ShareActions({required this.onSelected});
@override
double get maxWidth => 130;
@override
double get itemHeight => 22;
@override
List<ShareActionWrapper> get items => _items;
@override
void Function(dartz.Option<ShareActionWrapper> p1) get selectCallback => (result) {
result.fold(
() => onSelected(dartz.none()),
(wrapper) => onSelected(
dartz.some(wrapper.inner),
),
);
};
@override
FlowyOverlayDelegate? get delegate => this;
@override
void didRemove() => onSelected(dartz.none());
}
enum ShareAction {
markdown,
copyLink,
}
class ShareActionWrapper extends ActionItem {
final ShareAction inner;
ShareActionWrapper(this.inner);
@override
Widget? get icon => null;
@override
String get name => inner.name;
}
extension QuestionBubbleExtension on ShareAction {
String get name {
switch (this) {
case ShareAction.markdown:
return "Markdown";
case ShareAction.copyLink:
return "Copy Link";
}
}
}
@@ -1,57 +0,0 @@
import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/buttons/base_styled_button.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class DocBanner extends StatelessWidget {
final void Function() onRestore;
final void Function() onDelete;
const DocBanner({required this.onRestore, required this.onDelete, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final theme = context.watch<AppTheme>();
// [[Row]] CrossAxisAlignment vs mainAxisAlignment
// https://stackoverflow.com/questions/53850149/flutter-crossaxisalignment-vs-mainaxisalignment
return ConstrainedBox(
constraints: const BoxConstraints(minHeight: 60),
child: Container(
color: theme.main1,
child: Row(
children: [
const FlowyText.medium('This page is in Trash', color: Colors.white),
const HSpace(20),
BaseStyledButton(
minWidth: 160,
minHeight: 40,
contentPadding: EdgeInsets.zero,
bgColor: Colors.transparent,
hoverColor: theme.main2,
downColor: theme.main1,
outlineColor: Colors.white,
borderRadius: Corners.s8Border,
child: const FlowyText.medium('Restore page', color: Colors.white, fontSize: 14),
onPressed: onRestore),
const HSpace(20),
BaseStyledButton(
minWidth: 220,
minHeight: 40,
contentPadding: EdgeInsets.zero,
bgColor: Colors.transparent,
hoverColor: theme.main2,
downColor: theme.main1,
outlineColor: Colors.white,
borderRadius: Corners.s8Border,
child: const FlowyText.medium('Delete permanently', color: Colors.white, fontSize: 14),
onPressed: onDelete),
],
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
),
),
);
}
}
@@ -1,83 +0,0 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
import 'package:flowy_log/flowy_log.dart';
import 'package:flutter/material.dart';
import 'package:time/time.dart';
// [[diagram: HomeStack's widget structure]]
//
// ┌──────────────────┐ ┌───────────────┐
// ┌──│BlankStackContext │──▶│BlankStackPage │
// ┌──────────┐ ┌───────────────────┐ ┌─────────────────┐ │ └──────────────────┘ └───────────────┘
// │HomeStack │─▶│ HomeStackManager │──▶│HomeStackContext │◀─┤
// └──────────┘ └───────────────────┘ └─────────────────┘ │ ┌─────────────────┐ ┌────────────┐
// └──│ DocStackContext │───▶│DocStackPage│
// └─────────────────┘ └────────────┘
//
//
class HomeStack extends StatelessWidget {
static GlobalKey<ScaffoldState> scaffoldKey = GlobalKey();
// final Size size;
const HomeStack({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
Log.info('HomePage build');
return Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
getIt<HomeStackManager>().stackTopBar(),
Expanded(
child: Container(
color: Colors.white,
child: FocusTraversalGroup(
child: getIt<HomeStackManager>().stackWidget(),
),
),
),
],
);
}
}
class FadingIndexedStack extends StatefulWidget {
final int index;
final List<Widget> children;
final Duration duration;
const FadingIndexedStack({
Key? key,
required this.index,
required this.children,
this.duration = const Duration(
milliseconds: 250,
),
}) : super(key: key);
@override
_FadingIndexedStackState createState() => _FadingIndexedStackState();
}
class _FadingIndexedStackState extends State<FadingIndexedStack> {
double _targetOpacity = 1;
@override
void didUpdateWidget(FadingIndexedStack oldWidget) {
if (oldWidget.index == widget.index) return;
setState(() => _targetOpacity = 0);
Future.delayed(1.milliseconds, () => setState(() => _targetOpacity = 1));
super.didUpdateWidget(oldWidget);
}
@override
Widget build(BuildContext context) {
return TweenAnimationBuilder<double>(
duration: _targetOpacity > 0 ? widget.duration : 0.milliseconds,
tween: Tween(begin: 0, end: _targetOpacity),
builder: (_, value, child) {
return Opacity(opacity: value, child: child);
},
child: IndexedStack(index: widget.index, children: widget.children),
);
}
}
@@ -1,65 +0,0 @@
import 'package:app_flowy/workspace/domain/image.dart';
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
import 'package:app_flowy/workspace/presentation/home/home_sizes.dart';
import 'package:app_flowy/workspace/presentation/home/navigation.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-workspace-infra/view_create.pbenum.dart';
import 'package:flutter/material.dart';
import 'package:flowy_infra_ui/style_widget/extension.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:provider/provider.dart';
class HomeTopBar extends StatelessWidget {
const HomeTopBar({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
height: HomeSizes.topBarHeight,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const FlowyNavigation(),
const HSpace(16),
ChangeNotifierProvider.value(
value: Provider.of<HomeStackNotifier>(context, listen: false),
child: Consumer(
builder: (BuildContext context, HomeStackNotifier notifier, Widget? child) {
return notifier.stackContext.rightBarItem ?? const SizedBox();
},
),
) // _renderMoreButton(),
],
)
.padding(
horizontal: HomeInsets.topBarTitlePadding,
)
.bottomBorder(color: Colors.grey.shade300),
);
}
}
class HomeTitle extends StatelessWidget {
final String title;
final ViewType type;
const HomeTitle({
Key? key,
required this.title,
required this.type,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Flexible(
child: Row(
children: [
Image(fit: BoxFit.scaleDown, width: 15, height: 15, image: assetImageForViewType(type)),
const HSpace(6),
FlowyText(title, fontSize: 16),
],
),
);
}
}
@@ -1 +0,0 @@
export 'menu.dart';
@@ -1,36 +0,0 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
import 'package:app_flowy/workspace/presentation/stack_page/trash/trash_page.dart';
import 'package:app_flowy/workspace/presentation/widgets/menu/menu.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
class MenuTrash extends StatelessWidget {
const MenuTrash({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
height: 26,
child: InkWell(
onTap: () {
Provider.of<MenuSharedState>(context, listen: false).selectedView.value = null;
getIt<HomeStackManager>().setStack(TrashStackContext());
},
child: _render(context),
),
);
}
Widget _render(BuildContext context) {
return Row(children: [
SizedBox(width: 16, height: 16, child: svg("home/trash")),
const HSpace(6),
const FlowyText.medium('Trash', fontSize: 12),
]);
}
}
@@ -1,32 +0,0 @@
import 'package:app_flowy/workspace/application/menu/menu_bloc.dart';
import 'package:app_flowy/workspace/presentation/home/home_sizes.dart';
import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class MenuTopBar extends StatelessWidget {
const MenuTopBar({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return BlocBuilder<MenuBloc, MenuState>(
builder: (context, state) {
return SizedBox(
height: HomeSizes.topBarHeight,
child: Row(
children: [
svgWithSize("flowy_logo_with_text", const Size(92, 17)),
const Spacer(),
FlowyIconButton(
width: 28,
onPressed: () => context.read<MenuBloc>().add(const MenuEvent.collapse()),
iconPadding: const EdgeInsets.fromLTRB(4, 4, 4, 4),
icon: svg("home/hide_menu"),
)
],
),
);
},
);
}
}
@@ -1,5 +0,0 @@
export '../stack_page/blank/blank_page.dart';
export './edit_pannel/edit_pannel.dart';
export './edit_pannel/pannel_animation.dart';
export './home_top_bar.dart';
export 'menu/menu.dart';
-73
View File
@@ -1,73 +0,0 @@
PODS:
- flowy_editor (0.0.1):
- FlutterMacOS
- flowy_infra_ui (0.0.1):
- FlutterMacOS
- flowy_sdk (0.0.1):
- FlutterMacOS
- FlutterMacOS (1.0.0)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- package_info_plus_macos (0.0.1):
- FlutterMacOS
- path_provider_macos (0.0.1):
- FlutterMacOS
- sqflite (0.0.2):
- FlutterMacOS
- FMDB (>= 2.7.5)
- url_launcher_macos (0.0.1):
- FlutterMacOS
- window_size (0.0.2):
- FlutterMacOS
DEPENDENCIES:
- flowy_editor (from `Flutter/ephemeral/.symlinks/plugins/flowy_editor/macos`)
- flowy_infra_ui (from `Flutter/ephemeral/.symlinks/plugins/flowy_infra_ui/macos`)
- flowy_sdk (from `Flutter/ephemeral/.symlinks/plugins/flowy_sdk/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- package_info_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos`)
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
- sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- window_size (from `Flutter/ephemeral/.symlinks/plugins/window_size/macos`)
SPEC REPOS:
trunk:
- FMDB
EXTERNAL SOURCES:
flowy_editor:
:path: Flutter/ephemeral/.symlinks/plugins/flowy_editor/macos
flowy_infra_ui:
:path: Flutter/ephemeral/.symlinks/plugins/flowy_infra_ui/macos
flowy_sdk:
:path: Flutter/ephemeral/.symlinks/plugins/flowy_sdk/macos
FlutterMacOS:
:path: Flutter/ephemeral
package_info_plus_macos:
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus_macos/macos
path_provider_macos:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
sqflite:
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
window_size:
:path: Flutter/ephemeral/.symlinks/plugins/window_size/macos
SPEC CHECKSUMS:
flowy_editor: 26060a984848e6afac1f6a4455511f4114119d8d
flowy_infra_ui: 9d5021b1610fe0476eb1191bf7cd41c4a4138d8f
flowy_sdk: c302ac0a22dea596db0df8073b9637b2bf2ff6fd
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
package_info_plus_macos: f010621b07802a241d96d01876d6705f15e77c1c
path_provider_macos: 160cab0d5461f0c0e02995469a98f24bdb9a3f1f
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea
url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4
window_size: 339dafa0b27a95a62a843042038fa6c3c48de195
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
COCOAPODS: 1.10.1
-10
View File
@@ -1,10 +0,0 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: b7d4806243a4e906bf061f79a0e314ba28111aa6
channel: dev
project_type: plugin
-19
View File
@@ -1,19 +0,0 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "flowy_editor",
"request": "launch",
"type": "dart"
},
{
"name": "flowy_editor example",
"cwd": "example",
"request": "launch",
"type": "dart"
}
]
}
@@ -1,8 +0,0 @@
include: package:pedantic/analysis_options.yaml
analyzer:
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
# https://dart.dev/guides/language/analysis-options
@@ -1,40 +0,0 @@
group 'com.plugin.flowy_editor'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
rootProject.allprojects {
repositories {
google()
jcenter()
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 16
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
@@ -1 +0,0 @@
rootProject.name = 'flowy_editor'
@@ -1,3 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.plugin.flowy_editor">
</manifest>
@@ -1,36 +0,0 @@
package com.plugin.flowy_editor
import androidx.annotation.NonNull
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.PluginRegistry.Registrar
/** FlowyEditorPlugin */
class FlowyEditorPlugin: FlutterPlugin, MethodCallHandler {
/// The MethodChannel that will the communication between Flutter and native Android
///
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
/// when the Flutter Engine is detached from the Activity
private lateinit var channel : MethodChannel
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flowy_editor")
channel.setMethodCallHandler(this)
}
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
if (call.method == "getPlatformVersion") {
result.success("Android ${android.os.Build.VERSION.RELEASE}")
} else {
result.notImplemented()
}
}
override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
channel.setMethodCallHandler(null)
}
}
@@ -1,10 +0,0 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: b7d4806243a4e906bf061f79a0e314ba28111aa6
channel: dev
project_type: app
Loaded 100 of 2447 files, more files were not shown because too many files have changed in this diff. Show more