Compare commits
244
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1d66dc6e4
|
||
|
|
25cf9518f9
|
||
|
|
8d833d39d7
|
||
|
|
d098d9a6bf
|
||
|
|
0f8c5bb983
|
||
|
|
20f07a177b
|
||
|
|
1a48b606a4
|
||
|
|
6c54689393
|
||
|
|
d6c9dfd8a7
|
||
|
|
881cbc5bef
|
||
|
|
81c8851ac8 | ||
|
|
0c176ba0fa | ||
|
|
970dde2ef1 | ||
|
|
2e187b26eb | ||
|
|
0337d4f97a | ||
|
|
3c3545abfe | ||
|
|
2dfbd59773 | ||
|
|
4a3fde3a1e | ||
|
|
317eb56d66 | ||
|
|
b9dac32143 | ||
|
|
8955788fa5 | ||
|
|
ca6af3ccc3 | ||
|
|
ad0f1ec1c5 | ||
|
|
41a484c013 | ||
|
|
4811ed8998 | ||
|
|
dba14088b0 | ||
|
|
b2fe14a123 | ||
|
|
bbd3f0a02d | ||
|
|
79dc34414c | ||
|
|
349d1ae288 | ||
|
|
49b534d145 | ||
|
|
a68da15cdc
|
||
|
|
6037e13f50
|
||
|
|
93cc5058d1
|
||
|
|
12d04c91ed
|
||
|
|
5906d54aad
|
||
|
|
b077f4baf0
|
||
|
|
133e0e910b | ||
|
|
25224469b5 | ||
|
|
6537945946 | ||
|
|
702164082a | ||
|
|
f2b8c03dd7 | ||
|
|
51672cc95a | ||
|
|
eda643e9b4 | ||
|
|
cae4b68046 | ||
|
|
4030511f4a | ||
|
|
8ed8a71c7c | ||
|
|
b6d22002ee | ||
|
|
9b9339cb56 | ||
|
|
b57500b854 | ||
|
|
1edb1f7324 | ||
|
|
edf72cf4c2 | ||
|
|
f6c16c5dc4 | ||
|
|
c6beae597b | ||
|
|
c2b60f2d79 | ||
|
|
1e8d5d088e | ||
|
|
419c99c103 | ||
|
|
5387dd6eed
|
||
|
|
f67e4aa112
|
||
|
|
2769d45e20
|
||
|
|
66719732f7
|
||
|
|
25018dc78a
|
||
|
|
efeb3acff3
|
||
|
|
ef52015372
|
||
|
|
c5f8b69184
|
||
|
|
33984b1733
|
||
|
|
a47c28a4d6
|
||
|
|
63bbde8213
|
||
|
|
8070623e88
|
||
|
|
4c08a692d2
|
||
|
|
8044d07413
|
||
|
|
1af9b0b1f1
|
||
|
|
3a7b0abc58
|
||
|
|
dd198b0e51
|
||
|
|
a595183107
|
||
|
|
c786c153e0
|
||
|
|
cc71bf7abd
|
||
|
|
ed06e18043
|
||
|
|
96781880f4
|
||
|
|
c331bc6056
|
||
|
|
77ce4e33ab
|
||
|
|
2806ac5923
|
||
|
|
ed29f39673
|
||
|
|
7880293723
|
||
|
|
5c34528b3d
|
||
|
|
198d83b663
|
||
|
|
bd636e9d24
|
||
|
|
c942e2aacf
|
||
|
|
82eeba4d7d
|
||
|
|
4695cf0618
|
||
|
|
d49a4cad31
|
||
|
|
e4d904eb8d
|
||
|
|
4f1a064298
|
||
|
|
168d840b87
|
||
|
|
aea71fa32c
|
||
|
|
b6f25dd5b5
|
||
|
|
61e28ce5e7
|
||
|
|
5050e2c2bb
|
||
|
|
9e1b76e07b
|
||
|
|
442baa6882
|
||
|
|
60126fffc4
|
||
|
|
07572aeca2
|
||
|
|
4332eafda0
|
||
|
|
160b30d21b
|
||
|
|
602a372d7c
|
||
|
|
43df087319
|
||
|
|
4f71118a65
|
||
|
|
4b37175d17 | ||
|
|
ea18d39c44 | ||
|
|
b9f2305bca | ||
|
|
55822ad870 | ||
|
|
a563bd1fe3 | ||
|
|
5464cd1d40 | ||
|
|
ba1c1016e5 | ||
|
|
23b608ed10 | ||
|
|
44b2b7c27d
|
||
|
|
6bad9a8a05
|
||
|
|
5d8f94bee8
|
||
|
|
75cb341447
|
||
|
|
efa7ca09dd
|
||
|
|
ac432f6dc8 | ||
|
|
6c85faba82 | ||
|
|
dd75ecfc7a | ||
|
|
0132771e17 | ||
|
|
5d5ae145aa | ||
|
|
07428a5215 | ||
|
|
c994c822b0 | ||
|
|
bde54e0cf5 | ||
|
|
f3c3939ba1 | ||
|
|
9339100399
|
||
|
|
03725c25c7
|
||
|
|
588a09e0a1
|
||
|
|
bd53d11e0d | ||
|
|
ee8f08cc32 | ||
|
|
413589462b | ||
|
|
ff3f2008de | ||
|
|
0b27a62669 | ||
|
|
6c9b6e239b | ||
|
|
576a01512b | ||
|
|
cd3ed0fe69 | ||
|
|
46c51525e8 | ||
|
|
b025247002 | ||
|
|
c70d4c6650 | ||
|
|
04a87fe32a | ||
|
|
f8f367baf6 | ||
|
|
e667aa06d0 | ||
|
|
f6ef5828bb
|
||
|
|
f22ba300cb | ||
|
|
5f52b2fc3d
|
||
|
|
f46707f5c1
|
||
|
|
17ff0f8ba1 | ||
|
|
1a3631f691
|
||
|
|
197c5d54e6
|
||
|
|
c7b241de2d
|
||
|
|
94d573a584
|
||
|
|
37e00fe9c4
|
||
|
|
3c8ff373a1
|
||
|
|
640cfaf118
|
||
|
|
7fc3736854
|
||
|
|
29d8ec640f
|
||
|
|
7f9621b4f6
|
||
|
|
7b61f3f08a
|
||
|
|
75a5facfdc
|
||
|
|
c93b7fb5f7 | ||
|
|
aee7060a0b
|
||
|
|
4f49f4931c | ||
|
|
e8172004a3 | ||
|
|
c6d8ca37fe | ||
|
|
e01f47d41a | ||
|
|
7a24a36af0 | ||
|
|
244a286509 | ||
|
|
81a7ca5a1f | ||
|
|
45c7bd6fca | ||
|
|
cd2806b07b | ||
|
|
dd275460f6 | ||
|
|
dc0f0c61c6 | ||
|
|
1e305c75bd
|
||
|
|
9af76b8e1f | ||
|
|
5593620181 | ||
|
|
a19d4bc5ce | ||
|
|
21b18054ba | ||
|
|
ff90af47cd | ||
|
|
3bb57e65f8 | ||
|
|
9d0aac7894 | ||
|
|
a561cbff23 | ||
|
|
fafec78546 | ||
|
|
feca378131 | ||
|
|
f223811f4b
|
||
|
|
ed65489316
|
||
|
|
33797e4dbf | ||
|
|
3aa6d03dd6 | ||
|
|
bf03324fd0 | ||
|
|
5e83c9e74e
|
||
|
|
672aba7084
|
||
|
|
94d7efbe8c
|
||
|
|
5298bd99ed
|
||
|
|
d792f4cbe9 | ||
|
|
098ec9715e | ||
|
|
6d3c64d17c | ||
|
|
c615186f19 | ||
|
|
55e24fb23b | ||
|
|
4d04c3f446 | ||
|
|
a20e4a1715 | ||
|
|
cf9f1ddb65 | ||
|
|
0c141c715e | ||
|
|
d0f59bbf29 | ||
|
|
562f84dd33 | ||
|
|
771f600eb7 | ||
|
|
7fcb9e8ac3
|
||
|
|
2a4e29f38c
|
||
|
|
ca70f2eb1d
|
||
|
|
f123e537ae
|
||
|
|
c3315d968c | ||
|
|
45312473d1 | ||
|
|
17e7bce9e6 | ||
|
|
3886ef080e
|
||
|
|
626d951443
|
||
|
|
f36e0b51e0
|
||
|
|
80ce7aff91 | ||
|
|
a9121b6862 | ||
|
|
54f92e8042 | ||
|
|
00393a6ba7 | ||
|
|
136e0e8c98 | ||
|
|
500a6ae51d | ||
|
|
79fdde25fc | ||
|
|
742bf1d614 | ||
|
|
0dbde68d7d | ||
|
|
cd881da072 | ||
|
|
5918a5cf1f | ||
|
|
775d766d14 | ||
|
|
383098b147 | ||
|
|
4d51e2b786 | ||
|
|
32cc1f55d9 | ||
|
|
6ee101bf36 | ||
|
|
f0ed08bd49
|
||
|
|
390fb81b1e
|
||
|
|
279d451cd8
|
||
|
|
a66db23ace
|
||
|
|
3d7af98ac9
|
||
|
|
b033b97917 | ||
|
|
14b7f31b53
|
||
|
|
403bcafe93
|
||
|
|
21ab6f6021
|
||
|
|
198ecac5da
|
+36
@@ -0,0 +1,36 @@
|
|||||||
|
# Copyright (C) 2022 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: quality-check
|
||||||
|
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0-1
|
||||||
|
commands:
|
||||||
|
- melos run quality-check
|
||||||
|
- melos run publish:validate
|
||||||
|
- name: publish
|
||||||
|
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0-1
|
||||||
|
commands:
|
||||||
|
- melos run publish:validate
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- master
|
||||||
|
event:
|
||||||
|
- push
|
||||||
@@ -198,3 +198,6 @@ $RECYCLE.BIN/
|
|||||||
*.iml
|
*.iml
|
||||||
google-services.json
|
google-services.json
|
||||||
pubspec_overrides.yaml
|
pubspec_overrides.yaml
|
||||||
|
|
||||||
|
# Mason
|
||||||
|
.mason/
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/compilerla/conventional-pre-commit
|
||||||
|
rev: v2.1.1
|
||||||
|
hooks:
|
||||||
|
- id: conventional-pre-commit
|
||||||
|
stages: [commit-msg]
|
||||||
|
args: [build, ci, docs, feat, fix, perf, refactor, style, test, chore]
|
||||||
+195
@@ -3,6 +3,201 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## 2023-02-24
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Packages with breaking changes:
|
||||||
|
|
||||||
|
- There are no breaking changes in this release.
|
||||||
|
|
||||||
|
Packages with other changes:
|
||||||
|
|
||||||
|
- [`wyatt_analysis` - `v2.4.1`](#wyatt_analysis---v241)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### `wyatt_analysis` - `v2.4.1`
|
||||||
|
|
||||||
|
- **FEAT**: add latest version persistence between script executions.
|
||||||
|
- **FEAT**: ignore todo's.
|
||||||
|
|
||||||
|
|
||||||
|
## 2023-02-07
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Packages with breaking changes:
|
||||||
|
|
||||||
|
- There are no breaking changes in this release.
|
||||||
|
|
||||||
|
Packages with other changes:
|
||||||
|
|
||||||
|
- [`wyatt_analysis` - `v2.4.0`](#wyatt_analysis---v240)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### `wyatt_analysis` - `v2.4.0`
|
||||||
|
|
||||||
|
- **FEAT**: add new lint rules.
|
||||||
|
- **DOCS**: add instructions to create a new version (closes #104).
|
||||||
|
|
||||||
|
|
||||||
|
## 2022-12-13
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Packages with breaking changes:
|
||||||
|
|
||||||
|
- There are no breaking changes in this release.
|
||||||
|
|
||||||
|
Packages with other changes:
|
||||||
|
|
||||||
|
- [`wyatt_authentication_bloc` - `v0.4.1`](#wyatt_authentication_bloc---v041)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### `wyatt_authentication_bloc` - `v0.4.1`
|
||||||
|
|
||||||
|
- **REFACTOR**: use fromFirebaseUser factory to parse user.
|
||||||
|
- **REFACTOR**: update deps and re-export them.
|
||||||
|
- **FIX**: fix mock on register.
|
||||||
|
- **FEAT**: add google sign in in signIn cubit.
|
||||||
|
- **FEAT**: add google sign in parameter in firebase data source constructor.
|
||||||
|
- **FEAT**: add google sign_in support (closes #59).
|
||||||
|
- **FEAT**: add reauthenticate, updateEmail and updatePassword.
|
||||||
|
- **DOCS**: add correct header.
|
||||||
|
|
||||||
|
|
||||||
|
## 2022-12-12
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Packages with breaking changes:
|
||||||
|
|
||||||
|
- There are no breaking changes in this release.
|
||||||
|
|
||||||
|
Packages with other changes:
|
||||||
|
|
||||||
|
- [`wyatt_analysis` - `v2.3.0`](#wyatt_analysis---v230)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### `wyatt_analysis` - `v2.3.0`
|
||||||
|
|
||||||
|
- **REFACTOR**: follow melos versioning.
|
||||||
|
- **FIX**: change file include to keep coherence.
|
||||||
|
- **FEAT**: exclude generated code, and add dart>2.16 rules.
|
||||||
|
- **FEAT**: add overwrite protection.
|
||||||
|
- **FEAT**: add 2.2.2 files for archive.
|
||||||
|
- **FEAT**: add utils script to easely bump version.
|
||||||
|
|
||||||
|
|
||||||
|
## 2022-12-04
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Packages with breaking changes:
|
||||||
|
|
||||||
|
- [`wyatt_bloc_helper` - `v2.0.0`](#wyatt_bloc_helper---v200)
|
||||||
|
|
||||||
|
Packages with other changes:
|
||||||
|
|
||||||
|
- [`wyatt_type_utils` - `v0.0.4`](#wyatt_type_utils---v004)
|
||||||
|
- [`wyatt_authentication_bloc` - `v0.4.0+3`](#wyatt_authentication_bloc---v0403)
|
||||||
|
- [`wyatt_crud_bloc` - `v0.1.0+2`](#wyatt_crud_bloc---v0102)
|
||||||
|
- [`wyatt_architecture` - `v0.1.0+1`](#wyatt_architecture---v0101)
|
||||||
|
- [`wyatt_form_bloc` - `v0.2.0+2`](#wyatt_form_bloc---v0202)
|
||||||
|
|
||||||
|
Packages with dependency updates only:
|
||||||
|
|
||||||
|
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
|
||||||
|
|
||||||
|
- `wyatt_authentication_bloc` - `v0.4.0+3`
|
||||||
|
- `wyatt_crud_bloc` - `v0.1.0+2`
|
||||||
|
- `wyatt_architecture` - `v0.1.0+1`
|
||||||
|
- `wyatt_form_bloc` - `v0.2.0+2`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### `wyatt_bloc_helper` - `v2.0.0`
|
||||||
|
|
||||||
|
- **BREAKING** **REFACTOR**: update onWrap label (close #46).
|
||||||
|
|
||||||
|
#### `wyatt_type_utils` - `v0.0.4`
|
||||||
|
|
||||||
|
- **FEAT**: add Result extension on FutureOr type (close #40).
|
||||||
|
|
||||||
|
|
||||||
|
## 2022-12-03
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Packages with breaking changes:
|
||||||
|
|
||||||
|
- [`wyatt_architecture` - `v0.1.0`](#wyatt_architecture---v010)
|
||||||
|
|
||||||
|
Packages with other changes:
|
||||||
|
|
||||||
|
- [`wyatt_authentication_bloc` - `v0.4.0+2`](#wyatt_authentication_bloc---v0402)
|
||||||
|
- [`wyatt_crud_bloc` - `v0.1.0+1`](#wyatt_crud_bloc---v0101)
|
||||||
|
- [`wyatt_form_bloc` - `v0.2.0+1`](#wyatt_form_bloc---v0201)
|
||||||
|
|
||||||
|
Packages with dependency updates only:
|
||||||
|
|
||||||
|
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
|
||||||
|
|
||||||
|
- `wyatt_authentication_bloc` - `v0.4.0+2`
|
||||||
|
- `wyatt_crud_bloc` - `v0.1.0+1`
|
||||||
|
- `wyatt_form_bloc` - `v0.2.0+1`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### `wyatt_architecture` - `v0.1.0`
|
||||||
|
|
||||||
|
- **REFACTOR**: update naming methodes (close #47).
|
||||||
|
- **REFACTOR**: update example. (close #38).
|
||||||
|
- **FIX**: fix execute method on error handler. (#38).
|
||||||
|
- **FEAT**: update usecase en add & sepcific case. (#38).
|
||||||
|
- **FEAT**: add obsevers for alternative usecase scenarions (#38).
|
||||||
|
- **DOCS**: generate class model. (#38).
|
||||||
|
- **DOCS**: update Readme. (#38).
|
||||||
|
- **BREAKING** **CHORE**: update exports. (#38).
|
||||||
|
|
||||||
|
|
||||||
|
## 2022-11-16
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Packages with breaking changes:
|
||||||
|
|
||||||
|
- There are no breaking changes in this release.
|
||||||
|
|
||||||
|
Packages with other changes:
|
||||||
|
|
||||||
|
- [`wyatt_authentication_bloc` - `v0.4.0+1`](#wyatt_authentication_bloc---v0401)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### `wyatt_authentication_bloc` - `v0.4.0+1`
|
||||||
|
|
||||||
|
- **FIX**: add sort of mutex on onAuthChanges callback trigger.
|
||||||
|
|
||||||
|
|
||||||
## 2022-11-16
|
## 2022-11-16
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|||||||
@@ -17,10 +17,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
|
||||||
<a href="https://wyattapp.io">
|
|
||||||
<img width="150px" src="resources/wyatt-campus-logo.png">
|
|
||||||
</a>
|
|
||||||
<a href="https://wyatt-studio.fr">
|
<a href="https://wyatt-studio.fr">
|
||||||
<img width="150px" src="resources/wyatt-studio-logo.png">
|
<img width="150px" src="resources/wyatt-studio-logo.png">
|
||||||
</a>
|
</a>
|
||||||
@@ -44,64 +40,108 @@
|
|||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
Here is it a set of [Flutter plugins](https://flutter.io/platform-plugins/) that power up your applications.
|
Here is a set of [Flutter plugins](https://flutter.io/platform-plugins/) that enhance your applications.
|
||||||
|
|
||||||
[Flutter](https://flutter.dev) is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. Flutter is used by developers and organizations around the world, and is free
|
[Flutter](https://flutter.dev) is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop using a single codebase. It is used by developers and organizations worldwide and is free and open-source.
|
||||||
and open source.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Development
|
## Contribution
|
||||||
|
|
||||||
Clone this repo.
|
Clone this repo.
|
||||||
|
|
||||||
You have to install [melos](https://github.com/invertase/melos).
|
```shell
|
||||||
|
git clone ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### Prerequisite
|
||||||
|
|
||||||
|
1. [Flutter](https://github.com/flutter/flutter). It is a UI toolkit developed by Google for building beautiful and natively compiled applications for mobile, web, and desktop from a single codebase.
|
||||||
|
|
||||||
|
2. [Melos](https://github.com/invertase/melos). Melos is a tool that helps in managing Dart projects that have multiple packages. It can be installed using the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dart pub global activate melos
|
dart pub global activate melos
|
||||||
```
|
```
|
||||||
|
|
||||||
Then bootstrap with `melos bs`.
|
3. [Mason](https://github.com/felangel/mason). Mason is used for code generation purposes. It can be installed by running the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
dart pub global activate mason_cli
|
||||||
|
```
|
||||||
|
|
||||||
|
4. [Lcov](https://github.com/linux-test-project/lcov). Lcov is a tool used to generate coverage data. It can be installed on macOS by running the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# on macos
|
||||||
|
brew install lcov
|
||||||
|
```
|
||||||
|
|
||||||
|
- genhtml. Used to convert coverage data into html pages.
|
||||||
|
|
||||||
|
After installation of all these packages, the project can be bootstrapped using the command `melos bs`.
|
||||||
|
|
||||||
### Create a new package
|
### Create a new package
|
||||||
|
|
||||||
Create a new package in `packages/` folder.
|
Create a new package in `packages/` folder.
|
||||||
|
To create a new package in the packages/ folder, run the following command in the terminal:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dart create -t package-simple wyatt_<name>
|
mason make wyatt_package --package_name wyatt_<name> --description A new Wyatt package --flutter_only false
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove any `example/` subfolder. Then create a new sample project.
|
The <name> variable in the above command is important and must be clear and understandable.
|
||||||
|
|
||||||
```shell
|
After creating the package, bootstrap the project with the `melos bs` command.
|
||||||
flutter create --platforms android --project-name <name>_example example
|
|
||||||
```
|
|
||||||
|
|
||||||
Then bootstrap project with `melos bs` command.
|
|
||||||
|
|
||||||
### Convention
|
|
||||||
|
|
||||||
#### Naming
|
#### Naming
|
||||||
|
|
||||||
In the previous instructions `<name>` variable is important.
|
In the previous instructions `<name>` variable is important.
|
||||||
It have to be clear and intelligible.
|
It have to be clear and intelligible.
|
||||||
|
|
||||||
You **MUST** use underscores.
|
1. You must use underscores in the name.
|
||||||
|
2. You must use the wyatt prefix for the package name.
|
||||||
|
3. You must name the example with a specific name.
|
||||||
|
|
||||||
You **MUST** use `wyatt` prefix for package.
|
For example, if the name is "CRUD BLOC," the following naming conventions should be used:
|
||||||
|
|
||||||
You **MUST** name example with specific name.
|
1. name: crud_bloc
|
||||||
|
2. package name: wyatt_crud_bloc
|
||||||
|
3. example name: crud_bloc_example
|
||||||
|
|
||||||
For example, if name is CRUD BLOC
|
### Create issues
|
||||||
- name will be crud_bloc
|
|
||||||
- so the package will be: `wyatt_crud_bloc`
|
|
||||||
- and the example will be: `crud_bloc_example`
|
|
||||||
|
|
||||||
#### Commits
|
Create an issue for each specific feature or task you want to work on and label it correctly using the following format:
|
||||||
|
|
||||||
|
```
|
||||||
|
Type(scope): issue.
|
||||||
|
```
|
||||||
|
|
||||||
|
For example, on notification bloc package :
|
||||||
|
|
||||||
|
- `Feature(notification_bloc): add firebase messaging data source.`
|
||||||
|
- `Test(notification_bloc): add test for pushwoosh datasource.`
|
||||||
|
|
||||||
|
### Branches
|
||||||
|
|
||||||
|
The master branch is protected and cannot be pushed to directly. Please create a separate branch for each feature or task, with a name that corresponds to the related issue. The branch name should follow this format:
|
||||||
|
|
||||||
|
`type(scope):issue`
|
||||||
|
|
||||||
|
Example :
|
||||||
|
For the issue:
|
||||||
|
|
||||||
|
- `Feature(notification_bloc): add firebase messaging data source.`
|
||||||
|
|
||||||
|
The related branch should be named:
|
||||||
|
|
||||||
|
- `notification_bloc/feat/add_firebase_messaging_data_source`
|
||||||
|
|
||||||
|
### Commits
|
||||||
|
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
tl;dr : `type(scope): description`.
|
tl;dr : `type(scope): description #issue`.
|
||||||
Here allowed <type> values:
|
Here allowed <type> values:
|
||||||
|
|
||||||
- **feat** for a new feature for the user, not a new feature for build script. Such commit will trigger a release bumping a MINOR version.
|
- **feat** for a new feature for the user, not a new feature for build script. Such commit will trigger a release bumping a MINOR version.
|
||||||
@@ -115,11 +155,72 @@ Here allowed <type> values:
|
|||||||
|
|
||||||
Some examples :
|
Some examples :
|
||||||
|
|
||||||
- `feat(auth): add AWS support.` = add a feature in authentication_bloc package.
|
- `feat(auth): add AWS support. (#31)` = add a feature in authentication_bloc package, linked to the 31st issue.
|
||||||
- `docs: update readme.` = update **this** readme file.
|
- `docs: update readme.` = update **this** readme file.
|
||||||
- `fix(crud)!: fix bug in awesome() function.` = fix a bug, `!` is important and indicate `BREAKING CHANGES`.
|
- `fix(crud)!: fix bug in awesome() function. (#32)` = fix a bug, `!` is important and indicate `BREAKING CHANGES` linked with the 32nd issue.
|
||||||
|
|
||||||
Conventional commits are important for `melos version` command !
|
When you have completed your development work and are ready to resolve the related issue, you can close it via your commit message by including (close #issue_number). For example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
feat(auth): add AWS support. (close #31)
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
|
melos run test:all # this will run all tests in this project
|
||||||
|
melos run gen-coverage # this will generate coverage report
|
||||||
|
melos run gen-class-models # this will generate plantuml class diagrams
|
||||||
|
melos run quality-check # this will run all targets generally expected in CI
|
||||||
|
melos run publish:validate # this will run a validation before publish packages
|
||||||
|
melos run publish # this will publish packages
|
||||||
|
```
|
||||||
|
|
||||||
|
Please note that the issue will only be closed after it has been merged into the master branch. Before closing the issue, it is important to verify that all tests have been run and that coverage has been updated.
|
||||||
|
|
||||||
|
#### Merge your work
|
||||||
|
|
||||||
|
When you have completed your work and closed the related issue, it's possible that some changes may have been made to the master branch in the meantime. To maintain a clean Git history, it's recommended to rebase before creating a change request (pull request).
|
||||||
|
|
||||||
|
Two situations :
|
||||||
|
|
||||||
|
- You haven't created a branch yet and have made local commits:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git pull --rebase
|
||||||
|
```
|
||||||
|
|
||||||
|
- You are already working on a branch:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git rebase -i master
|
||||||
|
```
|
||||||
|
|
||||||
|
It's recommended to use the `--fixup` option during the interactive rebase to keep the Git history clean.
|
||||||
|
|
||||||
|
Once you have rebased, you can create a pull request, receive the necessary approvals, and then merge your work. And with that, you're done! 🎉
|
||||||
|
|
||||||
|
#### Update version.
|
||||||
|
|
||||||
|
When your work has been merged into the master branch, it's time to update the package version. To update only your specific package, use the --scope option. For example, after merging changes into the `wyatt_notification_bloc` package, you can run the following command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
melos version --scope="*wyatt_notification_bloc*"
|
||||||
|
```
|
||||||
|
|
||||||
|
This will filter all packages that match the `wyatt_notification_bloc` pattern and update only that package.
|
||||||
|
|
||||||
|
You can then verify that all packages and their tests are working correctly by running:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
melos run test:all
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Publish your package
|
||||||
|
|
||||||
|
If package is ready for procution, publish it runnig :
|
||||||
|
|
||||||
|
```shell
|
||||||
|
melos publish --scope"*package*"
|
||||||
|
```
|
||||||
|
|
||||||
#### Badging
|
#### Badging
|
||||||
|
|
||||||
@@ -130,6 +231,7 @@ In the package `readme.md` file, please specify the supported SDK:
|
|||||||
```markdown
|
```markdown
|
||||||

|

|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||

|

|
||||||
@@ -157,6 +259,12 @@ Here you can change `package name` and `package version`.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Simple work flow diagramm
|
||||||
|
|
||||||
|
To sum up, here a simple work flow diagramm.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
escapedPath="$(echo `pwd` | sed 's/\//\\\//g')"
|
||||||
|
|
||||||
|
if grep flutter pubspec.yaml > /dev/null; then
|
||||||
|
if [ -d "coverage" ]; then
|
||||||
|
# combine line coverage info from package tests to a common file
|
||||||
|
if [ ! -d "$MELOS_ROOT_PATH/coverage" ]; then
|
||||||
|
mkdir "$MELOS_ROOT_PATH/coverage"
|
||||||
|
fi
|
||||||
|
sed "s/^SF:lib/SF:$escapedPath\/lib/g" coverage/lcov.info >> "$MELOS_ROOT_PATH/coverage/lcov.info"
|
||||||
|
rm -rf "coverage"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
@startuml Simple Developpment Workflow
|
||||||
|
start
|
||||||
|
:Create an issue;
|
||||||
|
:Create branch related to the issue;
|
||||||
|
repeat :Commit related to the issue;
|
||||||
|
repeat while (feature is done)
|
||||||
|
:Update coverage;
|
||||||
|
:Close issue via last commit;
|
||||||
|
:Rebase from `master`;
|
||||||
|
:Create pull request;
|
||||||
|
:Merge branches;
|
||||||
|
:Update version;
|
||||||
|
:Publish package;
|
||||||
|
stop
|
||||||
|
@enduml
|
||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 7.5 KiB |
@@ -0,0 +1 @@
|
|||||||
|
{"bricks":{"wyatt_component_template":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_component_template","ref":"7cea909470ce75b91840f479649b93f953ded596"}}}}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
bricks:
|
||||||
|
wyatt_package_template:
|
||||||
|
git:
|
||||||
|
url: "ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git"
|
||||||
|
path: bricks/wyatt_package_template
|
||||||
|
wyatt_component_template:
|
||||||
|
git:
|
||||||
|
url: "ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git"
|
||||||
|
path: bricks/wyatt_component_template
|
||||||
+43
-6
@@ -21,22 +21,59 @@ scripts:
|
|||||||
|
|
||||||
analyze:
|
analyze:
|
||||||
run: |
|
run: |
|
||||||
melos exec -c 10 -- \
|
melos exec -c 1 -- flutter analyze --fatal-infos
|
||||||
flutter analyze --fatal-infos
|
|
||||||
description: Run `flutter analyze` for all packages.
|
description: Run `flutter analyze` for all packages.
|
||||||
|
|
||||||
|
fix:
|
||||||
|
run: melos exec dart fix . --apply
|
||||||
|
description: Run `dart fix` for all packages.
|
||||||
|
|
||||||
format:
|
format:
|
||||||
run: melos exec flutter format . --fix
|
run: melos exec dart format .
|
||||||
description: Run `flutter format` for all packages.
|
description: Run `dart format` for all packages.
|
||||||
|
|
||||||
format-check:
|
format-check:
|
||||||
run: melos exec flutter format . --set-exit-if-changed
|
run: melos exec dart fix . --set-exit-if-changed
|
||||||
description: Run `flutter format` checks for all packages.
|
description: Run `dart fix` checks for all packages.
|
||||||
|
|
||||||
clean:deep:
|
clean:deep:
|
||||||
run: git clean -x -d -f -q
|
run: git clean -x -d -f -q
|
||||||
description: Clean things very deeply with `git clean`.
|
description: Clean things very deeply with `git clean`.
|
||||||
|
|
||||||
|
test:selective_unit_test:
|
||||||
|
run: melos exec -- flutter test --no-pub --coverage
|
||||||
|
description: Run Flutter tests for a specific package in this project.
|
||||||
|
select-package:
|
||||||
|
dir-exists:
|
||||||
|
- test
|
||||||
|
ignore:
|
||||||
|
- '*example*'
|
||||||
|
|
||||||
|
test:all:
|
||||||
|
run: melos run test:selective_unit_test --no-select
|
||||||
|
description: Run all Flutter tests in this project.
|
||||||
|
|
||||||
|
gen-coverage: melos exec -- sh "\$MELOS_ROOT_PATH/combine_coverage.sh" && genhtml coverage/lcov.info -o coverage/html
|
||||||
|
|
||||||
|
gen-class-models:
|
||||||
|
run: melos exec -- dart pub global run dcdg -o models/class-models.puml
|
||||||
|
select-package:
|
||||||
|
ignore:
|
||||||
|
- '*example*'
|
||||||
|
|
||||||
|
quality-check:
|
||||||
|
run: |
|
||||||
|
melos clean && \
|
||||||
|
melos bootstrap && \
|
||||||
|
melos run test:all
|
||||||
|
description: Run all targets generally expected in CI for a full local quality check.
|
||||||
|
|
||||||
|
publish:validate:
|
||||||
|
run: melos publish --diff="origin/$DRONE_COMMIT_BRANCH...HEAD" --yes
|
||||||
|
|
||||||
|
# publish:
|
||||||
|
# run: melos publish --diff="origin/$DRONE_COMMIT_BRANCH...HEAD" --no-dry-run --yes
|
||||||
|
|
||||||
# Additional cleanup lifecycle script, executed when `melos clean` is run.
|
# Additional cleanup lifecycle script, executed when `melos clean` is run.
|
||||||
postclean: >
|
postclean: >
|
||||||
melos exec -c 6 -- "flutter clean"
|
melos exec -c 6 -- "flutter clean"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
2.4.1
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
new_version.sh
|
||||||
|
.latest_version
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2022 WYATT GROUP
|
* Copyright (C) 2023 WYATT GROUP
|
||||||
* Please see the AUTHORS file for details.
|
* Please see the AUTHORS file for details.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
@@ -1,3 +1,22 @@
|
|||||||
|
## 2.4.1
|
||||||
|
|
||||||
|
- **FEAT**: add latest version persistence between script executions.
|
||||||
|
- **FEAT**: ignore todo's.
|
||||||
|
|
||||||
|
## 2.4.0
|
||||||
|
|
||||||
|
- **FEAT**: add new lint rules.
|
||||||
|
- **DOCS**: add instructions to create a new version (closes #104).
|
||||||
|
|
||||||
|
## 2.3.0
|
||||||
|
|
||||||
|
- **REFACTOR**: follow melos versioning.
|
||||||
|
- **FIX**: change file include to keep coherence.
|
||||||
|
- **FEAT**: exclude generated code, and add dart>2.16 rules.
|
||||||
|
- **FEAT**: add overwrite protection.
|
||||||
|
- **FEAT**: add 2.2.2 files for archive.
|
||||||
|
- **FEAT**: add utils script to easely bump version.
|
||||||
|
|
||||||
## 2.2.2
|
## 2.2.2
|
||||||
|
|
||||||
- **DOCS**: add publish_to self hosted pub server.
|
- **DOCS**: add publish_to self hosted pub server.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
* Copyright (C) 2022 WYATT GROUP
|
* Copyright (C) 2023 WYATT GROUP
|
||||||
* Please see the AUTHORS file for details.
|
* Please see the AUTHORS file for details.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@@ -20,21 +20,26 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
This package provides lint rules for Dart and Flutter which are used at [Wyatt](https://wyattapp.io) and [Wyatt Studio](https://wyatt-studio.fr). For more information, see the complete list of options in **lib/analysis_options.2.0.0.yaml**.
|
This package provides lint rules for Dart and Flutter which are used at [Wyatt](https://wyattapp.io) and [Wyatt Studio](https://wyatt-studio.fr). For more information, see the complete list of options in **lib/analysis_options.2.4.1.yaml**.
|
||||||
|
|
||||||
**Note**: This package was heavily inspired by [pedantic](https://github.com/dart-lang/pedantic), [Very Good Analysis](https://github.com/VeryGoodOpenSource/very_good_analysis) and the official [flutter_lints](https://pub.dev/packages/flutter_lints).
|
**Note**: This package was heavily inspired by [pedantic](https://github.com/dart-lang/pedantic), [Very Good Analysis](https://github.com/VeryGoodOpenSource/very_good_analysis) and the official [flutter_lints](https://pub.dev/packages/flutter_lints).
|
||||||
|
|
||||||
|
## Adding Wyatt Analysis to your project
|
||||||
|
|
||||||
|
Using CLI:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
dart pub add wyatt_analysis:2.4.1 --dev --hosted-url=https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
To use the lints, add a dependency in your `pubspec.yaml` :
|
To use the lints, add a dependency in your `pubspec.yaml` :
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
dev_dependencies:
|
|
||||||
wyatt_analysis:
|
wyatt_analysis:
|
||||||
git:
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
||||||
url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages
|
version: 2.4.1
|
||||||
ref: wyatt_analysis-v2.0.0
|
|
||||||
path: packages/wyatt_analysis
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, add an include in `analysis_options.yaml` :
|
Then, add an include in `analysis_options.yaml` :
|
||||||
@@ -52,13 +57,13 @@ include: package:wyatt_analysis/analysis_options.flutter.yaml
|
|||||||
If you wish to restrict the lint version, specify a version of `analysis_options.yaml` instead:
|
If you wish to restrict the lint version, specify a version of `analysis_options.yaml` instead:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
include: package:wyatt_analysis/analysis_options.flutter.2.0.0.yaml
|
include: package:wyatt_analysis/analysis_options.flutter.2.4.1.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
If you just want **Dart** version:
|
If you just want **Dart** version:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
include: package:wyatt_analysis/analysis_options.2.0.0.yaml
|
include: package:wyatt_analysis/analysis_options.2.4.1.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
## Suppressing Lints
|
## Suppressing Lints
|
||||||
@@ -107,6 +112,17 @@ To indicate your project is using `wyatt_analysis` → [![style: wyatt analysis]
|
|||||||
[](https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis)
|
[](https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
When you want to create a new version of the plugin. Before any modification, execute the following command to create new files:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./new_version.sh <new_version>
|
||||||
|
```
|
||||||
|
|
||||||
|
The previous version is automatically detected thanks to the `.latest_version` file.
|
||||||
|
So `.latest_version` needs to be versioned!
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
You can explore every lint rules [here](https://dart-lang.github.io/linter/lints/).
|
You can explore every lint rules [here](https://dart-lang.github.io/linter/lints/).
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
# Copyright (C) 2022 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
analyzer:
|
||||||
|
language:
|
||||||
|
strict-casts: true
|
||||||
|
strict-inference: true
|
||||||
|
strict-raw-types: true
|
||||||
|
|
||||||
|
errors:
|
||||||
|
todo: ignore
|
||||||
|
close_sinks: ignore
|
||||||
|
missing_required_param: error
|
||||||
|
missing_return: error
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- example/**
|
||||||
|
- lib/l10n/**
|
||||||
|
- lib/generated/**
|
||||||
|
- lib/generated_plugin_registrant.dart
|
||||||
|
- test/.test_coverage.dart
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
- always_declare_return_types
|
||||||
|
- always_require_non_null_named_parameters
|
||||||
|
- always_put_control_body_on_new_line
|
||||||
|
- always_put_required_named_parameters_first
|
||||||
|
- always_use_package_imports
|
||||||
|
- annotate_overrides
|
||||||
|
- avoid_bool_literals_in_conditional_expressions
|
||||||
|
- avoid_catching_errors
|
||||||
|
- avoid_double_and_int_checks
|
||||||
|
- avoid_dynamic_calls
|
||||||
|
- avoid_empty_else
|
||||||
|
- avoid_equals_and_hash_code_on_mutable_classes
|
||||||
|
- avoid_escaping_inner_quotes
|
||||||
|
- avoid_field_initializers_in_const_classes
|
||||||
|
- avoid_function_literals_in_foreach_calls
|
||||||
|
- avoid_init_to_null
|
||||||
|
- avoid_js_rounded_ints
|
||||||
|
- avoid_null_checks_in_equality_operators
|
||||||
|
- avoid_positional_boolean_parameters
|
||||||
|
- avoid_private_typedef_functions
|
||||||
|
- avoid_redundant_argument_values
|
||||||
|
- avoid_relative_lib_imports
|
||||||
|
- avoid_renaming_method_parameters
|
||||||
|
- avoid_return_types_on_setters
|
||||||
|
- avoid_returning_null
|
||||||
|
- avoid_returning_null_for_future
|
||||||
|
- avoid_returning_null_for_void
|
||||||
|
- avoid_returning_this
|
||||||
|
- avoid_setters_without_getters
|
||||||
|
- avoid_shadowing_type_parameters
|
||||||
|
- avoid_single_cascade_in_expression_statements
|
||||||
|
- avoid_slow_async_io
|
||||||
|
- avoid_type_to_string
|
||||||
|
- avoid_types_as_parameter_names
|
||||||
|
- avoid_types_on_closure_parameters
|
||||||
|
- avoid_unused_constructor_parameters
|
||||||
|
- avoid_void_async
|
||||||
|
- await_only_futures
|
||||||
|
- camel_case_extensions
|
||||||
|
- camel_case_types
|
||||||
|
- cancel_subscriptions
|
||||||
|
- cascade_invocations
|
||||||
|
- cast_nullable_to_non_nullable
|
||||||
|
- comment_references
|
||||||
|
- conditional_uri_does_not_exist
|
||||||
|
- constant_identifier_names
|
||||||
|
- control_flow_in_finally
|
||||||
|
- curly_braces_in_flow_control_structures
|
||||||
|
- depend_on_referenced_packages
|
||||||
|
- deprecated_consistency
|
||||||
|
- directives_ordering
|
||||||
|
- empty_catches
|
||||||
|
- empty_constructor_bodies
|
||||||
|
- empty_statements
|
||||||
|
- eol_at_end_of_file
|
||||||
|
- exhaustive_cases
|
||||||
|
- file_names
|
||||||
|
- flutter_style_todos
|
||||||
|
- hash_and_equals
|
||||||
|
- implementation_imports
|
||||||
|
- iterable_contains_unrelated_type
|
||||||
|
- join_return_with_assignment
|
||||||
|
- leading_newlines_in_multiline_strings
|
||||||
|
- library_names
|
||||||
|
- library_prefixes
|
||||||
|
- library_private_types_in_public_api
|
||||||
|
- lines_longer_than_80_chars
|
||||||
|
- list_remove_unrelated_type
|
||||||
|
- literal_only_boolean_expressions
|
||||||
|
- missing_whitespace_between_adjacent_strings
|
||||||
|
- no_adjacent_strings_in_list
|
||||||
|
- no_default_cases
|
||||||
|
- no_duplicate_case_values
|
||||||
|
- no_leading_underscores_for_local_identifiers
|
||||||
|
- no_runtimeType_toString
|
||||||
|
- non_constant_identifier_names
|
||||||
|
- noop_primitive_operations
|
||||||
|
- null_check_on_nullable_type_parameter
|
||||||
|
- null_closures
|
||||||
|
- one_member_abstracts
|
||||||
|
- only_throw_errors
|
||||||
|
- overridden_fields
|
||||||
|
- package_api_docs
|
||||||
|
- package_names
|
||||||
|
- package_prefixed_library_names
|
||||||
|
- parameter_assignments
|
||||||
|
- prefer_adjacent_string_concatenation
|
||||||
|
- prefer_asserts_in_initializer_lists
|
||||||
|
- prefer_asserts_with_message
|
||||||
|
- prefer_collection_literals
|
||||||
|
- prefer_conditional_assignment
|
||||||
|
- prefer_const_constructors
|
||||||
|
- prefer_const_constructors_in_immutables
|
||||||
|
- prefer_const_declarations
|
||||||
|
- prefer_const_literals_to_create_immutables
|
||||||
|
- prefer_constructors_over_static_methods
|
||||||
|
- prefer_contains
|
||||||
|
- prefer_equal_for_default_values
|
||||||
|
- prefer_expression_function_bodies
|
||||||
|
- prefer_final_fields
|
||||||
|
- prefer_final_in_for_each
|
||||||
|
- prefer_final_locals
|
||||||
|
- prefer_for_elements_to_map_fromIterable
|
||||||
|
- prefer_function_declarations_over_variables
|
||||||
|
- prefer_generic_function_type_aliases
|
||||||
|
- prefer_if_elements_to_conditional_expressions
|
||||||
|
- prefer_if_null_operators
|
||||||
|
- prefer_initializing_formals
|
||||||
|
- prefer_inlined_adds
|
||||||
|
- prefer_int_literals
|
||||||
|
- prefer_interpolation_to_compose_strings
|
||||||
|
- prefer_is_empty
|
||||||
|
- prefer_is_not_empty
|
||||||
|
- prefer_is_not_operator
|
||||||
|
- prefer_iterable_whereType
|
||||||
|
- prefer_mixin
|
||||||
|
- prefer_null_aware_operators
|
||||||
|
- prefer_null_aware_method_calls
|
||||||
|
- prefer_single_quotes
|
||||||
|
- prefer_spread_collections
|
||||||
|
- prefer_typing_uninitialized_variables
|
||||||
|
- prefer_void_to_null
|
||||||
|
- provide_deprecation_message
|
||||||
|
- recursive_getters
|
||||||
|
- require_trailing_commas
|
||||||
|
- slash_for_doc_comments
|
||||||
|
- sort_unnamed_constructors_first
|
||||||
|
- test_types_in_equals
|
||||||
|
- throw_in_finally
|
||||||
|
- tighten_type_of_initializing_formals
|
||||||
|
- type_annotate_public_apis
|
||||||
|
- type_init_formals
|
||||||
|
- unawaited_futures
|
||||||
|
- unnecessary_await_in_return
|
||||||
|
- unnecessary_brace_in_string_interps
|
||||||
|
- unnecessary_const
|
||||||
|
- unnecessary_constructor_name
|
||||||
|
- unnecessary_getters_setters
|
||||||
|
- unnecessary_lambdas
|
||||||
|
- unnecessary_late
|
||||||
|
- unnecessary_new
|
||||||
|
- unnecessary_null_aware_assignments
|
||||||
|
- unnecessary_null_checks
|
||||||
|
- unnecessary_null_in_if_null_operators
|
||||||
|
- unnecessary_nullable_for_final_variable_declarations
|
||||||
|
- unnecessary_overrides
|
||||||
|
- unnecessary_parenthesis
|
||||||
|
- unnecessary_raw_strings
|
||||||
|
- unnecessary_statements
|
||||||
|
- unnecessary_string_escapes
|
||||||
|
- unnecessary_string_interpolations
|
||||||
|
- unnecessary_this
|
||||||
|
- unrelated_type_equality_checks
|
||||||
|
- unsafe_html
|
||||||
|
- use_enums
|
||||||
|
- use_function_type_syntax_for_parameters
|
||||||
|
- use_if_null_to_convert_nulls_to_bools
|
||||||
|
- use_is_even_rather_than_modulo
|
||||||
|
- use_late_for_private_fields_and_variables
|
||||||
|
- use_named_constants
|
||||||
|
- use_raw_strings
|
||||||
|
- use_rethrow_when_possible
|
||||||
|
- use_setters_to_change_properties
|
||||||
|
- use_string_buffers
|
||||||
|
- use_super_parameters
|
||||||
|
- use_test_throws_matchers
|
||||||
|
- use_to_and_as_if_applicable
|
||||||
|
- valid_regexps
|
||||||
|
- void_checks
|
||||||
@@ -0,0 +1,213 @@
|
|||||||
|
# Copyright (C) 2022 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
analyzer:
|
||||||
|
language:
|
||||||
|
strict-casts: true
|
||||||
|
strict-inference: true
|
||||||
|
strict-raw-types: true
|
||||||
|
|
||||||
|
errors:
|
||||||
|
todo: info
|
||||||
|
close_sinks: ignore
|
||||||
|
missing_required_param: error
|
||||||
|
missing_return: error
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- lib/l10n/**
|
||||||
|
- lib/generated/**
|
||||||
|
- lib/gen/**
|
||||||
|
- lib/generated_plugin_registrant.dart
|
||||||
|
- test/.test_coverage.dart
|
||||||
|
- '**/*.g.dart'
|
||||||
|
- '**/*.freezed.dart'
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
- always_declare_return_types
|
||||||
|
- always_put_control_body_on_new_line
|
||||||
|
- always_put_required_named_parameters_first
|
||||||
|
- always_require_non_null_named_parameters
|
||||||
|
- always_use_package_imports
|
||||||
|
- annotate_overrides
|
||||||
|
- avoid_bool_literals_in_conditional_expressions
|
||||||
|
- avoid_catching_errors
|
||||||
|
- avoid_double_and_int_checks
|
||||||
|
- avoid_dynamic_calls
|
||||||
|
- avoid_empty_else
|
||||||
|
- avoid_equals_and_hash_code_on_mutable_classes
|
||||||
|
- avoid_escaping_inner_quotes
|
||||||
|
- avoid_field_initializers_in_const_classes
|
||||||
|
- avoid_final_parameters
|
||||||
|
- avoid_function_literals_in_foreach_calls
|
||||||
|
- avoid_init_to_null
|
||||||
|
- avoid_js_rounded_ints
|
||||||
|
- avoid_multiple_declarations_per_line
|
||||||
|
- avoid_null_checks_in_equality_operators
|
||||||
|
- avoid_positional_boolean_parameters
|
||||||
|
- avoid_private_typedef_functions
|
||||||
|
- avoid_redundant_argument_values
|
||||||
|
- avoid_relative_lib_imports
|
||||||
|
- avoid_renaming_method_parameters
|
||||||
|
- avoid_return_types_on_setters
|
||||||
|
- avoid_returning_null
|
||||||
|
- avoid_returning_null_for_future
|
||||||
|
- avoid_returning_null_for_void
|
||||||
|
- avoid_returning_this
|
||||||
|
- avoid_setters_without_getters
|
||||||
|
- avoid_shadowing_type_parameters
|
||||||
|
- avoid_single_cascade_in_expression_statements
|
||||||
|
- avoid_slow_async_io
|
||||||
|
- avoid_type_to_string
|
||||||
|
- avoid_types_as_parameter_names
|
||||||
|
- avoid_types_on_closure_parameters
|
||||||
|
- avoid_unused_constructor_parameters
|
||||||
|
- avoid_void_async
|
||||||
|
- await_only_futures
|
||||||
|
- camel_case_extensions
|
||||||
|
- camel_case_types
|
||||||
|
- cancel_subscriptions
|
||||||
|
- cascade_invocations
|
||||||
|
- cast_nullable_to_non_nullable
|
||||||
|
- comment_references
|
||||||
|
- conditional_uri_does_not_exist
|
||||||
|
- constant_identifier_names
|
||||||
|
- control_flow_in_finally
|
||||||
|
- curly_braces_in_flow_control_structures
|
||||||
|
- depend_on_referenced_packages
|
||||||
|
- deprecated_consistency
|
||||||
|
- directives_ordering
|
||||||
|
- empty_catches
|
||||||
|
- empty_constructor_bodies
|
||||||
|
- empty_statements
|
||||||
|
- eol_at_end_of_file
|
||||||
|
- exhaustive_cases
|
||||||
|
- file_names
|
||||||
|
- flutter_style_todos
|
||||||
|
- hash_and_equals
|
||||||
|
- implementation_imports
|
||||||
|
- iterable_contains_unrelated_type
|
||||||
|
- join_return_with_assignment
|
||||||
|
- leading_newlines_in_multiline_strings
|
||||||
|
- library_names
|
||||||
|
- library_prefixes
|
||||||
|
- library_private_types_in_public_api
|
||||||
|
- lines_longer_than_80_chars
|
||||||
|
- list_remove_unrelated_type
|
||||||
|
- literal_only_boolean_expressions
|
||||||
|
- missing_whitespace_between_adjacent_strings
|
||||||
|
- no_adjacent_strings_in_list
|
||||||
|
- no_default_cases
|
||||||
|
- no_duplicate_case_values
|
||||||
|
- no_leading_underscores_for_library_prefixes
|
||||||
|
- no_leading_underscores_for_local_identifiers
|
||||||
|
- no_runtimeType_toString
|
||||||
|
- non_constant_identifier_names
|
||||||
|
- noop_primitive_operations
|
||||||
|
- null_check_on_nullable_type_parameter
|
||||||
|
- null_closures
|
||||||
|
- one_member_abstracts
|
||||||
|
- only_throw_errors
|
||||||
|
- overridden_fields
|
||||||
|
- package_api_docs
|
||||||
|
- package_names
|
||||||
|
- package_prefixed_library_names
|
||||||
|
- parameter_assignments
|
||||||
|
- prefer_adjacent_string_concatenation
|
||||||
|
- prefer_asserts_in_initializer_lists
|
||||||
|
- prefer_asserts_with_message
|
||||||
|
- prefer_collection_literals
|
||||||
|
- prefer_conditional_assignment
|
||||||
|
- prefer_const_constructors
|
||||||
|
- prefer_const_constructors_in_immutables
|
||||||
|
- prefer_const_declarations
|
||||||
|
- prefer_const_literals_to_create_immutables
|
||||||
|
- prefer_constructors_over_static_methods
|
||||||
|
- prefer_contains
|
||||||
|
- prefer_equal_for_default_values
|
||||||
|
- prefer_expression_function_bodies
|
||||||
|
- prefer_final_fields
|
||||||
|
- prefer_final_in_for_each
|
||||||
|
- prefer_final_locals
|
||||||
|
- prefer_for_elements_to_map_fromIterable
|
||||||
|
- prefer_function_declarations_over_variables
|
||||||
|
- prefer_generic_function_type_aliases
|
||||||
|
- prefer_if_elements_to_conditional_expressions
|
||||||
|
- prefer_if_null_operators
|
||||||
|
- prefer_initializing_formals
|
||||||
|
- prefer_inlined_adds
|
||||||
|
- prefer_int_literals
|
||||||
|
- prefer_interpolation_to_compose_strings
|
||||||
|
- prefer_is_empty
|
||||||
|
- prefer_is_not_empty
|
||||||
|
- prefer_is_not_operator
|
||||||
|
- prefer_iterable_whereType
|
||||||
|
- prefer_mixin
|
||||||
|
- prefer_null_aware_method_calls
|
||||||
|
- prefer_null_aware_operators
|
||||||
|
- prefer_single_quotes
|
||||||
|
- prefer_spread_collections
|
||||||
|
- prefer_typing_uninitialized_variables
|
||||||
|
- prefer_void_to_null
|
||||||
|
- provide_deprecation_message
|
||||||
|
- recursive_getters
|
||||||
|
- require_trailing_commas
|
||||||
|
- slash_for_doc_comments
|
||||||
|
- sort_constructors_first
|
||||||
|
- sort_unnamed_constructors_first
|
||||||
|
- test_types_in_equals
|
||||||
|
- throw_in_finally
|
||||||
|
- tighten_type_of_initializing_formals
|
||||||
|
- type_annotate_public_apis
|
||||||
|
- type_init_formals
|
||||||
|
- unawaited_futures
|
||||||
|
- unnecessary_await_in_return
|
||||||
|
- unnecessary_brace_in_string_interps
|
||||||
|
- unnecessary_const
|
||||||
|
- unnecessary_constructor_name
|
||||||
|
- unnecessary_getters_setters
|
||||||
|
- unnecessary_lambdas
|
||||||
|
- unnecessary_late
|
||||||
|
- unnecessary_new
|
||||||
|
- unnecessary_null_aware_assignments
|
||||||
|
- unnecessary_null_checks
|
||||||
|
- unnecessary_null_in_if_null_operators
|
||||||
|
- unnecessary_nullable_for_final_variable_declarations
|
||||||
|
- unnecessary_overrides
|
||||||
|
- unnecessary_parenthesis
|
||||||
|
- unnecessary_raw_strings
|
||||||
|
- unnecessary_statements
|
||||||
|
- unnecessary_string_escapes
|
||||||
|
- unnecessary_string_interpolations
|
||||||
|
- unnecessary_this
|
||||||
|
- unnecessary_to_list_in_spreads
|
||||||
|
- unrelated_type_equality_checks
|
||||||
|
- unsafe_html
|
||||||
|
- use_enums
|
||||||
|
- use_function_type_syntax_for_parameters
|
||||||
|
- use_if_null_to_convert_nulls_to_bools
|
||||||
|
- use_is_even_rather_than_modulo
|
||||||
|
- use_late_for_private_fields_and_variables
|
||||||
|
- use_named_constants
|
||||||
|
- use_raw_strings
|
||||||
|
- use_rethrow_when_possible
|
||||||
|
- use_setters_to_change_properties
|
||||||
|
- use_string_buffers
|
||||||
|
- use_super_parameters
|
||||||
|
- use_test_throws_matchers
|
||||||
|
- use_to_and_as_if_applicable
|
||||||
|
- valid_regexps
|
||||||
|
- void_checks
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
analyzer:
|
||||||
|
language:
|
||||||
|
strict-casts: true
|
||||||
|
strict-inference: true
|
||||||
|
strict-raw-types: true
|
||||||
|
|
||||||
|
errors:
|
||||||
|
todo: info
|
||||||
|
close_sinks: ignore
|
||||||
|
missing_required_param: error
|
||||||
|
missing_return: error
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- lib/l10n/**
|
||||||
|
- lib/generated/**
|
||||||
|
- lib/gen/**
|
||||||
|
- lib/generated_plugin_registrant.dart
|
||||||
|
- test/.test_coverage.dart
|
||||||
|
- '**/*.g.dart'
|
||||||
|
- '**/*.freezed.dart'
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
- always_declare_return_types
|
||||||
|
- always_put_control_body_on_new_line
|
||||||
|
- always_put_required_named_parameters_first
|
||||||
|
- always_require_non_null_named_parameters
|
||||||
|
- always_use_package_imports
|
||||||
|
- annotate_overrides
|
||||||
|
- avoid_bool_literals_in_conditional_expressions
|
||||||
|
- avoid_catching_errors
|
||||||
|
- avoid_double_and_int_checks
|
||||||
|
- avoid_dynamic_calls
|
||||||
|
- avoid_empty_else
|
||||||
|
- avoid_equals_and_hash_code_on_mutable_classes
|
||||||
|
- avoid_escaping_inner_quotes
|
||||||
|
- avoid_field_initializers_in_const_classes
|
||||||
|
- avoid_final_parameters
|
||||||
|
- avoid_function_literals_in_foreach_calls
|
||||||
|
- avoid_init_to_null
|
||||||
|
- avoid_js_rounded_ints
|
||||||
|
- avoid_multiple_declarations_per_line
|
||||||
|
- avoid_null_checks_in_equality_operators
|
||||||
|
- avoid_positional_boolean_parameters
|
||||||
|
- avoid_private_typedef_functions
|
||||||
|
- avoid_redundant_argument_values
|
||||||
|
- avoid_relative_lib_imports
|
||||||
|
- avoid_renaming_method_parameters
|
||||||
|
- avoid_return_types_on_setters
|
||||||
|
- avoid_returning_null
|
||||||
|
- avoid_returning_null_for_future
|
||||||
|
- avoid_returning_null_for_void
|
||||||
|
- avoid_returning_this
|
||||||
|
- avoid_setters_without_getters
|
||||||
|
- avoid_shadowing_type_parameters
|
||||||
|
- avoid_single_cascade_in_expression_statements
|
||||||
|
- avoid_slow_async_io
|
||||||
|
- avoid_type_to_string
|
||||||
|
- avoid_types_as_parameter_names
|
||||||
|
- avoid_types_on_closure_parameters
|
||||||
|
- avoid_unused_constructor_parameters
|
||||||
|
- avoid_void_async
|
||||||
|
- await_only_futures
|
||||||
|
- camel_case_extensions
|
||||||
|
- camel_case_types
|
||||||
|
- cancel_subscriptions
|
||||||
|
- cascade_invocations
|
||||||
|
- cast_nullable_to_non_nullable
|
||||||
|
- collection_methods_unrelated_type
|
||||||
|
- combinators_ordering
|
||||||
|
- comment_references
|
||||||
|
- conditional_uri_does_not_exist
|
||||||
|
- constant_identifier_names
|
||||||
|
- control_flow_in_finally
|
||||||
|
- curly_braces_in_flow_control_structures
|
||||||
|
- depend_on_referenced_packages
|
||||||
|
- deprecated_consistency
|
||||||
|
- directives_ordering
|
||||||
|
- empty_catches
|
||||||
|
- empty_constructor_bodies
|
||||||
|
- empty_statements
|
||||||
|
- eol_at_end_of_file
|
||||||
|
- exhaustive_cases
|
||||||
|
- file_names
|
||||||
|
- flutter_style_todos
|
||||||
|
- hash_and_equals
|
||||||
|
- implementation_imports
|
||||||
|
- implicit_call_tearoffs
|
||||||
|
- iterable_contains_unrelated_type
|
||||||
|
- join_return_with_assignment
|
||||||
|
- leading_newlines_in_multiline_strings
|
||||||
|
- library_names
|
||||||
|
- library_prefixes
|
||||||
|
- library_private_types_in_public_api
|
||||||
|
- lines_longer_than_80_chars
|
||||||
|
- list_remove_unrelated_type
|
||||||
|
- literal_only_boolean_expressions
|
||||||
|
- missing_whitespace_between_adjacent_strings
|
||||||
|
- no_adjacent_strings_in_list
|
||||||
|
- no_default_cases
|
||||||
|
- no_duplicate_case_values
|
||||||
|
- no_leading_underscores_for_library_prefixes
|
||||||
|
- no_leading_underscores_for_local_identifiers
|
||||||
|
- no_runtimeType_toString
|
||||||
|
- non_constant_identifier_names
|
||||||
|
- noop_primitive_operations
|
||||||
|
- null_check_on_nullable_type_parameter
|
||||||
|
- null_closures
|
||||||
|
- one_member_abstracts
|
||||||
|
- only_throw_errors
|
||||||
|
- overridden_fields
|
||||||
|
- package_api_docs
|
||||||
|
- package_names
|
||||||
|
- package_prefixed_library_names
|
||||||
|
- parameter_assignments
|
||||||
|
- prefer_adjacent_string_concatenation
|
||||||
|
- prefer_asserts_in_initializer_lists
|
||||||
|
- prefer_asserts_with_message
|
||||||
|
- prefer_collection_literals
|
||||||
|
- prefer_conditional_assignment
|
||||||
|
- prefer_const_constructors
|
||||||
|
- prefer_const_constructors_in_immutables
|
||||||
|
- prefer_const_declarations
|
||||||
|
- prefer_const_literals_to_create_immutables
|
||||||
|
- prefer_constructors_over_static_methods
|
||||||
|
- prefer_contains
|
||||||
|
- prefer_equal_for_default_values
|
||||||
|
- prefer_expression_function_bodies
|
||||||
|
- prefer_final_fields
|
||||||
|
- prefer_final_in_for_each
|
||||||
|
- prefer_final_locals
|
||||||
|
- prefer_for_elements_to_map_fromIterable
|
||||||
|
- prefer_function_declarations_over_variables
|
||||||
|
- prefer_generic_function_type_aliases
|
||||||
|
- prefer_if_elements_to_conditional_expressions
|
||||||
|
- prefer_if_null_operators
|
||||||
|
- prefer_initializing_formals
|
||||||
|
- prefer_inlined_adds
|
||||||
|
- prefer_int_literals
|
||||||
|
- prefer_interpolation_to_compose_strings
|
||||||
|
- prefer_is_empty
|
||||||
|
- prefer_is_not_empty
|
||||||
|
- prefer_is_not_operator
|
||||||
|
- prefer_iterable_whereType
|
||||||
|
- prefer_mixin
|
||||||
|
- prefer_null_aware_method_calls
|
||||||
|
- prefer_null_aware_operators
|
||||||
|
- prefer_single_quotes
|
||||||
|
- prefer_spread_collections
|
||||||
|
- prefer_typing_uninitialized_variables
|
||||||
|
- prefer_void_to_null
|
||||||
|
- provide_deprecation_message
|
||||||
|
- recursive_getters
|
||||||
|
- require_trailing_commas
|
||||||
|
- slash_for_doc_comments
|
||||||
|
- sort_constructors_first
|
||||||
|
- sort_unnamed_constructors_first
|
||||||
|
- test_types_in_equals
|
||||||
|
- throw_in_finally
|
||||||
|
- tighten_type_of_initializing_formals
|
||||||
|
- type_annotate_public_apis
|
||||||
|
- type_init_formals
|
||||||
|
- unawaited_futures
|
||||||
|
- unnecessary_await_in_return
|
||||||
|
- unnecessary_brace_in_string_interps
|
||||||
|
- unnecessary_const
|
||||||
|
- unnecessary_constructor_name
|
||||||
|
- unnecessary_getters_setters
|
||||||
|
- unnecessary_lambdas
|
||||||
|
- unnecessary_late
|
||||||
|
- unnecessary_new
|
||||||
|
- unnecessary_null_aware_assignments
|
||||||
|
- unnecessary_null_checks
|
||||||
|
- unnecessary_null_in_if_null_operators
|
||||||
|
- unnecessary_nullable_for_final_variable_declarations
|
||||||
|
- unnecessary_overrides
|
||||||
|
- unnecessary_parenthesis
|
||||||
|
- unnecessary_raw_strings
|
||||||
|
- unnecessary_statements
|
||||||
|
- unnecessary_string_escapes
|
||||||
|
- unnecessary_string_interpolations
|
||||||
|
- unnecessary_this
|
||||||
|
- unnecessary_to_list_in_spreads
|
||||||
|
- unrelated_type_equality_checks
|
||||||
|
- unsafe_html
|
||||||
|
- use_enums
|
||||||
|
- use_function_type_syntax_for_parameters
|
||||||
|
- use_if_null_to_convert_nulls_to_bools
|
||||||
|
- use_is_even_rather_than_modulo
|
||||||
|
- use_late_for_private_fields_and_variables
|
||||||
|
- use_named_constants
|
||||||
|
- use_raw_strings
|
||||||
|
- use_rethrow_when_possible
|
||||||
|
- use_setters_to_change_properties
|
||||||
|
- use_string_buffers
|
||||||
|
- use_string_in_part_of_directives
|
||||||
|
- use_super_parameters
|
||||||
|
- use_test_throws_matchers
|
||||||
|
- use_to_and_as_if_applicable
|
||||||
|
- valid_regexps
|
||||||
|
- void_checks
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
analyzer:
|
||||||
|
language:
|
||||||
|
strict-casts: true
|
||||||
|
strict-inference: true
|
||||||
|
strict-raw-types: true
|
||||||
|
|
||||||
|
errors:
|
||||||
|
todo: ignore
|
||||||
|
close_sinks: ignore
|
||||||
|
missing_required_param: error
|
||||||
|
missing_return: error
|
||||||
|
|
||||||
|
exclude:
|
||||||
|
- lib/l10n/**
|
||||||
|
- lib/generated/**
|
||||||
|
- lib/gen/**
|
||||||
|
- lib/generated_plugin_registrant.dart
|
||||||
|
- test/.test_coverage.dart
|
||||||
|
- "**/*.g.dart"
|
||||||
|
- "**/*.freezed.dart"
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
- always_declare_return_types
|
||||||
|
- always_put_control_body_on_new_line
|
||||||
|
- always_put_required_named_parameters_first
|
||||||
|
- always_require_non_null_named_parameters
|
||||||
|
- always_use_package_imports
|
||||||
|
- annotate_overrides
|
||||||
|
- avoid_bool_literals_in_conditional_expressions
|
||||||
|
- avoid_catching_errors
|
||||||
|
- avoid_double_and_int_checks
|
||||||
|
- avoid_dynamic_calls
|
||||||
|
- avoid_empty_else
|
||||||
|
- avoid_equals_and_hash_code_on_mutable_classes
|
||||||
|
- avoid_escaping_inner_quotes
|
||||||
|
- avoid_field_initializers_in_const_classes
|
||||||
|
- avoid_final_parameters
|
||||||
|
- avoid_function_literals_in_foreach_calls
|
||||||
|
- avoid_init_to_null
|
||||||
|
- avoid_js_rounded_ints
|
||||||
|
- avoid_multiple_declarations_per_line
|
||||||
|
- avoid_null_checks_in_equality_operators
|
||||||
|
- avoid_positional_boolean_parameters
|
||||||
|
- avoid_private_typedef_functions
|
||||||
|
- avoid_redundant_argument_values
|
||||||
|
- avoid_relative_lib_imports
|
||||||
|
- avoid_renaming_method_parameters
|
||||||
|
- avoid_return_types_on_setters
|
||||||
|
- avoid_returning_null
|
||||||
|
- avoid_returning_null_for_future
|
||||||
|
- avoid_returning_null_for_void
|
||||||
|
- avoid_returning_this
|
||||||
|
- avoid_setters_without_getters
|
||||||
|
- avoid_shadowing_type_parameters
|
||||||
|
- avoid_single_cascade_in_expression_statements
|
||||||
|
- avoid_slow_async_io
|
||||||
|
- avoid_type_to_string
|
||||||
|
- avoid_types_as_parameter_names
|
||||||
|
- avoid_types_on_closure_parameters
|
||||||
|
- avoid_unused_constructor_parameters
|
||||||
|
- avoid_void_async
|
||||||
|
- await_only_futures
|
||||||
|
- camel_case_extensions
|
||||||
|
- camel_case_types
|
||||||
|
- cancel_subscriptions
|
||||||
|
- cascade_invocations
|
||||||
|
- cast_nullable_to_non_nullable
|
||||||
|
- collection_methods_unrelated_type
|
||||||
|
- combinators_ordering
|
||||||
|
- comment_references
|
||||||
|
- conditional_uri_does_not_exist
|
||||||
|
- constant_identifier_names
|
||||||
|
- control_flow_in_finally
|
||||||
|
- curly_braces_in_flow_control_structures
|
||||||
|
- depend_on_referenced_packages
|
||||||
|
- deprecated_consistency
|
||||||
|
- directives_ordering
|
||||||
|
- empty_catches
|
||||||
|
- empty_constructor_bodies
|
||||||
|
- empty_statements
|
||||||
|
- eol_at_end_of_file
|
||||||
|
- exhaustive_cases
|
||||||
|
- file_names
|
||||||
|
- flutter_style_todos
|
||||||
|
- hash_and_equals
|
||||||
|
- implementation_imports
|
||||||
|
- implicit_call_tearoffs
|
||||||
|
- iterable_contains_unrelated_type
|
||||||
|
- join_return_with_assignment
|
||||||
|
- leading_newlines_in_multiline_strings
|
||||||
|
- library_names
|
||||||
|
- library_prefixes
|
||||||
|
- library_private_types_in_public_api
|
||||||
|
- lines_longer_than_80_chars
|
||||||
|
- list_remove_unrelated_type
|
||||||
|
- literal_only_boolean_expressions
|
||||||
|
- missing_whitespace_between_adjacent_strings
|
||||||
|
- no_adjacent_strings_in_list
|
||||||
|
- no_default_cases
|
||||||
|
- no_duplicate_case_values
|
||||||
|
- no_leading_underscores_for_library_prefixes
|
||||||
|
- no_leading_underscores_for_local_identifiers
|
||||||
|
- no_runtimeType_toString
|
||||||
|
- non_constant_identifier_names
|
||||||
|
- noop_primitive_operations
|
||||||
|
- null_check_on_nullable_type_parameter
|
||||||
|
- null_closures
|
||||||
|
- one_member_abstracts
|
||||||
|
- only_throw_errors
|
||||||
|
- overridden_fields
|
||||||
|
- package_api_docs
|
||||||
|
- package_names
|
||||||
|
- package_prefixed_library_names
|
||||||
|
- parameter_assignments
|
||||||
|
- prefer_adjacent_string_concatenation
|
||||||
|
- prefer_asserts_in_initializer_lists
|
||||||
|
- prefer_asserts_with_message
|
||||||
|
- prefer_collection_literals
|
||||||
|
- prefer_conditional_assignment
|
||||||
|
- prefer_const_constructors
|
||||||
|
- prefer_const_constructors_in_immutables
|
||||||
|
- prefer_const_declarations
|
||||||
|
- prefer_const_literals_to_create_immutables
|
||||||
|
- prefer_constructors_over_static_methods
|
||||||
|
- prefer_contains
|
||||||
|
- prefer_equal_for_default_values
|
||||||
|
- prefer_expression_function_bodies
|
||||||
|
- prefer_final_fields
|
||||||
|
- prefer_final_in_for_each
|
||||||
|
- prefer_final_locals
|
||||||
|
- prefer_for_elements_to_map_fromIterable
|
||||||
|
- prefer_function_declarations_over_variables
|
||||||
|
- prefer_generic_function_type_aliases
|
||||||
|
- prefer_if_elements_to_conditional_expressions
|
||||||
|
- prefer_if_null_operators
|
||||||
|
- prefer_initializing_formals
|
||||||
|
- prefer_inlined_adds
|
||||||
|
- prefer_int_literals
|
||||||
|
- prefer_interpolation_to_compose_strings
|
||||||
|
- prefer_is_empty
|
||||||
|
- prefer_is_not_empty
|
||||||
|
- prefer_is_not_operator
|
||||||
|
- prefer_iterable_whereType
|
||||||
|
- prefer_mixin
|
||||||
|
- prefer_null_aware_method_calls
|
||||||
|
- prefer_null_aware_operators
|
||||||
|
- prefer_single_quotes
|
||||||
|
- prefer_spread_collections
|
||||||
|
- prefer_typing_uninitialized_variables
|
||||||
|
- prefer_void_to_null
|
||||||
|
- provide_deprecation_message
|
||||||
|
- recursive_getters
|
||||||
|
- require_trailing_commas
|
||||||
|
- slash_for_doc_comments
|
||||||
|
- sort_constructors_first
|
||||||
|
- sort_unnamed_constructors_first
|
||||||
|
- test_types_in_equals
|
||||||
|
- throw_in_finally
|
||||||
|
- tighten_type_of_initializing_formals
|
||||||
|
- type_annotate_public_apis
|
||||||
|
- type_init_formals
|
||||||
|
- unawaited_futures
|
||||||
|
- unnecessary_await_in_return
|
||||||
|
- unnecessary_brace_in_string_interps
|
||||||
|
- unnecessary_const
|
||||||
|
- unnecessary_constructor_name
|
||||||
|
- unnecessary_getters_setters
|
||||||
|
- unnecessary_lambdas
|
||||||
|
- unnecessary_late
|
||||||
|
- unnecessary_new
|
||||||
|
- unnecessary_null_aware_assignments
|
||||||
|
- unnecessary_null_checks
|
||||||
|
- unnecessary_null_in_if_null_operators
|
||||||
|
- unnecessary_nullable_for_final_variable_declarations
|
||||||
|
- unnecessary_overrides
|
||||||
|
- unnecessary_parenthesis
|
||||||
|
- unnecessary_raw_strings
|
||||||
|
- unnecessary_statements
|
||||||
|
- unnecessary_string_escapes
|
||||||
|
- unnecessary_string_interpolations
|
||||||
|
- unnecessary_this
|
||||||
|
- unnecessary_to_list_in_spreads
|
||||||
|
- unrelated_type_equality_checks
|
||||||
|
- unsafe_html
|
||||||
|
- use_enums
|
||||||
|
- use_function_type_syntax_for_parameters
|
||||||
|
- use_if_null_to_convert_nulls_to_bools
|
||||||
|
- use_is_even_rather_than_modulo
|
||||||
|
- use_late_for_private_fields_and_variables
|
||||||
|
- use_named_constants
|
||||||
|
- use_raw_strings
|
||||||
|
- use_rethrow_when_possible
|
||||||
|
- use_setters_to_change_properties
|
||||||
|
- use_string_buffers
|
||||||
|
- use_string_in_part_of_directives
|
||||||
|
- use_super_parameters
|
||||||
|
- use_test_throws_matchers
|
||||||
|
- use_to_and_as_if_applicable
|
||||||
|
- valid_regexps
|
||||||
|
- void_checks
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
include: package:wyatt_analysis/analysis_options.2.1.1.yaml
|
include: package:wyatt_analysis/analysis_options.2.2.0.yaml
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
rules:
|
rules:
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Copyright (C) 2022 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
include: package:wyatt_analysis/analysis_options.2.2.2.yaml
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
- avoid_print
|
||||||
|
- avoid_unnecessary_containers
|
||||||
|
- avoid_web_libraries_in_flutter
|
||||||
|
- no_logic_in_create_state
|
||||||
|
- sized_box_for_whitespace
|
||||||
|
- sized_box_shrink_expand
|
||||||
|
- sort_child_properties_last
|
||||||
|
- use_build_context_synchronously
|
||||||
|
- use_colored_box
|
||||||
|
- use_decorated_box
|
||||||
|
- use_full_hex_values_for_flutter_colors
|
||||||
|
- use_key_in_widget_constructors
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Copyright (C) 2022 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
include: package:wyatt_analysis/analysis_options.2.3.0.yaml
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
- avoid_print
|
||||||
|
- avoid_unnecessary_containers
|
||||||
|
- avoid_web_libraries_in_flutter
|
||||||
|
- no_logic_in_create_state
|
||||||
|
- sized_box_for_whitespace
|
||||||
|
- sized_box_shrink_expand
|
||||||
|
- sort_child_properties_last
|
||||||
|
- use_build_context_synchronously
|
||||||
|
- use_colored_box
|
||||||
|
- use_decorated_box
|
||||||
|
- use_full_hex_values_for_flutter_colors
|
||||||
|
- use_key_in_widget_constructors
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
include: package:wyatt_analysis/analysis_options.2.4.0.yaml
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
- avoid_print
|
||||||
|
- avoid_unnecessary_containers
|
||||||
|
- avoid_web_libraries_in_flutter
|
||||||
|
- no_logic_in_create_state
|
||||||
|
- sized_box_for_whitespace
|
||||||
|
- sized_box_shrink_expand
|
||||||
|
- sort_child_properties_last
|
||||||
|
- use_build_context_synchronously
|
||||||
|
- use_colored_box
|
||||||
|
- use_decorated_box
|
||||||
|
- use_full_hex_values_for_flutter_colors
|
||||||
|
- use_key_in_widget_constructors
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
include: package:wyatt_analysis/analysis_options.2.4.1.yaml
|
||||||
|
|
||||||
|
linter:
|
||||||
|
rules:
|
||||||
|
- avoid_print
|
||||||
|
- avoid_unnecessary_containers
|
||||||
|
- avoid_web_libraries_in_flutter
|
||||||
|
- no_logic_in_create_state
|
||||||
|
- sized_box_for_whitespace
|
||||||
|
- sized_box_shrink_expand
|
||||||
|
- sort_child_properties_last
|
||||||
|
- use_build_context_synchronously
|
||||||
|
- use_colored_box
|
||||||
|
- use_decorated_box
|
||||||
|
- use_full_hex_values_for_flutter_colors
|
||||||
|
- use_key_in_widget_constructors
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2022 WYATT GROUP
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
# Please see the AUTHORS file for details.
|
# Please see the AUTHORS file for details.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
@@ -14,4 +14,4 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
include: package:wyatt_analysis/analysis_options.flutter.2.2.1.yaml
|
include: package:wyatt_analysis/analysis_options.flutter.2.4.1.yaml
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2022 WYATT GROUP
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
# Please see the AUTHORS file for details.
|
# Please see the AUTHORS file for details.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
@@ -14,4 +14,4 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
include: package:wyatt_analysis/analysis_options.2.2.1.yaml
|
include: package:wyatt_analysis/analysis_options.2.4.1.yaml
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2023 WYATT GROUP
|
||||||
// Please see the AUTHORS file for details.
|
// Please see the AUTHORS file for details.
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
@@ -15,8 +15,7 @@
|
|||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/// Wyatt analyzer settings and best practices
|
/// Wyatt analyzer settings and best practices
|
||||||
/// used internally at [Wyatt](https://wyattapp.io)
|
/// used internally at [Wyatt Studio](https://wyatt-studio.fr).
|
||||||
/// and [Wyatt Studio](https://wyatt-studio.fr).
|
|
||||||
library wyatt_analysis;
|
library wyatt_analysis;
|
||||||
|
|
||||||
const String wyattAnalysisVersion = '2.2.1';
|
const String wyattAnalysisVersion = '2.4.1';
|
||||||
|
|||||||
Executable
+142
@@ -0,0 +1,142 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# Copyright (C) 2022 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
usage="
|
||||||
|
usage:
|
||||||
|
$(basename "$0") <new_version> -- create new analyzer files.
|
||||||
|
|
||||||
|
where:
|
||||||
|
new_version: new version, for example \`2.4.0\`"
|
||||||
|
|
||||||
|
new=$1
|
||||||
|
|
||||||
|
if [ -z "$new" ]; then
|
||||||
|
echo "new_version cannot be null"
|
||||||
|
echo "${usage}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SCRIPT_PATH="${BASH_SOURCE:-$0}"
|
||||||
|
ABS_SCRIPT_PATH="$(realpath "${SCRIPT_PATH}")"
|
||||||
|
ABS_DIRECTORY="$(dirname "${ABS_SCRIPT_PATH}")"
|
||||||
|
|
||||||
|
LATEST_VERSION="${ABS_DIRECTORY}/.latest_version"
|
||||||
|
|
||||||
|
# Read latest version
|
||||||
|
if [ -e "$LATEST_VERSION" ]; then
|
||||||
|
old=$(cat "$LATEST_VERSION")
|
||||||
|
echo "> latest package version is: $old"
|
||||||
|
echo "> new package version is: $new"
|
||||||
|
else
|
||||||
|
echo "latest version is not set"
|
||||||
|
echo "create a file named \`.latest_version\` in the root of the project"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
LIB="${ABS_DIRECTORY}/lib/wyatt_analysis.dart"
|
||||||
|
OPTIONS="${ABS_DIRECTORY}/lib/analysis_options.yaml"
|
||||||
|
OLD_OPTIONS="${ABS_DIRECTORY}/lib/analysis_options.${old}.yaml"
|
||||||
|
NEW_OPTIONS="${ABS_DIRECTORY}/lib/analysis_options.${new}.yaml"
|
||||||
|
|
||||||
|
OPTIONS_FLUTTER="${ABS_DIRECTORY}/lib/analysis_options.flutter.yaml"
|
||||||
|
OLD_OPTIONS_FLUTTER="${ABS_DIRECTORY}/lib/analysis_options.flutter.${old}.yaml"
|
||||||
|
NEW_OPTIONS_FLUTTER="${ABS_DIRECTORY}/lib/analysis_options.flutter.${new}.yaml"
|
||||||
|
|
||||||
|
|
||||||
|
if [ ! -e "$OLD_OPTIONS" ]; then
|
||||||
|
echo "analysis_options.${old}.yaml doesn't exists"
|
||||||
|
echo "${usage}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "$OLD_OPTIONS_FLUTTER" ]; then
|
||||||
|
echo "analysis_options.flutter.${old}.yaml doesn't exists"
|
||||||
|
echo "${usage}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "$NEW_OPTIONS" ]; then
|
||||||
|
echo "analysis_options.${new}.yaml already exists"
|
||||||
|
echo "${usage}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e "$NEW_OPTIONS_FLUTTER" ]; then
|
||||||
|
echo "analysis_options.flutter.${old}.yaml already exists"
|
||||||
|
echo "${usage}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy previous version files
|
||||||
|
cp "${OLD_OPTIONS}" "${NEW_OPTIONS}"
|
||||||
|
cp "${OLD_OPTIONS_FLUTTER}" "${NEW_OPTIONS_FLUTTER}"
|
||||||
|
|
||||||
|
# Search and replace old version string occurences in new files
|
||||||
|
sed -e "s/${old}/${new}/g" "${NEW_OPTIONS_FLUTTER}" > tempfile.tmp
|
||||||
|
mv -f tempfile.tmp "${NEW_OPTIONS_FLUTTER}"
|
||||||
|
|
||||||
|
sed -e "s/${old}/${new}/g" "${LIB}" > tempfile.tmp
|
||||||
|
mv -f tempfile.tmp "${LIB}"
|
||||||
|
|
||||||
|
sed -e "s/${old}/${new}/g" "README.md" > tempfile.tmp
|
||||||
|
mv -f tempfile.tmp "README.md"
|
||||||
|
|
||||||
|
echo "
|
||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
include: package:wyatt_analysis/analysis_options.${new}.yaml
|
||||||
|
" > "${OPTIONS}"
|
||||||
|
|
||||||
|
echo "
|
||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
include: package:wyatt_analysis/analysis_options.flutter.${new}.yaml
|
||||||
|
" > "${OPTIONS_FLUTTER}"
|
||||||
|
|
||||||
|
# Update latest version
|
||||||
|
echo "${new}" > "$LATEST_VERSION"
|
||||||
|
|
||||||
|
exit 0
|
||||||
@@ -1,9 +1,25 @@
|
|||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
name: wyatt_analysis
|
name: wyatt_analysis
|
||||||
description: Lint rules for Dart and Flutter used internally at Wyatt and Wyatt Studio.
|
description: Lint rules for Dart and Flutter used internally at Wyatt Studio.
|
||||||
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis
|
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis
|
||||||
version: 2.2.2
|
version: 2.4.1
|
||||||
|
|
||||||
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.12.0 <3.0.0'
|
sdk: ">=2.12.0 <3.0.0"
|
||||||
|
|||||||
@@ -1,3 +1,20 @@
|
|||||||
|
## 0.1.0+1
|
||||||
|
|
||||||
|
- Update a dependency to the latest release.
|
||||||
|
|
||||||
|
## 0.1.0
|
||||||
|
|
||||||
|
> Note: This release has breaking changes.
|
||||||
|
|
||||||
|
- **REFACTOR**: update naming methodes (close #47).
|
||||||
|
- **REFACTOR**: update example. (close #38).
|
||||||
|
- **FIX**: fix execute method on error handler. (#38).
|
||||||
|
- **FEAT**: update usecase en add & sepcific case. (#38).
|
||||||
|
- **FEAT**: add obsevers for alternative usecase scenarions (#38).
|
||||||
|
- **DOCS**: generate class model. (#38).
|
||||||
|
- **DOCS**: update Readme. (#38).
|
||||||
|
- **BREAKING** **CHORE**: update exports. (#38).
|
||||||
|
|
||||||
## 0.0.2
|
## 0.0.2
|
||||||
|
|
||||||
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
|
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ The Wyatt Architecture for Flutter.
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* Usecase
|
- Usecase
|
||||||
* Repository
|
- Repository
|
||||||
* DataSource
|
- DataSource
|
||||||
* Entity
|
- Entity
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -75,16 +75,17 @@ abstract class PhotoRepository extends BaseRepository {
|
|||||||
|
|
||||||
> Here the repository is just a proxy of the data sources with result type (to have beautiful error handling).
|
> Here the repository is just a proxy of the data sources with result type (to have beautiful error handling).
|
||||||
|
|
||||||
And finaly create your different usecases by using `UseCase<Parameters, ReturnType>` :
|
And finaly create your different usecases :
|
||||||
|
|
||||||
|
Several use cases are supported :
|
||||||
|
|
||||||
|
- Classic usecase :
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
class RetrieveAllPhoto extends UseCase<QueryParameters, List<Photo>> {
|
class Test extends AsyncUseCase<QueryParameters, List<Photo>>> {
|
||||||
final PhotoRepository _photoRepository;
|
|
||||||
|
|
||||||
RetrieveAllPhotos(this._photoRepository);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Photo>> call(QueryParameters params) {
|
FuturOrResult<List<Photo>>> call(QueryParameters? params) {
|
||||||
final photos = _photoRepository.getAllPhotos(
|
final photos = _photoRepository.getAllPhotos(
|
||||||
start: params.start,
|
start: params.start,
|
||||||
limit: params.limit,
|
limit: params.limit,
|
||||||
@@ -94,6 +95,54 @@ class RetrieveAllPhoto extends UseCase<QueryParameters, List<Photo>> {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can add alternatve scenarios and check pre/post conditions using our extensions :
|
||||||
|
|
||||||
|
```dart
|
||||||
|
class SearchPhotos extends AsyncUseCase<QueryParameters, List<Photo>>> {
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOrResult<List<Photo>>> call(QueryParameters? params) {
|
||||||
|
final photos = _photoRepository.getAllPhotos(
|
||||||
|
start: params.start,
|
||||||
|
limit: params.limit,
|
||||||
|
);
|
||||||
|
return photos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<void> onStart(QueryParameters? params) {
|
||||||
|
if(params.start == null || params.limit == null){
|
||||||
|
throw ClientException('Préconndition non valides');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can implement error scenarios overriding `onError`, or check postconditions by overriding `onComplete` .
|
||||||
|
|
||||||
|
- Stream usecase :
|
||||||
|
|
||||||
|
```dart
|
||||||
|
class SearchPhotos extends StreamUseCase<QueryParameters, List<Photo>>> {
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOrResult<Stream<List<Photo>>>> call(QueryParameters? params) {
|
||||||
|
final photos = _photoRepository.getAllPhotos(
|
||||||
|
start: params.start,
|
||||||
|
limit: params.limit,
|
||||||
|
);
|
||||||
|
return photos;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
On this case, observers allow you to add alternative scénarios when data changed, overriding `onData` or `onDone`.
|
||||||
|
|
||||||
|
Please note that to use handlers, call `call` method and not `execute`.
|
||||||
|
|
||||||
> In fact, here we need a new parameter object, so let's create it:
|
> In fact, here we need a new parameter object, so let's create it:
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
|
|||||||
+1
-2
@@ -24,9 +24,8 @@ import 'package:wyatt_http_client/wyatt_http_client.dart';
|
|||||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||||
|
|
||||||
class AlbumApiDataSourceImpl extends AlbumRemoteDataSource {
|
class AlbumApiDataSourceImpl extends AlbumRemoteDataSource {
|
||||||
final MiddlewareClient _client;
|
|
||||||
|
|
||||||
AlbumApiDataSourceImpl(this._client);
|
AlbumApiDataSourceImpl(this._client);
|
||||||
|
final MiddlewareClient _client;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Album> getAlbum(int id) async {
|
Future<Album> getAlbum(int id) async {
|
||||||
|
|||||||
+1
-2
@@ -24,9 +24,8 @@ import 'package:wyatt_http_client/wyatt_http_client.dart';
|
|||||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||||
|
|
||||||
class PhotoApiDataSourceImpl extends PhotoRemoteDataSource {
|
class PhotoApiDataSourceImpl extends PhotoRemoteDataSource {
|
||||||
final MiddlewareClient _client;
|
|
||||||
|
|
||||||
PhotoApiDataSourceImpl(this._client);
|
PhotoApiDataSourceImpl(this._client);
|
||||||
|
final MiddlewareClient _client;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Photo> getPhoto(int id) async {
|
Future<Photo> getPhoto(int id) async {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
import 'package:architecture_example/data/models/photo_model.dart';
|
import 'package:architecture_example/data/models/photo_model.dart';
|
||||||
|
|
||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
|||||||
+13
-13
@@ -24,57 +24,57 @@ import 'package:wyatt_architecture/wyatt_architecture.dart';
|
|||||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||||
|
|
||||||
class PhotoRepositoryImpl extends PhotoRepository {
|
class PhotoRepositoryImpl extends PhotoRepository {
|
||||||
final PhotoRemoteDataSource _photoRemoteDataSource;
|
|
||||||
final AlbumRemoteDataSource _albumRemoteDataSource;
|
|
||||||
final FavoriteLocalDataSource _favoriteLocalDataSource;
|
|
||||||
|
|
||||||
PhotoRepositoryImpl(
|
PhotoRepositoryImpl(
|
||||||
this._photoRemoteDataSource,
|
this._photoRemoteDataSource,
|
||||||
this._albumRemoteDataSource,
|
this._albumRemoteDataSource,
|
||||||
this._favoriteLocalDataSource,
|
this._favoriteLocalDataSource,
|
||||||
);
|
);
|
||||||
|
final PhotoRemoteDataSource _photoRemoteDataSource;
|
||||||
|
final AlbumRemoteDataSource _albumRemoteDataSource;
|
||||||
|
final FavoriteLocalDataSource _favoriteLocalDataSource;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<void> addPhotoToFavorites(Photo photo) => Result.tryCatchAsync(
|
FutureOrResult<void> addPhotoToFavorites(Photo photo) => Result.tryCatchAsync(
|
||||||
() => _favoriteLocalDataSource.addPhotoToFavorites(photo),
|
() => _favoriteLocalDataSource.addPhotoToFavorites(photo),
|
||||||
(error) => ClientException('Cannot add photo to favorites.'),
|
(error) => ClientException('Cannot add photo to favorites.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<bool> checkIfPhotoIsInFavorites(int id) => Result.tryCatchAsync(
|
FutureOrResult<bool> checkIfPhotoIsInFavorites(int id) =>
|
||||||
|
Result.tryCatchAsync(
|
||||||
() => _favoriteLocalDataSource.checkIfPhotoIsInFavorites(id),
|
() => _favoriteLocalDataSource.checkIfPhotoIsInFavorites(id),
|
||||||
(error) =>
|
(error) =>
|
||||||
ClientException('Cannot check if photo `$id` is in favorites.'),
|
ClientException('Cannot check if photo `$id` is in favorites.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<void> deletePhotoFromFavorites(int id) => Result.tryCatchAsync(
|
FutureOrResult<void> deletePhotoFromFavorites(int id) => Result.tryCatchAsync(
|
||||||
() => _favoriteLocalDataSource.deletePhotoFromFavorites(id),
|
() => _favoriteLocalDataSource.deletePhotoFromFavorites(id),
|
||||||
(error) => ClientException('Cannot delete photo `$id` from favorites.'),
|
(error) => ClientException('Cannot delete photo `$id` from favorites.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<Album> getAlbum(int id) => Result.tryCatchAsync(
|
FutureOrResult<Album> getAlbum(int id) => Result.tryCatchAsync(
|
||||||
() => _albumRemoteDataSource.getAlbum(id),
|
() => _albumRemoteDataSource.getAlbum(id),
|
||||||
(error) => ServerException('Cannot retrieve album $id.'),
|
(error) => ServerException('Cannot retrieve album $id.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Album>> getAllAlbums({int? start, int? limit}) =>
|
FutureOrResult<List<Album>> getAllAlbums({int? start, int? limit}) =>
|
||||||
Result.tryCatchAsync(
|
Result.tryCatchAsync(
|
||||||
() => _albumRemoteDataSource.getAllAlbums(start: start, limit: limit),
|
() => _albumRemoteDataSource.getAllAlbums(start: start, limit: limit),
|
||||||
(error) => ServerException('Cannot retrieve all albums.'),
|
(error) => ServerException('Cannot retrieve all albums.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Photo>> getAllPhotos({int? start, int? limit}) async =>
|
FutureOrResult<List<Photo>> getAllPhotos({int? start, int? limit}) async =>
|
||||||
Result.tryCatchAsync(
|
Result.tryCatchAsync(
|
||||||
() => _photoRemoteDataSource.getAllPhotos(start: start, limit: limit),
|
() => _photoRemoteDataSource.getAllPhotos(start: start, limit: limit),
|
||||||
(error) => ServerException('Cannot retrieve all photos.'),
|
(error) => ServerException('Cannot retrieve all photos.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Photo>> getAllPhotosFromFavorites() async {
|
FutureOrResult<List<Photo>> getAllPhotosFromFavorites() async {
|
||||||
try {
|
try {
|
||||||
final response = <Photo>[];
|
final response = <Photo>[];
|
||||||
final favorites =
|
final favorites =
|
||||||
@@ -95,13 +95,13 @@ class PhotoRepositoryImpl extends PhotoRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<Photo> getPhoto(int id) => Result.tryCatchAsync(
|
FutureOrResult<Photo> getPhoto(int id) => Result.tryCatchAsync(
|
||||||
() => _photoRemoteDataSource.getPhoto(id),
|
() => _photoRemoteDataSource.getPhoto(id),
|
||||||
(error) => ServerException('Cannot retrieve photo $id.'),
|
(error) => ServerException('Cannot retrieve photo $id.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Photo>> getPhotosFromAlbum(
|
FutureOrResult<List<Photo>> getPhotosFromAlbum(
|
||||||
int albumId, {
|
int albumId, {
|
||||||
int? start,
|
int? start,
|
||||||
int? limit,
|
int? limit,
|
||||||
|
|||||||
@@ -19,17 +19,17 @@ import 'package:architecture_example/domain/entities/photo.dart';
|
|||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
abstract class PhotoRepository extends BaseRepository {
|
abstract class PhotoRepository extends BaseRepository {
|
||||||
FutureResult<Album> getAlbum(int id);
|
FutureOrResult<Album> getAlbum(int id);
|
||||||
FutureResult<List<Album>> getAllAlbums({int? start, int? limit});
|
FutureOrResult<List<Album>> getAllAlbums({int? start, int? limit});
|
||||||
FutureResult<Photo> getPhoto(int id);
|
FutureOrResult<Photo> getPhoto(int id);
|
||||||
FutureResult<List<Photo>> getAllPhotos({int? start, int? limit});
|
FutureOrResult<List<Photo>> getAllPhotos({int? start, int? limit});
|
||||||
FutureResult<List<Photo>> getPhotosFromAlbum(
|
FutureOrResult<List<Photo>> getPhotosFromAlbum(
|
||||||
int albumId, {
|
int albumId, {
|
||||||
int? start,
|
int? start,
|
||||||
int? limit,
|
int? limit,
|
||||||
});
|
});
|
||||||
FutureResult<void> addPhotoToFavorites(Photo photo);
|
FutureOrResult<void> addPhotoToFavorites(Photo photo);
|
||||||
FutureResult<void> deletePhotoFromFavorites(int id);
|
FutureOrResult<void> deletePhotoFromFavorites(int id);
|
||||||
FutureResult<List<Photo>> getAllPhotosFromFavorites();
|
FutureOrResult<List<Photo>> getAllPhotosFromFavorites();
|
||||||
FutureResult<bool> checkIfPhotoIsInFavorites(int id);
|
FutureOrResult<bool> checkIfPhotoIsInFavorites(int id);
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-5
@@ -14,18 +14,26 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:architecture_example/domain/entities/photo.dart';
|
import 'package:architecture_example/domain/entities/photo.dart';
|
||||||
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
class AddPhotoToFavorites extends UseCase<Photo, List<Photo>> {
|
class AddPhotoToFavorites extends AsyncUseCase<Photo, List<Photo>> {
|
||||||
|
AddPhotoToFavorites(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
AddPhotoToFavorites(this._photoRepository);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Photo>> call(Photo params) async {
|
FutureOrResult<List<Photo>> execute(Photo? params) async {
|
||||||
await _photoRepository.addPhotoToFavorites(params);
|
await _photoRepository.addPhotoToFavorites(params!);
|
||||||
return _photoRepository.getAllPhotosFromFavorites();
|
return _photoRepository.getAllPhotosFromFavorites();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<void> onStart(Photo? params) {
|
||||||
|
if (params == null) {
|
||||||
|
throw ClientException('Photo cannot be null');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-4
@@ -14,15 +14,23 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
class CheckIfPhotoIsInFavorites extends UseCase<int, bool> {
|
class CheckIfPhotoIsInFavorites extends AsyncUseCase<int, bool> {
|
||||||
|
CheckIfPhotoIsInFavorites(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
CheckIfPhotoIsInFavorites(this._photoRepository);
|
@override
|
||||||
|
FutureOrResult<bool> execute(int? params) async =>
|
||||||
|
_photoRepository.checkIfPhotoIsInFavorites(params!);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<bool> call(int params) async =>
|
FutureOr<void> onStart(int? params) {
|
||||||
_photoRepository.checkIfPhotoIsInFavorites(params);
|
if (params == null) {
|
||||||
|
throw ClientException('id cannot be null');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -18,13 +18,12 @@ import 'package:architecture_example/domain/entities/photo.dart';
|
|||||||
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
class DisplayFavorites extends UseCase<void, List<Photo>> {
|
class DisplayFavorites extends AsyncUseCase<NoParam, List<Photo>> {
|
||||||
|
DisplayFavorites(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
DisplayFavorites(this._photoRepository);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Photo>> call(void params) {
|
FutureOrResult<List<Photo>> execute(void params) {
|
||||||
final photos = _photoRepository.getAllPhotosFromFavorites();
|
final photos = _photoRepository.getAllPhotosFromFavorites();
|
||||||
return photos;
|
return photos;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,18 +14,26 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:architecture_example/domain/entities/photo.dart';
|
import 'package:architecture_example/domain/entities/photo.dart';
|
||||||
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
class DisplayPhoto extends UseCase<int, Photo> {
|
class DisplayPhoto extends AsyncUseCase<int, Photo> {
|
||||||
|
DisplayPhoto(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
DisplayPhoto(this._photoRepository);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<Photo> call(int params) {
|
FutureOrResult<Photo> execute(int? params) {
|
||||||
final photo = _photoRepository.getPhoto(params);
|
final photo = _photoRepository.getPhoto(params!);
|
||||||
return photo;
|
return photo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<void> onStart(int? params) {
|
||||||
|
if (params == null) {
|
||||||
|
throw ClientException('id cannot be null');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,24 +14,32 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:architecture_example/domain/entities/photo.dart';
|
import 'package:architecture_example/domain/entities/photo.dart';
|
||||||
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||||
import 'package:architecture_example/domain/usecases/photos/params/query_parameters.dart';
|
import 'package:architecture_example/domain/usecases/photos/params/query_parameters.dart';
|
||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
class OpenAlbum extends UseCase<QueryParameters, List<Photo>> {
|
class OpenAlbum extends AsyncUseCase<QueryParameters, List<Photo>> {
|
||||||
|
OpenAlbum(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
OpenAlbum(this._photoRepository);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Photo>> call(QueryParameters params) {
|
FutureOrResult<List<Photo>> execute(QueryParameters? params) {
|
||||||
final photos = _photoRepository.getPhotosFromAlbum(
|
final photos = _photoRepository.getPhotosFromAlbum(
|
||||||
params.albumId,
|
params!.albumId,
|
||||||
start: params.start,
|
start: params.start,
|
||||||
limit: params.limit,
|
limit: params.limit,
|
||||||
);
|
);
|
||||||
|
|
||||||
return photos;
|
return photos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<void> onStart(QueryParameters? params) {
|
||||||
|
if (params == null) {
|
||||||
|
throw ClientException('params cannot be null');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -15,9 +15,8 @@
|
|||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
class QueryParameters {
|
class QueryParameters {
|
||||||
|
QueryParameters(this.start, this.limit, {this.albumId = -1});
|
||||||
final int albumId;
|
final int albumId;
|
||||||
final int? start;
|
final int? start;
|
||||||
final int? limit;
|
final int? limit;
|
||||||
|
|
||||||
QueryParameters(this.start, this.limit, {this.albumId = -1});
|
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-5
@@ -14,18 +14,26 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:architecture_example/domain/entities/photo.dart';
|
import 'package:architecture_example/domain/entities/photo.dart';
|
||||||
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
class RemovePhotoFromFavorites extends UseCase<int, List<Photo>> {
|
class RemovePhotoFromFavorites extends AsyncUseCase<int, List<Photo>> {
|
||||||
|
RemovePhotoFromFavorites(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
RemovePhotoFromFavorites(this._photoRepository);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Photo>> call(int params) async {
|
FutureOrResult<List<Photo>> execute(int? params) async {
|
||||||
await _photoRepository.deletePhotoFromFavorites(params);
|
await _photoRepository.deletePhotoFromFavorites(params!);
|
||||||
return _photoRepository.getAllPhotosFromFavorites();
|
return _photoRepository.getAllPhotosFromFavorites();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<void> onStart(int? params) {
|
||||||
|
if (params == null) {
|
||||||
|
throw ClientException('id cannot be null');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-5
@@ -14,22 +14,30 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:architecture_example/domain/entities/album.dart';
|
import 'package:architecture_example/domain/entities/album.dart';
|
||||||
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
import 'package:architecture_example/domain/repositories/photo_repository.dart';
|
||||||
import 'package:architecture_example/domain/usecases/photos/params/query_parameters.dart';
|
import 'package:architecture_example/domain/usecases/photos/params/query_parameters.dart';
|
||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
class RetrieveAllAlbums extends UseCase<QueryParameters, List<Album>> {
|
class RetrieveAllAlbums extends AsyncUseCase<QueryParameters, List<Album>> {
|
||||||
|
RetrieveAllAlbums(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
RetrieveAllAlbums(this._photoRepository);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureResult<List<Album>> call(QueryParameters params) {
|
FutureOrResult<List<Album>> execute(QueryParameters? params) {
|
||||||
final albums = _photoRepository.getAllAlbums(
|
final albums = _photoRepository.getAllAlbums(
|
||||||
start: params.start,
|
start: params!.start,
|
||||||
limit: params.limit,
|
limit: params.limit,
|
||||||
);
|
);
|
||||||
return albums;
|
return albums;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
FutureOr<void> onStart(QueryParameters? params) {
|
||||||
|
if (params == null) {
|
||||||
|
throw ClientException('params cannot be null');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -33,14 +33,13 @@ EventTransformer<E> throttleDroppable<E>(Duration duration) =>
|
|||||||
(events, mapper) => droppable<E>().call(events.throttle(duration), mapper);
|
(events, mapper) => droppable<E>().call(events.throttle(duration), mapper);
|
||||||
|
|
||||||
class AlbumBloc extends Bloc<AlbumEvent, AlbumState> {
|
class AlbumBloc extends Bloc<AlbumEvent, AlbumState> {
|
||||||
final RetrieveAllAlbums _retrieveAllAlbums;
|
|
||||||
|
|
||||||
AlbumBloc(this._retrieveAllAlbums) : super(const AlbumState()) {
|
AlbumBloc(this._retrieveAllAlbums) : super(const AlbumState()) {
|
||||||
on<AlbumFetched>(
|
on<AlbumFetched>(
|
||||||
_onAlbumFetched,
|
_onAlbumFetched,
|
||||||
transformer: throttleDroppable(throttleDuration),
|
transformer: throttleDroppable(throttleDuration),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
final RetrieveAllAlbums _retrieveAllAlbums;
|
||||||
|
|
||||||
Future<void> _onAlbumFetched(
|
Future<void> _onAlbumFetched(
|
||||||
AlbumFetched event,
|
AlbumFetched event,
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ class AlbumsScreen extends BlocScreen<AlbumBloc, AlbumEvent, AlbumState> {
|
|||||||
bloc..add(AlbumFetched());
|
bloc..add(AlbumFetched());
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget onWrap(BuildContext context, Widget child) => AlbumsWrapperWidget(
|
Widget parent(BuildContext context, Widget child) => AlbumsWrapperWidget(
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -22,8 +22,11 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
class AlbumsList extends StatefulWidget {
|
class AlbumsList extends StatefulWidget {
|
||||||
const AlbumsList(
|
const AlbumsList({
|
||||||
{required this.albums, required this.hasReachedMax, super.key,});
|
required this.albums,
|
||||||
|
required this.hasReachedMax,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
final List<Album> albums;
|
final List<Album> albums;
|
||||||
final bool hasReachedMax;
|
final bool hasReachedMax;
|
||||||
|
|||||||
+2
-4
@@ -26,19 +26,17 @@ abstract class PhotoDetailsState extends Equatable {
|
|||||||
class PhotoDetailsInitial extends PhotoDetailsState {}
|
class PhotoDetailsInitial extends PhotoDetailsState {}
|
||||||
|
|
||||||
class PhotoDetailsSuccess extends PhotoDetailsState {
|
class PhotoDetailsSuccess extends PhotoDetailsState {
|
||||||
|
const PhotoDetailsSuccess(this.photo, {required this.isFavorite});
|
||||||
final Photo photo;
|
final Photo photo;
|
||||||
final bool isFavorite;
|
final bool isFavorite;
|
||||||
|
|
||||||
const PhotoDetailsSuccess(this.photo, {required this.isFavorite});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [photo, isFavorite];
|
List<Object> get props => [photo, isFavorite];
|
||||||
}
|
}
|
||||||
|
|
||||||
class PhotoDetailsFailure extends PhotoDetailsState {
|
class PhotoDetailsFailure extends PhotoDetailsState {
|
||||||
final String error;
|
|
||||||
|
|
||||||
const PhotoDetailsFailure(this.error);
|
const PhotoDetailsFailure(this.error);
|
||||||
|
final String error;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [error];
|
List<Object> get props => [error];
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ class PhotoDetailsScreen
|
|||||||
bloc..load(photoId);
|
bloc..load(photoId);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget onWrap(BuildContext context, Widget child) =>
|
Widget parent(BuildContext context, Widget child) =>
|
||||||
PhotoDetailsWrapperWidget(child: child);
|
PhotoDetailsWrapperWidget(child: child);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
+1
-2
@@ -23,10 +23,9 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
part 'favorite_checker_state.dart';
|
part 'favorite_checker_state.dart';
|
||||||
|
|
||||||
class FavoriteCheckerCubit extends Cubit<FavoriteCheckerState> {
|
class FavoriteCheckerCubit extends Cubit<FavoriteCheckerState> {
|
||||||
final CheckIfPhotoIsInFavorites _checkIfPhotoIsInFavorites;
|
|
||||||
|
|
||||||
FavoriteCheckerCubit(this._checkIfPhotoIsInFavorites)
|
FavoriteCheckerCubit(this._checkIfPhotoIsInFavorites)
|
||||||
: super(FavoriteCheckerInitial());
|
: super(FavoriteCheckerInitial());
|
||||||
|
final CheckIfPhotoIsInFavorites _checkIfPhotoIsInFavorites;
|
||||||
|
|
||||||
FutureOr<void> checkIfPhotoIsInFavorites(int photoId) async {
|
FutureOr<void> checkIfPhotoIsInFavorites(int photoId) async {
|
||||||
final response = await _checkIfPhotoIsInFavorites.call(photoId);
|
final response = await _checkIfPhotoIsInFavorites.call(photoId);
|
||||||
|
|||||||
+2
-4
@@ -10,19 +10,17 @@ abstract class FavoriteCheckerState extends Equatable {
|
|||||||
class FavoriteCheckerInitial extends FavoriteCheckerState {}
|
class FavoriteCheckerInitial extends FavoriteCheckerState {}
|
||||||
|
|
||||||
class FavoriteCheckerSuccess extends FavoriteCheckerState {
|
class FavoriteCheckerSuccess extends FavoriteCheckerState {
|
||||||
|
const FavoriteCheckerSuccess(this.photoId, {required this.isFavorite});
|
||||||
final int photoId;
|
final int photoId;
|
||||||
final bool isFavorite;
|
final bool isFavorite;
|
||||||
|
|
||||||
const FavoriteCheckerSuccess(this.photoId, {required this.isFavorite});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [photoId, isFavorite];
|
List<Object> get props => [photoId, isFavorite];
|
||||||
}
|
}
|
||||||
|
|
||||||
class FavoriteCheckerFailure extends FavoriteCheckerState {
|
class FavoriteCheckerFailure extends FavoriteCheckerState {
|
||||||
final String error;
|
|
||||||
|
|
||||||
const FavoriteCheckerFailure(this.error);
|
const FavoriteCheckerFailure(this.error);
|
||||||
|
final String error;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object> get props => [error];
|
List<Object> get props => [error];
|
||||||
|
|||||||
+1
-2
@@ -33,14 +33,13 @@ EventTransformer<E> throttleDroppable<E>(Duration duration) =>
|
|||||||
(events, mapper) => droppable<E>().call(events.throttle(duration), mapper);
|
(events, mapper) => droppable<E>().call(events.throttle(duration), mapper);
|
||||||
|
|
||||||
class PhotoBloc extends Bloc<PhotoEvent, PhotoState> {
|
class PhotoBloc extends Bloc<PhotoEvent, PhotoState> {
|
||||||
final OpenAlbum _openAlbum;
|
|
||||||
|
|
||||||
PhotoBloc(this._openAlbum) : super(const PhotoState()) {
|
PhotoBloc(this._openAlbum) : super(const PhotoState()) {
|
||||||
on<PhotoFetched>(
|
on<PhotoFetched>(
|
||||||
_onPhotoFetched,
|
_onPhotoFetched,
|
||||||
transformer: throttleDroppable(throttleDuration),
|
transformer: throttleDroppable(throttleDuration),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
final OpenAlbum _openAlbum;
|
||||||
|
|
||||||
Future<void> _onPhotoFetched(
|
Future<void> _onPhotoFetched(
|
||||||
PhotoFetched event,
|
PhotoFetched event,
|
||||||
|
|||||||
+1
-2
@@ -24,7 +24,6 @@ abstract class PhotoEvent extends Equatable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PhotoFetched extends PhotoEvent {
|
class PhotoFetched extends PhotoEvent {
|
||||||
final int albumId;
|
|
||||||
|
|
||||||
const PhotoFetched(this.albumId);
|
const PhotoFetched(this.albumId);
|
||||||
|
final int albumId;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ class PhotosScreen extends BlocScreen<PhotoBloc, PhotoEvent, PhotoState> {
|
|||||||
bloc..add(PhotoFetched(albumId));
|
bloc..add(PhotoFetched(albumId));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget onWrap(BuildContext context, Widget child) => PhotosWrapperWidget(
|
Widget parent(BuildContext context, Widget child) => PhotosWrapperWidget(
|
||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -55,7 +55,10 @@ class PhotosGridThumbnail
|
|||||||
),
|
),
|
||||||
if (state is FavoriteCheckerSuccess && state.isFavorite) ...[
|
if (state is FavoriteCheckerSuccess && state.isFavorite) ...[
|
||||||
const Positioned(
|
const Positioned(
|
||||||
bottom: 10, right: 10, child: Icon(Icons.favorite),)
|
bottom: 10,
|
||||||
|
right: 10,
|
||||||
|
child: Icon(Icons.favorite),
|
||||||
|
)
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ dependencies:
|
|||||||
|
|
||||||
wyatt_type_utils:
|
wyatt_type_utils:
|
||||||
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
version: ^0.0.3+1
|
version: ^0.0.4
|
||||||
|
|
||||||
wyatt_http_client:
|
wyatt_http_client:
|
||||||
git:
|
git:
|
||||||
@@ -49,7 +49,7 @@ dependencies:
|
|||||||
|
|
||||||
wyatt_bloc_helper:
|
wyatt_bloc_helper:
|
||||||
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
||||||
version: ^1.2.0
|
version: ^2.0.0
|
||||||
equatable: ^2.0.5
|
equatable: ^2.0.5
|
||||||
stream_transform: ^2.1.0
|
stream_transform: ^2.1.0
|
||||||
bloc_concurrency: ^0.2.0
|
bloc_concurrency: ^0.2.0
|
||||||
@@ -67,7 +67,7 @@ dev_dependencies:
|
|||||||
wyatt_analysis:
|
wyatt_analysis:
|
||||||
git:
|
git:
|
||||||
url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages
|
url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages
|
||||||
ref: wyatt_analysis-v2.2.2
|
ref: wyatt_analysis-v2.4.1
|
||||||
path: packages/wyatt_analysis
|
path: packages/wyatt_analysis
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
|
|||||||
@@ -17,9 +17,8 @@
|
|||||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||||
|
|
||||||
abstract class AppException implements Exception {
|
abstract class AppException implements Exception {
|
||||||
final String? message;
|
|
||||||
|
|
||||||
AppException([this.message]);
|
AppException([this.message]);
|
||||||
|
final String? message;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() {
|
String toString() {
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
|
/// Usecase observers
|
||||||
|
mixin Observer<Parameters, ReturnType> {
|
||||||
|
/// Called before usecase is runned.
|
||||||
|
/// Usefull to check the preconditions
|
||||||
|
FutureOr<void> onStart(Parameters? params) {}
|
||||||
|
|
||||||
|
/// Called when error occures during main scenario
|
||||||
|
/// Usefull to run alternative scenario
|
||||||
|
FutureOr<void> onError(AppException? error) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Specific observer for classic usecase
|
||||||
|
mixin AsyncObserver<ReturnType> {
|
||||||
|
FutureOr<void> onComplete(ReturnType? data) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Specific observer for stream case usecase
|
||||||
|
mixin StreamObserver<ReturnType> {
|
||||||
|
/// Replaces the data event handler of this subscription.
|
||||||
|
void onDone() {}
|
||||||
|
|
||||||
|
/// Replaces the done event handler of this subscription.
|
||||||
|
void onData(ReturnType? data) {}
|
||||||
|
}
|
||||||
@@ -14,14 +14,67 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:wyatt_architecture/src/core/exceptions/exceptions.dart';
|
import 'package:wyatt_architecture/src/core/exceptions/exceptions.dart';
|
||||||
|
import 'package:wyatt_architecture/src/domain/usecases/observers.dart';
|
||||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||||
|
|
||||||
typedef FutureResult<T> = Future<Result<T, AppException>>;
|
typedef FutureOrResult<T> = FutureOr<Result<T, AppException>>;
|
||||||
typedef StreamResult<T> = Stream<Result<T, AppException>>;
|
typedef StreamResult<T> = Stream<Result<T, AppException>>;
|
||||||
typedef Res<T> = Result<T, AppException>;
|
|
||||||
|
|
||||||
// ignore: one_member_abstracts
|
/// Abstract class of a use case
|
||||||
abstract class UseCase<Parameters, ReturnType> {
|
abstract class BaseUseCase<Parameters, ReturnType> {
|
||||||
FutureResult<ReturnType> call(Parameters params);
|
/// Run use case scenarios
|
||||||
|
ReturnType call(Parameters parameters);
|
||||||
|
|
||||||
|
/// Private function to implement main scenario
|
||||||
|
/// of your usecase.
|
||||||
|
ReturnType execute(Parameters params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Abstract class of a use case that deals specifically
|
||||||
|
/// with the response and its state.
|
||||||
|
abstract class UseCase<Parameters, ReturnType>
|
||||||
|
extends BaseUseCase<Parameters?, FutureOrResult<ReturnType>>
|
||||||
|
with Observer<Parameters, ReturnType> {
|
||||||
|
FutureOr<void> _onSuccess(ReturnType data);
|
||||||
|
|
||||||
|
/// Supports the result of the main scenario and integrates
|
||||||
|
/// some alternative scenarios if necessary.
|
||||||
|
@override
|
||||||
|
FutureOrResult<ReturnType> call(Parameters? parameters) async {
|
||||||
|
try {
|
||||||
|
await onStart(parameters);
|
||||||
|
final response = await execute(parameters);
|
||||||
|
if (response.isErr) {
|
||||||
|
await onError(response.err);
|
||||||
|
} else if (response.isOk && response.ok != null) {
|
||||||
|
await _onSuccess(response.ok as ReturnType);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
} catch (e) {
|
||||||
|
return Err(ClientException(e.toString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Abtstract classic usecase.
|
||||||
|
abstract class AsyncUseCase<Parameters, ReturnType>
|
||||||
|
extends UseCase<Parameters?, ReturnType> with AsyncObserver<ReturnType> {
|
||||||
|
@override
|
||||||
|
FutureOr<void> _onSuccess(ReturnType data) => onComplete(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Abstract specific usecase bases on streams
|
||||||
|
abstract class StreamUseCase<Parameters, ReturnType>
|
||||||
|
extends UseCase<Parameters?, Stream<ReturnType>>
|
||||||
|
with StreamObserver<ReturnType> {
|
||||||
|
@override
|
||||||
|
FutureOr<void> _onSuccess(Stream<ReturnType> data) {
|
||||||
|
data.listen(
|
||||||
|
onData,
|
||||||
|
onDone: onDone,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,5 @@
|
|||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
export 'no_param.dart';
|
export 'no_param.dart';
|
||||||
|
export 'observers.dart';
|
||||||
export 'usecase.dart';
|
export 'usecase.dart';
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 117 KiB |
@@ -0,0 +1,86 @@
|
|||||||
|
@startuml
|
||||||
|
set namespaceSeparator ::
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::core::exceptions::exceptions.dart::AppException" {
|
||||||
|
+String? message
|
||||||
|
+String toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
"dart::core::Exception" <|-- "wyatt_architecture::src::core::exceptions::exceptions.dart::AppException"
|
||||||
|
|
||||||
|
class "wyatt_architecture::src::core::exceptions::exceptions.dart::ClientException" {
|
||||||
|
}
|
||||||
|
|
||||||
|
"wyatt_architecture::src::core::exceptions::exceptions.dart::AppException" <|-- "wyatt_architecture::src::core::exceptions::exceptions.dart::ClientException"
|
||||||
|
class "wyatt_architecture::src::core::exceptions::exceptions.dart::ServerException" {
|
||||||
|
}
|
||||||
|
|
||||||
|
"wyatt_architecture::src::core::exceptions::exceptions.dart::AppException" <|-- "wyatt_architecture::src::core::exceptions::exceptions.dart::ServerException"
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::repositories::base_repository.dart::BaseRepository" {
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::data_sources::local::base_local_data_source.dart::BaseLocalDataSource" {
|
||||||
|
}
|
||||||
|
|
||||||
|
"wyatt_architecture::src::domain::data_sources::base_data_source.dart::BaseDataSource" <|-- "wyatt_architecture::src::domain::data_sources::local::base_local_data_source.dart::BaseLocalDataSource"
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::data_sources::base_data_source.dart::BaseDataSource" {
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::data_sources::remote::base_remote_data_source.dart::BaseRemoteDataSource" {
|
||||||
|
}
|
||||||
|
|
||||||
|
"wyatt_architecture::src::domain::data_sources::base_data_source.dart::BaseDataSource" <|-- "wyatt_architecture::src::domain::data_sources::remote::base_remote_data_source.dart::BaseRemoteDataSource"
|
||||||
|
|
||||||
|
class "wyatt_architecture::src::domain::usecases::no_param.dart::NoParam" {
|
||||||
|
}
|
||||||
|
|
||||||
|
"wyatt_architecture::src::domain::entities::entity.dart::Entity" <|-- "wyatt_architecture::src::domain::usecases::no_param.dart::NoParam"
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::usecases::observers.dart::Observer" {
|
||||||
|
+FutureOr<void> onStart()
|
||||||
|
+FutureOr<void> onError()
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::usecases::observers.dart::AsyncObserver" {
|
||||||
|
+FutureOr<void> onComplete()
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::usecases::observers.dart::StreamObserver" {
|
||||||
|
+void onDone()
|
||||||
|
+void onData()
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::usecases::usecase.dart::BaseUseCase" {
|
||||||
|
+ReturnType execute()
|
||||||
|
+ReturnType call()
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::usecases::usecase.dart::UseCase" {
|
||||||
|
-FutureOr<void> _onSuccess()
|
||||||
|
+FutureOr<Result<ReturnType, AppException>> execute()
|
||||||
|
}
|
||||||
|
|
||||||
|
"wyatt_architecture::src::domain::usecases::usecase.dart::BaseUseCase" <|-- "wyatt_architecture::src::domain::usecases::usecase.dart::UseCase"
|
||||||
|
"wyatt_architecture::src::domain::usecases::observers.dart::Observer" <|-- "wyatt_architecture::src::domain::usecases::usecase.dart::UseCase"
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::usecases::usecase.dart::AsyncUseCase" {
|
||||||
|
-FutureOr<void> _onSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
"wyatt_architecture::src::domain::usecases::usecase.dart::UseCase" <|-- "wyatt_architecture::src::domain::usecases::usecase.dart::AsyncUseCase"
|
||||||
|
"wyatt_architecture::src::domain::usecases::observers.dart::AsyncObserver" <|-- "wyatt_architecture::src::domain::usecases::usecase.dart::AsyncUseCase"
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::usecases::usecase.dart::StreamUseCase" {
|
||||||
|
-FutureOr<void> _onSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
"wyatt_architecture::src::domain::usecases::usecase.dart::UseCase" <|-- "wyatt_architecture::src::domain::usecases::usecase.dart::StreamUseCase"
|
||||||
|
"wyatt_architecture::src::domain::usecases::observers.dart::StreamObserver" <|-- "wyatt_architecture::src::domain::usecases::usecase.dart::StreamUseCase"
|
||||||
|
|
||||||
|
abstract class "wyatt_architecture::src::domain::entities::entity.dart::Entity" {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@enduml
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
name: wyatt_architecture
|
name: wyatt_architecture
|
||||||
description: A new Wyatt package
|
description: A new Wyatt package
|
||||||
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_architecture
|
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_architecture
|
||||||
version: 0.0.2
|
version: 0.1.0+1
|
||||||
|
|
||||||
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ dependencies:
|
|||||||
|
|
||||||
wyatt_type_utils:
|
wyatt_type_utils:
|
||||||
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
version: ^0.0.3+1
|
version: ^0.0.4
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
||||||
@@ -24,4 +24,4 @@ dev_dependencies:
|
|||||||
|
|
||||||
wyatt_analysis:
|
wyatt_analysis:
|
||||||
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
version: ^2.2.2
|
version: ^2.4.1
|
||||||
@@ -1 +1,2 @@
|
|||||||
firebase_options.dart
|
firebase_options.dart
|
||||||
|
.vscode
|
||||||
@@ -1 +0,0 @@
|
|||||||
../../.vscode/
|
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
// Dart
|
||||||
|
"dart.runPubGetOnPubspecChanges": "never",
|
||||||
|
// Gitea
|
||||||
|
"gitea.owner": "Wyatt-FOSS",
|
||||||
|
"gitea.repo": "wyatt-packages",
|
||||||
|
// Header
|
||||||
|
"psi-header.changes-tracking": {
|
||||||
|
"isActive": true
|
||||||
|
},
|
||||||
|
"psi-header.config": {
|
||||||
|
"blankLinesAfter": 1,
|
||||||
|
"forceToTop": true
|
||||||
|
},
|
||||||
|
"psi-header.lang-config": [
|
||||||
|
{
|
||||||
|
"beforeHeader": [
|
||||||
|
"# -*- coding:utf-8 -*-",
|
||||||
|
"#!/usr/bin/env python3"
|
||||||
|
],
|
||||||
|
"begin": "###",
|
||||||
|
"end": "###",
|
||||||
|
"language": "python",
|
||||||
|
"prefix": "# "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"beforeHeader": [
|
||||||
|
"#!/usr/bin/env sh",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"language": "shellscript",
|
||||||
|
"begin": "",
|
||||||
|
"end": "",
|
||||||
|
"prefix": "# "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"begin": "",
|
||||||
|
"end": "",
|
||||||
|
"language": "dart",
|
||||||
|
"prefix": "// "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"begin": "",
|
||||||
|
"end": "",
|
||||||
|
"language": "yaml",
|
||||||
|
"prefix": "# "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"begin": "<!--",
|
||||||
|
"end": "-->",
|
||||||
|
"language": "markdown",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"psi-header.templates": [
|
||||||
|
{
|
||||||
|
"language": "*",
|
||||||
|
"template": [
|
||||||
|
"Copyright (C) <<year>> WYATT GROUP",
|
||||||
|
"Please see the AUTHORS file for details.",
|
||||||
|
"",
|
||||||
|
"This program is free software: you can redistribute it and/or modify",
|
||||||
|
"it under the terms of the GNU General Public License as published by",
|
||||||
|
"the Free Software Foundation, either version 3 of the License, or",
|
||||||
|
"any later version.",
|
||||||
|
"",
|
||||||
|
"This program is distributed in the hope that it will be useful,",
|
||||||
|
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
|
||||||
|
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
|
||||||
|
"GNU General Public License for more details.",
|
||||||
|
"",
|
||||||
|
"You should have received a copy of the GNU General Public License",
|
||||||
|
"along with this program. If not, see <https://www.gnu.org/licenses/>."
|
||||||
|
],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -1,3 +1,26 @@
|
|||||||
|
## 0.4.1
|
||||||
|
|
||||||
|
- **REFACTOR**: use fromFirebaseUser factory to parse user.
|
||||||
|
- **REFACTOR**: update deps and re-export them.
|
||||||
|
- **FIX**: fix mock on register.
|
||||||
|
- **FEAT**: add google sign in in signIn cubit.
|
||||||
|
- **FEAT**: add google sign in parameter in firebase data source constructor.
|
||||||
|
- **FEAT**: add google sign_in support (closes #59).
|
||||||
|
- **FEAT**: add reauthenticate, updateEmail and updatePassword.
|
||||||
|
- **DOCS**: add correct header.
|
||||||
|
|
||||||
|
## 0.4.0+3
|
||||||
|
|
||||||
|
- Update a dependency to the latest release.
|
||||||
|
|
||||||
|
## 0.4.0+2
|
||||||
|
|
||||||
|
- Update a dependency to the latest release.
|
||||||
|
|
||||||
|
## 0.4.0+1
|
||||||
|
|
||||||
|
- **FIX**: add sort of mutex on onAuthChanges callback trigger.
|
||||||
|
|
||||||
## 0.4.0
|
## 0.4.0
|
||||||
|
|
||||||
> Note: This release has breaking changes.
|
> Note: This release has breaking changes.
|
||||||
|
|||||||
@@ -1,4 +1 @@
|
|||||||
include: package:wyatt_analysis/analysis_options.flutter.yaml
|
include: package:wyatt_analysis/analysis_options.flutter.yaml
|
||||||
|
|
||||||
analyzer:
|
|
||||||
exclude: "!example/**"
|
|
||||||
@@ -45,5 +45,3 @@ app.*.map.json
|
|||||||
/android/app/debug
|
/android/app/debug
|
||||||
/android/app/profile
|
/android/app/profile
|
||||||
/android/app/release
|
/android/app/release
|
||||||
|
|
||||||
firebase_options.dart
|
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
* -----
|
* -----
|
||||||
* File: launch.json
|
* File: launch.json
|
||||||
* Created Date: 19/08/2022 15:12:25
|
* Created Date: 19/08/2022 15:12:25
|
||||||
* Last Modified: 19/08/2022 15:22:02
|
* Last Modified: Tue Dec 13 2022
|
||||||
* -----
|
* -----
|
||||||
* Copyright (c) 2022
|
* Copyright (c) 2022
|
||||||
*/
|
*/
|
||||||
@@ -15,11 +15,18 @@
|
|||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "example_router",
|
"name": "Mock",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "dart",
|
"type": "dart",
|
||||||
"program": "lib/main.dart",
|
"program": "lib/main.dart",
|
||||||
"flutterMode": "debug"
|
"flutterMode": "debug"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Firebase",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "dart",
|
||||||
|
"program": "lib/main_firebase.dart",
|
||||||
|
"flutterMode": "debug"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -5,41 +5,30 @@ PODS:
|
|||||||
- AppAuth/Core (1.6.0)
|
- AppAuth/Core (1.6.0)
|
||||||
- AppAuth/ExternalUserAgent (1.6.0):
|
- AppAuth/ExternalUserAgent (1.6.0):
|
||||||
- AppAuth/Core
|
- AppAuth/Core
|
||||||
- FBAEMKit (14.1.0):
|
- Firebase/Auth (10.3.0):
|
||||||
- FBSDKCoreKit_Basics (= 14.1.0)
|
|
||||||
- FBSDKCoreKit (14.1.0):
|
|
||||||
- FBAEMKit (= 14.1.0)
|
|
||||||
- FBSDKCoreKit_Basics (= 14.1.0)
|
|
||||||
- FBSDKCoreKit_Basics (14.1.0)
|
|
||||||
- FBSDKLoginKit (14.1.0):
|
|
||||||
- FBSDKCoreKit (= 14.1.0)
|
|
||||||
- Firebase/Auth (10.0.0):
|
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseAuth (~> 10.0.0)
|
- FirebaseAuth (~> 10.3.0)
|
||||||
- Firebase/CoreOnly (10.0.0):
|
- Firebase/CoreOnly (10.3.0):
|
||||||
- FirebaseCore (= 10.0.0)
|
- FirebaseCore (= 10.3.0)
|
||||||
- firebase_auth (4.1.1):
|
- firebase_auth (4.2.0):
|
||||||
- Firebase/Auth (= 10.0.0)
|
- Firebase/Auth (= 10.3.0)
|
||||||
- firebase_core
|
- firebase_core
|
||||||
- Flutter
|
- Flutter
|
||||||
- firebase_core (2.1.1):
|
- firebase_core (2.4.0):
|
||||||
- Firebase/CoreOnly (= 10.0.0)
|
- Firebase/CoreOnly (= 10.3.0)
|
||||||
- Flutter
|
- Flutter
|
||||||
- FirebaseAuth (10.0.0):
|
- FirebaseAuth (10.3.0):
|
||||||
- FirebaseCore (~> 10.0)
|
- FirebaseCore (~> 10.0)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
|
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
|
||||||
- GoogleUtilities/Environment (~> 7.8)
|
- GoogleUtilities/Environment (~> 7.8)
|
||||||
- GTMSessionFetcher/Core (~> 2.1)
|
- GTMSessionFetcher/Core (< 4.0, >= 2.1)
|
||||||
- FirebaseCore (10.0.0):
|
- FirebaseCore (10.3.0):
|
||||||
- FirebaseCoreInternal (~> 10.0)
|
- FirebaseCoreInternal (~> 10.0)
|
||||||
- GoogleUtilities/Environment (~> 7.8)
|
- GoogleUtilities/Environment (~> 7.8)
|
||||||
- GoogleUtilities/Logger (~> 7.8)
|
- GoogleUtilities/Logger (~> 7.8)
|
||||||
- FirebaseCoreInternal (10.1.0):
|
- FirebaseCoreInternal (10.3.0):
|
||||||
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- flutter_facebook_auth (4.4.1):
|
|
||||||
- FBSDKLoginKit (= 14.1.0)
|
|
||||||
- Flutter
|
|
||||||
- google_sign_in_ios (0.0.1):
|
- google_sign_in_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- GoogleSignIn (~> 6.2)
|
- GoogleSignIn (~> 6.2)
|
||||||
@@ -47,47 +36,36 @@ PODS:
|
|||||||
- AppAuth (~> 1.5)
|
- AppAuth (~> 1.5)
|
||||||
- GTMAppAuth (~> 1.3)
|
- GTMAppAuth (~> 1.3)
|
||||||
- GTMSessionFetcher/Core (< 3.0, >= 1.1)
|
- GTMSessionFetcher/Core (< 3.0, >= 1.1)
|
||||||
- GoogleUtilities/AppDelegateSwizzler (7.8.0):
|
- GoogleUtilities/AppDelegateSwizzler (7.10.0):
|
||||||
- GoogleUtilities/Environment
|
- GoogleUtilities/Environment
|
||||||
- GoogleUtilities/Logger
|
- GoogleUtilities/Logger
|
||||||
- GoogleUtilities/Network
|
- GoogleUtilities/Network
|
||||||
- GoogleUtilities/Environment (7.8.0):
|
- GoogleUtilities/Environment (7.10.0):
|
||||||
- PromisesObjC (< 3.0, >= 1.2)
|
- PromisesObjC (< 3.0, >= 1.2)
|
||||||
- GoogleUtilities/Logger (7.8.0):
|
- GoogleUtilities/Logger (7.10.0):
|
||||||
- GoogleUtilities/Environment
|
- GoogleUtilities/Environment
|
||||||
- GoogleUtilities/Network (7.8.0):
|
- GoogleUtilities/Network (7.10.0):
|
||||||
- GoogleUtilities/Logger
|
- GoogleUtilities/Logger
|
||||||
- "GoogleUtilities/NSData+zlib"
|
- "GoogleUtilities/NSData+zlib"
|
||||||
- GoogleUtilities/Reachability
|
- GoogleUtilities/Reachability
|
||||||
- "GoogleUtilities/NSData+zlib (7.8.0)"
|
- "GoogleUtilities/NSData+zlib (7.10.0)"
|
||||||
- GoogleUtilities/Reachability (7.8.0):
|
- GoogleUtilities/Reachability (7.10.0):
|
||||||
- GoogleUtilities/Logger
|
- GoogleUtilities/Logger
|
||||||
- GTMAppAuth (1.3.1):
|
- GTMAppAuth (1.3.1):
|
||||||
- AppAuth/Core (~> 1.6)
|
- AppAuth/Core (~> 1.6)
|
||||||
- GTMSessionFetcher/Core (< 3.0, >= 1.5)
|
- GTMSessionFetcher/Core (< 3.0, >= 1.5)
|
||||||
- GTMSessionFetcher/Core (2.1.0)
|
- GTMSessionFetcher/Core (2.3.0)
|
||||||
- PromisesObjC (2.1.1)
|
- PromisesObjC (2.1.1)
|
||||||
- sign_in_with_apple (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- twitter_login (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
|
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
|
||||||
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`)
|
|
||||||
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`)
|
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`)
|
||||||
- sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`)
|
|
||||||
- twitter_login (from `.symlinks/plugins/twitter_login/ios`)
|
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
trunk:
|
trunk:
|
||||||
- AppAuth
|
- AppAuth
|
||||||
- FBAEMKit
|
|
||||||
- FBSDKCoreKit
|
|
||||||
- FBSDKCoreKit_Basics
|
|
||||||
- FBSDKLoginKit
|
|
||||||
- Firebase
|
- Firebase
|
||||||
- FirebaseAuth
|
- FirebaseAuth
|
||||||
- FirebaseCore
|
- FirebaseCore
|
||||||
@@ -105,37 +83,24 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/firebase_core/ios"
|
:path: ".symlinks/plugins/firebase_core/ios"
|
||||||
Flutter:
|
Flutter:
|
||||||
:path: Flutter
|
:path: Flutter
|
||||||
flutter_facebook_auth:
|
|
||||||
:path: ".symlinks/plugins/flutter_facebook_auth/ios"
|
|
||||||
google_sign_in_ios:
|
google_sign_in_ios:
|
||||||
:path: ".symlinks/plugins/google_sign_in_ios/ios"
|
:path: ".symlinks/plugins/google_sign_in_ios/ios"
|
||||||
sign_in_with_apple:
|
|
||||||
:path: ".symlinks/plugins/sign_in_with_apple/ios"
|
|
||||||
twitter_login:
|
|
||||||
:path: ".symlinks/plugins/twitter_login/ios"
|
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
AppAuth: 8fca6b5563a5baef2c04bee27538025e4ceb2add
|
AppAuth: 8fca6b5563a5baef2c04bee27538025e4ceb2add
|
||||||
FBAEMKit: a899515e45476027f73aef377b5cffadcd56ca3a
|
Firebase: f92fc551ead69c94168d36c2b26188263860acd9
|
||||||
FBSDKCoreKit: 24f8bc8d3b5b2a8c5c656a1329492a12e8efa792
|
firebase_auth: 579a0dc15451491cc83fccaa5102296635f24938
|
||||||
FBSDKCoreKit_Basics: 6e578c9bdc7aa1365dbbbde633c9ebb536bcaa98
|
firebase_core: 6f2f753e316765799d88568232ed59e300ff53db
|
||||||
FBSDKLoginKit: 787de205d524c3a4b17d527916f1d066e4361660
|
FirebaseAuth: 0e415d29d846c1dce2fb641e46f35e9888d9bec6
|
||||||
Firebase: 1b810f3d0c0532e27a48f1961f8c0400a668a2cf
|
FirebaseCore: 988754646ab3bd4bdcb740f1bfe26b9f6c0d5f2a
|
||||||
firebase_auth: dd33e93fce72a1c72040f7380dacf06e89db5705
|
FirebaseCoreInternal: 29b76f784d607df8b2a1259d73c3f04f1210137b
|
||||||
firebase_core: 5c0bb0ca7d0e70480a68a6e9ad9bf55d1edd5305
|
|
||||||
FirebaseAuth: 493382cf533cc45e2862b00e9aa4cfe4c98daf71
|
|
||||||
FirebaseCore: 97f48a3a567a72b8d4daa0f03c3aadb78df4e995
|
|
||||||
FirebaseCoreInternal: 96d75228e10fd369564da51bd898414eb0f54df5
|
|
||||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||||
flutter_facebook_auth: 361ac7a57263ebf327f26089507ead0d66558ee8
|
|
||||||
google_sign_in_ios: 4f85eb9f937450765c8573bb85fd8cd6a5af675c
|
google_sign_in_ios: 4f85eb9f937450765c8573bb85fd8cd6a5af675c
|
||||||
GoogleSignIn: 5651ce3a61e56ca864160e79b484cd9ed3f49b7a
|
GoogleSignIn: 5651ce3a61e56ca864160e79b484cd9ed3f49b7a
|
||||||
GoogleUtilities: 1d20a6ad97ef46f67bbdec158ce00563a671ebb7
|
GoogleUtilities: bad72cb363809015b1f7f19beb1f1cd23c589f95
|
||||||
GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
|
GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
|
||||||
GTMSessionFetcher: ffbb25ec00ebcb5201adab0a56d808f6f1902d9f
|
GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2
|
||||||
PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
|
PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
|
||||||
sign_in_with_apple: f3bf75217ea4c2c8b91823f225d70230119b8440
|
|
||||||
twitter_login: 2794db69b7640681171b17b3c2c84ad9dfb4a57f
|
|
||||||
|
|
||||||
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
|
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,17 @@
|
|||||||
<string>LaunchScreen</string>
|
<string>LaunchScreen</string>
|
||||||
<key>UIMainStoryboardFile</key>
|
<key>UIMainStoryboardFile</key>
|
||||||
<string>Main</string>
|
<string>Main</string>
|
||||||
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Editor</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>com.googleusercontent.apps.405351917235-2jv4ff02kovoim58f8d6d0rsa14apgkj</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
<key>UISupportedInterfaceOrientations</key>
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
<array>
|
<array>
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"file_generated_by": "FlutterFire CLI",
|
"file_generated_by": "FlutterFire CLI",
|
||||||
"purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
|
"purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory",
|
||||||
"GOOGLE_APP_ID": "1:136771801992:ios:bcdca68d2b7d227097203d",
|
"GOOGLE_APP_ID": "1:405351917235:ios:869f0ad8ace08db899f2c6",
|
||||||
"FIREBASE_PROJECT_ID": "tchat-beta",
|
"FIREBASE_PROJECT_ID": "meerabel-dev",
|
||||||
"GCM_SENDER_ID": "136771801992"
|
"GCM_SENDER_ID": "405351917235"
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,64 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: bootstrap.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 15:05:17
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: Fri Nov 11 2022
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:example_router/core/dependency_injection/get_it.dart';
|
import 'package:example_router/core/dependency_injection/get_it.dart';
|
||||||
import 'package:example_router/core/utils/app_bloc_observer.dart';
|
import 'package:example_router/core/utils/app_bloc_observer.dart';
|
||||||
|
import 'package:example_router/firebase_options.dart';
|
||||||
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
|
class MockSettings {
|
||||||
|
static MockSettings? _instance;
|
||||||
|
|
||||||
|
/// Data source mode
|
||||||
|
late bool enable = false;
|
||||||
|
|
||||||
|
MockSettings._(this.enable);
|
||||||
|
|
||||||
|
factory MockSettings.enable() {
|
||||||
|
_instance ??= MockSettings._(true);
|
||||||
|
if (_instance!.enable != true) {
|
||||||
|
throw Exception('Mock already initialized in: ${_instance!.enable}');
|
||||||
|
}
|
||||||
|
return _instance!;
|
||||||
|
}
|
||||||
|
|
||||||
|
factory MockSettings.disable() {
|
||||||
|
_instance ??= MockSettings._(false);
|
||||||
|
if (_instance!.enable != false) {
|
||||||
|
throw Exception('Mock already initialized in: ${_instance!.enable}');
|
||||||
|
}
|
||||||
|
return _instance!;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isEnable() {
|
||||||
|
if (_instance == null) {
|
||||||
|
throw Exception('MockSettings not initialized!');
|
||||||
|
}
|
||||||
|
return _instance!.enable == true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool isDisable() {
|
||||||
|
return !isEnable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> bootstrap(FutureOr<Widget> Function() builder) async {
|
Future<void> bootstrap(FutureOr<Widget> Function() builder) async {
|
||||||
await runZonedGuarded(
|
await runZonedGuarded(
|
||||||
() async {
|
() async {
|
||||||
@@ -23,6 +68,12 @@ Future<void> bootstrap(FutureOr<Widget> Function() builder) async {
|
|||||||
FlutterError.onError = (details) {
|
FlutterError.onError = (details) {
|
||||||
debugPrint(details.toString());
|
debugPrint(details.toString());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (MockSettings.isDisable()) {
|
||||||
|
await Firebase.initializeApp(
|
||||||
|
options: DefaultFirebaseOptions.currentPlatform,
|
||||||
|
);
|
||||||
|
}
|
||||||
await GetItInitializer.init();
|
await GetItInitializer.init();
|
||||||
|
|
||||||
runApp(await builder());
|
runApp(await builder());
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: form_field.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 11:52:33
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: 19/08/2022 16:35:39
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
abstract class AppFormField {
|
abstract class AppFormField {
|
||||||
|
static const oldPassword = 'oldPassword';
|
||||||
static const confirmedPassword = 'confirmedPassword';
|
static const confirmedPassword = 'confirmedPassword';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
abstract class AppFormName {
|
||||||
|
static const editProfile = 'editProfile';
|
||||||
|
}
|
||||||
+8
-2
@@ -14,6 +14,8 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:example_router/bootstrap.dart';
|
||||||
|
import 'package:example_router/firebase_options.dart';
|
||||||
import 'package:get_it/get_it.dart';
|
import 'package:get_it/get_it.dart';
|
||||||
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
||||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||||
@@ -24,7 +26,8 @@ abstract class GetItInitializer {
|
|||||||
static Future<void> init() async {
|
static Future<void> init() async {
|
||||||
getIt
|
getIt
|
||||||
..registerLazySingleton<AuthenticationRemoteDataSource>(
|
..registerLazySingleton<AuthenticationRemoteDataSource>(
|
||||||
() => AuthenticationMockDataSourceImpl(registeredAccounts: [
|
MockSettings.isEnable()
|
||||||
|
? () => AuthenticationMockDataSourceImpl(registeredAccounts: [
|
||||||
Pair(
|
Pair(
|
||||||
AccountModel(
|
AccountModel(
|
||||||
uid: '1',
|
uid: '1',
|
||||||
@@ -45,7 +48,10 @@ abstract class GetItInitializer {
|
|||||||
),
|
),
|
||||||
'tata1234',
|
'tata1234',
|
||||||
),
|
),
|
||||||
]),
|
])
|
||||||
|
: () => AuthenticationFirebaseDataSourceImpl(
|
||||||
|
googleSignIn: GoogleSignIn(
|
||||||
|
clientId: DefaultFirebaseOptions.ios.iosClientId)),
|
||||||
)
|
)
|
||||||
..registerLazySingleton<AuthenticationCacheDataSource<int>>(
|
..registerLazySingleton<AuthenticationCacheDataSource<int>>(
|
||||||
() => AuthenticationCacheDataSourceImpl<int>(),
|
() => AuthenticationCacheDataSourceImpl<int>(),
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: router.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 11:52:22
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: 19/08/2022 16:39:07
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:example_router/presentation/features/edit_profile/edit_profile_page.dart';
|
||||||
import 'package:example_router/presentation/features/home/home_page.dart';
|
import 'package:example_router/presentation/features/home/home_page.dart';
|
||||||
import 'package:example_router/presentation/features/sign_in/sign_in_page.dart';
|
import 'package:example_router/presentation/features/sign_in/sign_in_page.dart';
|
||||||
import 'package:example_router/presentation/features/sign_up/sign_up_page.dart';
|
import 'package:example_router/presentation/features/sign_up/sign_up_page.dart';
|
||||||
@@ -75,5 +83,14 @@ class AppRouter {
|
|||||||
const SubPage(),
|
const SubPage(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
GoRoute(
|
||||||
|
path: '/home/edit',
|
||||||
|
name: EditProfilePage.pageName,
|
||||||
|
pageBuilder: (context, state) => defaultTransition(
|
||||||
|
context,
|
||||||
|
state,
|
||||||
|
const EditProfilePage(),
|
||||||
|
),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: app_bloc_observer.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 12:02:23
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: 19/08/2022 12:02:45
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
||||||
|
|
||||||
|
class CustomPassword extends RegexValidator<ValidationStandardError> {
|
||||||
|
const CustomPassword.pure([super.value]) : super.pure();
|
||||||
|
const CustomPassword.dirty([super.value]) : super.dirty();
|
||||||
|
|
||||||
|
@override
|
||||||
|
ValidationStandardError get onEmpty => ValidationStandardError.empty;
|
||||||
|
@override
|
||||||
|
ValidationStandardError get onError => ValidationStandardError.invalid;
|
||||||
|
|
||||||
|
@override
|
||||||
|
RegExp get regex => RegExp(r'^(?=.*[A-Za-z\w\s])(?=.*\d).{6,}$');
|
||||||
|
}
|
||||||
+14
-28
@@ -14,33 +14,19 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
part of prompt.framework;
|
import 'package:example_router/core/constants/form_field.dart';
|
||||||
|
import 'package:example_router/core/constants/form_name.dart';
|
||||||
|
import 'package:example_router/core/utils/custom_password.dart';
|
||||||
|
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
||||||
|
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
||||||
|
|
||||||
abstract class Widget<T extends dynamic> {
|
abstract class AppForms {
|
||||||
int _initLineCount = 0;
|
static WyattForm getEditProfileForm() => WyattFormImpl(
|
||||||
|
[
|
||||||
/// Creates the mutable state for this widget
|
FormInput(AuthFormField.email, const Email.pure()),
|
||||||
@protected
|
FormInput(AuthFormField.password, const CustomPassword.pure()),
|
||||||
@factory
|
FormInput(AppFormField.oldPassword, const CustomPassword.pure()),
|
||||||
State createState();
|
],
|
||||||
|
name: AppFormName.editProfile,
|
||||||
State pipeState(State state) => state;
|
);
|
||||||
|
|
||||||
T prompt() {
|
|
||||||
final state = pipeState(createState())
|
|
||||||
.._widget = this
|
|
||||||
..initState();
|
|
||||||
_initLineCount = state.context.lineCount;
|
|
||||||
state.context.resetLineCount();
|
|
||||||
|
|
||||||
state.build();
|
|
||||||
state.context.incrementBuildCount();
|
|
||||||
|
|
||||||
final dynamic out = state.prompt();
|
|
||||||
state.context.wipe();
|
|
||||||
state.context.erasePreviousLine(_initLineCount);
|
|
||||||
state.dispose();
|
|
||||||
|
|
||||||
return out as T;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
// File generated by FlutterFire CLI.
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
|
||||||
|
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
||||||
|
import 'package:flutter/foundation.dart'
|
||||||
|
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||||
|
|
||||||
|
/// Default [FirebaseOptions] for use with your Firebase apps.
|
||||||
|
///
|
||||||
|
/// Example:
|
||||||
|
/// ```dart
|
||||||
|
/// import 'firebase_options.dart';
|
||||||
|
/// // ...
|
||||||
|
/// await Firebase.initializeApp(
|
||||||
|
/// options: DefaultFirebaseOptions.currentPlatform,
|
||||||
|
/// );
|
||||||
|
/// ```
|
||||||
|
class DefaultFirebaseOptions {
|
||||||
|
static FirebaseOptions get currentPlatform {
|
||||||
|
if (kIsWeb) {
|
||||||
|
throw UnsupportedError(
|
||||||
|
'DefaultFirebaseOptions have not been configured for web - '
|
||||||
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.android:
|
||||||
|
throw UnsupportedError(
|
||||||
|
'DefaultFirebaseOptions have not been configured for android - '
|
||||||
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||||
|
);
|
||||||
|
case TargetPlatform.iOS:
|
||||||
|
return ios;
|
||||||
|
case TargetPlatform.macOS:
|
||||||
|
throw UnsupportedError(
|
||||||
|
'DefaultFirebaseOptions have not been configured for macos - '
|
||||||
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||||
|
);
|
||||||
|
case TargetPlatform.windows:
|
||||||
|
throw UnsupportedError(
|
||||||
|
'DefaultFirebaseOptions have not been configured for windows - '
|
||||||
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||||
|
);
|
||||||
|
case TargetPlatform.linux:
|
||||||
|
throw UnsupportedError(
|
||||||
|
'DefaultFirebaseOptions have not been configured for linux - '
|
||||||
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||||
|
);
|
||||||
|
default:
|
||||||
|
throw UnsupportedError(
|
||||||
|
'DefaultFirebaseOptions are not supported for this platform.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const FirebaseOptions ios = FirebaseOptions(
|
||||||
|
apiKey: 'AIzaSyDDmtf0KN7Xw12_pqUsxoBfAxMuvCMmMmk',
|
||||||
|
appId: '1:405351917235:ios:869f0ad8ace08db899f2c6',
|
||||||
|
messagingSenderId: '405351917235',
|
||||||
|
projectId: 'meerabel-dev',
|
||||||
|
storageBucket: 'meerabel-dev.appspot.com',
|
||||||
|
androidClientId:
|
||||||
|
'405351917235-4g1dh3475tq6t1sa2qoh7ol60nf4ta05.apps.googleusercontent.com',
|
||||||
|
iosClientId:
|
||||||
|
'405351917235-2jv4ff02kovoim58f8d6d0rsa14apgkj.apps.googleusercontent.com',
|
||||||
|
iosBundleId: 'com.example.exampleRouter',
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,6 +1,23 @@
|
|||||||
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'package:example_router/bootstrap.dart';
|
import 'package:example_router/bootstrap.dart';
|
||||||
import 'package:example_router/presentation/features/app/app.dart';
|
import 'package:example_router/presentation/features/app/app.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
MockSettings.enable();
|
||||||
bootstrap(App.new);
|
bootstrap(App.new);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -14,6 +14,10 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'dart:io';
|
import 'package:example_router/bootstrap.dart';
|
||||||
|
import 'package:example_router/presentation/features/app/app.dart';
|
||||||
|
|
||||||
bool get supportsAnsiColor => stdout.supportsAnsiEscapes;
|
void main() {
|
||||||
|
MockSettings.disable();
|
||||||
|
bootstrap(App.new);
|
||||||
|
}
|
||||||
@@ -1,11 +1,18 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: app.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 12:05:38
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: Thu Nov 10 2022
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
@@ -13,6 +20,8 @@ import 'dart:math';
|
|||||||
import 'package:example_router/core/constants/form_field.dart';
|
import 'package:example_router/core/constants/form_field.dart';
|
||||||
import 'package:example_router/core/dependency_injection/get_it.dart';
|
import 'package:example_router/core/dependency_injection/get_it.dart';
|
||||||
import 'package:example_router/core/routes/router.dart';
|
import 'package:example_router/core/routes/router.dart';
|
||||||
|
import 'package:example_router/core/utils/custom_password.dart';
|
||||||
|
import 'package:example_router/core/utils/forms.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
@@ -21,7 +30,8 @@ import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
|||||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
FutureResult<int?> onSignUpSuccess(
|
FutureOrResult<int?> onSignUpSuccess(
|
||||||
|
AuthenticationRepository<int> repo,
|
||||||
Account? account,
|
Account? account,
|
||||||
WyattForm form,
|
WyattForm form,
|
||||||
) async {
|
) async {
|
||||||
@@ -34,9 +44,15 @@ FutureResult<int?> onSignUpSuccess(
|
|||||||
return const Ok<int, AppException>(id);
|
return const Ok<int, AppException>(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureResult<int?> onAccountChanges(Account? account) async {
|
FutureOrResult<int?> onAccountChanges(
|
||||||
|
AuthenticationRepository<int> repo,
|
||||||
|
Account? account,
|
||||||
|
) async {
|
||||||
final id = Random().nextInt(1000);
|
final id = Random().nextInt(1000);
|
||||||
debugPrint('onAccountChanges: $account, generatedId: $id');
|
final token =
|
||||||
|
await repo.getIdentityToken().fold((value) => value, (error) => 'null');
|
||||||
|
|
||||||
|
debugPrint('onAccountChanges: $account, token: $token, generatedId: $id');
|
||||||
return Ok<int, AppException>(id);
|
return Ok<int, AppException>(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,6 +63,7 @@ class App extends StatelessWidget {
|
|||||||
authenticationRemoteDataSource: getIt<AuthenticationRemoteDataSource>(),
|
authenticationRemoteDataSource: getIt<AuthenticationRemoteDataSource>(),
|
||||||
onSignUpSuccess: onSignUpSuccess,
|
onSignUpSuccess: onSignUpSuccess,
|
||||||
onAuthChange: onAccountChanges,
|
onAuthChange: onAccountChanges,
|
||||||
|
customPasswordValidator: const CustomPassword.pure(),
|
||||||
extraSignUpInputs: [
|
extraSignUpInputs: [
|
||||||
FormInput(
|
FormInput(
|
||||||
AppFormField.confirmedPassword,
|
AppFormField.confirmedPassword,
|
||||||
@@ -60,7 +77,7 @@ class App extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
AuthenticationState? previous;
|
AuthenticationState<int>? previous;
|
||||||
|
|
||||||
final AuthenticationCubit<int> authenticationCubit =
|
final AuthenticationCubit<int> authenticationCubit =
|
||||||
AuthenticationCubit(authenticationRepository: authenticationRepository);
|
AuthenticationCubit(authenticationRepository: authenticationRepository);
|
||||||
@@ -76,29 +93,18 @@ class App extends StatelessWidget {
|
|||||||
redirect: (context, state) {
|
redirect: (context, state) {
|
||||||
final authState = authenticationCubit.state;
|
final authState = authenticationCubit.state;
|
||||||
|
|
||||||
if (authState != previous) {
|
if (authState.status != previous?.status) {
|
||||||
previous = authState;
|
previous = authState;
|
||||||
// Check if current user is logged in
|
|
||||||
final loggedIn =
|
|
||||||
authState.status == AuthenticationStatus.authenticated;
|
|
||||||
|
|
||||||
// Checking if current path is onboarding or not
|
// Checking if current path is onboarding or not
|
||||||
final isOnboarding = AppRouter.publicRoutes.contains(state.subloc);
|
final isOnboarding = AppRouter.publicRoutes.contains(state.subloc);
|
||||||
|
if (authState.status == AuthenticationStatus.unauthenticated) {
|
||||||
if (!loggedIn) {
|
|
||||||
debugPrint('Not logged');
|
debugPrint('Not logged');
|
||||||
if (isOnboarding) {
|
if (!isOnboarding) {
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
return '/';
|
return '/';
|
||||||
}
|
}
|
||||||
} else {
|
} else if (authState.status == AuthenticationStatus.authenticated) {
|
||||||
debugPrint('Logged');
|
debugPrint('Logged');
|
||||||
if (isOnboarding) {
|
|
||||||
return '/home';
|
return '/home';
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -107,9 +113,13 @@ class App extends StatelessWidget {
|
|||||||
|
|
||||||
return MultiRepositoryProvider(
|
return MultiRepositoryProvider(
|
||||||
providers: [
|
providers: [
|
||||||
RepositoryProvider<AuthenticationRepository>.value(
|
RepositoryProvider<AuthenticationRepository<int>>.value(
|
||||||
value: authenticationRepository,
|
value: authenticationRepository,
|
||||||
),
|
),
|
||||||
|
RepositoryProvider<FormRepository>(
|
||||||
|
create: (context) =>
|
||||||
|
FormRepositoryImpl()..registerForm(AppForms.getEditProfileForm()),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
child: MultiBlocProvider(
|
child: MultiBlocProvider(
|
||||||
providers: [
|
providers: [
|
||||||
|
|||||||
+74
@@ -0,0 +1,74 @@
|
|||||||
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:example_router/core/constants/form_field.dart';
|
||||||
|
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
||||||
|
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
||||||
|
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||||
|
|
||||||
|
class EditProfileCubit extends FormDataCubitImpl {
|
||||||
|
final AuthenticationRepository<int> authenticationRepository;
|
||||||
|
|
||||||
|
EditProfileCubit(
|
||||||
|
super._formRepository,
|
||||||
|
super._formName, {
|
||||||
|
required this.authenticationRepository,
|
||||||
|
}) : super();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> submit() async {
|
||||||
|
emit(
|
||||||
|
state.copyWith(
|
||||||
|
status: FormStatus.submissionInProgress,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
// final user = (await authenticationRepository.getAccount()).ok;
|
||||||
|
|
||||||
|
final form = state.form;
|
||||||
|
final email = form.valueOf<String?>(AuthFormField.email);
|
||||||
|
final oldPassword = form.valueOf<String?>(AppFormField.oldPassword);
|
||||||
|
final newPassword = form.valueOf<String?>(AuthFormField.password);
|
||||||
|
|
||||||
|
if (email.isNullOrEmpty ||
|
||||||
|
oldPassword.isNullOrEmpty ||
|
||||||
|
newPassword.isNullOrEmpty) {
|
||||||
|
emit(
|
||||||
|
state.copyWith(
|
||||||
|
errorMessage: 'An error occured while retrieving data from the form.',
|
||||||
|
status: FormStatus.submissionFailure,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// await authenticationRepository.signInWithEmailAndPassword(
|
||||||
|
// email: user?.email ?? '',
|
||||||
|
// password: oldPassword ?? '',
|
||||||
|
// );
|
||||||
|
// await authenticationRepository.reauthenticateWithCredential();
|
||||||
|
await authenticationRepository.updateEmail(email: email!);
|
||||||
|
await authenticationRepository.updatePassword(password: newPassword!);
|
||||||
|
} on Exception catch (e) {
|
||||||
|
emit(
|
||||||
|
state.copyWith(
|
||||||
|
status: FormStatus.submissionFailure,
|
||||||
|
errorMessage: e.toString(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
emit(state.copyWith(status: FormStatus.submissionSuccess));
|
||||||
|
}
|
||||||
|
}
|
||||||
+61
@@ -0,0 +1,61 @@
|
|||||||
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:example_router/core/constants/form_name.dart';
|
||||||
|
import 'package:example_router/presentation/features/edit_profile/blocs/edit_profile_cubit.dart';
|
||||||
|
import 'package:example_router/presentation/features/edit_profile/widgets/edit_profile_form.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
||||||
|
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
||||||
|
|
||||||
|
class EditProfilePage extends StatelessWidget {
|
||||||
|
const EditProfilePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
static String pageName = 'EditProfile';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(title: const Text('Edit Profile')),
|
||||||
|
body: Padding(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: BlocProvider<EditProfileCubit>(
|
||||||
|
create: (context) => EditProfileCubit(
|
||||||
|
context.read<FormRepository>(),
|
||||||
|
AppFormName.editProfile,
|
||||||
|
authenticationRepository:
|
||||||
|
context.read<AuthenticationRepository<int>>(),
|
||||||
|
)..dataChanged<String?>(
|
||||||
|
AuthFormField.email,
|
||||||
|
Email.dirty(
|
||||||
|
context
|
||||||
|
.read<AuthenticationCubit<int>>()
|
||||||
|
.state
|
||||||
|
.accountWrapper
|
||||||
|
?.account
|
||||||
|
?.email ??
|
||||||
|
'',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: const EditProfileForm(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+136
@@ -0,0 +1,136 @@
|
|||||||
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:example_router/core/constants/form_field.dart';
|
||||||
|
import 'package:example_router/core/utils/custom_password.dart';
|
||||||
|
import 'package:example_router/presentation/features/edit_profile/blocs/edit_profile_cubit.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
||||||
|
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
||||||
|
|
||||||
|
class _EmailInput extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InputBuilderTextController<EditProfileCubit, String?, void>(
|
||||||
|
field: AuthFormField.email,
|
||||||
|
builder: ((context, cubit, state, field, input, controller, extra) {
|
||||||
|
return TextField(
|
||||||
|
onChanged: (email) => cubit.dataChanged<String?>(
|
||||||
|
AuthFormField.email, Email.dirty(email)),
|
||||||
|
keyboardType: TextInputType.emailAddress,
|
||||||
|
controller: controller,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Email',
|
||||||
|
helperText: '',
|
||||||
|
errorText: input.validator.invalid ? 'Invalid email' : null,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _OldPasswordInput extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InputBuilder<EditProfileCubit>(
|
||||||
|
field: AppFormField.oldPassword,
|
||||||
|
builder: ((context, cubit, state, field, input) {
|
||||||
|
return TextField(
|
||||||
|
onChanged: (pwd) => cubit.dataChanged<String?>(
|
||||||
|
AppFormField.oldPassword, CustomPassword.dirty(pwd)),
|
||||||
|
obscureText: true,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Old Password',
|
||||||
|
helperText: '',
|
||||||
|
errorText: input.validator.invalid ? 'Invalid password' : null,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _NewPasswordInput extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InputBuilder<EditProfileCubit>(
|
||||||
|
field: AuthFormField.password,
|
||||||
|
builder: ((context, cubit, state, field, input) {
|
||||||
|
return TextField(
|
||||||
|
onChanged: (pwd) => cubit.dataChanged<String?>(
|
||||||
|
AuthFormField.password, CustomPassword.dirty(pwd)),
|
||||||
|
obscureText: true,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'New Password',
|
||||||
|
helperText: '',
|
||||||
|
errorText: input.validator.invalid ? 'Invalid password' : null,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _EditButton extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SubmitBuilder<EditProfileCubit>(
|
||||||
|
builder: ((context, cubit, status) {
|
||||||
|
return status.isSubmissionInProgress
|
||||||
|
? const CircularProgressIndicator()
|
||||||
|
: ElevatedButton(
|
||||||
|
onPressed: status.isValidated ? () => cubit.submit() : null,
|
||||||
|
child: const Text('Edit profile'),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class EditProfileForm extends StatelessWidget {
|
||||||
|
const EditProfileForm({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BlocListener<EditProfileCubit, FormDataState>(
|
||||||
|
listener: (context, state) {
|
||||||
|
if (state.status == FormStatus.submissionFailure) {
|
||||||
|
ScaffoldMessenger.of(context)
|
||||||
|
..hideCurrentSnackBar()
|
||||||
|
..showSnackBar(
|
||||||
|
SnackBar(content: Text(state.errorMessage ?? 'Edit Failure')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
_EmailInput(),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
_OldPasswordInput(),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
_NewPasswordInput(),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
_EditButton(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+26
-12
@@ -1,12 +1,20 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: home_page.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 14:38:24
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: Wed Nov 09 2022
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:example_router/presentation/features/edit_profile/edit_profile_page.dart';
|
||||||
import 'package:example_router/presentation/features/sub/sub_page.dart';
|
import 'package:example_router/presentation/features/sub/sub_page.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
@@ -25,7 +33,8 @@ class HomePage extends StatelessWidget {
|
|||||||
title: const Text('Home'),
|
title: const Text('Home'),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => context.read<AuthenticationCubit<int>>().signOut(),
|
onPressed: () =>
|
||||||
|
context.read<AuthenticationCubit<int>>().signOut(),
|
||||||
icon: const Icon(Icons.logout_rounded))
|
icon: const Icon(Icons.logout_rounded))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -35,8 +44,8 @@ class HomePage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
AuthenticationBuilder<int>(
|
AuthenticationBuilder<int>(
|
||||||
authenticated: (context, accountWrapper) =>
|
authenticated: (context, accountWrapper) => Text(
|
||||||
Text('Logged as ${accountWrapper.account?.email} | GeneratedId is ${accountWrapper.data}'),
|
'Logged as ${accountWrapper.account?.email} | GeneratedId is ${accountWrapper.data}'),
|
||||||
unauthenticated: (context) =>
|
unauthenticated: (context) =>
|
||||||
const Text('Not logged (unauthenticated)'),
|
const Text('Not logged (unauthenticated)'),
|
||||||
unknown: (context) => const Text('Not logged (unknown)'),
|
unknown: (context) => const Text('Not logged (unknown)'),
|
||||||
@@ -46,7 +55,12 @@ class HomePage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () => context.pushNamed(SubPage.pageName),
|
onPressed: () => context.pushNamed(SubPage.pageName),
|
||||||
child: const Text('Go to sub page')),
|
child: const Text('Go to sub page'),
|
||||||
|
),
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () => context.pushNamed(EditProfilePage.pageName),
|
||||||
|
child: const Text('Go to edit profile page'),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
+15
-8
@@ -1,11 +1,18 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: sign_in_page.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 12:41:42
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: 19/08/2022 15:26:36
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'package:example_router/presentation/features/sign_in/widgets/sign_in_form.dart';
|
import 'package:example_router/presentation/features/sign_in/widgets/sign_in_form.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|||||||
+39
-10
@@ -1,12 +1,20 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: sign_in_form.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 15:24:37
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: Wed Nov 16 2022
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:example_router/core/utils/custom_password.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
||||||
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
||||||
@@ -38,7 +46,8 @@ class _PasswordInput extends StatelessWidget {
|
|||||||
field: AuthFormField.password,
|
field: AuthFormField.password,
|
||||||
builder: ((context, cubit, state, field, input) {
|
builder: ((context, cubit, state, field, input) {
|
||||||
return TextField(
|
return TextField(
|
||||||
onChanged: (pwd) => cubit.passwordChanged(pwd),
|
onChanged: (pwd) => cubit
|
||||||
|
.passwordCustomChanged<CustomPassword>(CustomPassword.dirty(pwd)),
|
||||||
obscureText: true,
|
obscureText: true,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelText: 'Password',
|
labelText: 'Password',
|
||||||
@@ -59,7 +68,9 @@ class _SignInButton extends StatelessWidget {
|
|||||||
return status.isSubmissionInProgress
|
return status.isSubmissionInProgress
|
||||||
? const CircularProgressIndicator()
|
? const CircularProgressIndicator()
|
||||||
: ElevatedButton(
|
: ElevatedButton(
|
||||||
onPressed: status.isValidated ? () => cubit.signInWithEmailAndPassword() : null,
|
onPressed: status.isValidated
|
||||||
|
? () => cubit.signInWithEmailAndPassword()
|
||||||
|
: null,
|
||||||
child: const Text('Sign in with credentials'),
|
child: const Text('Sign in with credentials'),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
@@ -83,6 +94,22 @@ class _SignInAnonymouslyButton extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _SignInWithGoogleButton extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SubmitBuilder<SignInCubit<int>>(
|
||||||
|
builder: ((context, cubit, status) {
|
||||||
|
return status.isSubmissionInProgress
|
||||||
|
? const CircularProgressIndicator()
|
||||||
|
: ElevatedButton(
|
||||||
|
onPressed: () => cubit.signInWithGoogle(),
|
||||||
|
child: const Text('Sign in Google'),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class SignInForm extends StatelessWidget {
|
class SignInForm extends StatelessWidget {
|
||||||
const SignInForm({Key? key}) : super(key: key);
|
const SignInForm({Key? key}) : super(key: key);
|
||||||
|
|
||||||
@@ -105,6 +132,8 @@ class SignInForm extends StatelessWidget {
|
|||||||
_SignInButton(),
|
_SignInButton(),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
_SignInAnonymouslyButton(),
|
_SignInAnonymouslyButton(),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
_SignInWithGoogleButton(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
+15
-8
@@ -1,11 +1,18 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: sign_up_page.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 12:41:27
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: 19/08/2022 14:58:51
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'package:example_router/presentation/features/sign_up/widgets/sign_up_form.dart';
|
import 'package:example_router/presentation/features/sign_up/widgets/sign_up_form.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|||||||
+18
-9
@@ -1,13 +1,21 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: sign_up_form.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 14:41:08
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: Wed Nov 16 2022
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'package:example_router/core/constants/form_field.dart';
|
import 'package:example_router/core/constants/form_field.dart';
|
||||||
|
import 'package:example_router/core/utils/custom_password.dart';
|
||||||
import 'package:flutter/material.dart' hide FormField;
|
import 'package:flutter/material.dart' hide FormField;
|
||||||
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
||||||
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
import 'package:wyatt_form_bloc/wyatt_form_bloc.dart';
|
||||||
@@ -40,7 +48,8 @@ class _PasswordInput extends StatelessWidget {
|
|||||||
builder: ((context, cubit, state, field, input) {
|
builder: ((context, cubit, state, field, input) {
|
||||||
return TextField(
|
return TextField(
|
||||||
onChanged: (pwd) {
|
onChanged: (pwd) {
|
||||||
cubit.passwordChanged(pwd);
|
cubit.passwordCustomChanged<CustomPassword>(
|
||||||
|
CustomPassword.dirty(pwd));
|
||||||
cubit.dataChanged(
|
cubit.dataChanged(
|
||||||
AppFormField.confirmedPassword,
|
AppFormField.confirmedPassword,
|
||||||
ConfirmedPassword.dirty(
|
ConfirmedPassword.dirty(
|
||||||
|
|||||||
+22
-10
@@ -1,11 +1,18 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: sub_page.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 16:10:05
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: Wed Nov 09 2022
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
@@ -23,8 +30,13 @@ class SubPage extends StatelessWidget {
|
|||||||
title: const Text('Sub'),
|
title: const Text('Sub'),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () => context.read<AuthenticationCubit<int>>().signOut(),
|
onPressed: () =>
|
||||||
icon: const Icon(Icons.logout_rounded))
|
context.read<AuthenticationCubit<int>>().signOut(),
|
||||||
|
icon: const Icon(Icons.logout_rounded)),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () =>
|
||||||
|
context.read<AuthenticationRepository<int>>().refresh(),
|
||||||
|
icon: const Icon(Icons.refresh))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: const Padding(
|
body: const Padding(
|
||||||
|
|||||||
+15
-8
@@ -1,11 +1,18 @@
|
|||||||
// Author: Hugo Pointcheval
|
// Copyright (C) 2022 WYATT GROUP
|
||||||
// Email: git@pcl.ovh
|
// Please see the AUTHORS file for details.
|
||||||
// -----
|
//
|
||||||
// File: welcome_page.dart
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// Created Date: 19/08/2022 12:33:21
|
// it under the terms of the GNU General Public License as published by
|
||||||
// Last Modified: Wed Nov 09 2022
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// -----
|
// any later version.
|
||||||
// Copyright (c) 2022
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import 'package:example_router/presentation/features/sign_in/sign_in_page.dart';
|
import 'package:example_router/presentation/features/sign_in/sign_in_page.dart';
|
||||||
import 'package:example_router/presentation/features/sign_up/sign_up_page.dart';
|
import 'package:example_router/presentation/features/sign_up/sign_up_page.dart';
|
||||||
|
|||||||
@@ -40,15 +40,15 @@ dependencies:
|
|||||||
|
|
||||||
wyatt_form_bloc:
|
wyatt_form_bloc:
|
||||||
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
||||||
version: 0.2.0
|
version: 0.2.0+2
|
||||||
|
|
||||||
wyatt_architecture:
|
wyatt_architecture:
|
||||||
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
||||||
version: 0.0.2
|
version: 0.1.0+1
|
||||||
|
|
||||||
wyatt_type_utils:
|
wyatt_type_utils:
|
||||||
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub/
|
||||||
version: 0.0.3+1
|
version: 0.0.4
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
|
|||||||
@@ -18,4 +18,3 @@ export 'constants/form_field.dart';
|
|||||||
export 'constants/form_name.dart';
|
export 'constants/form_name.dart';
|
||||||
export 'enums/enums.dart';
|
export 'enums/enums.dart';
|
||||||
export 'exceptions/exceptions.dart';
|
export 'exceptions/exceptions.dart';
|
||||||
export 'utils/utils.dart';
|
|
||||||
|
|||||||
@@ -20,15 +20,14 @@ part 'exceptions_firebase.dart';
|
|||||||
|
|
||||||
abstract class AuthenticationFailureInterface extends AppException
|
abstract class AuthenticationFailureInterface extends AppException
|
||||||
implements Exception {
|
implements Exception {
|
||||||
|
AuthenticationFailureInterface(this.code, this.msg);
|
||||||
|
AuthenticationFailureInterface.fromCode(this.code)
|
||||||
|
: msg = 'An unknown error occurred.';
|
||||||
String code;
|
String code;
|
||||||
String msg;
|
String msg;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get message => msg;
|
String get message => msg;
|
||||||
|
|
||||||
AuthenticationFailureInterface(this.code, this.msg);
|
|
||||||
AuthenticationFailureInterface.fromCode(this.code)
|
|
||||||
: msg = 'An unknown error occurred.';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// {@template apply_action_code_failure}
|
/// {@template apply_action_code_failure}
|
||||||
@@ -256,3 +255,31 @@ abstract class GetIdTokenFailureInterface
|
|||||||
|
|
||||||
GetIdTokenFailureInterface.fromCode(super.code) : super.fromCode();
|
GetIdTokenFailureInterface.fromCode(super.code) : super.fromCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class ReauthenticateFailureInterface
|
||||||
|
extends AuthenticationFailureInterface {
|
||||||
|
ReauthenticateFailureInterface(super.code, super.msg);
|
||||||
|
|
||||||
|
ReauthenticateFailureInterface.fromCode(super.code) : super.fromCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class UpdateEmailFailureInterface
|
||||||
|
extends AuthenticationFailureInterface {
|
||||||
|
UpdateEmailFailureInterface(super.code, super.msg);
|
||||||
|
|
||||||
|
UpdateEmailFailureInterface.fromCode(super.code) : super.fromCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class UpdatePasswordFailureInterface
|
||||||
|
extends AuthenticationFailureInterface {
|
||||||
|
UpdatePasswordFailureInterface(super.code, super.msg);
|
||||||
|
|
||||||
|
UpdatePasswordFailureInterface.fromCode(super.code) : super.fromCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class ModelParsingFailureInterface
|
||||||
|
extends AuthenticationFailureInterface {
|
||||||
|
ModelParsingFailureInterface(super.code, super.msg);
|
||||||
|
|
||||||
|
ModelParsingFailureInterface.fromCode(super.code) : super.fromCode();
|
||||||
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user