Compare commits
898
Commits
0.0.1
...
0.0.4_beta.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a19536d525 | ||
|
|
16a167c19c | ||
|
|
d0d8295e15 | ||
|
|
ac584fb7ef | ||
|
|
f5b140a4d9 | ||
|
|
31b2ace48f | ||
|
|
6af78641d2 | ||
|
|
82840e1201 | ||
|
|
f438898831 | ||
|
|
2dd5930560 | ||
|
|
9d629412c8 | ||
|
|
43095cb0dd | ||
|
|
5db5fd118e | ||
|
|
5d9763ff7f | ||
|
|
df6871e777 | ||
|
|
fbb2f49b6f | ||
|
|
f01d3250ae | ||
|
|
420b8ca05d | ||
|
|
a755d52371 | ||
|
|
b92660058c | ||
|
|
d08f298fb6 | ||
|
|
b93feb49c3 | ||
|
|
ed10ebac7a | ||
|
|
ce85050114 | ||
|
|
a53ffdfade | ||
|
|
8a94644add | ||
|
|
0ba0bb62ce | ||
|
|
953af35029 | ||
|
|
1e997ccaad | ||
|
|
fc4ed6c057 | ||
|
|
fc77e0857a | ||
|
|
59fbe02ded | ||
|
|
4f2c733746 | ||
|
|
a035228798 | ||
|
|
6de7933a2f | ||
|
|
5e686906ec | ||
|
|
1f657f3bf8 | ||
|
|
7b98e8dbca | ||
|
|
814fdfe8e9 | ||
|
|
ef008a7b0b | ||
|
|
9073351cbb | ||
|
|
65993b7205 | ||
|
|
11627269be | ||
|
|
e15d335fed | ||
|
|
c82c6d9c6e | ||
|
|
bf8a752b4d | ||
|
|
a3770a699c | ||
|
|
d09a5bf42b | ||
|
|
6a36e2bcfd | ||
|
|
c7a3bb73b9 | ||
|
|
2607822412 | ||
|
|
99d827f07d | ||
|
|
5358203a46 | ||
|
|
271a8485b6 | ||
|
|
1abf0b565f | ||
|
|
5c3500e24c | ||
|
|
aa9e3d065b | ||
|
|
6a94594a35 | ||
|
|
5d007c5359 | ||
|
|
147e948b35 | ||
|
|
6ac2617113 | ||
|
|
ca45673a9e | ||
|
|
2262dd0d7b | ||
|
|
82eed0506b | ||
|
|
915d71991a | ||
|
|
e0b969595c | ||
|
|
80f82fa5b1 | ||
|
|
3749168861 | ||
|
|
c3c75dde9f | ||
|
|
7c6a857a69 | ||
|
|
4b27fef76e | ||
|
|
547b8ec29c | ||
|
|
065a72a8da | ||
|
|
55b888e364 | ||
|
|
0c1670cdab | ||
|
|
32aa19dc39 | ||
|
|
dd589e0768 | ||
|
|
47e2571f38 | ||
|
|
4a797fcf96 | ||
|
|
f829c63bd2 | ||
|
|
d2080a6c03 | ||
|
|
35e27b579f | ||
|
|
8b7eee46bb | ||
|
|
c7bba01fe5 | ||
|
|
b65b4796d2 | ||
|
|
16598650ff | ||
|
|
28948e567c | ||
|
|
90e7873135 | ||
|
|
2eccd0452b | ||
|
|
3fdf922f81 | ||
|
|
694963a47d | ||
|
|
188302d4ba | ||
|
|
2bbcfaf3ce | ||
|
|
475d511829 | ||
|
|
1f30a77f1d | ||
|
|
c77a31806d | ||
|
|
6a3820253f | ||
|
|
b1d87d95cf | ||
|
|
27628cc78e | ||
|
|
d6a1afe326 | ||
|
|
f181ce106d | ||
|
|
318d7e6456 | ||
|
|
05bcd38534 | ||
|
|
9a40fc9974 | ||
|
|
4730ca9302 | ||
|
|
1237962ab2 | ||
|
|
34530a58ec | ||
|
|
7fd06361b3 | ||
|
|
694c612c67 | ||
|
|
8c148e3b67 | ||
|
|
b3ed254caf | ||
|
|
47081f3095 | ||
|
|
50f32521c5 | ||
|
|
46be04f94e | ||
|
|
196d254278 | ||
|
|
d101509b32 | ||
|
|
572e38ec1c | ||
|
|
baa70f2ee6 | ||
|
|
1e6d82c0ec | ||
|
|
6579940dc8 | ||
|
|
df399d3f35 | ||
|
|
e11176436d | ||
|
|
9a791974b4 | ||
|
|
cea7d30a53 | ||
|
|
7ac6a1dc89 | ||
|
|
e45be3b81e | ||
|
|
fe8811392b | ||
|
|
321682717c | ||
|
|
00db755c29 | ||
|
|
808d848f62 | ||
|
|
54cf451826 | ||
|
|
0502eec717 | ||
|
|
1c1e955151 | ||
|
|
733b6f7176 | ||
|
|
a323073244 | ||
|
|
05441f865e | ||
|
|
9bb516786e | ||
|
|
264166fa29 | ||
|
|
1b80934899 | ||
|
|
5c155a07bf | ||
|
|
11ceb96f65 | ||
|
|
8029f1035d | ||
|
|
d0b457c007 | ||
|
|
9125db7ef0 | ||
|
|
49807a0b57 | ||
|
|
67e6b091a5 | ||
|
|
477fa5f4f6 | ||
|
|
0bbf17f776 | ||
|
|
03f34b143d | ||
|
|
4187e99433 | ||
|
|
5549cff177 | ||
|
|
84afc50cd3 | ||
|
|
383925ba55 | ||
|
|
2e6dd39780 | ||
|
|
0e8ac4828b | ||
|
|
be14a6b0ad | ||
|
|
31467d3e98 | ||
|
|
c2f2ad24db | ||
|
|
853d9e8968 | ||
|
|
33c758e711 | ||
|
|
e7033aa6e8 | ||
|
|
8a0308703e | ||
|
|
b16b61f46c | ||
|
|
6eddb7c8c5 | ||
|
|
cace6248e0 | ||
|
|
dd61dd4d2f | ||
|
|
d1ce1686a4 | ||
|
|
7a36fed778 | ||
|
|
65917da468 | ||
|
|
64d651ab13 | ||
|
|
4180765dc6 | ||
|
|
afab7f23c4 | ||
|
|
289b3e31e7 | ||
|
|
871d0bb7be | ||
|
|
156d38179a | ||
|
|
a979037644 | ||
|
|
b6de0caad6 | ||
|
|
95d33c75a5 | ||
|
|
6509247fbd | ||
|
|
8128283ad4 | ||
|
|
9112bbbcd3 | ||
|
|
d1e1813002 | ||
|
|
8747457836 | ||
|
|
d9f7b1047d | ||
|
|
74831964a6 | ||
|
|
d00425d50b | ||
|
|
5d09e1509d | ||
|
|
11fee0a815 | ||
|
|
4cf509d695 | ||
|
|
8f50d0c6dc | ||
|
|
912fb0b9da | ||
|
|
3021bdc1af | ||
|
|
23ccfa54b5 | ||
|
|
d18e06a9ef | ||
|
|
c843571e3d | ||
|
|
e282a7672f | ||
|
|
d6770c6690 | ||
|
|
01985848f9 | ||
|
|
0a9fb53ef8 | ||
|
|
e9226243df | ||
|
|
2d7d61bdaa | ||
|
|
3eacf70edd | ||
|
|
cebf097fb2 | ||
|
|
6078e46d3d | ||
|
|
349a8350c3 | ||
|
|
d13a6b9649 | ||
|
|
d5cc168d75 | ||
|
|
926b1666dd | ||
|
|
8bdcb43332 | ||
|
|
f8f77db79b | ||
|
|
be3141b08e | ||
|
|
87cc542275 | ||
|
|
441627783b | ||
|
|
03192f8d7e | ||
|
|
ed9a48fc1c | ||
|
|
93695dc4be | ||
|
|
62c104179a | ||
|
|
b855a1199d | ||
|
|
5fdeff83dd | ||
|
|
959b2db9a3 | ||
|
|
d30ac55b0f | ||
|
|
67a3ba6b34 | ||
|
|
74ca10cf28 | ||
|
|
4bcc05fc8a | ||
|
|
c5759baea4 | ||
|
|
0c9fc35cb3 | ||
|
|
d05e4bbc82 | ||
|
|
aa77d52b58 | ||
|
|
6ffa1ad191 | ||
|
|
3a2424cda3 | ||
|
|
288afbe68b | ||
|
|
c1237452ab | ||
|
|
6e1c6d7a47 | ||
|
|
6ae8efbdfe | ||
|
|
a0654d8a41 | ||
|
|
a829d2ac61 | ||
|
|
3bfda80911 | ||
|
|
0b2bb33b73 | ||
|
|
b8a4897056 | ||
|
|
3028195e5e | ||
|
|
fe3533cb2c | ||
|
|
06d3aace92 | ||
|
|
3f90170c71 | ||
|
|
ef770980f5 | ||
|
|
b5d463578a | ||
|
|
ca0851418e | ||
|
|
a6221d34cb | ||
|
|
7eada39a8b | ||
|
|
23795e1b67 | ||
|
|
7314f02282 | ||
|
|
e3d9d4c42a | ||
|
|
22742c904b | ||
|
|
9012494e1f | ||
|
|
c9424c5d55 | ||
|
|
cdec567cbb | ||
|
|
33358c2a04 | ||
|
|
e9ba9ad149 | ||
|
|
7d93ed8e81 | ||
|
|
860ebc567b | ||
|
|
bf7e1b9829 | ||
|
|
0b0cbe192b | ||
|
|
0acb7063ed | ||
|
|
cf1ecaf89b | ||
|
|
2781809f87 | ||
|
|
6fc8197468 | ||
|
|
c559c5cc6b | ||
|
|
2c3aade0f9 | ||
|
|
dd8c26df02 | ||
|
|
dd832b7482 | ||
|
|
cea62a5c8e | ||
|
|
7820c8e70d | ||
|
|
bde597a10b | ||
|
|
6593855f8f | ||
|
|
dab835ad86 | ||
|
|
06967d8057 | ||
|
|
ceaf1ccc21 | ||
|
|
33ff6b2f23 | ||
|
|
eda5d9f4f9 | ||
|
|
5c74e1d667 | ||
|
|
e1f9260982 | ||
|
|
a7819c6456 | ||
|
|
373407fd57 | ||
|
|
47d17e6bb2 | ||
|
|
91b1430e7b | ||
|
|
7335119933 | ||
|
|
6061dc1989 | ||
|
|
c760ca6788 | ||
|
|
5a0f87fe02 | ||
|
|
2a6ce12a55 | ||
|
|
0aed86737f | ||
|
|
afd8335e95 | ||
|
|
cd013529d4 | ||
|
|
bf3a0b6e5b | ||
|
|
0933935071 | ||
|
|
427d2c2e25 | ||
|
|
aecf29ddca | ||
|
|
f65ee293ae | ||
|
|
e9712540a1 | ||
|
|
bcf9e83fd7 | ||
|
|
fa33f0c21b | ||
|
|
257ea11ce6 | ||
|
|
ddcbd25fae | ||
|
|
9b8c110a66 | ||
|
|
320aea039a | ||
|
|
9434bff9c9 | ||
|
|
ff203a91eb | ||
|
|
afa629a2b4 | ||
|
|
f192406afd | ||
|
|
4e2bd6ba74 | ||
|
|
53e2fbad3d | ||
|
|
4ba1ba00a5 | ||
|
|
5ceaee415c | ||
|
|
bf36cbccbb | ||
|
|
6d4335ae04 | ||
|
|
bbbf3006c9 | ||
|
|
fa57de5419 | ||
|
|
04f61cdf5e | ||
|
|
983fed16dc | ||
|
|
e0495b65ab | ||
|
|
45826b5571 | ||
|
|
8df2dccfce | ||
|
|
686507cd67 | ||
|
|
487e5035bb | ||
|
|
f872c6c1f8 | ||
|
|
08433defd8 | ||
|
|
68dfde4cf8 | ||
|
|
d6409e5889 | ||
|
|
ebfddc744b | ||
|
|
c407c38dc3 | ||
|
|
ddc2926c9b | ||
|
|
17c8f9fdde | ||
|
|
82ac2a5d79 | ||
|
|
5809758539 | ||
|
|
93863462a2 | ||
|
|
7cceafa432 | ||
|
|
4b63170e56 | ||
|
|
1c3c519b14 | ||
|
|
7646f984e0 | ||
|
|
32e0b5e96d | ||
|
|
30bedb337f | ||
|
|
832db73410 | ||
|
|
837666d36d | ||
|
|
10187ce049 | ||
|
|
68b0730dda | ||
|
|
1ab3f42477 | ||
|
|
15d91d3cbe | ||
|
|
f55de1fd17 | ||
|
|
014ff27881 | ||
|
|
dd3f1d0b24 | ||
|
|
561aa348e9 | ||
|
|
79d30eb84d | ||
|
|
d0b02cb4fd | ||
|
|
9135b92a39 | ||
|
|
ecf2598be7 | ||
|
|
59aed762e7 | ||
|
|
337161c3d7 | ||
|
|
9f8e3b09c3 | ||
|
|
0c6903f793 | ||
|
|
084e9c5f6f | ||
|
|
680d130986 | ||
|
|
248473dddf | ||
|
|
67dff1720b | ||
|
|
cac0dcaf7f | ||
|
|
c5aefeb45e | ||
|
|
e1f6e483e7 | ||
|
|
1796d0a448 | ||
|
|
f1a8919772 | ||
|
|
28e3cb35b8 | ||
|
|
62bafce0b2 | ||
|
|
e9ba1e1886 | ||
|
|
0d47397851 | ||
|
|
592e91bed4 | ||
|
|
0758db971b | ||
|
|
662220ab8a | ||
|
|
18407a0e47 | ||
|
|
cb57d20bfb | ||
|
|
a6f675c1d9 | ||
|
|
ec4d69e5b8 | ||
|
|
e65a320c00 | ||
|
|
5519dcd525 | ||
|
|
92b3f3e769 | ||
|
|
ef1d10b377 | ||
|
|
ea0179536d | ||
|
|
b21498dc9b | ||
|
|
062873a1fe | ||
|
|
177ed8d51a | ||
|
|
728d60239a | ||
|
|
df5e178c6c | ||
|
|
be806e301c | ||
|
|
8127e47cea | ||
|
|
99cadf98d2 | ||
|
|
aaca3ba90d | ||
|
|
6e8c3c821a | ||
|
|
f709bb6a6d | ||
|
|
4aa51a933d | ||
|
|
df642b54f6 | ||
|
|
204c0a90f2 | ||
|
|
2090c36f71 | ||
|
|
fcc6f51b3b | ||
|
|
a48031df7c | ||
|
|
442bf57e44 | ||
|
|
195bb9edcb | ||
|
|
fccd8ad4b9 | ||
|
|
0159414cac | ||
|
|
3a1136a8fb | ||
|
|
513423a9be | ||
|
|
3e3ac9503c | ||
|
|
5a3099e323 | ||
|
|
68d4c6dbdb | ||
|
|
595cfed892 | ||
|
|
d7b936a017 | ||
|
|
835a64ca75 | ||
|
|
214946cbbc | ||
|
|
8e14f8b9f1 | ||
|
|
95247bc5fb | ||
|
|
578bf963f7 | ||
|
|
6ea43cd5e5 | ||
|
|
1c6b78e7d4 | ||
|
|
beb844da17 | ||
|
|
ef8624e87c | ||
|
|
564af73076 | ||
|
|
814f9f4c19 | ||
|
|
1c2c1e6250 | ||
|
|
8449f736e7 | ||
|
|
80242afb93 | ||
|
|
17e82f98d5 | ||
|
|
774d9ddcf6 | ||
|
|
df0e128810 | ||
|
|
e98972cebc | ||
|
|
c9c2ea74ad | ||
|
|
e77e6d275f | ||
|
|
2fa99a563c | ||
|
|
17955bcf43 | ||
|
|
eff62b24fb | ||
|
|
6b314ea283 | ||
|
|
75bc7495bd | ||
|
|
c95fdc4782 | ||
|
|
9f54be3fcc | ||
|
|
8eaec5e58c | ||
|
|
cc86089715 | ||
|
|
f0f4bc0b30 | ||
|
|
1cd1d49c07 | ||
|
|
4cdf3e3e3e | ||
|
|
61dd68199e | ||
|
|
49f1a96cda | ||
|
|
d333f754c2 | ||
|
|
44af890f05 | ||
|
|
353bdc592b | ||
|
|
22c8850cea | ||
|
|
d97abcc99f | ||
|
|
f90e3b63cd | ||
|
|
48e9e75cc7 | ||
|
|
7f8c0ed53f | ||
|
|
bba8f8ae01 | ||
|
|
a9eec5baed | ||
|
|
24c1817c8d | ||
|
|
d5ffeb3c8a | ||
|
|
10d99bdd8b | ||
|
|
8fa3590661 | ||
|
|
cfb589dda1 | ||
|
|
dccbd45a00 | ||
|
|
fa91654f68 | ||
|
|
2031368ac3 | ||
|
|
23c4924532 | ||
|
|
ccb7d0181f | ||
|
|
1313178924 | ||
|
|
222067ec5a | ||
|
|
1e66aae051 | ||
|
|
9d8db6e746 | ||
|
|
1c8d5a782b | ||
|
|
cae691df9a | ||
|
|
27f900753e | ||
|
|
dc05a4cc65 | ||
|
|
4da2dadf69 | ||
|
|
33212df63a | ||
|
|
d1c5df4b88 | ||
|
|
130923af55 | ||
|
|
fa006e0b99 | ||
|
|
584af6aa71 | ||
|
|
2317f1682c | ||
|
|
8c17e96c51 | ||
|
|
ffa9d7bbf4 | ||
|
|
c1ccad104b | ||
|
|
907b10b783 | ||
|
|
fd98b192af | ||
|
|
324dc53e5f | ||
|
|
0ed1847672 | ||
|
|
03e58a90d2 | ||
|
|
01d2860948 | ||
|
|
b2eb964045 | ||
|
|
afeda52419 | ||
|
|
44ff74a37c | ||
|
|
cfeb408bab | ||
|
|
7f1a0adf13 | ||
|
|
3eff006d6d | ||
|
|
6bca483c28 | ||
|
|
02201c238c | ||
|
|
13aba928c3 | ||
|
|
3964508cd8 | ||
|
|
f9b552395b | ||
|
|
dac86ef857 | ||
|
|
718613de42 | ||
|
|
554cfb53e5 | ||
|
|
0fba8d9195 | ||
|
|
3c819ead49 | ||
|
|
60e9071685 | ||
|
|
4bdd9df54c | ||
|
|
e7aad4045b | ||
|
|
855d396122 | ||
|
|
2ae4762de8 | ||
|
|
95378dd73a | ||
|
|
46a3eb57fa | ||
|
|
5e56f5e0ec | ||
|
|
08a43c03d4 | ||
|
|
7e7254b306 | ||
|
|
c456687a18 | ||
|
|
1e0cef41a9 | ||
|
|
287698be9e | ||
|
|
f66ea6d224 | ||
|
|
28d8a3a269 | ||
|
|
2a134bcb40 | ||
|
|
956ad1b590 | ||
|
|
1cfcbbc35b | ||
|
|
9ca2d60f3f | ||
|
|
b239f28d10 | ||
|
|
4fd9388b79 | ||
|
|
a488944d2c | ||
|
|
53126c47d1 | ||
|
|
85ad90fc51 | ||
|
|
ddd0dec5c3 | ||
|
|
33d82a5104 | ||
|
|
2e047de2a2 | ||
|
|
1846f86dd7 | ||
|
|
b354fb79c8 | ||
|
|
96f6a1d37c | ||
|
|
3fd3389f62 | ||
|
|
7b772a8a6e | ||
|
|
89bff10c84 | ||
|
|
af08c55ebf | ||
|
|
661940f728 | ||
|
|
951584c2ab | ||
|
|
1a869c0003 | ||
|
|
12e8424e8a | ||
|
|
df5266d7c9 | ||
|
|
a654623c12 | ||
|
|
09ef0927f7 | ||
|
|
45821f00a2 | ||
|
|
282ed9067a | ||
|
|
f17f0dd6cf | ||
|
|
152cb17701 | ||
|
|
e4e40ebe20 | ||
|
|
049b8828fe | ||
|
|
a0e6c61f50 | ||
|
|
bbc9190bc0 | ||
|
|
0c7c3621d7 | ||
|
|
2b9ce79ed4 | ||
|
|
95e0418d97 | ||
|
|
e069bfb057 | ||
|
|
463cab6eee | ||
|
|
64ea2d4f31 | ||
|
|
777082c879 | ||
|
|
cb4398eab0 | ||
|
|
eb601932ea | ||
|
|
da4f7f40e7 | ||
|
|
da1ed0c320 | ||
|
|
dd5d745c31 | ||
|
|
cd85f3f464 | ||
|
|
bda6840523 | ||
|
|
bc645af3e2 | ||
|
|
c2196c7dba | ||
|
|
6325bd300b | ||
|
|
547be89b72 | ||
|
|
e0e48f1e99 | ||
|
|
3d67c0698a | ||
|
|
9fc13c7d62 | ||
|
|
7270c578e9 | ||
|
|
b25db57fca | ||
|
|
adce96f15b | ||
|
|
d9421f70a0 | ||
|
|
b04111e5a3 | ||
|
|
b22b8ab3a0 | ||
|
|
b66f46108d | ||
|
|
e55b79d3e6 | ||
|
|
d3a00b14b0 | ||
|
|
ef491f4276 | ||
|
|
f0b61546fe | ||
|
|
16c702b1e1 | ||
|
|
936e133624 | ||
|
|
77be3e9c71 | ||
|
|
79aa20d662 | ||
|
|
987a246c80 | ||
|
|
baade1f5d4 | ||
|
|
7a264dba6a | ||
|
|
fc74b2b962 | ||
|
|
d445aeb304 | ||
|
|
cdb36f9526 | ||
|
|
327fa0c811 | ||
|
|
1744938a51 | ||
|
|
913da7ce5b | ||
|
|
a93d7e1987 | ||
|
|
405c618d27 | ||
|
|
6f5e19d053 | ||
|
|
4a46bf3fa3 | ||
|
|
9b85349650 | ||
|
|
b413fade91 | ||
|
|
72a851bd7e | ||
|
|
4a49669cc5 | ||
|
|
869399eb16 | ||
|
|
511b6658a4 | ||
|
|
ef6e777ec0 | ||
|
|
446da06212 | ||
|
|
a8b42cbc95 | ||
|
|
84d5d2c2f1 | ||
|
|
c93e73d3d1 | ||
|
|
1b1ab4ad26 | ||
|
|
013d8f753a | ||
|
|
2e24ae65fd | ||
|
|
72a8f7a9e3 | ||
|
|
75f021744b | ||
|
|
6f05d317e9 | ||
|
|
a5facab7e3 | ||
|
|
72fef86e28 | ||
|
|
5946dd0b7b | ||
|
|
8adc4501ef | ||
|
|
5b7e6690f8 | ||
|
|
bf344685e6 | ||
|
|
31086ad4df | ||
|
|
ab214d4a74 | ||
|
|
df432d11c3 | ||
|
|
dfa9c04f5a | ||
|
|
54cd9eca8c | ||
|
|
0231ad3adf | ||
|
|
90e3ba14f1 | ||
|
|
94dc76d1a9 | ||
|
|
66defa85f6 | ||
|
|
c2f4ee4cac | ||
|
|
31ced8bde7 | ||
|
|
d3bfca10e9 | ||
|
|
d80061461b | ||
|
|
85cc9b60d9 | ||
|
|
c8f6f4861b | ||
|
|
b73f35b18c | ||
|
|
69ee8aff55 | ||
|
|
aeb448c4de | ||
|
|
34441ee076 | ||
|
|
d283d29202 | ||
|
|
45d9a0918f | ||
|
|
3fa0f97e74 | ||
|
|
909406bf08 | ||
|
|
0172fc71db | ||
|
|
6b338d4cc5 | ||
|
|
7ac55f29db | ||
|
|
4450d4410b | ||
|
|
23f4684d3f | ||
|
|
8a9a23ddbe | ||
|
|
2f413a8e67 | ||
|
|
8457682092 | ||
|
|
6298a0d96d | ||
|
|
29c14949cb | ||
|
|
cea83238eb | ||
|
|
e28b1ab8b3 | ||
|
|
2aaa076592 | ||
|
|
b8ce9b9afb | ||
|
|
90cac1819a | ||
|
|
a519e96b17 | ||
|
|
a935f25344 | ||
|
|
5a89655982 | ||
|
|
52d510691f | ||
|
|
ee9884ba34 | ||
|
|
90b5eca5d9 | ||
|
|
bb07eeb2e2 | ||
|
|
b701abed12 | ||
|
|
2e7ab3000f | ||
|
|
ce8805aff8 | ||
|
|
31efacb274 | ||
|
|
63082418be | ||
|
|
c649673b2b | ||
|
|
76691e3e8c | ||
|
|
e7cc11cc44 | ||
|
|
6fa7b0632a | ||
|
|
2514a65617 | ||
|
|
643bb25e2b | ||
|
|
67ef72ee41 | ||
|
|
719c2d10c7 | ||
|
|
0999263902 | ||
|
|
83b30a2185 | ||
|
|
31d3ffb664 | ||
|
|
739333c29c | ||
|
|
24ea68c605 | ||
|
|
06a91b02fb | ||
|
|
6653385a85 | ||
|
|
6e51173335 | ||
|
|
b17a3f50db | ||
|
|
cb802c3162 | ||
|
|
76c1cd70a5 | ||
|
|
8f582faffe | ||
|
|
5f064b8118 | ||
|
|
e46326f775 | ||
|
|
cdc6da835e | ||
|
|
10febe2497 | ||
|
|
d1364354ff | ||
|
|
488ba00456 | ||
|
|
e1ed027b9c | ||
|
|
6504863586 | ||
|
|
d33f646790 | ||
|
|
d6b5e4c404 | ||
|
|
6b7a46e781 | ||
|
|
aa86a44af8 | ||
|
|
8259752958 | ||
|
|
826be05494 | ||
|
|
2d058ea100 | ||
|
|
d8171238f2 | ||
|
|
28f0288526 | ||
|
|
d822f036e0 | ||
|
|
e763525c58 | ||
|
|
f22cf6349b | ||
|
|
079f18d727 | ||
|
|
321de104fe | ||
|
|
841d5e6fd0 | ||
|
|
57f8226b38 | ||
|
|
3363952a23 | ||
|
|
0c1263cb78 | ||
|
|
c4088622f8 | ||
|
|
8c54949271 | ||
|
|
1239c9026e | ||
|
|
964aec8066 | ||
|
|
8940f87935 | ||
|
|
fc82b2b7e1 | ||
|
|
c8a7fb2e2b | ||
|
|
ed117c4d31 | ||
|
|
f9bfe94a6b | ||
|
|
180b0cd568 | ||
|
|
172e1ab1de | ||
|
|
271cd0dd61 | ||
|
|
3abd5b953e | ||
|
|
8d9cde17a9 | ||
|
|
f8f5b7c233 | ||
|
|
b83ff2c3c5 | ||
|
|
3d93308293 | ||
|
|
d010211028 | ||
|
|
f59cf4eb71 | ||
|
|
784d518632 | ||
|
|
3648a42054 | ||
|
|
b37e636da3 | ||
|
|
0f48d5da53 | ||
|
|
35d3224d08 | ||
|
|
e2c2a6602a | ||
|
|
08de5da716 | ||
|
|
ac32760bfc | ||
|
|
688ca90ec8 | ||
|
|
038bf41077 | ||
|
|
4a72b7a87c | ||
|
|
ba5d66cea0 | ||
|
|
2c8cce99e8 | ||
|
|
a0c59fd61d | ||
|
|
542622c512 | ||
|
|
513df69042 | ||
|
|
5c5f0f6a1e | ||
|
|
627aac9a15 | ||
|
|
870aa61080 | ||
|
|
f45608163c | ||
|
|
fd07d64a7b | ||
|
|
93b7cf481b | ||
|
|
ce077c059e | ||
|
|
054fa4c952 | ||
|
|
ce126fe08d | ||
|
|
7b47fb5c7f | ||
|
|
0d28267386 | ||
|
|
76c8aa82ad | ||
|
|
8acdb82612 | ||
|
|
6c9fa781cf | ||
|
|
7288224c3e | ||
|
|
9790251aa2 | ||
|
|
1ee5a9402b | ||
|
|
b2f3570bbf | ||
|
|
fe88e100e2 | ||
|
|
0f0dd5755d | ||
|
|
5703d7ea9f | ||
|
|
08635f1984 | ||
|
|
dd92d0faf4 | ||
|
|
91d9516dc7 | ||
|
|
db5d9aa891 | ||
|
|
b8eedf70c3 | ||
|
|
838c85c5f2 | ||
|
|
9fc5d628b0 | ||
|
|
a216c52416 | ||
|
|
538d8916c7 | ||
|
|
9d5eafc97b | ||
|
|
24ca6259da | ||
|
|
7bf0d8e230 | ||
|
|
0548546881 | ||
|
|
0bbf9c3ef1 | ||
|
|
9453f8a4b7 | ||
|
|
19521bf695 | ||
|
|
4e9472c3e8 | ||
|
|
32949d0395 | ||
|
|
f21cd52f26 | ||
|
|
e66c8ac78e | ||
|
|
6c958cf43d | ||
|
|
09358570b3 | ||
|
|
1517202889 | ||
|
|
a535b8585f | ||
|
|
4324897054 | ||
|
|
169f1e2c44 | ||
|
|
e713a6dfc6 | ||
|
|
ccf7ff8888 | ||
|
|
ac9a89fdca | ||
|
|
d4432eabb9 | ||
|
|
b0ab6bdd4b | ||
|
|
a008cb6bd5 | ||
|
|
c6524b273f | ||
|
|
35f4aa64c4 | ||
|
|
673afa1fcb | ||
|
|
702a04ab24 | ||
|
|
4beeffbc37 | ||
|
|
d4fc1b9126 | ||
|
|
502229adb8 | ||
|
|
e5d8581091 | ||
|
|
4b1010fb13 | ||
|
|
910a70fb41 | ||
|
|
01cc16d50f | ||
|
|
0dcaa6be2f | ||
|
|
d3dd3e229d | ||
|
|
7f70036951 | ||
|
|
81511764c4 | ||
|
|
704035e070 | ||
|
|
3038dc3c93 | ||
|
|
2a1c5a3420 | ||
|
|
0888e7afbd | ||
|
|
7d5c002952 | ||
|
|
461a4ddb3f | ||
|
|
89bbd5b893 | ||
|
|
8e994a954e | ||
|
|
be23b4cc5a | ||
|
|
8fc2089d51 | ||
|
|
55c05364dd | ||
|
|
8f1d62f115 | ||
|
|
f93f012bc8 | ||
|
|
0fc09dcb53 | ||
|
|
447766f9cb | ||
|
|
c25153e666 | ||
|
|
8660ade554 | ||
|
|
f474476e24 | ||
|
|
a06a2b9e5b | ||
|
|
ba67652e29 | ||
|
|
2449e9352c | ||
|
|
80d1b3072d | ||
|
|
7bd2773cf2 | ||
|
|
c64ef55d60 | ||
|
|
91c9f2c62f | ||
|
|
7c60626049 | ||
|
|
49cbc6c1b3 | ||
|
|
9474f1f722 | ||
|
|
5076a6cb38 | ||
|
|
d965d26e60 | ||
|
|
2b9367aa40 | ||
|
|
0b6d52cb46 | ||
|
|
b7a40a7cda | ||
|
|
58078c26db | ||
|
|
5a1e059a78 | ||
|
|
fc5e82d169 | ||
|
|
93ce7d3b7d | ||
|
|
6536098b38 | ||
|
|
5ee37972ef | ||
|
|
59922b95a9 | ||
|
|
89ba4195e5 | ||
|
|
f94f3f2d6a | ||
|
|
74239d65cb | ||
|
|
19968010af | ||
|
|
796a0a9f41 | ||
|
|
3cfa7d0c68 | ||
|
|
e334cde639 | ||
|
|
1cdf5aea53 | ||
|
|
ce8979afe8 | ||
|
|
df053fbc48 | ||
|
|
fcb8d49cf9 | ||
|
|
a72dc5d2ec | ||
|
|
418812d61d | ||
|
|
a2854297b3 | ||
|
|
92ab7eac17 | ||
|
|
96560d2b3e | ||
|
|
f7d66a1e59 | ||
|
|
706f64c9dd | ||
|
|
d2a8f89668 | ||
|
|
b0a818b813 | ||
|
|
259a61378d | ||
|
|
0e8ebe1e4d | ||
|
|
118219e5b3 | ||
|
|
d160c35e29 | ||
|
|
51a7cc9dee | ||
|
|
b51b12ab7d | ||
|
|
95a5c06e30 | ||
|
|
2e03e03c77 | ||
|
|
b36de8b8c8 | ||
|
|
6cdbb459fa | ||
|
|
7f11b01480 | ||
|
|
b63a6e8abc | ||
|
|
4661e32053 |
No files matched your search
+4
-7
@@ -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
@@ -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
File mode changed.
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
@@ -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
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx --no -- commitlint --edit
|
||||
@@ -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,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" />
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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"
|
||||
@@ -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">
|
||||
|
||||

|
||||
|
||||
</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.
|
||||

|
||||
## 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)
|
||||
Vendored
-26
@@ -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 |
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
export 'application_task.dart';
|
||||
export 'sdk_task.dart';
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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';
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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>
|
||||
-36
@@ -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
Reference in new issue
Block a user