Compare commits

...
Author SHA1 Message Date
hugo c2f588d96e feat(deferred): (wip) add generator package 2023-02-10 14:40:31 +01:00
hugo 4441ddeb33 feat(deferred): (wip) add annotations package 2023-02-10 14:40:14 +01:00
malo a563bd1fe3 style(ui_kit): add macos platform in example
continuous-integration/drone/push Build is failing
2023-02-10 14:19:32 +01:00
malo 5464cd1d40 feat(ui_kit): implement information card (#126)
continuous-integration/drone/push Build is failing
2023-02-10 14:08:04 +01:00
malo ba1c1016e5 style(ui_kit): remove default files 2023-02-10 11:35:51 +01:00
malo 23b608ed10 feat(ui_components): add gradient attribut to text wrapper
continuous-integration/drone/push Build is failing
2023-02-10 11:25:39 +01:00
hugo 44b2b7c27d chore(ui_kit): create package template
continuous-integration/drone/push Build is failing
2023-02-09 18:10:11 +01:00
hugo 6bad9a8a05 fix(ui_layout): fix textwrapper 2023-02-09 18:09:45 +01:00
hugo 5d8f94bee8 fix(cw_gen): fix textwrapper 2023-02-09 18:09:14 +01:00
hugo 75cb341447 fix(bloc_layout): fix textwrapper 2023-02-09 18:08:49 +01:00
hugo efa7ca09dd feat(ui_component): add string extension to easely wrap text 2023-02-09 18:08:03 +01:00
malo ac432f6dc8 feat(ui_components): export cards #126
continuous-integration/drone/push Build is failing
2023-02-09 16:50:48 +00:00
malo 6c85faba82 feat(ui_components): add portfolio & skill cards #126 2023-02-09 16:50:48 +00:00
malo dd75ecfc7a feat: make text wrapper constructor constant 2023-02-09 16:50:48 +00:00
malo 0132771e17 feat(ui_components): add text wrapper instead of String/Widget for Texts 2023-02-09 16:50:48 +00:00
malo 5d5ae145aa feat(ui_components): make fields nullable and not required in quote card 2023-02-09 16:50:48 +00:00
malo 07428a5215 fix(ui_components): remove darkmode enable field in cards 2023-02-09 16:50:48 +00:00
malo c994c822b0 feat(ui_components): export components and add license header 2023-02-09 16:50:48 +00:00
malo bde54e0cf5 feat(ui_components): add information_card & quote_card (#126) 2023-02-09 16:50:48 +00:00
malo f3c3939ba1 docs: update readme
continuous-integration/drone/push Build is failing
2023-02-07 14:26:53 +00:00
hugo 9339100399 chore(release): publish packages
continuous-integration/drone/push Build is failing
- wyatt_analysis@2.4.0
2023-02-07 14:46:21 +01:00
hugo 03725c25c7 feat(analysis): add new lint rules 2023-02-07 14:44:57 +01:00
hugo 588a09e0a1 docs(analysis): add instructions to create a new version (closes #104) 2023-02-07 14:43:52 +01:00
malo bd53d11e0d refactor(bloc_layout): migrate bloc layouts using copywith component method (close #121)
continuous-integration/drone/push Build is failing
2023-02-07 11:46:50 +01:00
malo ee8f08cc32 refactor(ui_layout): update exemple (close #116)
continuous-integration/drone/push Build is failing
2023-02-07 10:49:56 +01:00
malo 413589462b refactor(ui_layout): migrate layouts using copywith component method (#116) 2023-02-07 10:49:09 +01:00
malo ff3f2008de fix(ui_components): generate new files after generator fixes (close #118)
continuous-integration/drone/push Build is failing
2023-02-07 10:25:58 +01:00
malo 0b27a62669 fix(component_copy_with_gen): update example (#118) 2023-02-07 10:24:00 +01:00
malo 6c9b6e239b fix(component_copy_with_gen): copywith method takes non nullable fields too (#118) 2023-02-07 10:22:32 +01:00
malo 576a01512b refactor(ui_components): update example (close #115)
continuous-integration/drone/push Build is failing
2023-02-07 09:44:34 +01:00
malo cd3ed0fe69 refactor(ui_components): migrate components using code generator packages (#115) 2023-02-07 09:44:03 +01:00
AN12345 46c51525e8 feat: add generators for components proxy and mixins to enable copywith methods
continuous-integration/drone/push Build is failing
2023-02-06 18:42:34 +01:00
AN12345 b025247002 feat: add class annotation for component code generators 2023-02-06 18:41:54 +01:00
AN12345 c70d4c6650 build: update mason file to add new tempalte 2023-02-06 18:40:35 +01:00
AN12345 04a87fe32a feat(bloc_layout): make package compatible with crud cubit (close #111)
continuous-integration/drone/push Build is passing
2022-12-19 19:21:38 -05:00
AN12345 f8f367baf6 (feat): rething conception and add missing layouts (close #97)
continuous-integration/drone/push Build is passing
2022-12-13 18:50:47 -05:00
AN12345 e667aa06d0 feat(ui_layout): make field nullable & add new app bar fields (#97) 2022-12-13 18:49:28 -05:00
286 changed files with 8631 additions and 639 deletions
+22
View File
@@ -3,6 +3,28 @@
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-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
+44 -50
View File
@@ -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
![Status: Experimental](https://img.shields.io/badge/Status-WIP-red?style=flat-square)
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.
![Dev Wokflow](doc/workflow.svg) ![Dev Wokflow](doc/workflow.svg)
## Status
![Status: Experimental](https://img.shields.io/badge/Status-WIP-red?style=flat-square)
This repository is maintained by Wyatt Studio but work is in progress.
+1 -1
View File
@@ -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_clean_code":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_clean_code","ref":"5009f1ef21d8531b773298c0fc08704d8f69afd1"}},"wyatt_feature_brick":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_feature_brick","ref":"5009f1ef21d8531b773298c0fc08704d8f69afd1"}},"wyatt_package_template":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_package_template","ref":"5009f1ef21d8531b773298c0fc08704d8f69afd1"}}}}
+5 -5
View File
@@ -1,13 +1,13 @@
bricks: bricks:
wyatt_clean_code: wyatt_clean_code:
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_clean_code
wyatt_feature_brick: wyatt_feature_brick:
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_feature_brick
wyatt_package: 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_package path: bricks/wyatt_package_template
+5
View File
@@ -1,3 +1,8 @@
## 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.
+18 -8
View File
@@ -1,5 +1,5 @@
<!-- <!--
* Copyright (C) 2022 WYATT GROUP * Copyright (C) 2023 WYATT GROUP
* Please see the AUTHORS file for details. * Please see the AUTHORS file for details.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
@@ -20,21 +20,21 @@
![SDK: Dart & Flutter](https://img.shields.io/badge/SDK-Dart%20%7C%20Flutter-blue?style=flat-square) ![SDK: Dart & Flutter](https://img.shields.io/badge/SDK-Dart%20%7C%20Flutter-blue?style=flat-square)
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.0.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).
## 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.0
``` ```
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 +49,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.0.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.0.yaml
``` ```
## Suppressing Lints ## Suppressing Lints
@@ -87,7 +87,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 +104,16 @@ To indicate your project is using `wyatt_analysis` → [![style: wyatt analysis]
[![style: wyatt analysis](https://img.shields.io/badge/Style-Wyatt%20Analysis-blue)](https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis) [![style: wyatt analysis](https://img.shields.io/badge/Style-Wyatt%20Analysis-blue)](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 <previous_version> <new_version>
```
> Where `<previous_version>` is 2.4.0
## 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,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
@@ -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,5 @@
# 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.0.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,5 @@
# 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.0.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.0';
+17 -1
View File
@@ -1,7 +1,23 @@
# 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.0
publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub publish_to: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
@@ -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.0
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
+1 -1
View File
@@ -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.0
@@ -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.0
+1 -1
View File
@@ -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.0
@@ -0,0 +1,14 @@
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_app_bar.g.dart';
@ComponentCopyWithExtension()
class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
const CustomAppBar({super.title});
@override
Widget build(BuildContext context) => AppBar(
title: Text(title?.text ?? 'Title'),
);
}
@@ -0,0 +1,35 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'custom_app_bar.dart';
// **************************************************************************
// ComponentCopyWithGenerator
// **************************************************************************
class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
const $CustomAppBarCWProxyImpl(this._value);
final CustomAppBar _value;
@override
CustomAppBar title(TextWrapper? title) => this(title: title);
@override
CustomAppBar leading(Widget? leading) => this(leading: leading);
@override
CustomAppBar actions(List<Widget>? actions) => this(actions: actions);
@override
CustomAppBar key(Key? key) => this(key: key);
@override
CustomAppBar call({
TextWrapper? title,
Widget? leading,
List<Widget>? actions,
Key? key,
}) =>
CustomAppBar(
title: title ?? _value.title,
);
}
mixin $CustomAppBarCWMixin on Component {
$AppBarComponentCWProxy get copyWith =>
$CustomAppBarCWProxyImpl(this as CustomAppBar);
}
@@ -0,0 +1,26 @@
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 {
@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,
);
}
@@ -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.error});
@override
Widget build(BuildContext context) => ColoredBox(
color: Colors.red,
child: Center(child: Text(error?.text ?? '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.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,4 +1,7 @@
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 {
@@ -9,71 +12,3 @@ class AppThemeComponent {
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,
);
}
@@ -105,7 +105,7 @@ class ExampleListCrudStateManagement
} }
class ExampleFrameLayoutCrudConsumer class ExampleFrameLayoutCrudConsumer
extends FrameLayoutCrudConsumerScreen<ExampleCubit, String> { extends FrameLayoutCrudCubitConsumerScreen<ExampleCubit, String> {
const ExampleFrameLayoutCrudConsumer() const ExampleFrameLayoutCrudConsumer()
: super( : super(
title: 'Example Title', title: 'Example Title',
@@ -118,7 +118,7 @@ class ExampleFrameLayoutCrudConsumer
} }
class ExampleFrameLayoutCrudListConsumer class ExampleFrameLayoutCrudListConsumer
extends FrameLayoutCrudListConsumerScreen<ExampleCubit, String> { extends FrameLayoutCrudListCubitConsumerScreen<ExampleCubit, String> {
const ExampleFrameLayoutCrudListConsumer() const ExampleFrameLayoutCrudListConsumer()
: super( : super(
title: 'Example Title', title: 'Example Title',
@@ -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: "../"
dev_dependencies: 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:
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.0
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.
@@ -13,3 +13,5 @@
// //
// 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';
@@ -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,
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();
}
@@ -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';
@@ -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,
); );
} }
@@ -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';
@@ -18,40 +18,34 @@ import 'package:flutter/src/widgets/framework.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 FrameLayoutCrudConsumerScreen< abstract class AppBarLayoutCrudCubitConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>, Cubit extends bloc_base.Cubit<CrudState>, T extends Object?>
T> extends CrudCubitConsumerScreen<Cubit, T> { extends AppBarLayoutCubitConsumerScreen<Cubit, CrudState>
final String? title; with CrudMixin<Cubit, CrudLoaded<T>> {
final int? currentIndex; const AppBarLayoutCrudCubitConsumerScreen({
super.title,
const FrameLayoutCrudConsumerScreen({ super.leading,
this.title, super.actions,
this.currentIndex, super.key,
}); });
@override @override
Widget parent(BuildContext context, Widget child) => FrameLayout( Widget onBuild(BuildContext context, CrudState state) =>
title: title ?? 'Title', crudBuilder(context, state);
body: child,
currentIndex: currentIndex ?? 0,
);
} }
abstract class FrameLayoutCrudListConsumerScreen< abstract class AppBarLayoutCrudListCubitConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>, Cubit extends bloc_base.Cubit<CrudState>, T extends Object?>
T> extends CrudListCubitConsumerScreen<Cubit, T> { extends AppBarLayoutCubitConsumerScreen<Cubit, CrudState>
final String? title; with CrudMixin<Cubit, CrudListLoaded<T>> {
final int? currentIndex; const AppBarLayoutCrudListCubitConsumerScreen({
super.title,
const FrameLayoutCrudListConsumerScreen({ super.leading,
this.title, super.actions,
this.currentIndex, super.key,
}); });
@override @override
Widget parent(BuildContext context, Widget child) => FrameLayout( Widget onBuild(BuildContext context, CrudState state) =>
title: title ?? 'Title', crudBuilder(context, state);
body: child,
currentIndex: currentIndex ?? 0,
);
} }
@@ -0,0 +1,47 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
abstract class BottomBarLayoutCrudCubitConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>, T extends Object?>
extends BottomBarLayoutCubitConsumerScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudLoaded<T>> {
const BottomBarLayoutCrudCubitConsumerScreen({
super.currentIndex,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
abstract class BottomBarLayoutCrudListCubitConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>, T extends Object?>
extends BottomBarLayoutCubitConsumerScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudListLoaded<T>> {
const BottomBarLayoutCrudListCubitConsumerScreen({
super.currentIndex,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
@@ -0,0 +1,20 @@
// 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_crud_cubit_consumer_screen.dart';
export './bottom_bar_layout_crud_cubit_consumer_screen.dart';
export './frame_layout_crud_cubit_consumer_screen.dart';
export './crud_cubit_consumer_screen.dart';
@@ -0,0 +1,40 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
abstract class CrudCubitConsumerScreen<Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends CubitConsumerScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudLoaded<T>> {
const CrudCubitConsumerScreen({super.key});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
abstract class CrudListCubitConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends CubitConsumerScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudListLoaded<T>> {
const CrudListCubitConsumerScreen({super.key});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
@@ -0,0 +1,53 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
abstract class FrameLayoutCrudCubitConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>, T extends Object?>
extends FrameLayoutCubitConsumerScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudLoaded<T>> {
const FrameLayoutCrudCubitConsumerScreen({
super.title,
super.leading,
super.actions,
super.currentIndex,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
abstract class FrameLayoutCrudListCubitConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>, T extends Object?>
extends FrameLayoutCubitConsumerScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudListLoaded<T>> {
const FrameLayoutCrudListCubitConsumerScreen({
super.title,
super.leading,
super.actions,
super.currentIndex,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
@@ -1,61 +0,0 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_helper/wyatt_bloc_helper.dart';
import 'package:wyatt_crud_bloc/wyatt_crud_bloc.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
abstract class CrudCubitConsumerScreenBase<
Cubit extends bloc_base.Cubit<CrudState>,
SuccessState extends CrudSuccess>
extends CubitConsumerScreen<Cubit, CrudState> {
const CrudCubitConsumerScreenBase({super.key});
Widget errorBuilder(BuildContext context, CrudError state) =>
context.components.errorWidget?.configure(error: state.message) ??
const SizedBox.shrink();
Widget loadingBuilder(BuildContext context, CrudLoading state) =>
context.components.loadingWidget ?? const SizedBox.shrink();
Widget initialBuilder(BuildContext context, CrudInitial state) =>
const SizedBox.shrink();
Widget successBuilder(BuildContext context, SuccessState state);
@override
Widget onBuild(BuildContext context, CrudState state) =>
CrudBuilder<CrudInitial, CrudLoading, SuccessState, CrudError>(
errorBuilder: errorBuilder,
loadingBuilder: loadingBuilder,
initialBuilder: initialBuilder,
state: state,
builder: successBuilder,
);
}
abstract class CrudCubitConsumerScreen<Cubit extends bloc_base.Cubit<CrudState>,
T> extends CrudCubitConsumerScreenBase<Cubit, CrudLoaded<T>> {
const CrudCubitConsumerScreen();
}
abstract class CrudListCubitConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T> extends CrudCubitConsumerScreenBase<Cubit, CrudListLoaded<T>> {
const CrudListCubitConsumerScreen();
}
@@ -14,11 +14,5 @@
// 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 'consumers/crud_cubit_consumer_screen_bases.dart'; export 'consumers/consumers.dart';
export 'consumers/bottom_navigation_bar_layout_crud_consumer_screen.dart'; export 'screens/screens.dart';
export 'consumers/app_bar_cubit_consumer_screen.dart';
export 'consumers/frame_layout_crud_consumer_screen.dart';
export 'screens/crud_cubit_screen_base.dart';
export 'screens/app_bar_cubit_screen.dart';
export 'screens/bottom_navigation_bar_layout_crud_screen.dart';
export 'screens/frame_layout_crud_screen.dart';
@@ -16,38 +16,25 @@
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 AppBarLayoutCrudConsumerScreen< abstract class AppBarLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
Cubit extends bloc_base.Cubit<CrudState>, State extends Object> extends CubitScreen<Cubit, State> {
T> extends CrudCubitConsumerScreen<Cubit, T> { const AppBarLayoutCubitScreen({
final String? title;
const AppBarLayoutCrudConsumerScreen({
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 AppBarLayoutCrudListConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T> extends CrudListCubitConsumerScreen<Cubit, T> {
final String? title;
final int? currentIndex;
const AppBarLayoutCrudListConsumerScreen({
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_screen.dart';
export 'bottom_bar_layout_cubit_screen.dart';
export 'frame_layout_cubit_screen.dart';
@@ -16,40 +16,22 @@
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 BottomNavigationBarLayoutCrudConsumerScreen< abstract class BottomBarLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
Cubit extends bloc_base.Cubit<CrudState>, State extends Object> extends CubitScreen<Cubit, State> {
T> extends CrudCubitConsumerScreen<Cubit, T> { const BottomBarLayoutCubitScreen({
final int? currentIndex;
const BottomNavigationBarLayoutCrudConsumerScreen({
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 BottomNavigationBarLayoutCrudListConsumerScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T> extends CrudListCubitConsumerScreen<Cubit, T> {
final String? title;
final int? currentIndex;
const BottomNavigationBarLayoutCrudListConsumerScreen({
this.title,
this.currentIndex,
});
@override
Widget parent(BuildContext context, Widget child) =>
BottomNavigationBarLayout(
body: child,
currentIndex: currentIndex ?? 0,
); );
} }
@@ -0,0 +1,43 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
abstract class FrameLayoutCubitScreen<Cubit extends bloc_base.Cubit<State>,
State extends Object> extends CubitScreen<Cubit, State> {
const FrameLayoutCubitScreen({
this.title,
this.leading,
this.actions,
this.currentIndex,
super.key,
});
final int? currentIndex;
final String? title;
final Widget? leading;
final List<Widget>? actions;
@override
Widget parent(BuildContext context, Widget child) => FrameLayout(
title: title,
currentIndex: currentIndex,
body: child,
);
}
@@ -0,0 +1,51 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
abstract class AppBarLayoutCrudCubitScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends AppBarLayoutCubitScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudLoaded<T>> {
const AppBarLayoutCrudCubitScreen({
super.title,
super.leading,
super.actions,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
abstract class AppBarLayoutCrudListCubitScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends AppBarLayoutCubitScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudListLoaded<T>> {
const AppBarLayoutCrudListCubitScreen({
super.title,
super.leading,
super.actions,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
@@ -0,0 +1,47 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
abstract class BottomBarLayoutCrudCubitScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends BottomBarLayoutCubitScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudLoaded<T>> {
const BottomBarLayoutCrudCubitScreen({
super.currentIndex,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
abstract class BottomBarLayoutCrudListCubitScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends BottomBarLayoutCubitScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudListLoaded<T>> {
const BottomBarLayoutCrudListCubitScreen({
super.currentIndex,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
@@ -0,0 +1,20 @@
// 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_crud_cubit_screen.dart';
export 'bottom_bar_layout_crud_cubit_screen.dart';
export 'frame_layout_crud_cubit_screen.dart';
export './crud_cubit_screen.dart';
@@ -0,0 +1,39 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
abstract class CrudCubitScreen<Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends CubitScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudLoaded<T>> {
const CrudCubitScreen({super.key});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
abstract class CrudListCubitScreen<Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends CubitScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudListLoaded<T>> {
const CrudListCubitScreen({super.key});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
@@ -0,0 +1,53 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart' as bloc_base;
import 'package:wyatt_bloc_layout/wyatt_bloc_layout.dart';
abstract class FrameLayoutCrudCubitScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends FrameLayoutCubitScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudLoaded<T>> {
const FrameLayoutCrudCubitScreen({
super.title,
super.leading,
super.actions,
super.currentIndex,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
abstract class FrameLayoutCrudListCubitScreen<
Cubit extends bloc_base.Cubit<CrudState>,
T extends Object?> extends FrameLayoutCubitScreen<Cubit, CrudState>
with CrudMixin<Cubit, CrudListLoaded<T>> {
const FrameLayoutCrudListCubitScreen({
super.title,
super.leading,
super.actions,
super.currentIndex,
super.key,
});
@override
Widget onBuild(BuildContext context, CrudState state) =>
crudBuilder(context, state);
}
@@ -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';
@@ -15,6 +15,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
export 'presentation/presentation.dart'; export 'presentation/presentation.dart';
export 'core/core.dart';
export 'package:flutter_bloc/flutter_bloc.dart'; export 'package:flutter_bloc/flutter_bloc.dart';
export 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart'; export 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
@@ -0,0 +1,181 @@
@startuml
set namespaceSeparator ::
abstract class "wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" {
+Widget errorBuilder()
+Widget loadingBuilder()
+Widget initialBuilder()
+Widget successBuilder()
+Widget crudBuilder()
}
abstract class "wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" {
+int? currentIndex
+Widget parent()
}
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" {
+String? title
+Widget? leading
+List<Widget>? actions
+Widget parent()
}
"wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" o-- "flutter::src::widgets::framework.dart::Widget"
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" {
+int? currentIndex
+String? title
+Widget? leading
+List<Widget>? actions
+Widget parent()
}
"wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" o-- "flutter::src::widgets::framework.dart::Widget"
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudCubitScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudCubitScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudListCubitScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::screens::bases::app_bar_layout_cubit_screen.dart::AppBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudListCubitScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::app_bar_layout_crud_cubit_screen.dart::AppBarLayoutCrudListCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudCubitScreen" {
+Widget onBuild()
}
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudCubitScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudListCubitScreen" {
+Widget onBuild()
}
"wyatt_bloc_helper::src::cubit.dart::CubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudListCubitScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::crud_cubit_screen.dart::CrudListCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudCubitScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudCubitScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudListCubitScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::screens::bases::frame_layout_cubit_screen.dart::FrameLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudListCubitScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::frame_layout_crud_cubit_screen.dart::FrameLayoutCrudListCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudCubitScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudCubitScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudListCubitScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::screens::bases::bottom_bar_layout_cubit_screen.dart::BottomBarLayoutCubitScreen" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudListCubitScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::screens::crud::bottom_bar_layout_crud_cubit_screen.dart::BottomBarLayoutCrudListCubitScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" {
+int? currentIndex
+Widget parent()
}
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" {
+String? title
+Widget? leading
+List<Widget>? actions
+Widget parent()
}
"wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" o-- "flutter::src::widgets::framework.dart::Widget"
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" {
+int? currentIndex
+String? title
+Widget? leading
+List<Widget>? actions
+Widget parent()
}
"wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" o-- "flutter::src::widgets::framework.dart::Widget"
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudCubitConsumerScreen" {
+Widget onBuild()
}
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudCubitConsumerScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudListCubitConsumerScreen" {
+Widget onBuild()
}
"wyatt_bloc_helper::src::cubit.dart::CubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudListCubitConsumerScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::crud_cubit_consumer_screen.dart::CrudListCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudCubitConsumerScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudCubitConsumerScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudListCubitConsumerScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::consumers::bases::app_bar_layout_cubit_consumer_screen.dart::AppBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudListCubitConsumerScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::app_bar_layout_crud_cubit_consumer_screen.dart::AppBarLayoutCrudListCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudCubitConsumerScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudCubitConsumerScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudListCubitConsumerScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::consumers::bases::bottom_bar_layout_cubit_consumer_screen.dart::BottomBarLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudListCubitConsumerScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::bottom_bar_layout_crud_cubit_consumer_screen.dart::BottomBarLayoutCrudListCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudCubitConsumerScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudCubitConsumerScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudCubitConsumerScreen"
abstract class "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudListCubitConsumerScreen" {
+Widget onBuild()
}
"wyatt_bloc_layout::src::presentation::consumers::bases::frame_layout_cubit_consumer_screen.dart::FrameLayoutCubitConsumerScreen" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudListCubitConsumerScreen"
"wyatt_bloc_layout::src::core::crud_cubit_consumer_screen_mixin.dart::CrudMixin" <|-- "wyatt_bloc_layout::src::presentation::consumers::crud::frame_layout_crud_cubit_consumer_screen.dart::FrameLayoutCrudListCubitConsumerScreen"
@enduml
+1 -1
View File
@@ -40,5 +40,5 @@ 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.0
path: packages/wyatt_analysis path: packages/wyatt_analysis
@@ -0,0 +1,7 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/
# Avoid committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock
@@ -0,0 +1,24 @@
/*
* 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/>.
*/
{
"recommendations": [
"psioniq.psi-header",
"blaugold.melos-code"
]
}
@@ -0,0 +1,34 @@
/*
* 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/>.
*/
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Example",
"request": "launch",
"type": "dart",
"cwd": "example/",
"program": "lib/main.dart",
"flutterMode": "debug"
},
]
}
@@ -0,0 +1,72 @@
{
"dart.runPubGetOnPubspecChanges": "never",
"bloc.newCubitTemplate.type": "equatable",
"psi-header.changes-tracking": {
"isActive": true
},
"psi-header.config": {
"blankLinesAfter": 1,
"forceToTop": true
},
"psi-header.lang-config": [
{
"beforeHeader": [
"# -*- coding:utf-8 -*-",
"#!/usr/bin/env python3"
],
"begin": "###",
"end": "###",
"language": "python",
"prefix": "# "
},
{
"beforeHeader": [
"#!/usr/bin/env sh",
""
],
"language": "shellscript",
"begin": "",
"end": "",
"prefix": "# "
},
{
"begin": "",
"end": "",
"language": "dart",
"prefix": "// "
},
{
"begin": "",
"end": "",
"language": "yaml",
"prefix": "# "
},
{
"begin": "<!--",
"end": "-->",
"language": "markdown",
},
],
"psi-header.templates": [
{
"language": "*",
"template": [
"Copyright (C) <<year>> WYATT GROUP",
"Please see the AUTHORS file for details.",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation, either version 3 of the License, or",
"any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <https://www.gnu.org/licenses/>."
],
}
],
}
@@ -0,0 +1,3 @@
## 1.0.0
- Initial version.
@@ -0,0 +1,66 @@
<!--
* 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/>.
-->
# Flutter - Component Copy With Extension
<p align="left">
<a href="https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis"><img src="https://img.shields.io/badge/Style-Wyatt%20Analysis-blue.svg?style=flat-square" alt="Style: Wyatt Analysis" /></a>
<img src="https://img.shields.io/badge/SDK-Flutter-blue?style=flat-square" alt="SDK: Flutter" />
</p>
This package provides annotations for generating code and simplifying the use of an UI kit within a Flutter application. **The package contains only the annotation classes**.
## Annotation Classes
#### `ComponentProxyExtension`
This annotation class is used to annotate a new component of an UI kit in the `wyatt_ui_components` package. It generates the abstract proxy of the component and allows access to all its properties in different packages and throughout the application.
```dart
part 'text_field_component.g.dart';
@ComponentProxyExtension()
abstract class TextFieldComponent extends Component {
with CopyWithMixin<$TextFieldComponentCWProxy> {
const TextFieldComponent({
...
});
}
```
#### `ComponentCopyWithExtension`
This annotation class is used to annotate the implementation of components directly in the application. It generates the implementation of the proxy and the mixin to ensure that the component meets the specifications defined in the `wyatt_ui_components package`.
```dart
part 'text_field_component.g.dart';
@ComponentProxyExtension()
abstract class TextFieldComponent extends Component {
with CopyWithMixin<$TextFieldComponentCWProxy> {
const TextFieldComponent({
...
});
}
```
## Additional features
The skipFields field allows you to directly and specifically change a field. This makes it easier to use. You can disable it through annotation.
@@ -0,0 +1,7 @@
include: package:wyatt_analysis/analysis_options.flutter.yaml
@@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
version:
revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
channel: stable
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
- platform: web
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
@@ -0,0 +1,16 @@
# example
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
@@ -0,0 +1,7 @@
include: package:wyatt_analysis/analysis_options.flutter.yaml
@@ -0,0 +1,29 @@
// 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/>.
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
@ComponentProxyExtension()
class BasicComponentAnnotationExemple {}
@ComponentProxyExtension(skipFields: true)
class ComponentAnnotationExempleWithSkipFields {}
@ComponentCopyWithExtension()
class BasicCustomComponent {}
@ComponentCopyWithExtension(skipFields: false)
class CustomComponentAnnotationExempleWithSkipFields {}
@@ -0,0 +1,27 @@
name: component_copy_with_extension_example
description: A new Flutter project.
version: 1.0.0
publish_to: "none"
environment:
sdk: ">=2.19.0 <3.0.0"
flutter: ">=3.0.0"
dependencies:
flutter:
sdk: flutter
wyatt_component_copy_with_extension:
path: "../"
dev_dependencies:
flutter_test:
sdk: flutter
wyatt_analysis:
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
version: ^2.4.0
# The following section is specific to Flutter.
flutter:
uses-material-design: true
@@ -0,0 +1,22 @@
// 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/>.
/// Extension for component copy with feature
library component_copy_with_extension;
export './src/domain/domain.dart';
export 'src/component_copy_with_extension.dart';
export 'src/component_proxy_extension.dart';
@@ -0,0 +1,25 @@
// Copyright (C) 2023 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:meta/meta_meta.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
/// Annotation used to indicate that the `copyWith` extension
/// should be generated for the compononent.
@Target({TargetKind.classType})
class ComponentCopyWithExtension extends ComponentAnnotation {
const ComponentCopyWithExtension({super.skipFields});
}
@@ -0,0 +1,25 @@
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:meta/meta_meta.dart';
@Target({TargetKind.classType})
class ComponentProxyExtension {
const ComponentProxyExtension({
this.skipFields = true,
});
final bool? skipFields;
}
@@ -0,0 +1,24 @@
// 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/>.
abstract class ComponentAnnotation {
const ComponentAnnotation({this.skipFields = true});
/// Prevent the library from generating `copyWith` functions for individual
/// fields e.g. `instance.copyWith.id("123")`. If you want to use only
/// copyWith(...) function. Default is `true`.
final bool? skipFields;
}
@@ -0,0 +1,17 @@
// 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/>.
export './component_annotation.dart';
@@ -0,0 +1,20 @@
name: wyatt_component_copy_with_extension
description: Extension for component copy with feature.
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/component_copy_with_extension
version: 1.0.0
environment:
sdk: ">=2.19.0 <3.0.0"
dependencies:
meta: ^1.8.0
path: ^1.8.0
dev_dependencies:
wyatt_analysis:
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
version: ^2.4.0
# The following section is specific to Flutter.
flutter:
uses-material-design: true
@@ -0,0 +1,7 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/
# Avoid committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock
@@ -0,0 +1,24 @@
/*
* 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/>.
*/
{
"recommendations": [
"psioniq.psi-header",
"blaugold.melos-code"
]
}
@@ -0,0 +1,34 @@
/*
* 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/>.
*/
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Example",
"request": "launch",
"type": "dart",
"cwd": "example/",
"program": "lib/main.dart",
"flutterMode": "debug"
},
]
}
@@ -0,0 +1,72 @@
{
"dart.runPubGetOnPubspecChanges": "never",
"bloc.newCubitTemplate.type": "equatable",
"psi-header.changes-tracking": {
"isActive": true
},
"psi-header.config": {
"blankLinesAfter": 1,
"forceToTop": true
},
"psi-header.lang-config": [
{
"beforeHeader": [
"# -*- coding:utf-8 -*-",
"#!/usr/bin/env python3"
],
"begin": "###",
"end": "###",
"language": "python",
"prefix": "# "
},
{
"beforeHeader": [
"#!/usr/bin/env sh",
""
],
"language": "shellscript",
"begin": "",
"end": "",
"prefix": "# "
},
{
"begin": "",
"end": "",
"language": "dart",
"prefix": "// "
},
{
"begin": "",
"end": "",
"language": "yaml",
"prefix": "# "
},
{
"begin": "<!--",
"end": "-->",
"language": "markdown",
},
],
"psi-header.templates": [
{
"language": "*",
"template": [
"Copyright (C) <<year>> WYATT GROUP",
"Please see the AUTHORS file for details.",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation, either version 3 of the License, or",
"any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <https://www.gnu.org/licenses/>."
],
}
],
}
@@ -0,0 +1,3 @@
## 1.0.0
- Initial version.
@@ -0,0 +1,57 @@
<!--
* 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/>.
-->
# Dart - Component Copy With Gen
<p align="left">
<a href="https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis"><img src="https://img.shields.io/badge/Style-Wyatt%20Analysis-blue.svg?style=flat-square" alt="Style: Wyatt Analysis" /></a>
<img src="https://img.shields.io/badge/SDK-Dart%20%7C%20Flutter-blue?style=flat-square" alt="SDK: Dart & Flutter" />
</p>
A Dart package for generating code from annotations to ease the use of a UIKit in Flutter applications. The generated code is based on the annotation classes present in the 'wyatt_component_copy_with_extension' package.
## Features
- Supports the generation of abstract proxies in the `wyatt_ui_components` package.
- Supports direct use in Flutter applications.
## Usage
### In the 'wyatt_ui_components' package
- Add the appropriate annotation when addicdng a new component.
- Run the build runner command to generate the proxy.
### In Flutter applications
- Add the following dependencies to your pubspec.yaml:
```yaml
dependencies:
...
wyatt_component_copy_with_extension: ^0.0.1
dev_dependencies:
...
wyatt_component_copy_with_gen: ^0.0.1
build_runner: ^2.3.3
```
- In your UIKit, extend the desired component class and add the appropriate annotation.
- Run the code generation command via the build runner.
For further details and additional features on class annotation, see the 'wyatt_component_copy_with_extension' package's README.
@@ -0,0 +1,7 @@
include: package:wyatt_analysis/analysis_options.yaml
@@ -0,0 +1,21 @@
targets:
$default:
builders:
component_copy_with_gen:
enabled: true
generate_for:
exclude:
- test
- example
include:
- test/gen_*
builders:
component_copy_with_gen:
target: ":component_copy_with_gen"
import: "package:wyatt_component_copy_with_gen/component_copy_with_gen.dart"
builder_factories: ["componentCopyWithReporter"]
build_extensions: { ".dart": ["copy_with_extension_gen.g.part"] }
auto_apply: dependents
build_to: cache
applies_builders: ["source_gen|combining_builder"]
@@ -0,0 +1,44 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
version:
revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
channel: stable
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
- platform: web
create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
@@ -0,0 +1,16 @@
# example
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
@@ -0,0 +1,7 @@
include: package:wyatt_analysis/analysis_options.yaml
@@ -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/>.
import 'package:flutter/material.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
part 'custom_app_bar_example.g.dart';
@ComponentCopyWithExtension()
class CustomAppBarExample extends AppBarComponent
with $CustomAppBarExampleCWMixin {
const CustomAppBarExample({super.title, super.key});
@override
Widget build(BuildContext context) => AppBar(
title: Text(super.title?.text ?? ''),
);
}
@@ -0,0 +1,36 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'custom_app_bar_example.dart';
// **************************************************************************
// ComponentCopyWithGenerator
// **************************************************************************
class $CustomAppBarExampleCWProxyImpl implements $AppBarComponentCWProxy {
const $CustomAppBarExampleCWProxyImpl(this._value);
final CustomAppBarExample _value;
@override
CustomAppBarExample title(String? title) => this(title: title);
@override
CustomAppBarExample leading(Widget? leading) => this(leading: leading);
@override
CustomAppBarExample actions(List<Widget>? actions) => this(actions: actions);
@override
CustomAppBarExample key(Key? key) => this(key: key);
@override
CustomAppBarExample call({
String? title,
Widget? leading,
List<Widget>? actions,
Key? key,
}) =>
CustomAppBarExample(
title: title ?? _value.title,
key: key ?? _value.key,
);
}
mixin $CustomAppBarExampleCWMixin on Component {
$AppBarComponentCWProxy get copyWith =>
$CustomAppBarExampleCWProxyImpl(this as CustomAppBarExample);
}
@@ -0,0 +1,28 @@
name: component_copy_with_gen_example
description: A new Flutter project.
version: 1.0.0
publish_to: "none"
environment:
sdk: ">=2.19.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
wyatt_component_copy_with_extension:
path: "../../wyatt_component_copy_with_extension"
wyatt_ui_components:
git:
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
path: packages/wyatt_ui_components
dev_dependencies:
build_runner: ^2.3.3
wyatt_component_copy_with_gen:
path: "../"
wyatt_analysis:
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
version: ^2.4.0
@@ -0,0 +1,21 @@
// 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/>.
/// Generator for copywith method for components
library component_copy_with_gen;
export 'src/builder.dart';
export 'src/generators/component_copy_with_generator.dart';
@@ -0,0 +1,28 @@
// 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/>.
import 'package:build/build.dart';
import 'package:source_gen/source_gen.dart';
import 'package:wyatt_component_copy_with_gen/src/generators/component_copy_with_generator.dart';
import 'package:wyatt_component_copy_with_gen/src/generators/component_proxy_generator.dart';
Builder componentCopyWithReporter(BuilderOptions options) => SharedPartBuilder(
[
ComponentProxyGenerator(),
ComponentCopyWithGenerator(),
],
'component_copy_with',
);
@@ -0,0 +1,97 @@
// 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/>.
import 'dart:async';
import 'package:analyzer/dart/element/element.dart';
import 'package:build/build.dart';
import 'package:source_gen/source_gen.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
class ComponentCopyWithGenerator
extends GeneratorForAnnotation<ComponentCopyWithExtension> {
@override
FutureOr<String> generateForAnnotatedElement(
Element element,
ConstantReader annotation,
BuildStep buildStep,
) {
/// Check element type
if (element is! ClassElement) {
throw InvalidGenerationSourceError(
'Only classes can be annotated with "CopyWith". "$element" is '
'not a ClassElement.',
element: element,
);
}
final classAnnotation = ComponentCopyWithExtension(
skipFields: annotation.peek('skipFields')?.boolValue ?? true,
);
final generatedCode = StringBuffer()
// Generate CopyWith Proxy implementation.
..write('class \$${element.displayName}CWProxyImpl implements '
'\$${element.supertype?.getDisplayString(
withNullability: false,
)}CWProxy { '
'const \$${element.displayName}CWProxyImpl '
'(this._value); '
'final ${element.displayName} _value;');
if (classAnnotation.skipFields ?? true) {
for (final superField
in element.supertype!.element.constructors.first.parameters) {
final superFieldDisplayName = superField.displayName;
generatedCode.write('@override ${element.displayName} '
'$superFieldDisplayName(${superField.type.getDisplayString(
withNullability: false,
)}? '
' $superFieldDisplayName)'
' => this($superFieldDisplayName : $superFieldDisplayName); ');
}
}
generatedCode.write('@override ${element.displayName} call ({');
for (final superField
in element.supertype!.element.constructors.first.parameters) {
final superFieldDisplayName = superField.displayName;
generatedCode.write('${superField.type.getDisplayString(
withNullability: false,
)}? $superFieldDisplayName,');
}
generatedCode.write('})=>${element.displayName}(');
for (final superField in element.constructors.first.parameters) {
final superFieldDisplayName = superField.displayName;
generatedCode.write('$superFieldDisplayName:$superFieldDisplayName?? '
'_value.$superFieldDisplayName,');
}
generatedCode
..write(');}')
..write(
'mixin \$${element.displayName}CWMixin on Component { '
'\$${element.supertype?.element.displayName}CWProxy get copyWith => '
'\$${element.displayName}CWProxyImpl(this as ${element.displayName});}',
);
return generatedCode.toString();
}
}
@@ -0,0 +1,72 @@
// 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/>.
import 'dart:async';
import 'package:analyzer/dart/element/element.dart';
import 'package:build/build.dart';
import 'package:source_gen/source_gen.dart';
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
class ComponentProxyGenerator
extends GeneratorForAnnotation<ComponentProxyExtension> {
@override
FutureOr<String> generateForAnnotatedElement(
Element element,
ConstantReader annotation,
BuildStep buildStep,
) {
/// Check element type
if (element is! ClassElement) {
throw InvalidGenerationSourceError(
'Only classes can be annotated with "CopyWith". "$element" is '
'not a ClassElement.',
element: element,
);
}
final classAnnotation = ComponentProxyExtension(
skipFields: annotation.peek('skipFields')?.boolValue ?? true,
);
final generatedCode = StringBuffer()
..write('abstract class \$${element.displayName}CWProxy {');
if (classAnnotation.skipFields ?? true) {
for (final field in element.constructors.first.parameters) {
generatedCode.write(
'${element.displayName} '
'${field.displayName}(${field.type.getDisplayString(
withNullability: false,
)}? '
'${field.displayName});',
);
}
}
generatedCode.write('${element.displayName} call({');
for (final field in element.constructors.first.parameters) {
generatedCode.write('${field.type.getDisplayString(
withNullability: false,
)}? ${field.displayName}, ');
}
generatedCode.write('});}');
return generatedCode.toString();
}
}
@@ -0,0 +1,25 @@
name: wyatt_component_copy_with_gen
description: Generator for copywith method for components.
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/component_copy_with_gen
version: 1.0.0
environment:
sdk: ">=2.19.0 <3.0.0"
dependencies:
path: ^1.8.0
build: ^2.3.1
source_gen: ^1.2.7
analyzer: ^5.4.0
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:
test: ^1.21.0
wyatt_analysis:
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
version: ^2.4.0
+1 -1
View File
@@ -31,4 +31,4 @@ dev_dependencies:
bloc_test: ^9.1.0 bloc_test: ^9.1.0
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.0
@@ -0,0 +1,7 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/
# Avoid committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock
@@ -0,0 +1,24 @@
/*
* 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/>.
*/
{
"recommendations": [
"psioniq.psi-header",
"blaugold.melos-code"
]
}
@@ -0,0 +1,34 @@
/*
* 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/>.
*/
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Example",
"request": "launch",
"type": "dart",
"cwd": "example/",
"program": "lib/main.dart",
"flutterMode": "debug"
},
]
}
@@ -0,0 +1,72 @@
{
"dart.runPubGetOnPubspecChanges": "never",
"bloc.newCubitTemplate.type": "equatable",
"psi-header.changes-tracking": {
"isActive": true
},
"psi-header.config": {
"blankLinesAfter": 1,
"forceToTop": true
},
"psi-header.lang-config": [
{
"beforeHeader": [
"# -*- coding:utf-8 -*-",
"#!/usr/bin/env python3"
],
"begin": "###",
"end": "###",
"language": "python",
"prefix": "# "
},
{
"beforeHeader": [
"#!/usr/bin/env sh",
""
],
"language": "shellscript",
"begin": "",
"end": "",
"prefix": "# "
},
{
"begin": "",
"end": "",
"language": "dart",
"prefix": "// "
},
{
"begin": "",
"end": "",
"language": "yaml",
"prefix": "# "
},
{
"begin": "<!--",
"end": "-->",
"language": "markdown",
},
],
"psi-header.templates": [
{
"language": "*",
"template": [
"Copyright (C) <<year>> WYATT GROUP",
"Please see the AUTHORS file for details.",
"",
"This program is free software: you can redistribute it and/or modify",
"it under the terms of the GNU General Public License as published by",
"the Free Software Foundation, either version 3 of the License, or",
"any later version.",
"",
"This program is distributed in the hope that it will be useful,",
"but WITHOUT ANY WARRANTY; without even the implied warranty of",
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
"GNU General Public License for more details.",
"",
"You should have received a copy of the GNU General Public License",
"along with this program. If not, see <https://www.gnu.org/licenses/>."
],
}
],
}
@@ -0,0 +1,3 @@
## 1.0.0
- Initial version.
@@ -0,0 +1,56 @@
<!--
* 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/>.
-->
# Flutter - Wyatt Deferred Widget Annotation
<p align="left">
<a href="https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis"><img src="https://img.shields.io/badge/Style-Wyatt%20Analysis-blue.svg?style=flat-square" alt="Style: Wyatt Analysis" /></a>
<img src="https://img.shields.io/badge/SDK-Flutter-blue?style=flat-square" alt="SDK: Flutter" />
</p>
A package by wyatt studio
## Features
TODO: List what your package can do. Maybe include images, gifs, or videos.
## Getting started
TODO: List prerequisites and provide or point to information on how to
start using the package.
## Usage
TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.
```dart
const like = 'sample';
```
## Additional information
TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.

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