Compare commits
146
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 |
+2
-2
@@ -20,12 +20,12 @@ name: default
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: quality-check
|
- name: quality-check
|
||||||
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0
|
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0-1
|
||||||
commands:
|
commands:
|
||||||
- melos run quality-check
|
- melos run quality-check
|
||||||
- melos run publish:validate
|
- melos run publish:validate
|
||||||
- name: publish
|
- name: publish
|
||||||
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0
|
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0-1
|
||||||
commands:
|
commands:
|
||||||
- melos run publish:validate
|
- melos run publish:validate
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,50 @@
|
|||||||
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
|
## 2022-12-13
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|||||||
@@ -17,11 +17,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
<a href="https://wyatt-studio.fr">
|
||||||
<a href="https://wyattapp.io">
|
|
||||||
<img width="150px" src="resources/wyatt-campus-logo.png">
|
|
||||||
</a>
|
|
||||||
<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>
|
||||||
<h1 align="center">Wyatt Packages</h1>
|
<h1 align="center">Wyatt Packages</h1>
|
||||||
@@ -44,10 +40,9 @@
|
|||||||
|
|
||||||
## 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.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -61,21 +56,21 @@ git clone ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
|||||||
|
|
||||||
### Prerequisite
|
### Prerequisite
|
||||||
|
|
||||||
- [Flutter](https://github.com/flutter/flutter).
|
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.
|
||||||
|
|
||||||
- [Melos](https://github.com/invertase/melos). Used to manage Dart projects with multiple packages.
|
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
|
||||||
```
|
```
|
||||||
|
|
||||||
- [Mason](https://github.com/felangel/mason). Used for code generation.
|
3. [Mason](https://github.com/felangel/mason). Mason is used for code generation purposes. It can be installed by running the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dart pub global activate mason_cli
|
dart pub global activate mason_cli
|
||||||
```
|
```
|
||||||
|
|
||||||
- [Lcov](https://github.com/linux-test-project/lcov). Used to generate coverage data.
|
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
|
```shell
|
||||||
# on macos
|
# on macos
|
||||||
@@ -84,38 +79,39 @@ brew install lcov
|
|||||||
|
|
||||||
- genhtml. Used to convert coverage data into html pages.
|
- genhtml. Used to convert coverage data into html pages.
|
||||||
|
|
||||||
After installing all these packages, bootstrap with `melos bs`.
|
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
|
||||||
mason make wyatt_package --package_name wyatt_<name> --description A new Wyatt package --flutter_only false
|
mason make wyatt_package --package_name wyatt_<name> --description A new Wyatt package --flutter_only false
|
||||||
```
|
```
|
||||||
|
|
||||||
Then bootstrap project with `melos bs` command.
|
The <name> variable in the above command is important and must be clear and understandable.
|
||||||
|
|
||||||
|
After creating the package, bootstrap the project with the `melos bs` command.
|
||||||
|
|
||||||
#### 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
|
||||||
For example, if name is CRUD BLOC
|
3. example name: crud_bloc_example
|
||||||
|
|
||||||
- name will be crud_bloc
|
|
||||||
- so the package will be: `wyatt_crud_bloc`
|
|
||||||
- and the example will be: `crud_bloc_example`
|
|
||||||
|
|
||||||
### Create issues
|
### Create issues
|
||||||
|
|
||||||
Add the issues directly related to what you want to develop and label them correctly.
|
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.
|
Type(scope): issue.
|
||||||
@@ -128,18 +124,18 @@ For example, on notification bloc package :
|
|||||||
|
|
||||||
### Branches
|
### Branches
|
||||||
|
|
||||||
Master is protected. You can't push on it. Please develop your feature on another branch. The name of your branch has to match with the issue opened.
|
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`
|
`type(scope):issue`
|
||||||
|
|
||||||
Example :
|
Example :
|
||||||
Issue :
|
For the issue:
|
||||||
|
|
||||||
- `Feature(notification_bloc): add firebase messaging data source.`
|
- `Feature(notification_bloc): add firebase messaging data source.`
|
||||||
|
|
||||||
Branch related to this issue :
|
The related branch should be named:
|
||||||
|
|
||||||
- `feature(notification_bloc)/add_firebase_messaging_data_source`
|
- `notification_bloc/feat/add_firebase_messaging_data_source`
|
||||||
|
|
||||||
### Commits
|
### Commits
|
||||||
|
|
||||||
@@ -163,12 +159,11 @@ Some examples :
|
|||||||
- `docs: update readme.` = update **this** readme file.
|
- `docs: update readme.` = update **this** readme file.
|
||||||
- `fix(crud)!: fix bug in awesome() function. (#32)` = fix a bug, `!` is important and indicate `BREAKING CHANGES` linked with the 32nd issue.
|
- `fix(crud)!: fix bug in awesome() function. (#32)` = fix a bug, `!` is important and indicate `BREAKING CHANGES` linked with the 32nd issue.
|
||||||
|
|
||||||
When you have finished developing, and are ready to close the issue, close it via your commit :
|
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:
|
||||||
|
|
||||||
`feat(auth): add AWS support. (close #31)`
|
```shell
|
||||||
|
feat(auth): add AWS support. (close #31)
|
||||||
Note that your issue will be close after merging on master.
|
```
|
||||||
Before closing the issue, please check tests and update coverage. You might run :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
melos run test:all # this will run all tests in this project
|
melos run test:all # this will run all tests in this project
|
||||||
@@ -179,45 +174,44 @@ melos run publish:validate # this will run a validation before publish packages
|
|||||||
melos run publish # this will publish packages
|
melos run publish # this will publish packages
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note that only modified package will be verified and published.
|
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
|
#### Merge your work
|
||||||
|
|
||||||
After closing your issue, some work may have been done on master in the meantime. To keep a clean git history, please rebase before opening a change request.
|
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 :
|
Two situations :
|
||||||
|
|
||||||
- You have not yet created your branch and have committed locally :
|
- You haven't created a branch yet and have made local commits:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git pull --rebase
|
git pull --rebase
|
||||||
```
|
```
|
||||||
|
|
||||||
- You are already working on your branch :
|
- You are already working on a branch:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git rebase -i master
|
git rebase -i master
|
||||||
```
|
```
|
||||||
|
|
||||||
If possible, please use `--fixup` on your commit in interactive rebase.
|
It's recommended to use the `--fixup` option during the interactive rebase to keep the Git history clean.
|
||||||
|
|
||||||
Then, opend your PR, get the necessary approval and merge your work. Then you're done ✅.
|
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.
|
#### Update version.
|
||||||
|
|
||||||
Once your work is on the master, you can update your package version. Please filter packages to update only your package. `--scope` is used to do it.
|
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:
|
||||||
For example, after merging changes on `wyatt_otification_bloc` package, you might run :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
melos version --scope="*wyatt_notification_bloc*"
|
melos version --scope="*wyatt_notification_bloc*"
|
||||||
```
|
```
|
||||||
|
|
||||||
In fact, melos will filter all packages that match the `wyatt_notification_block` pattern.
|
This will filter all packages that match the `wyatt_notification_bloc` pattern and update only that package.
|
||||||
|
|
||||||
You can update check all packages tests by running :
|
You can then verify that all packages and their tests are working correctly by running:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
melos run test
|
melos run test:all
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Publish your package
|
#### Publish your package
|
||||||
@@ -265,14 +259,14 @@ Here you can change `package name` and `package version`.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Status
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
This repository is maintained by Wyatt Studio but work is in progress.
|
|
||||||
|
|
||||||
## Simple work flow diagramm
|
## Simple work flow diagramm
|
||||||
|
|
||||||
To sum up, here a simple work flow diagramm.
|
To sum up, here a simple work flow diagramm.
|
||||||
|
|
||||||

|

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

|
||||||
|
|
||||||
|
This repository is maintained by Wyatt Studio but work is in progress.
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"bricks":{"wyatt_clean_code":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_clean_code","ref":"033baa65408ec6b68e6a2ef43e64c24708ef16a1"}},"wyatt_feature_brick":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_feature_brick","ref":"033baa65408ec6b68e6a2ef43e64c24708ef16a1"}},"wyatt_package":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_package","ref":"033baa65408ec6b68e6a2ef43e64c24708ef16a1"}}}}
|
{"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"}}}}
|
||||||
+22
-10
@@ -1,13 +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:
|
bricks:
|
||||||
wyatt_clean_code:
|
wyatt_package_template:
|
||||||
git:
|
git:
|
||||||
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git
|
url: "ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git"
|
||||||
path: bricks/wyatt_clean_code
|
path: bricks/wyatt_package_template
|
||||||
wyatt_feature_brick:
|
wyatt_component_template:
|
||||||
git:
|
git:
|
||||||
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git
|
url: "ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git"
|
||||||
path: bricks/wyatt_feature_brick
|
path: bricks/wyatt_component_template
|
||||||
wyatt_package:
|
|
||||||
git:
|
|
||||||
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git
|
|
||||||
path: bricks/wyatt_package
|
|
||||||
+9
-5
@@ -24,13 +24,17 @@ scripts:
|
|||||||
melos exec -c 1 -- flutter analyze --fatal-infos
|
melos exec -c 1 -- flutter analyze --fatal-infos
|
||||||
description: Run `flutter analyze` for all packages.
|
description: Run `flutter analyze` for all packages.
|
||||||
|
|
||||||
format:
|
fix:
|
||||||
run: melos exec flutter format . --fix
|
run: melos exec dart fix . --apply
|
||||||
description: Run `flutter format` for all packages.
|
description: Run `dart fix` for all packages.
|
||||||
|
|
||||||
|
format:
|
||||||
|
run: melos exec dart format .
|
||||||
|
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
|
||||||
|
|||||||
@@ -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,13 @@
|
|||||||
|
## 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
|
## 2.3.0
|
||||||
|
|
||||||
- **REFACTOR**: follow melos versioning.
|
- **REFACTOR**: follow melos versioning.
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* any later version.
|
* any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
@@ -20,21 +20,29 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
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.3.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
|
||||||
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.3.0
|
version: 2.4.1
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, add an include in `analysis_options.yaml`:
|
Then, add an include in `analysis_options.yaml` :
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
include: package:wyatt_analysis/analysis_options.yaml
|
include: package:wyatt_analysis/analysis_options.yaml
|
||||||
@@ -49,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.3.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.3.0.yaml
|
include: package:wyatt_analysis/analysis_options.2.4.1.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
## Suppressing Lints
|
## Suppressing Lints
|
||||||
@@ -87,7 +95,7 @@ class B {}
|
|||||||
|
|
||||||
### Project Level
|
### Project Level
|
||||||
|
|
||||||
To surpress a specific lint rule for an entire project, modify `analysis_options.yaml`:
|
To surpress a specific lint rule for an entire project, modify `analysis_options.yaml` :
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
include: package:wyatt_analysis/analysis_options.yaml
|
include: package:wyatt_analysis/analysis_options.yaml
|
||||||
@@ -104,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,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
|
||||||
@@ -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,5 +1,4 @@
|
|||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
# Copyright (C) 2022 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,5 +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.3.0.yaml
|
include: package:wyatt_analysis/analysis_options.flutter.2.4.1.yaml
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
# Copyright (C) 2022 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,5 +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.3.0.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
|
||||||
@@ -18,4 +18,4 @@
|
|||||||
/// used internally at [Wyatt Studio](https://wyatt-studio.fr).
|
/// used internally at [Wyatt Studio](https://wyatt-studio.fr).
|
||||||
library wyatt_analysis;
|
library wyatt_analysis;
|
||||||
|
|
||||||
const String wyattAnalysisVersion = '2.3.0';
|
const String wyattAnalysisVersion = '2.4.1';
|
||||||
|
|||||||
@@ -18,20 +18,12 @@
|
|||||||
|
|
||||||
usage="
|
usage="
|
||||||
usage:
|
usage:
|
||||||
$(basename "$0") <previous_version> <new_version> -- create new analyzer files.
|
$(basename "$0") <new_version> -- create new analyzer files.
|
||||||
|
|
||||||
where:
|
where:
|
||||||
previous_version: last version, for example \`2.3.0\`
|
|
||||||
new_version: new version, for example \`2.4.0\`"
|
new_version: new version, for example \`2.4.0\`"
|
||||||
|
|
||||||
old=$1
|
new=$1
|
||||||
new=$2
|
|
||||||
|
|
||||||
if [ -z "$old" ]; then
|
|
||||||
echo "previous_version cannot be null"
|
|
||||||
echo "${usage}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$new" ]; then
|
if [ -z "$new" ]; then
|
||||||
echo "new_version cannot be null"
|
echo "new_version cannot be null"
|
||||||
@@ -43,6 +35,19 @@ SCRIPT_PATH="${BASH_SOURCE:-$0}"
|
|||||||
ABS_SCRIPT_PATH="$(realpath "${SCRIPT_PATH}")"
|
ABS_SCRIPT_PATH="$(realpath "${SCRIPT_PATH}")"
|
||||||
ABS_DIRECTORY="$(dirname "${ABS_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"
|
LIB="${ABS_DIRECTORY}/lib/wyatt_analysis.dart"
|
||||||
OPTIONS="${ABS_DIRECTORY}/lib/analysis_options.yaml"
|
OPTIONS="${ABS_DIRECTORY}/lib/analysis_options.yaml"
|
||||||
OLD_OPTIONS="${ABS_DIRECTORY}/lib/analysis_options.${old}.yaml"
|
OLD_OPTIONS="${ABS_DIRECTORY}/lib/analysis_options.${old}.yaml"
|
||||||
@@ -52,6 +57,7 @@ OPTIONS_FLUTTER="${ABS_DIRECTORY}/lib/analysis_options.flutter.yaml"
|
|||||||
OLD_OPTIONS_FLUTTER="${ABS_DIRECTORY}/lib/analysis_options.flutter.${old}.yaml"
|
OLD_OPTIONS_FLUTTER="${ABS_DIRECTORY}/lib/analysis_options.flutter.${old}.yaml"
|
||||||
NEW_OPTIONS_FLUTTER="${ABS_DIRECTORY}/lib/analysis_options.flutter.${new}.yaml"
|
NEW_OPTIONS_FLUTTER="${ABS_DIRECTORY}/lib/analysis_options.flutter.${new}.yaml"
|
||||||
|
|
||||||
|
|
||||||
if [ ! -e "$OLD_OPTIONS" ]; then
|
if [ ! -e "$OLD_OPTIONS" ]; then
|
||||||
echo "analysis_options.${old}.yaml doesn't exists"
|
echo "analysis_options.${old}.yaml doesn't exists"
|
||||||
echo "${usage}"
|
echo "${usage}"
|
||||||
@@ -91,7 +97,7 @@ sed -e "s/${old}/${new}/g" "README.md" > tempfile.tmp
|
|||||||
mv -f tempfile.tmp "README.md"
|
mv -f tempfile.tmp "README.md"
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
# 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
|
||||||
@@ -111,7 +117,7 @@ include: package:wyatt_analysis/analysis_options.${new}.yaml
|
|||||||
" > "${OPTIONS}"
|
" > "${OPTIONS}"
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
# 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
|
||||||
@@ -130,4 +136,7 @@ echo "
|
|||||||
include: package:wyatt_analysis/analysis_options.flutter.${new}.yaml
|
include: package:wyatt_analysis/analysis_options.flutter.${new}.yaml
|
||||||
" > "${OPTIONS_FLUTTER}"
|
" > "${OPTIONS_FLUTTER}"
|
||||||
|
|
||||||
|
# Update latest version
|
||||||
|
echo "${new}" > "$LATEST_VERSION"
|
||||||
|
|
||||||
exit 0
|
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 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.3.0
|
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"
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ 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 {
|
||||||
|
|
||||||
PhotoRepositoryImpl(
|
PhotoRepositoryImpl(
|
||||||
this._photoRemoteDataSource,
|
this._photoRemoteDataSource,
|
||||||
this._albumRemoteDataSource,
|
this._albumRemoteDataSource,
|
||||||
|
|||||||
+3
-3
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
-1
@@ -21,7 +21,6 @@ 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 AsyncUseCase<Photo, List<Photo>> {
|
class AddPhotoToFavorites extends AsyncUseCase<Photo, List<Photo>> {
|
||||||
|
|
||||||
AddPhotoToFavorites(this._photoRepository);
|
AddPhotoToFavorites(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
|
|||||||
-1
@@ -20,7 +20,6 @@ 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 AsyncUseCase<int, bool> {
|
class CheckIfPhotoIsInFavorites extends AsyncUseCase<int, bool> {
|
||||||
|
|
||||||
CheckIfPhotoIsInFavorites(this._photoRepository);
|
CheckIfPhotoIsInFavorites(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ 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 AsyncUseCase<NoParam, List<Photo>> {
|
class DisplayFavorites extends AsyncUseCase<NoParam, List<Photo>> {
|
||||||
|
|
||||||
DisplayFavorites(this._photoRepository);
|
DisplayFavorites(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ 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 AsyncUseCase<int, Photo> {
|
class DisplayPhoto extends AsyncUseCase<int, Photo> {
|
||||||
|
|
||||||
DisplayPhoto(this._photoRepository);
|
DisplayPhoto(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import 'package:architecture_example/domain/usecases/photos/params/query_paramet
|
|||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
class OpenAlbum extends AsyncUseCase<QueryParameters, List<Photo>> {
|
class OpenAlbum extends AsyncUseCase<QueryParameters, List<Photo>> {
|
||||||
|
|
||||||
OpenAlbum(this._photoRepository);
|
OpenAlbum(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
|
|||||||
-1
@@ -15,7 +15,6 @@
|
|||||||
// 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});
|
QueryParameters(this.start, this.limit, {this.albumId = -1});
|
||||||
final int albumId;
|
final int albumId;
|
||||||
final int? start;
|
final int? start;
|
||||||
|
|||||||
-1
@@ -21,7 +21,6 @@ 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 AsyncUseCase<int, List<Photo>> {
|
class RemovePhotoFromFavorites extends AsyncUseCase<int, List<Photo>> {
|
||||||
|
|
||||||
RemovePhotoFromFavorites(this._photoRepository);
|
RemovePhotoFromFavorites(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
|
|||||||
-1
@@ -22,7 +22,6 @@ import 'package:architecture_example/domain/usecases/photos/params/query_paramet
|
|||||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||||
|
|
||||||
class RetrieveAllAlbums extends AsyncUseCase<QueryParameters, List<Album>> {
|
class RetrieveAllAlbums extends AsyncUseCase<QueryParameters, List<Album>> {
|
||||||
|
|
||||||
RetrieveAllAlbums(this._photoRepository);
|
RetrieveAllAlbums(this._photoRepository);
|
||||||
final PhotoRepository _photoRepository;
|
final PhotoRepository _photoRepository;
|
||||||
|
|
||||||
|
|||||||
-1
@@ -33,7 +33,6 @@ 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> {
|
||||||
|
|
||||||
AlbumBloc(this._retrieveAllAlbums) : super(const AlbumState()) {
|
AlbumBloc(this._retrieveAllAlbums) : super(const AlbumState()) {
|
||||||
on<AlbumFetched>(
|
on<AlbumFetched>(
|
||||||
_onAlbumFetched,
|
_onAlbumFetched,
|
||||||
|
|||||||
+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
@@ -26,7 +26,6 @@ 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});
|
const PhotoDetailsSuccess(this.photo, {required this.isFavorite});
|
||||||
final Photo photo;
|
final Photo photo;
|
||||||
final bool isFavorite;
|
final bool isFavorite;
|
||||||
@@ -36,7 +35,6 @@ class PhotoDetailsSuccess extends PhotoDetailsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PhotoDetailsFailure extends PhotoDetailsState {
|
class PhotoDetailsFailure extends PhotoDetailsState {
|
||||||
|
|
||||||
const PhotoDetailsFailure(this.error);
|
const PhotoDetailsFailure(this.error);
|
||||||
final String error;
|
final String 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
@@ -23,7 +23,6 @@ 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> {
|
||||||
|
|
||||||
FavoriteCheckerCubit(this._checkIfPhotoIsInFavorites)
|
FavoriteCheckerCubit(this._checkIfPhotoIsInFavorites)
|
||||||
: super(FavoriteCheckerInitial());
|
: super(FavoriteCheckerInitial());
|
||||||
final CheckIfPhotoIsInFavorites _checkIfPhotoIsInFavorites;
|
final CheckIfPhotoIsInFavorites _checkIfPhotoIsInFavorites;
|
||||||
|
|||||||
-2
@@ -10,7 +10,6 @@ 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});
|
const FavoriteCheckerSuccess(this.photoId, {required this.isFavorite});
|
||||||
final int photoId;
|
final int photoId;
|
||||||
final bool isFavorite;
|
final bool isFavorite;
|
||||||
@@ -20,7 +19,6 @@ class FavoriteCheckerSuccess extends FavoriteCheckerState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FavoriteCheckerFailure extends FavoriteCheckerState {
|
class FavoriteCheckerFailure extends FavoriteCheckerState {
|
||||||
|
|
||||||
const FavoriteCheckerFailure(this.error);
|
const FavoriteCheckerFailure(this.error);
|
||||||
final String error;
|
final String error;
|
||||||
|
|
||||||
|
|||||||
-1
@@ -33,7 +33,6 @@ 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> {
|
||||||
|
|
||||||
PhotoBloc(this._openAlbum) : super(const PhotoState()) {
|
PhotoBloc(this._openAlbum) : super(const PhotoState()) {
|
||||||
on<PhotoFetched>(
|
on<PhotoFetched>(
|
||||||
_onPhotoFetched,
|
_onPhotoFetched,
|
||||||
|
|||||||
-1
@@ -24,7 +24,6 @@ abstract class PhotoEvent extends Equatable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PhotoFetched extends PhotoEvent {
|
class PhotoFetched extends PhotoEvent {
|
||||||
|
|
||||||
const PhotoFetched(this.albumId);
|
const PhotoFetched(this.albumId);
|
||||||
final int 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,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+13
-13
@@ -71,17 +71,17 @@ class _PhotosGridState extends State<PhotosGrid> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => GridView.builder(
|
Widget build(BuildContext context) => GridView.builder(
|
||||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisSpacing: 4,
|
crossAxisSpacing: 4,
|
||||||
mainAxisSpacing: 4,
|
mainAxisSpacing: 4,
|
||||||
crossAxisCount: 4,
|
crossAxisCount: 4,
|
||||||
),
|
),
|
||||||
itemCount: widget.hasReachedMax
|
itemCount: widget.hasReachedMax
|
||||||
? widget.photos.length
|
? widget.photos.length
|
||||||
: widget.photos.length + 1,
|
: widget.photos.length + 1,
|
||||||
controller: _scrollController,
|
controller: _scrollController,
|
||||||
itemBuilder: (context, index) => index >= widget.photos.length
|
itemBuilder: (context, index) => index >= widget.photos.length
|
||||||
? const BottomLoader()
|
? const BottomLoader()
|
||||||
: PhotosGridThumbnail(photo: widget.photos[index]),
|
: PhotosGridThumbnail(photo: widget.photos[index]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+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),
|
||||||
|
)
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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.3.0
|
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,7 +17,6 @@
|
|||||||
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 {
|
||||||
|
|
||||||
AppException([this.message]);
|
AppException([this.message]);
|
||||||
final String? message;
|
final String? message;
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
@@ -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.3.0
|
version: ^2.4.1
|
||||||
+1
-1
@@ -35,7 +35,7 @@ class EditProfileCubit extends FormDataCubitImpl {
|
|||||||
status: FormStatus.submissionInProgress,
|
status: FormStatus.submissionInProgress,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final user = (await authenticationRepository.getAccount()).ok;
|
// final user = (await authenticationRepository.getAccount()).ok;
|
||||||
|
|
||||||
final form = state.form;
|
final form = state.form;
|
||||||
final email = form.valueOf<String?>(AuthFormField.email);
|
final email = form.valueOf<String?>(AuthFormField.email);
|
||||||
|
|||||||
@@ -37,4 +37,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.3.0
|
version: 2.4.1
|
||||||
|
|||||||
+2
-2
@@ -25,8 +25,8 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
|||||||
class MockAuthenticationRepository extends Mock
|
class MockAuthenticationRepository extends Mock
|
||||||
implements AuthenticationRepository<int> {}
|
implements AuthenticationRepository<int> {}
|
||||||
|
|
||||||
class MockAuthenticationCubit extends Mock implements AuthenticationCubit<int> {
|
class MockAuthenticationCubit extends Mock
|
||||||
}
|
implements AuthenticationCubit<int> {}
|
||||||
|
|
||||||
class MockAccount extends Mock implements Account {}
|
class MockAccount extends Mock implements Account {}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -25,8 +25,8 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
|||||||
class MockAuthenticationRepository extends Mock
|
class MockAuthenticationRepository extends Mock
|
||||||
implements AuthenticationRepository<int> {}
|
implements AuthenticationRepository<int> {}
|
||||||
|
|
||||||
class MockAuthenticationCubit extends Mock implements AuthenticationCubit<int> {
|
class MockAuthenticationCubit extends Mock
|
||||||
}
|
implements AuthenticationCubit<int> {}
|
||||||
|
|
||||||
class MockAccount extends Mock implements Account {}
|
class MockAccount extends Mock implements Account {}
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
|||||||
class MockAuthenticationRepository extends Mock
|
class MockAuthenticationRepository extends Mock
|
||||||
implements AuthenticationRepository<int> {}
|
implements AuthenticationRepository<int> {}
|
||||||
|
|
||||||
class MockAuthenticationCubit extends Mock implements AuthenticationCubit<int> {
|
class MockAuthenticationCubit extends Mock
|
||||||
}
|
implements AuthenticationCubit<int> {}
|
||||||
|
|
||||||
class MockAccount extends Mock implements Account {}
|
class MockAccount extends Mock implements Account {}
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
|||||||
class MockAuthenticationRepository extends Mock
|
class MockAuthenticationRepository extends Mock
|
||||||
implements AuthenticationRepository<int> {}
|
implements AuthenticationRepository<int> {}
|
||||||
|
|
||||||
class MockAuthenticationCubit extends Mock implements AuthenticationCubit<int> {
|
class MockAuthenticationCubit extends Mock
|
||||||
}
|
implements AuthenticationCubit<int> {}
|
||||||
|
|
||||||
class MockAccount extends Mock implements Account {}
|
class MockAccount extends Mock implements Account {}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
@@ -25,7 +25,6 @@ class CounterBloc extends Bloc<CounterEvent, CounterState> {
|
|||||||
final CounterRepository counterRepository;
|
final CounterRepository counterRepository;
|
||||||
|
|
||||||
CounterBloc(this.counterRepository) : super(const CounterInitial()) {
|
CounterBloc(this.counterRepository) : super(const CounterInitial()) {
|
||||||
|
|
||||||
on<CounterIncrement>((event, emit) {
|
on<CounterIncrement>((event, emit) {
|
||||||
emit(CounterModified(counterRepository.increment(state.count)));
|
emit(CounterModified(counterRepository.increment(state.count)));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
@@ -32,4 +32,3 @@ class CounterInitial extends CounterState {
|
|||||||
class CounterModified extends CounterState {
|
class CounterModified extends CounterState {
|
||||||
const CounterModified(super.count);
|
const CounterModified(super.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,14 +24,16 @@ class CounterBlocPage
|
|||||||
const CounterBlocPage({super.key});
|
const CounterBlocPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
CounterBloc create(BuildContext context) => CounterBloc(repo<CounterRepository>(context));
|
CounterBloc create(BuildContext context) =>
|
||||||
|
CounterBloc(repo<CounterRepository>(context));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget onBuild(BuildContext context, CounterState state) {
|
Widget onBuild(BuildContext context, CounterState state) {
|
||||||
final textTheme = Theme.of(context).textTheme;
|
final textTheme = Theme.of(context).textTheme;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: const Text('Counter with Bloc')),
|
appBar: AppBar(title: const Text('Counter with Bloc')),
|
||||||
body: Center(child: Text('${state.count}', style: textTheme.headline2)),
|
body:
|
||||||
|
Center(child: Text('${state.count}', style: textTheme.displayMedium)),
|
||||||
floatingActionButton: Column(
|
floatingActionButton: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ class CounterConsumerPage
|
|||||||
final textTheme = Theme.of(context).textTheme;
|
final textTheme = Theme.of(context).textTheme;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: const Text('Counter with Consumer')),
|
appBar: AppBar(title: const Text('Counter with Consumer')),
|
||||||
body: Center(child: Text('${state.count}', style: textTheme.headline2)),
|
body:
|
||||||
|
Center(child: Text('${state.count}', style: textTheme.displayMedium)),
|
||||||
floatingActionButton: Column(
|
floatingActionButton: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
@@ -19,19 +19,20 @@ import 'package:bloc_helper_example/counter/repository/counter_repository.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart';
|
import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart';
|
||||||
|
|
||||||
class CounterCubitPage
|
class CounterCubitPage extends CubitScreen<CounterCubit, CounterState> {
|
||||||
extends CubitScreen<CounterCubit, CounterState> {
|
|
||||||
const CounterCubitPage({super.key});
|
const CounterCubitPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
CounterCubit create(BuildContext context) => CounterCubit(repo<CounterRepository>(context));
|
CounterCubit create(BuildContext context) =>
|
||||||
|
CounterCubit(repo<CounterRepository>(context));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget onBuild(BuildContext context, CounterState state) {
|
Widget onBuild(BuildContext context, CounterState state) {
|
||||||
final textTheme = Theme.of(context).textTheme;
|
final textTheme = Theme.of(context).textTheme;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: const Text('Counter with Cubit')),
|
appBar: AppBar(title: const Text('Counter with Cubit')),
|
||||||
body: Center(child: Text('${state.count}', style: textTheme.headline2)),
|
body:
|
||||||
|
Center(child: Text('${state.count}', style: textTheme.displayMedium)),
|
||||||
floatingActionButton: Column(
|
floatingActionButton: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
@@ -53,4 +54,4 @@ class CounterCubitPage
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class CounterProviderPage
|
|||||||
appBar: AppBar(title: const Text('Counter with Provider')),
|
appBar: AppBar(title: const Text('Counter with Provider')),
|
||||||
body: Center(child: BlocBuilder<CounterBloc, CounterState>(
|
body: Center(child: BlocBuilder<CounterBloc, CounterState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
return Text('${state.count}', style: textTheme.headline2);
|
return Text('${state.count}', style: textTheme.displayMedium);
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
floatingActionButton: Column(
|
floatingActionButton: Column(
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
@@ -32,4 +32,3 @@ class CounterInitial extends CounterState {
|
|||||||
class CounterModified extends CounterState {
|
class CounterModified extends CounterState {
|
||||||
const CounterModified(super.count);
|
const CounterModified(super.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
// Copyright (C) 2022 WYATT GROUP
|
// Copyright (C) 2022 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
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// any later version.
|
// any later version.
|
||||||
//
|
//
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ class CounterObserver extends BlocObserver {
|
|||||||
super.onChange(bloc, change);
|
super.onChange(bloc, change);
|
||||||
debugPrint('${bloc.runtimeType} $change');
|
debugPrint('${bloc.runtimeType} $change');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
BlocOverrides.runZoned(() => runApp(const CounterRepositoryProviderPage()),
|
Bloc.observer = CounterObserver();
|
||||||
blocObserver: CounterObserver());
|
runApp(const CounterRepositoryProviderPage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ class MainPage extends StatelessWidget {
|
|||||||
onPressed: () => Navigator.of(context)
|
onPressed: () => Navigator.of(context)
|
||||||
.push(MaterialPageRoute(builder: (context) {
|
.push(MaterialPageRoute(builder: (context) {
|
||||||
return BlocProvider<CounterCubit>(
|
return BlocProvider<CounterCubit>(
|
||||||
create: (context) => CounterCubit(context.read<CounterRepository>()),
|
create: (context) =>
|
||||||
|
CounterCubit(context.read<CounterRepository>()),
|
||||||
child: const CounterConsumerPage(),
|
child: const CounterConsumerPage(),
|
||||||
);
|
);
|
||||||
})),
|
})),
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ mixin BlocBaseProviderMixin<Bloc extends BlocBase<Object>> {
|
|||||||
|
|
||||||
/// Returns another [BlocBase] **not** used by this [BlocBaseProviderMixin].
|
/// Returns another [BlocBase] **not** used by this [BlocBaseProviderMixin].
|
||||||
/// Short hand for `context.read<AnotherBloc>();`
|
/// Short hand for `context.read<AnotherBloc>();`
|
||||||
///
|
///
|
||||||
/// To get [BlocBase] used by by this [BlocBaseProviderMixin] see `bloc()`
|
/// To get [BlocBase] used by by this [BlocBaseProviderMixin] see `bloc()`
|
||||||
AnotherBloc anotherBloc<AnotherBloc>(BuildContext context) =>
|
AnotherBloc anotherBloc<AnotherBloc>(BuildContext context) =>
|
||||||
context.read<AnotherBloc>();
|
context.read<AnotherBloc>();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import 'package:flutter_bloc/flutter_bloc.dart' as blocbase;
|
|||||||
/// of helper methods for events.
|
/// of helper methods for events.
|
||||||
mixin BlocProviderMixin<Bloc extends blocbase.Bloc<Event, Object>, Event> {
|
mixin BlocProviderMixin<Bloc extends blocbase.Bloc<Event, Object>, Event> {
|
||||||
/// Add an event to the [Bloc].
|
/// Add an event to the [Bloc].
|
||||||
///
|
///
|
||||||
/// Short hand for `context.read<Bloc>().add(event)`.
|
/// Short hand for `context.read<Bloc>().add(event)`.
|
||||||
void add(BuildContext context, Event event) =>
|
void add(BuildContext context, Event event) =>
|
||||||
context.read<Bloc>().add(event);
|
context.read<Bloc>().add(event);
|
||||||
|
|||||||
@@ -18,14 +18,14 @@ import 'package:flutter/widgets.dart';
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
/// {@template multi_provider}
|
/// {@template multi_provider}
|
||||||
/// Merges [MultiRepositoryProvider] and [MultiBlocProvider] widgets into
|
/// Merges [MultiRepositoryProvider] and [MultiBlocProvider] widgets into
|
||||||
/// one widget tree.
|
/// one widget tree.
|
||||||
///
|
///
|
||||||
/// [MultiProvider] improves the readability and eliminates the need
|
/// [MultiProvider] improves the readability and eliminates the need
|
||||||
/// to nest multiple providers.
|
/// to nest multiple providers.
|
||||||
///
|
///
|
||||||
/// By using [MultiProvider] we can go from:
|
/// By using [MultiProvider] we can go from:
|
||||||
///
|
///
|
||||||
/// ```dart
|
/// ```dart
|
||||||
/// MultiRepositoryProvider(
|
/// MultiRepositoryProvider(
|
||||||
/// providers: [
|
/// providers: [
|
||||||
@@ -69,7 +69,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
/// )
|
/// )
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// [MultiProvider] converts the [RepositoryProvider] and [BlocProvider] lists
|
/// [MultiProvider] converts the [RepositoryProvider] and [BlocProvider] lists
|
||||||
/// into a tree of nested provider widgets.
|
/// into a tree of nested provider widgets.
|
||||||
/// As a result, the only advantage of using [MultiProvider] is
|
/// As a result, the only advantage of using [MultiProvider] is
|
||||||
/// improved readability due to the reduction in nesting and boilerplate.
|
/// improved readability due to the reduction in nesting and boilerplate.
|
||||||
|
|||||||
@@ -22,4 +22,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.3.0
|
version: ^2.4.1
|
||||||
@@ -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,6 +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.yaml
|
||||||
include: package:wyatt_analysis/analysis_options.flutter.experimental.yaml
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,31 +7,33 @@ class ExampleCubit extends Cubit<CrudState> {
|
|||||||
|
|
||||||
FutureOr<void> run() async {
|
FutureOr<void> run() async {
|
||||||
while (true) {
|
while (true) {
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
await Future<void>.delayed(const Duration(seconds: 1));
|
||||||
emit(CrudLoading());
|
emit(CrudLoading());
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
await Future<void>.delayed(const Duration(seconds: 1));
|
||||||
emit(CrudError('Cubit Error'));
|
emit(const CrudError('Cubit Error'));
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
await Future<void>.delayed(const Duration(seconds: 1));
|
||||||
emit(CrudLoaded<String>('DATA LOADED'));
|
emit(const CrudLoaded<String>('DATA LOADED'));
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
await Future<void>.delayed(const Duration(seconds: 1));
|
||||||
emit(CrudInitial());
|
emit(CrudInitial());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FutureOr<void> runList() async {
|
FutureOr<void> runList() async {
|
||||||
while (true) {
|
while (true) {
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
await Future<void>.delayed(const Duration(seconds: 1));
|
||||||
emit(CrudLoading());
|
emit(CrudLoading());
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
await Future<void>.delayed(const Duration(seconds: 1));
|
||||||
emit(CrudError('Cubit Error'));
|
emit(const CrudError('Cubit Error'));
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
await Future<void>.delayed(const Duration(seconds: 1));
|
||||||
emit(CrudListLoaded<String>([
|
emit(
|
||||||
'DATA LOADED 1',
|
const CrudListLoaded<String>([
|
||||||
'DATA LOADED 2',
|
'DATA LOADED 1',
|
||||||
'DATA LOADED 3',
|
'DATA LOADED 2',
|
||||||
'DATA LOADED 4'
|
'DATA LOADED 3',
|
||||||
]));
|
'DATA LOADED 4'
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
]),
|
||||||
|
);
|
||||||
|
await Future<void>.delayed(const Duration(seconds: 1));
|
||||||
emit(CrudInitial());
|
emit(CrudInitial());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
|
||||||
|
part 'custom_app_bar.g.dart';
|
||||||
|
|
||||||
|
@ComponentCopyWithExtension()
|
||||||
|
class CustomAppBar extends TopAppBarComponent with $CustomAppBarCWMixin {
|
||||||
|
const CustomAppBar({super.key, super.title});
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => AppBar(
|
||||||
|
title: Text(title?.data ?? 'Title'),
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'custom_app_bar.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentCopyWithGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class $CustomAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
|
||||||
|
const $CustomAppBarCWProxyImpl(this._value);
|
||||||
|
final CustomAppBar _value;
|
||||||
|
@override
|
||||||
|
CustomAppBar title(TextWrapper? title) => this(title: title);
|
||||||
|
@override
|
||||||
|
CustomAppBar centerTitle(bool? centerTitle) => this(centerTitle: centerTitle);
|
||||||
|
@override
|
||||||
|
CustomAppBar shape(ShapeBorder? shape) => this(shape: shape);
|
||||||
|
@override
|
||||||
|
CustomAppBar systemOverlayStyle(SystemUiOverlayStyle? systemOverlayStyle) =>
|
||||||
|
this(systemOverlayStyle: systemOverlayStyle);
|
||||||
|
@override
|
||||||
|
CustomAppBar automaticallyImplyLeading(bool? automaticallyImplyLeading) =>
|
||||||
|
this(automaticallyImplyLeading: automaticallyImplyLeading);
|
||||||
|
@override
|
||||||
|
CustomAppBar flexibleSpace(Widget? flexibleSpace) =>
|
||||||
|
this(flexibleSpace: flexibleSpace);
|
||||||
|
@override
|
||||||
|
CustomAppBar bottom(PreferredSizeWidget? bottom) => this(bottom: bottom);
|
||||||
|
@override
|
||||||
|
CustomAppBar elevation(double? elevation) => this(elevation: elevation);
|
||||||
|
@override
|
||||||
|
CustomAppBar scrolledUnderElevation(double? scrolledUnderElevation) =>
|
||||||
|
this(scrolledUnderElevation: scrolledUnderElevation);
|
||||||
|
@override
|
||||||
|
CustomAppBar shadowColor(Color? shadowColor) =>
|
||||||
|
this(shadowColor: shadowColor);
|
||||||
|
@override
|
||||||
|
CustomAppBar surfaceTintColor(Color? surfaceTintColor) =>
|
||||||
|
this(surfaceTintColor: surfaceTintColor);
|
||||||
|
@override
|
||||||
|
CustomAppBar backgroundColor(MultiColor? backgroundColor) =>
|
||||||
|
this(backgroundColor: backgroundColor);
|
||||||
|
@override
|
||||||
|
CustomAppBar iconTheme(IconThemeData? iconTheme) =>
|
||||||
|
this(iconTheme: iconTheme);
|
||||||
|
@override
|
||||||
|
CustomAppBar primary(bool? primary) => this(primary: primary);
|
||||||
|
@override
|
||||||
|
CustomAppBar excludeHeaderSemantics(bool? excludeHeaderSemantics) =>
|
||||||
|
this(excludeHeaderSemantics: excludeHeaderSemantics);
|
||||||
|
@override
|
||||||
|
CustomAppBar toolbarHeight(double? toolbarHeight) =>
|
||||||
|
this(toolbarHeight: toolbarHeight);
|
||||||
|
@override
|
||||||
|
CustomAppBar leadingWidth(double? leadingWidth) =>
|
||||||
|
this(leadingWidth: leadingWidth);
|
||||||
|
@override
|
||||||
|
CustomAppBar leading(Widget? leading) => this(leading: leading);
|
||||||
|
@override
|
||||||
|
CustomAppBar actions(List<Widget>? actions) => this(actions: actions);
|
||||||
|
@override
|
||||||
|
CustomAppBar expandedWidget(List<Widget>? expandedWidget) =>
|
||||||
|
this(expandedWidget: expandedWidget);
|
||||||
|
@override
|
||||||
|
CustomAppBar key(Key? key) => this(key: key);
|
||||||
|
@override
|
||||||
|
CustomAppBar call({
|
||||||
|
TextWrapper? title,
|
||||||
|
bool? centerTitle,
|
||||||
|
ShapeBorder? shape,
|
||||||
|
SystemUiOverlayStyle? systemOverlayStyle,
|
||||||
|
bool? automaticallyImplyLeading,
|
||||||
|
Widget? flexibleSpace,
|
||||||
|
PreferredSizeWidget? bottom,
|
||||||
|
double? elevation,
|
||||||
|
double? scrolledUnderElevation,
|
||||||
|
Color? shadowColor,
|
||||||
|
Color? surfaceTintColor,
|
||||||
|
MultiColor? backgroundColor,
|
||||||
|
IconThemeData? iconTheme,
|
||||||
|
bool? primary,
|
||||||
|
bool? excludeHeaderSemantics,
|
||||||
|
double? toolbarHeight,
|
||||||
|
double? leadingWidth,
|
||||||
|
Widget? leading,
|
||||||
|
List<Widget>? actions,
|
||||||
|
List<Widget>? expandedWidget,
|
||||||
|
Key? key,
|
||||||
|
}) =>
|
||||||
|
CustomAppBar(
|
||||||
|
title: title ?? _value.title,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin $CustomAppBarCWMixin on Component {
|
||||||
|
$TopAppBarComponentCWProxy get copyWith =>
|
||||||
|
$CustomAppBarCWProxyImpl(this as CustomAppBar);
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
|
||||||
|
part 'custom_bottom_bar.g.dart';
|
||||||
|
|
||||||
|
@ComponentCopyWithExtension()
|
||||||
|
class CustomBottomBar extends BottomNavigationBarComponent
|
||||||
|
with $CustomBottomBarCWMixin {
|
||||||
|
const CustomBottomBar({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => BottomNavigationBar(
|
||||||
|
items: const [
|
||||||
|
BottomNavigationBarItem(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.e_mobiledata,
|
||||||
|
),
|
||||||
|
label: 'Icon 1',
|
||||||
|
),
|
||||||
|
BottomNavigationBarItem(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.do_not_disturb_off,
|
||||||
|
),
|
||||||
|
label: 'Icon 2',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
backgroundColor: Colors.blue,
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'custom_bottom_bar.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentCopyWithGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class $CustomBottomBarCWProxyImpl
|
||||||
|
implements $BottomNavigationBarComponentCWProxy {
|
||||||
|
const $CustomBottomBarCWProxyImpl(this._value);
|
||||||
|
final CustomBottomBar _value;
|
||||||
|
@override
|
||||||
|
CustomBottomBar onTap(void Function(BuildContext, int)? onTap) =>
|
||||||
|
this(onTap: onTap);
|
||||||
|
@override
|
||||||
|
CustomBottomBar currentIndex(int? currentIndex) =>
|
||||||
|
this(currentIndex: currentIndex);
|
||||||
|
@override
|
||||||
|
CustomBottomBar key(Key? key) => this(key: key);
|
||||||
|
@override
|
||||||
|
CustomBottomBar call({
|
||||||
|
void Function(BuildContext, int)? onTap,
|
||||||
|
int? currentIndex,
|
||||||
|
Key? key,
|
||||||
|
}) =>
|
||||||
|
CustomBottomBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin $CustomBottomBarCWMixin on Component {
|
||||||
|
$BottomNavigationBarComponentCWProxy get copyWith =>
|
||||||
|
$CustomBottomBarCWProxyImpl(this as CustomBottomBar);
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
|
||||||
|
part 'custom_error_widget.g.dart';
|
||||||
|
|
||||||
|
@ComponentCopyWithExtension()
|
||||||
|
class CustomErrorWidget extends ErrorWidgetComponent
|
||||||
|
with $CustomErrorWidgetCWMixin {
|
||||||
|
CustomErrorWidget({super.key, super.error});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => ColoredBox(
|
||||||
|
color: Colors.red,
|
||||||
|
child: Center(child: Text(error?.data ?? 'Error')),
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'custom_error_widget.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentCopyWithGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class $CustomErrorWidgetCWProxyImpl implements $ErrorWidgetComponentCWProxy {
|
||||||
|
const $CustomErrorWidgetCWProxyImpl(this._value);
|
||||||
|
final CustomErrorWidget _value;
|
||||||
|
@override
|
||||||
|
CustomErrorWidget error(TextWrapper? error) => this(error: error);
|
||||||
|
@override
|
||||||
|
CustomErrorWidget key(Key? key) => this(key: key);
|
||||||
|
@override
|
||||||
|
CustomErrorWidget call({
|
||||||
|
TextWrapper? error,
|
||||||
|
Key? key,
|
||||||
|
}) =>
|
||||||
|
CustomErrorWidget(
|
||||||
|
error: error ?? _value.error,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin $CustomErrorWidgetCWMixin on Component {
|
||||||
|
$ErrorWidgetComponentCWProxy get copyWith =>
|
||||||
|
$CustomErrorWidgetCWProxyImpl(this as CustomErrorWidget);
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
|
||||||
|
part 'custom_loading_widget.g.dart';
|
||||||
|
|
||||||
|
@ComponentCopyWithExtension()
|
||||||
|
class CustomLoadingWidget extends LoadingWidgetComponent
|
||||||
|
with $CustomLoadingWidgetCWMixin {
|
||||||
|
CustomLoadingWidget({super.key, super.color});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) =>
|
||||||
|
Center(child: CircularProgressIndicator(color: color));
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'custom_loading_widget.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentCopyWithGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class $CustomLoadingWidgetCWProxyImpl
|
||||||
|
implements $LoadingWidgetComponentCWProxy {
|
||||||
|
const $CustomLoadingWidgetCWProxyImpl(this._value);
|
||||||
|
final CustomLoadingWidget _value;
|
||||||
|
@override
|
||||||
|
CustomLoadingWidget color(Color? color) => this(color: color);
|
||||||
|
@override
|
||||||
|
CustomLoadingWidget key(Key? key) => this(key: key);
|
||||||
|
@override
|
||||||
|
CustomLoadingWidget call({
|
||||||
|
Color? color,
|
||||||
|
Key? key,
|
||||||
|
}) =>
|
||||||
|
CustomLoadingWidget(
|
||||||
|
color: color ?? _value.color,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
mixin $CustomLoadingWidgetCWMixin on Component {
|
||||||
|
$LoadingWidgetComponentCWProxy get copyWith =>
|
||||||
|
$CustomLoadingWidgetCWProxyImpl(this as CustomLoadingWidget);
|
||||||
|
}
|
||||||
@@ -1,79 +1,14 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:bloc_layout_example/components/custom_app_bar.dart';
|
||||||
|
import 'package:bloc_layout_example/components/custom_bottom_bar.dart';
|
||||||
|
import 'package:bloc_layout_example/components/custom_error_widget.dart';
|
||||||
|
import 'package:bloc_layout_example/components/custom_loading_widget.dart';
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
class AppThemeComponent {
|
class AppThemeComponent {
|
||||||
static ComponentThemeData get components => ComponentThemeData.raw(
|
static ComponentThemeData get components => ComponentThemeData.raw(
|
||||||
appBar: CustomAppBar(),
|
appBar: const CustomAppBar(),
|
||||||
bottomNavigationBar: CustomBottomBar(),
|
bottomNavigationBar: const CustomBottomBar(),
|
||||||
loadingWidget: CustomLoadingWidget(),
|
loadingWidget: CustomLoadingWidget(),
|
||||||
errorWidget: CustomErrorWidget(),
|
errorWidget: CustomErrorWidget(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CustomAppBar extends AppBarComponent {
|
|
||||||
const CustomAppBar({super.title});
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) => AppBar(
|
|
||||||
title: Text(title ?? 'Title'),
|
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
|
||||||
AppBarComponent? configure(
|
|
||||||
{String? title, Widget? leading, List<Widget>? actions}) =>
|
|
||||||
CustomAppBar(
|
|
||||||
title: title ?? this.title,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomBottomBar extends BottomNavigationBarComponent {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) => BottomNavigationBar(
|
|
||||||
items: [
|
|
||||||
BottomNavigationBarItem(
|
|
||||||
icon: Icon(
|
|
||||||
Icons.e_mobiledata,
|
|
||||||
),
|
|
||||||
label: 'Icon 1'),
|
|
||||||
BottomNavigationBarItem(
|
|
||||||
icon: Icon(
|
|
||||||
Icons.do_not_disturb_off,
|
|
||||||
),
|
|
||||||
label: 'Icon 2'),
|
|
||||||
],
|
|
||||||
backgroundColor: Colors.blue,
|
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
|
||||||
BottomNavigationBarComponent? configure(
|
|
||||||
{void Function(BuildContext p1, int p2)? onTap,
|
|
||||||
int currentIndex = 0}) =>
|
|
||||||
this;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomLoadingWidget extends LoadingWidgetComponent {
|
|
||||||
CustomLoadingWidget({super.color});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) =>
|
|
||||||
Center(child: CircularProgressIndicator(color: color));
|
|
||||||
|
|
||||||
@override
|
|
||||||
LoadingWidgetComponent? configure({Color? color}) => CustomLoadingWidget(
|
|
||||||
color: color ?? this.color,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomErrorWidget extends ErrorWidgetComponent {
|
|
||||||
CustomErrorWidget({super.error});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) => ColoredBox(
|
|
||||||
color: Colors.red,
|
|
||||||
child: Center(child: Text(error ?? 'Error')),
|
|
||||||
);
|
|
||||||
|
|
||||||
@override
|
|
||||||
ErrorWidgetComponent? configure({String? error}) => CustomErrorWidget(
|
|
||||||
error: error ?? this.error,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -28,61 +28,63 @@ class MyApp extends StatelessWidget {
|
|||||||
|
|
||||||
// This widget is the root of your application.
|
// This widget is the root of your application.
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) => ComponentTheme(
|
||||||
return ComponentTheme(
|
componentThemeWidget: AppThemeComponent.components,
|
||||||
componentThemeWidget: AppThemeComponent.components,
|
child: MaterialApp(
|
||||||
child: MaterialApp(
|
title: 'Bloc Layout Example',
|
||||||
title: 'Bloc Layout Example',
|
theme: ThemeData(
|
||||||
theme: ThemeData(
|
primarySwatch: Colors.blue,
|
||||||
primarySwatch: Colors.blue,
|
),
|
||||||
),
|
home: Scaffold(
|
||||||
home: Scaffold(
|
body: Column(
|
||||||
body: Column(
|
children: [
|
||||||
children: [
|
Expanded(
|
||||||
Expanded(
|
child: Row(
|
||||||
child: Row(
|
children: [
|
||||||
children: [
|
Expanded(
|
||||||
Expanded(
|
child: BlocProvider(
|
||||||
child: BlocProvider(
|
|
||||||
create: (_) => ExampleCubit()..run(),
|
|
||||||
child: ExampleCrudStateManagement(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: BlocProvider(
|
|
||||||
create: (_) => ExampleCubit()..runList(),
|
|
||||||
child: ExampleListCrudStateManagement(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: BlocProvider(
|
|
||||||
create: (_) => ExampleCubit()..run(),
|
create: (_) => ExampleCubit()..run(),
|
||||||
child: ExampleFrameLayoutCrudConsumer()),
|
child: const ExampleCrudStateManagement(),
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
child: BlocProvider(
|
Expanded(
|
||||||
|
child: BlocProvider(
|
||||||
create: (_) => ExampleCubit()..runList(),
|
create: (_) => ExampleCubit()..runList(),
|
||||||
child: ExampleFrameLayoutCrudListConsumer()),
|
child: const ExampleListCrudStateManagement(),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
],
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: BlocProvider(
|
||||||
|
create: (_) => ExampleCubit()..run(),
|
||||||
|
child: const ExampleFrameLayoutCrudConsumer(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: BlocProvider(
|
||||||
|
create: (_) => ExampleCubit()..runList(),
|
||||||
|
child: const ExampleFrameLayoutCrudListConsumer(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExampleCrudStateManagement
|
class ExampleCrudStateManagement
|
||||||
extends CrudCubitConsumerScreen<ExampleCubit, String> {
|
extends CrudCubitConsumerScreen<ExampleCubit, String> {
|
||||||
|
const ExampleCrudStateManagement({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget initialBuilder(BuildContext context, CrudInitial state) =>
|
Widget initialBuilder(BuildContext context, CrudInitial state) =>
|
||||||
Container(color: Colors.yellow);
|
Container(color: Colors.yellow);
|
||||||
@@ -93,6 +95,8 @@ class ExampleCrudStateManagement
|
|||||||
|
|
||||||
class ExampleListCrudStateManagement
|
class ExampleListCrudStateManagement
|
||||||
extends CrudListCubitConsumerScreen<ExampleCubit, String> {
|
extends CrudListCubitConsumerScreen<ExampleCubit, String> {
|
||||||
|
const ExampleListCrudStateManagement({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget initialBuilder(BuildContext context, CrudInitial state) =>
|
Widget initialBuilder(BuildContext context, CrudInitial state) =>
|
||||||
Container(color: Colors.green);
|
Container(color: Colors.green);
|
||||||
@@ -105,8 +109,8 @@ class ExampleListCrudStateManagement
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ExampleFrameLayoutCrudConsumer
|
class ExampleFrameLayoutCrudConsumer
|
||||||
extends FrameLayoutCrudConsumerScreen<ExampleCubit, String> {
|
extends FrameLayoutCrudCubitConsumerScreen<ExampleCubit, String> {
|
||||||
const ExampleFrameLayoutCrudConsumer()
|
const ExampleFrameLayoutCrudConsumer({super.key})
|
||||||
: super(
|
: super(
|
||||||
title: 'Example Title',
|
title: 'Example Title',
|
||||||
currentIndex: 0,
|
currentIndex: 0,
|
||||||
@@ -118,8 +122,8 @@ class ExampleFrameLayoutCrudConsumer
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ExampleFrameLayoutCrudListConsumer
|
class ExampleFrameLayoutCrudListConsumer
|
||||||
extends FrameLayoutCrudListConsumerScreen<ExampleCubit, String> {
|
extends FrameLayoutCrudListCubitConsumerScreen<ExampleCubit, String> {
|
||||||
const ExampleFrameLayoutCrudListConsumer()
|
const ExampleFrameLayoutCrudListConsumer({super.key})
|
||||||
: super(
|
: super(
|
||||||
title: 'Example Title',
|
title: 'Example Title',
|
||||||
currentIndex: 0,
|
currentIndex: 0,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ description: A new Flutter project.
|
|||||||
|
|
||||||
# The following line prevents the package from being accidentally published to
|
# The following line prevents the package from being accidentally published to
|
||||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
# The following defines the version and build number for your application.
|
# The following defines the version and build number for your application.
|
||||||
# A version number is three numbers separated by dots, like 1.2.43
|
# A version number is three numbers separated by dots, like 1.2.43
|
||||||
@@ -27,33 +27,38 @@ environment:
|
|||||||
# the latest version available on pub.dev. To see which dependencies have newer
|
# the latest version available on pub.dev. To see which dependencies have newer
|
||||||
# versions available, run `flutter pub outdated`.
|
# versions available, run `flutter pub outdated`.
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
|
||||||
wyatt_bloc_layout:
|
wyatt_bloc_layout:
|
||||||
path: "../"
|
path: "../"
|
||||||
|
|
||||||
|
wyatt_component_copy_with_extension:
|
||||||
|
git:
|
||||||
|
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
||||||
|
path: packages/wyatt_component_copy_with_extension
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
|
build_runner: ^2.3.3
|
||||||
|
wyatt_component_copy_with_gen:
|
||||||
|
git:
|
||||||
|
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
||||||
|
path: packages/wyatt_component_copy_with_gen
|
||||||
|
|
||||||
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.3.0
|
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
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
|
|
||||||
# The following section is specific to Flutter.
|
# The following section is specific to Flutter.
|
||||||
flutter:
|
flutter:
|
||||||
|
|
||||||
# The following line ensures that the Material Icons font is
|
# The following line ensures that the Material Icons font is
|
||||||
# included with your application, so that you can use the icons in
|
# included with your application, so that you can use the icons in
|
||||||
# the material Icons class.
|
# the material Icons class.
|
||||||
|
|||||||
@@ -12,4 +12,4 @@
|
|||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|||||||
+3
-1
@@ -12,4 +12,6 @@
|
|||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// 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/>.
|
||||||
|
|
||||||
|
export './crud_cubit_consumer_screen_mixin.dart';
|
||||||
+7
-17
@@ -16,13 +16,14 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
|
||||||
|
|
||||||
abstract class CrudCubitScreenBase<Cubit extends bloc_base.Cubit<CrudState>,
|
import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
|
||||||
SuccessState extends CrudSuccess> extends CubitScreen<Cubit, CrudState> {
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
const CrudCubitScreenBase();
|
|
||||||
|
mixin CrudMixin<Cubit extends bloc_base.Cubit<dynamic>,
|
||||||
|
SuccessState extends CrudSuccess> {
|
||||||
Widget errorBuilder(BuildContext context, CrudError state) =>
|
Widget errorBuilder(BuildContext context, CrudError state) =>
|
||||||
context.components.errorWidget?.configure(error: state.message) ??
|
context.components.errorWidget?.copyWith(error: state.message.wrap()) ??
|
||||||
const SizedBox.shrink();
|
const SizedBox.shrink();
|
||||||
|
|
||||||
Widget loadingBuilder(BuildContext context, CrudLoading state) =>
|
Widget loadingBuilder(BuildContext context, CrudLoading state) =>
|
||||||
@@ -33,8 +34,7 @@ abstract class CrudCubitScreenBase<Cubit extends bloc_base.Cubit<CrudState>,
|
|||||||
|
|
||||||
Widget successBuilder(BuildContext context, SuccessState state);
|
Widget successBuilder(BuildContext context, SuccessState state);
|
||||||
|
|
||||||
@override
|
Widget crudBuilder(BuildContext context, CrudState state) =>
|
||||||
Widget onBuild(BuildContext context, CrudState state) =>
|
|
||||||
CrudBuilder<CrudInitial, CrudLoading, SuccessState, CrudError>(
|
CrudBuilder<CrudInitial, CrudLoading, SuccessState, CrudError>(
|
||||||
errorBuilder: errorBuilder,
|
errorBuilder: errorBuilder,
|
||||||
loadingBuilder: loadingBuilder,
|
loadingBuilder: loadingBuilder,
|
||||||
@@ -43,13 +43,3 @@ abstract class CrudCubitScreenBase<Cubit extends bloc_base.Cubit<CrudState>,
|
|||||||
builder: successBuilder,
|
builder: successBuilder,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class CrudCubitScreen<Cubit extends bloc_base.Cubit<CrudState>, T>
|
|
||||||
extends CrudCubitScreenBase<Cubit, CrudLoaded<T>> {
|
|
||||||
const CrudCubitScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class CrudListCubitScreen<Cubit extends bloc_base.Cubit<CrudState>, T>
|
|
||||||
extends CrudCubitScreenBase<Cubit, CrudListLoaded<T>> {
|
|
||||||
const CrudListCubitScreen();
|
|
||||||
}
|
|
||||||
+13
-24
@@ -16,37 +16,26 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class AppBarLayoutCrudScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
abstract class AppBarLayoutCubitConsumerScreen<
|
||||||
T> extends CrudCubitScreen<Cubit, T> {
|
Cubit extends bloc_base.Cubit<State>,
|
||||||
final String? title;
|
State extends Object> extends CubitConsumerScreen<Cubit, State> {
|
||||||
|
const AppBarLayoutCubitConsumerScreen({
|
||||||
const AppBarLayoutCrudScreen({
|
|
||||||
this.title,
|
this.title,
|
||||||
|
this.leading,
|
||||||
|
this.actions,
|
||||||
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final String? title;
|
||||||
|
final Widget? leading;
|
||||||
|
final List<Widget>? actions;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
||||||
title: title ?? 'Title',
|
title: title,
|
||||||
body: child,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class AppBarLayoutCrudListScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T> extends CrudListCubitScreen<Cubit, T> {
|
|
||||||
final String? title;
|
|
||||||
final int? currentIndex;
|
|
||||||
|
|
||||||
const AppBarLayoutCrudListScreen({
|
|
||||||
this.title,
|
|
||||||
this.currentIndex,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget parent(BuildContext context, Widget child) => AppBarLayout(
|
|
||||||
title: title ?? 'Title',
|
|
||||||
body: child,
|
body: child,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -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/>.
|
||||||
|
|
||||||
|
export './app_bar_layout_cubit_consumer_screen.dart';
|
||||||
|
export './bottom_bar_layout_cubit_consumer_screen.dart';
|
||||||
|
export './frame_layout_cubit_consumer_screen.dart';
|
||||||
+9
-26
@@ -16,40 +16,23 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class BottomNavigationBarLayoutCrudScreen<
|
abstract class BottomBarLayoutCubitConsumerScreen<
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
Cubit extends bloc_base.Cubit<State>,
|
||||||
T> extends CrudCubitScreen<Cubit, T> {
|
State extends Object> extends CubitConsumerScreen<Cubit, State> {
|
||||||
final int? currentIndex;
|
const BottomBarLayoutCubitConsumerScreen({
|
||||||
|
|
||||||
const BottomNavigationBarLayoutCrudScreen({
|
|
||||||
this.currentIndex,
|
this.currentIndex,
|
||||||
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final int? currentIndex;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) =>
|
Widget parent(BuildContext context, Widget child) =>
|
||||||
BottomNavigationBarLayout(
|
BottomNavigationBarLayout(
|
||||||
|
currentIndex: currentIndex,
|
||||||
body: child,
|
body: child,
|
||||||
currentIndex: currentIndex ?? 0,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class BottomNavigationBarLayoutCrudListScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T> extends CrudListCubitScreen<Cubit, T> {
|
|
||||||
final String? title;
|
|
||||||
final int? currentIndex;
|
|
||||||
|
|
||||||
const BottomNavigationBarLayoutCrudListScreen({
|
|
||||||
this.title,
|
|
||||||
this.currentIndex,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget parent(BuildContext context, Widget child) =>
|
|
||||||
BottomNavigationBarLayout(
|
|
||||||
body: child,
|
|
||||||
currentIndex: currentIndex ?? 0,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+16
-28
@@ -14,43 +14,31 @@
|
|||||||
// 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:flutter/src/widgets/framework.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
|
||||||
|
|
||||||
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
|
||||||
|
|
||||||
abstract class FrameLayoutCrudScreen<Cubit extends bloc_base.Cubit<CrudState>,
|
abstract class FrameLayoutCubitConsumerScreen<
|
||||||
T> extends CrudCubitScreen<Cubit, T> {
|
Cubit extends bloc_base.Cubit<State>,
|
||||||
final String? title;
|
State extends Object> extends CubitConsumerScreen<Cubit, State> {
|
||||||
final int? currentIndex;
|
const FrameLayoutCubitConsumerScreen({
|
||||||
|
|
||||||
const FrameLayoutCrudScreen({
|
|
||||||
this.title,
|
this.title,
|
||||||
|
this.leading,
|
||||||
|
this.actions,
|
||||||
this.currentIndex,
|
this.currentIndex,
|
||||||
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final int? currentIndex;
|
||||||
|
final String? title;
|
||||||
|
final Widget? leading;
|
||||||
|
final List<Widget>? actions;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
||||||
title: title ?? 'Title',
|
title: title,
|
||||||
|
currentIndex: currentIndex,
|
||||||
body: child,
|
body: child,
|
||||||
currentIndex: currentIndex ?? 0,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class FrameLayoutCrudListScreen<
|
|
||||||
Cubit extends bloc_base.Cubit<CrudState>,
|
|
||||||
T> extends CrudListCubitScreen<Cubit, T> {
|
|
||||||
final String? title;
|
|
||||||
final int? currentIndex;
|
|
||||||
|
|
||||||
const FrameLayoutCrudListScreen({
|
|
||||||
this.title,
|
|
||||||
this.currentIndex,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget parent(BuildContext context, Widget child) => FrameLayout(
|
|
||||||
title: title ?? 'Title',
|
|
||||||
body: child,
|
|
||||||
currentIndex: currentIndex ?? 0,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// 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/>.
|
||||||
|
|
||||||
|
export 'bases/bases.dart';
|
||||||
|
export 'crud/crud.dart';
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user