Compare commits
119
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81c8851ac8 | ||
|
|
0c176ba0fa | ||
|
|
970dde2ef1 | ||
|
|
2e187b26eb | ||
|
|
0337d4f97a | ||
|
|
3c3545abfe | ||
|
|
2dfbd59773 | ||
|
|
4a3fde3a1e | ||
|
|
317eb56d66 | ||
|
|
b9dac32143 | ||
|
|
8955788fa5 | ||
|
|
ca6af3ccc3 | ||
|
|
ad0f1ec1c5 | ||
|
|
41a484c013 | ||
|
|
4811ed8998 | ||
|
|
dba14088b0 | ||
|
|
b2fe14a123 | ||
|
|
bbd3f0a02d | ||
|
|
79dc34414c | ||
|
|
349d1ae288 | ||
|
|
49b534d145 | ||
|
|
a68da15cdc
|
||
|
|
6037e13f50
|
||
|
|
93cc5058d1
|
||
|
|
12d04c91ed
|
||
|
|
5906d54aad
|
||
|
|
b077f4baf0
|
||
|
|
133e0e910b | ||
|
|
25224469b5 | ||
|
|
6537945946 | ||
|
|
702164082a | ||
|
|
f2b8c03dd7 | ||
|
|
51672cc95a | ||
|
|
eda643e9b4 | ||
|
|
cae4b68046 | ||
|
|
4030511f4a | ||
|
|
8ed8a71c7c | ||
|
|
b6d22002ee | ||
|
|
9b9339cb56 | ||
|
|
b57500b854 | ||
|
|
1edb1f7324 | ||
|
|
edf72cf4c2 | ||
|
|
f6c16c5dc4 | ||
|
|
c6beae597b | ||
|
|
c2b60f2d79 | ||
|
|
1e8d5d088e | ||
|
|
419c99c103 | ||
|
|
5387dd6eed
|
||
|
|
f67e4aa112
|
||
|
|
2769d45e20
|
||
|
|
66719732f7
|
||
|
|
25018dc78a
|
||
|
|
efeb3acff3
|
||
|
|
ef52015372
|
||
|
|
c5f8b69184
|
||
|
|
33984b1733
|
||
|
|
a47c28a4d6
|
||
|
|
63bbde8213
|
||
|
|
8070623e88
|
||
|
|
4c08a692d2
|
||
|
|
8044d07413
|
||
|
|
1af9b0b1f1
|
||
|
|
3a7b0abc58
|
||
|
|
dd198b0e51
|
||
|
|
a595183107
|
||
|
|
c786c153e0
|
||
|
|
cc71bf7abd
|
||
|
|
ed06e18043
|
||
|
|
96781880f4
|
||
|
|
c331bc6056
|
||
|
|
77ce4e33ab
|
||
|
|
2806ac5923
|
||
|
|
ed29f39673
|
||
|
|
7880293723
|
||
|
|
5c34528b3d
|
||
|
|
198d83b663
|
||
|
|
bd636e9d24
|
||
|
|
c942e2aacf
|
||
|
|
82eeba4d7d
|
||
|
|
4695cf0618
|
||
|
|
d49a4cad31
|
||
|
|
e4d904eb8d
|
||
|
|
4f1a064298
|
||
|
|
168d840b87
|
||
|
|
aea71fa32c
|
||
|
|
b6f25dd5b5
|
||
|
|
61e28ce5e7
|
||
|
|
5050e2c2bb
|
||
|
|
9e1b76e07b
|
||
|
|
442baa6882
|
||
|
|
60126fffc4
|
||
|
|
07572aeca2
|
||
|
|
4332eafda0
|
||
|
|
160b30d21b
|
||
|
|
602a372d7c
|
||
|
|
43df087319
|
||
|
|
4f71118a65
|
||
|
|
4b37175d17 | ||
|
|
ea18d39c44 | ||
|
|
b9f2305bca | ||
|
|
55822ad870 | ||
|
|
a563bd1fe3 | ||
|
|
5464cd1d40 | ||
|
|
ba1c1016e5 | ||
|
|
23b608ed10 | ||
|
|
44b2b7c27d
|
||
|
|
6bad9a8a05
|
||
|
|
5d8f94bee8
|
||
|
|
75cb341447
|
||
|
|
efa7ca09dd
|
||
|
|
ac432f6dc8 | ||
|
|
6c85faba82 | ||
|
|
dd75ecfc7a | ||
|
|
0132771e17 | ||
|
|
5d5ae145aa | ||
|
|
07428a5215 | ||
|
|
c994c822b0 | ||
|
|
bde54e0cf5 | ||
|
|
f3c3939ba1 |
+2
-2
@@ -20,12 +20,12 @@ name: default
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: quality-check
|
- name: quality-check
|
||||||
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0
|
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0-1
|
||||||
commands:
|
commands:
|
||||||
- melos run quality-check
|
- melos run quality-check
|
||||||
- melos run publish:validate
|
- melos run publish:validate
|
||||||
- name: publish
|
- name: publish
|
||||||
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0
|
image: git.wyatt-studio.fr/wyatt-foss/flutter-melos:2.9.0-1
|
||||||
commands:
|
commands:
|
||||||
- melos run publish:validate
|
- melos run publish:validate
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
|
||||||
<a href="https://wyattapp.io">
|
|
||||||
<img width="150px" src="resources/wyatt-campus-logo.png">
|
|
||||||
</a>
|
|
||||||
<a href="https://wyatt-studio.fr">
|
<a href="https://wyatt-studio.fr">
|
||||||
<img width="150px" src="resources/wyatt-studio-logo.png">
|
<img width="150px" src="resources/wyatt-studio-logo.png">
|
||||||
</a>
|
</a>
|
||||||
@@ -44,10 +40,9 @@
|
|||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
Here is it a set of [Flutter plugins](https://flutter.io/platform-plugins/) that power up your applications.
|
Here is a set of [Flutter plugins](https://flutter.io/platform-plugins/) that enhance your applications.
|
||||||
|
|
||||||
[Flutter](https://flutter.dev) is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. Flutter is used by developers and organizations around the world, and is free
|
[Flutter](https://flutter.dev) is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop using a single codebase. It is used by developers and organizations worldwide and is free and open-source.
|
||||||
and open source.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -61,21 +56,21 @@ git clone ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
|||||||
|
|
||||||
### Prerequisite
|
### Prerequisite
|
||||||
|
|
||||||
- [Flutter](https://github.com/flutter/flutter).
|
1. [Flutter](https://github.com/flutter/flutter). It is a UI toolkit developed by Google for building beautiful and natively compiled applications for mobile, web, and desktop from a single codebase.
|
||||||
|
|
||||||
- [Melos](https://github.com/invertase/melos). Used to manage Dart projects with multiple packages.
|
2. [Melos](https://github.com/invertase/melos). Melos is a tool that helps in managing Dart projects that have multiple packages. It can be installed using the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dart pub global activate melos
|
dart pub global activate melos
|
||||||
```
|
```
|
||||||
|
|
||||||
- [Mason](https://github.com/felangel/mason). Used for code generation.
|
3. [Mason](https://github.com/felangel/mason). Mason is used for code generation purposes. It can be installed by running the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dart pub global activate mason_cli
|
dart pub global activate mason_cli
|
||||||
```
|
```
|
||||||
|
|
||||||
- [Lcov](https://github.com/linux-test-project/lcov). Used to generate coverage data.
|
4. [Lcov](https://github.com/linux-test-project/lcov). Lcov is a tool used to generate coverage data. It can be installed on macOS by running the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# on macos
|
# on macos
|
||||||
@@ -84,38 +79,39 @@ brew install lcov
|
|||||||
|
|
||||||
- genhtml. Used to convert coverage data into html pages.
|
- genhtml. Used to convert coverage data into html pages.
|
||||||
|
|
||||||
After installing all these packages, bootstrap with `melos bs`.
|
After installation of all these packages, the project can be bootstrapped using the command `melos bs`.
|
||||||
|
|
||||||
### Create a new package
|
### Create a new package
|
||||||
|
|
||||||
Create a new package in `packages/` folder.
|
Create a new package in `packages/` folder.
|
||||||
|
To create a new package in the packages/ folder, run the following command in the terminal:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mason make wyatt_package --package_name wyatt_<name> --description A new Wyatt package --flutter_only false
|
mason make wyatt_package --package_name wyatt_<name> --description A new Wyatt package --flutter_only false
|
||||||
```
|
```
|
||||||
|
|
||||||
Then bootstrap project with `melos bs` command.
|
The <name> variable in the above command is important and must be clear and understandable.
|
||||||
|
|
||||||
|
After creating the package, bootstrap the project with the `melos bs` command.
|
||||||
|
|
||||||
#### Naming
|
#### Naming
|
||||||
|
|
||||||
In the previous instructions `<name>` variable is important.
|
In the previous instructions `<name>` variable is important.
|
||||||
It have to be clear and intelligible.
|
It have to be clear and intelligible.
|
||||||
|
|
||||||
You **MUST** use underscores.
|
1. You must use underscores in the name.
|
||||||
|
2. You must use the wyatt prefix for the package name.
|
||||||
|
3. You must name the example with a specific name.
|
||||||
|
|
||||||
You **MUST** use `wyatt` prefix for package.
|
For example, if the name is "CRUD BLOC," the following naming conventions should be used:
|
||||||
|
|
||||||
You **MUST** name example with specific name.
|
1. name: crud_bloc
|
||||||
|
2. package name: wyatt_crud_bloc
|
||||||
For example, if name is CRUD BLOC
|
3. example name: crud_bloc_example
|
||||||
|
|
||||||
- name will be crud_bloc
|
|
||||||
- so the package will be: `wyatt_crud_bloc`
|
|
||||||
- and the example will be: `crud_bloc_example`
|
|
||||||
|
|
||||||
### Create issues
|
### Create issues
|
||||||
|
|
||||||
Add the issues directly related to what you want to develop and label them correctly.
|
Create an issue for each specific feature or task you want to work on and label it correctly using the following format:
|
||||||
|
|
||||||
```
|
```
|
||||||
Type(scope): issue.
|
Type(scope): issue.
|
||||||
@@ -128,18 +124,18 @@ For example, on notification bloc package :
|
|||||||
|
|
||||||
### Branches
|
### Branches
|
||||||
|
|
||||||
Master is protected. You can't push on it. Please develop your feature on another branch. The name of your branch has to match with the issue opened.
|
The master branch is protected and cannot be pushed to directly. Please create a separate branch for each feature or task, with a name that corresponds to the related issue. The branch name should follow this format:
|
||||||
|
|
||||||
`type(scope):issue`
|
`type(scope):issue`
|
||||||
|
|
||||||
Example :
|
Example :
|
||||||
Issue :
|
For the issue:
|
||||||
|
|
||||||
- `Feature(notification_bloc): add firebase messaging data source.`
|
- `Feature(notification_bloc): add firebase messaging data source.`
|
||||||
|
|
||||||
Branch related to this issue :
|
The related branch should be named:
|
||||||
|
|
||||||
- `feature(notification_bloc)/add_firebase_messaging_data_source`
|
- `notification_bloc/feat/add_firebase_messaging_data_source`
|
||||||
|
|
||||||
### Commits
|
### Commits
|
||||||
|
|
||||||
@@ -163,12 +159,11 @@ Some examples :
|
|||||||
- `docs: update readme.` = update **this** readme file.
|
- `docs: update readme.` = update **this** readme file.
|
||||||
- `fix(crud)!: fix bug in awesome() function. (#32)` = fix a bug, `!` is important and indicate `BREAKING CHANGES` linked with the 32nd issue.
|
- `fix(crud)!: fix bug in awesome() function. (#32)` = fix a bug, `!` is important and indicate `BREAKING CHANGES` linked with the 32nd issue.
|
||||||
|
|
||||||
When you have finished developing, and are ready to close the issue, close it via your commit :
|
When you have completed your development work and are ready to resolve the related issue, you can close it via your commit message by including (close #issue_number). For example:
|
||||||
|
|
||||||
`feat(auth): add AWS support. (close #31)`
|
```shell
|
||||||
|
feat(auth): add AWS support. (close #31)
|
||||||
Note that your issue will be close after merging on master.
|
```
|
||||||
Before closing the issue, please check tests and update coverage. You might run :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
melos run test:all # this will run all tests in this project
|
melos run test:all # this will run all tests in this project
|
||||||
@@ -179,45 +174,44 @@ melos run publish:validate # this will run a validation before publish packages
|
|||||||
melos run publish # this will publish packages
|
melos run publish # this will publish packages
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note that only modified package will be verified and published.
|
Please note that the issue will only be closed after it has been merged into the master branch. Before closing the issue, it is important to verify that all tests have been run and that coverage has been updated.
|
||||||
|
|
||||||
#### Merge your work
|
#### Merge your work
|
||||||
|
|
||||||
After closing your issue, some work may have been done on master in the meantime. To keep a clean git history, please rebase before opening a change request.
|
When you have completed your work and closed the related issue, it's possible that some changes may have been made to the master branch in the meantime. To maintain a clean Git history, it's recommended to rebase before creating a change request (pull request).
|
||||||
|
|
||||||
Two situations :
|
Two situations :
|
||||||
|
|
||||||
- You have not yet created your branch and have committed locally :
|
- You haven't created a branch yet and have made local commits:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git pull --rebase
|
git pull --rebase
|
||||||
```
|
```
|
||||||
|
|
||||||
- You are already working on your branch :
|
- You are already working on a branch:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git rebase -i master
|
git rebase -i master
|
||||||
```
|
```
|
||||||
|
|
||||||
If possible, please use `--fixup` on your commit in interactive rebase.
|
It's recommended to use the `--fixup` option during the interactive rebase to keep the Git history clean.
|
||||||
|
|
||||||
Then, opend your PR, get the necessary approval and merge your work. Then you're done ✅.
|
Once you have rebased, you can create a pull request, receive the necessary approvals, and then merge your work. And with that, you're done! 🎉
|
||||||
|
|
||||||
#### Update version.
|
#### Update version.
|
||||||
|
|
||||||
Once your work is on the master, you can update your package version. Please filter packages to update only your package. `--scope` is used to do it.
|
When your work has been merged into the master branch, it's time to update the package version. To update only your specific package, use the --scope option. For example, after merging changes into the `wyatt_notification_bloc` package, you can run the following command:
|
||||||
For example, after merging changes on `wyatt_otification_bloc` package, you might run :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
melos version --scope="*wyatt_notification_bloc*"
|
melos version --scope="*wyatt_notification_bloc*"
|
||||||
```
|
```
|
||||||
|
|
||||||
In fact, melos will filter all packages that match the `wyatt_notification_block` pattern.
|
This will filter all packages that match the `wyatt_notification_bloc` pattern and update only that package.
|
||||||
|
|
||||||
You can update check all packages tests by running :
|
You can then verify that all packages and their tests are working correctly by running:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
melos run test
|
melos run test:all
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Publish your package
|
#### Publish your package
|
||||||
@@ -265,14 +259,14 @@ Here you can change `package name` and `package version`.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Status
|
|
||||||
|
|
||||||

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

|

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

|
||||||
|
|
||||||
|
This repository is maintained by Wyatt Studio but work is in progress.
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"bricks":{"wyatt_clean_code":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_clean_code","ref":"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"}}}}
|
{"bricks":{"wyatt_component_template":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_component_template","ref":"7cea909470ce75b91840f479649b93f953ded596"}}}}
|
||||||
+20
-8
@@ -1,13 +1,25 @@
|
|||||||
|
# Copyright (C) 2023 WYATT GROUP
|
||||||
|
# Please see the AUTHORS file for details.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
bricks:
|
bricks:
|
||||||
wyatt_clean_code:
|
|
||||||
git:
|
|
||||||
url: "ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git"
|
|
||||||
path: bricks/wyatt_clean_code
|
|
||||||
wyatt_feature_brick:
|
|
||||||
git:
|
|
||||||
url: "ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git"
|
|
||||||
path: bricks/wyatt_feature_brick
|
|
||||||
wyatt_package_template:
|
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_template
|
path: bricks/wyatt_package_template
|
||||||
|
wyatt_component_template:
|
||||||
|
git:
|
||||||
|
url: "ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git"
|
||||||
|
path: bricks/wyatt_component_template
|
||||||
@@ -9,6 +9,6 @@ class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
|
|||||||
const CustomAppBar({super.title});
|
const CustomAppBar({super.title});
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => AppBar(
|
Widget build(BuildContext context) => AppBar(
|
||||||
title: Text(title ?? 'Title'),
|
title: Text(title?.text ?? 'Title'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
|
|||||||
const $CustomAppBarCWProxyImpl(this._value);
|
const $CustomAppBarCWProxyImpl(this._value);
|
||||||
final CustomAppBar _value;
|
final CustomAppBar _value;
|
||||||
@override
|
@override
|
||||||
CustomAppBar title(String? title) => this(title: title);
|
CustomAppBar title(TextWrapper? title) => this(title: title);
|
||||||
@override
|
@override
|
||||||
CustomAppBar leading(Widget? leading) => this(leading: leading);
|
CustomAppBar leading(Widget? leading) => this(leading: leading);
|
||||||
@override
|
@override
|
||||||
@@ -19,7 +19,7 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
|
|||||||
CustomAppBar key(Key? key) => this(key: key);
|
CustomAppBar key(Key? key) => this(key: key);
|
||||||
@override
|
@override
|
||||||
CustomAppBar call({
|
CustomAppBar call({
|
||||||
String? title,
|
TextWrapper? title,
|
||||||
Widget? leading,
|
Widget? leading,
|
||||||
List<Widget>? actions,
|
List<Widget>? actions,
|
||||||
Key? key,
|
Key? key,
|
||||||
|
|||||||
@@ -12,6 +12,6 @@ class CustomErrorWidget extends ErrorWidgetComponent
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => ColoredBox(
|
Widget build(BuildContext context) => ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Center(child: Text(error ?? 'Error')),
|
child: Center(child: Text(error?.text ?? 'Error')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ class $CustomErrorWidgetCWProxyImpl implements $ErrorWidgetComponentCWProxy {
|
|||||||
const $CustomErrorWidgetCWProxyImpl(this._value);
|
const $CustomErrorWidgetCWProxyImpl(this._value);
|
||||||
final CustomErrorWidget _value;
|
final CustomErrorWidget _value;
|
||||||
@override
|
@override
|
||||||
CustomErrorWidget error(String? error) => this(error: error);
|
CustomErrorWidget error(TextWrapper? error) => this(error: error);
|
||||||
@override
|
@override
|
||||||
CustomErrorWidget key(Key? key) => this(key: key);
|
CustomErrorWidget key(Key? key) => this(key: key);
|
||||||
@override
|
@override
|
||||||
CustomErrorWidget call({
|
CustomErrorWidget call({
|
||||||
String? error,
|
TextWrapper? error,
|
||||||
Key? key,
|
Key? key,
|
||||||
}) =>
|
}) =>
|
||||||
CustomErrorWidget(
|
CustomErrorWidget(
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
|||||||
mixin CrudMixin<Cubit extends bloc_base.Cubit,
|
mixin CrudMixin<Cubit extends bloc_base.Cubit,
|
||||||
SuccessState extends CrudSuccess> {
|
SuccessState extends CrudSuccess> {
|
||||||
Widget errorBuilder(BuildContext context, CrudError state) =>
|
Widget errorBuilder(BuildContext context, CrudError state) =>
|
||||||
context.components.errorWidget?.copyWith(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) =>
|
||||||
|
|||||||
@@ -27,6 +27,6 @@ class CustomAppBarExample extends AppBarComponent
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => AppBar(
|
Widget build(BuildContext context) => AppBar(
|
||||||
title: Text(super.title ?? ''),
|
title: Text(super.title?.text ?? ''),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,4 +14,4 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
include: package:wyatt_analysis/analysis_options.flutter.experimental.yaml
|
include: package:wyatt_analysis/analysis_options.flutter.yaml
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
targets:
|
||||||
|
$default:
|
||||||
|
builders:
|
||||||
|
# Typically the builder key is just the package name, run `pub run build_runner doctor` to check your config.
|
||||||
|
wyatt_component_copy_with_gen:component_copy_with_gen:
|
||||||
|
generate_for:
|
||||||
|
# Example glob for only the Dart files under `lib/models`
|
||||||
|
- lib/**/*.dart
|
||||||
|
- example/lib/**/*.dart
|
||||||
@@ -5,11 +5,13 @@ import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
|||||||
part 'custom_app_bar.g.dart';
|
part 'custom_app_bar.g.dart';
|
||||||
|
|
||||||
@ComponentCopyWithExtension()
|
@ComponentCopyWithExtension()
|
||||||
class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
|
class CustomAppBar extends TopAppBarComponent with $CustomAppBarCWMixin {
|
||||||
const CustomAppBar({super.title, super.key});
|
const CustomAppBar({super.title, super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => AppBar(
|
Widget build(BuildContext context) => AppBar(
|
||||||
title: Text(super.title ?? ''),
|
title: Text(
|
||||||
|
super.title?.data ?? '',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,22 +6,85 @@ part of 'custom_app_bar.dart';
|
|||||||
// ComponentCopyWithGenerator
|
// ComponentCopyWithGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
|
class $CustomAppBarCWProxyImpl implements $TopAppBarComponentCWProxy {
|
||||||
const $CustomAppBarCWProxyImpl(this._value);
|
const $CustomAppBarCWProxyImpl(this._value);
|
||||||
final CustomAppBar _value;
|
final CustomAppBar _value;
|
||||||
@override
|
@override
|
||||||
CustomAppBar title(String? title) => this(title: title);
|
CustomAppBar title(TextWrapper? title) => this(title: title);
|
||||||
|
@override
|
||||||
|
CustomAppBar centerTitle(bool? centerTitle) => this(centerTitle: centerTitle);
|
||||||
|
@override
|
||||||
|
CustomAppBar shape(ShapeBorder? shape) => this(shape: shape);
|
||||||
|
@override
|
||||||
|
CustomAppBar systemOverlayStyle(SystemUiOverlayStyle? systemOverlayStyle) =>
|
||||||
|
this(systemOverlayStyle: systemOverlayStyle);
|
||||||
|
@override
|
||||||
|
CustomAppBar automaticallyImplyLeading(bool? automaticallyImplyLeading) =>
|
||||||
|
this(automaticallyImplyLeading: automaticallyImplyLeading);
|
||||||
|
@override
|
||||||
|
CustomAppBar flexibleSpace(Widget? flexibleSpace) =>
|
||||||
|
this(flexibleSpace: flexibleSpace);
|
||||||
|
@override
|
||||||
|
CustomAppBar bottom(PreferredSizeWidget? bottom) => this(bottom: bottom);
|
||||||
|
@override
|
||||||
|
CustomAppBar elevation(double? elevation) => this(elevation: elevation);
|
||||||
|
@override
|
||||||
|
CustomAppBar scrolledUnderElevation(double? scrolledUnderElevation) =>
|
||||||
|
this(scrolledUnderElevation: scrolledUnderElevation);
|
||||||
|
@override
|
||||||
|
CustomAppBar shadowColor(Color? shadowColor) =>
|
||||||
|
this(shadowColor: shadowColor);
|
||||||
|
@override
|
||||||
|
CustomAppBar surfaceTintColor(Color? surfaceTintColor) =>
|
||||||
|
this(surfaceTintColor: surfaceTintColor);
|
||||||
|
@override
|
||||||
|
CustomAppBar backgroundColor(MultiColor? backgroundColor) =>
|
||||||
|
this(backgroundColor: backgroundColor);
|
||||||
|
@override
|
||||||
|
CustomAppBar iconTheme(IconThemeData? iconTheme) =>
|
||||||
|
this(iconTheme: iconTheme);
|
||||||
|
@override
|
||||||
|
CustomAppBar primary(bool? primary) => this(primary: primary);
|
||||||
|
@override
|
||||||
|
CustomAppBar excludeHeaderSemantics(bool? excludeHeaderSemantics) =>
|
||||||
|
this(excludeHeaderSemantics: excludeHeaderSemantics);
|
||||||
|
@override
|
||||||
|
CustomAppBar toolbarHeight(double? toolbarHeight) =>
|
||||||
|
this(toolbarHeight: toolbarHeight);
|
||||||
|
@override
|
||||||
|
CustomAppBar leadingWidth(double? leadingWidth) =>
|
||||||
|
this(leadingWidth: leadingWidth);
|
||||||
@override
|
@override
|
||||||
CustomAppBar leading(Widget? leading) => this(leading: leading);
|
CustomAppBar leading(Widget? leading) => this(leading: leading);
|
||||||
@override
|
@override
|
||||||
CustomAppBar actions(List<Widget>? actions) => this(actions: actions);
|
CustomAppBar actions(List<Widget>? actions) => this(actions: actions);
|
||||||
@override
|
@override
|
||||||
|
CustomAppBar expandedWidget(List<Widget>? expandedWidget) =>
|
||||||
|
this(expandedWidget: expandedWidget);
|
||||||
|
@override
|
||||||
CustomAppBar key(Key? key) => this(key: key);
|
CustomAppBar key(Key? key) => this(key: key);
|
||||||
@override
|
@override
|
||||||
CustomAppBar call({
|
CustomAppBar call({
|
||||||
String? title,
|
TextWrapper? title,
|
||||||
|
bool? centerTitle,
|
||||||
|
ShapeBorder? shape,
|
||||||
|
SystemUiOverlayStyle? systemOverlayStyle,
|
||||||
|
bool? automaticallyImplyLeading,
|
||||||
|
Widget? flexibleSpace,
|
||||||
|
PreferredSizeWidget? bottom,
|
||||||
|
double? elevation,
|
||||||
|
double? scrolledUnderElevation,
|
||||||
|
Color? shadowColor,
|
||||||
|
Color? surfaceTintColor,
|
||||||
|
MultiColor? backgroundColor,
|
||||||
|
IconThemeData? iconTheme,
|
||||||
|
bool? primary,
|
||||||
|
bool? excludeHeaderSemantics,
|
||||||
|
double? toolbarHeight,
|
||||||
|
double? leadingWidth,
|
||||||
Widget? leading,
|
Widget? leading,
|
||||||
List<Widget>? actions,
|
List<Widget>? actions,
|
||||||
|
List<Widget>? expandedWidget,
|
||||||
Key? key,
|
Key? key,
|
||||||
}) =>
|
}) =>
|
||||||
CustomAppBar(
|
CustomAppBar(
|
||||||
@@ -31,6 +94,6 @@ class $CustomAppBarCWProxyImpl implements $AppBarComponentCWProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mixin $CustomAppBarCWMixin on Component {
|
mixin $CustomAppBarCWMixin on Component {
|
||||||
$AppBarComponentCWProxy get copyWith =>
|
$TopAppBarComponentCWProxy get copyWith =>
|
||||||
$CustomAppBarCWProxyImpl(this as CustomAppBar);
|
$CustomAppBarCWProxyImpl(this as CustomAppBar);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,6 @@ class CustomErrorWidget extends ErrorWidgetComponent
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => ColoredBox(
|
Widget build(BuildContext context) => ColoredBox(
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Center(child: Text(error ?? 'Error')),
|
child: Center(child: Text(error?.data ?? 'Error')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ class $CustomErrorWidgetCWProxyImpl implements $ErrorWidgetComponentCWProxy {
|
|||||||
const $CustomErrorWidgetCWProxyImpl(this._value);
|
const $CustomErrorWidgetCWProxyImpl(this._value);
|
||||||
final CustomErrorWidget _value;
|
final CustomErrorWidget _value;
|
||||||
@override
|
@override
|
||||||
CustomErrorWidget error(String? error) => this(error: error);
|
CustomErrorWidget error(TextWrapper? error) => this(error: error);
|
||||||
@override
|
@override
|
||||||
CustomErrorWidget key(Key? key) => this(key: key);
|
CustomErrorWidget key(Key? key) => this(key: key);
|
||||||
@override
|
@override
|
||||||
CustomErrorWidget call({
|
CustomErrorWidget call({
|
||||||
String? error,
|
TextWrapper? error,
|
||||||
Key? key,
|
Key? key,
|
||||||
}) =>
|
}) =>
|
||||||
CustomErrorWidget(
|
CustomErrorWidget(
|
||||||
|
|||||||
@@ -27,8 +27,7 @@ class MyApp extends StatelessWidget {
|
|||||||
|
|
||||||
// This widget is the root of your application.
|
// This widget is the root of your application.
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) => ComponentTheme(
|
||||||
return ComponentTheme(
|
|
||||||
componentThemeWidget: AppThemeComponent.components,
|
componentThemeWidget: AppThemeComponent.components,
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
title: 'Wyatt Ui Components Example',
|
title: 'Wyatt Ui Components Example',
|
||||||
@@ -41,7 +40,6 @@ class MyApp extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
class Home extends StatelessWidget {
|
class Home extends StatelessWidget {
|
||||||
const Home({super.key});
|
const Home({super.key});
|
||||||
@@ -50,14 +48,15 @@ class Home extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) => Scaffold(
|
Widget build(BuildContext context) => Scaffold(
|
||||||
appBar: PreferredSize(
|
appBar: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(60),
|
preferredSize: const Size.fromHeight(60),
|
||||||
child: context.components.appBar?.copyWith.title('Example title') ??
|
child: context.components.appBar?.copyWith
|
||||||
|
.title('Example title'.wrap()) ??
|
||||||
const SizedBox.shrink(),
|
const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: context.components.errorWidget
|
child: context.components.errorWidget
|
||||||
?.copyWith(error: 'Example erreur') ??
|
?.copyWith(error: 'Example erreur'.wrap()) ??
|
||||||
const SizedBox.shrink(),
|
const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
|
|||||||
@@ -14,4 +14,8 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
export 'enums/enums.dart';
|
||||||
export 'extensions/build_context_extensions.dart';
|
export 'extensions/build_context_extensions.dart';
|
||||||
|
export 'extensions/string_extension.dart';
|
||||||
|
export 'mixins/copy_with_mixin.dart';
|
||||||
|
export 'utils/utils.dart';
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
// 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/>.
|
||||||
|
|
||||||
|
enum ControlState {
|
||||||
|
/// When the control is disabled and un-clickable
|
||||||
|
disabled,
|
||||||
|
|
||||||
|
/// Default state of a control
|
||||||
|
normal,
|
||||||
|
|
||||||
|
/// When the mouse cursor is hover the control
|
||||||
|
hovered,
|
||||||
|
|
||||||
|
/// When the control is clicked
|
||||||
|
tapped,
|
||||||
|
|
||||||
|
/// When the control is focused (like pressing tab)
|
||||||
|
focused;
|
||||||
|
|
||||||
|
bool isDisabled() => this == ControlState.disabled;
|
||||||
|
bool isEnabled() => this != ControlState.disabled;
|
||||||
|
bool isHovered() => this == ControlState.hovered;
|
||||||
|
bool isTapped() => this == ControlState.tapped;
|
||||||
|
bool isFocused() => this == ControlState.focused;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// 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 './control_state.dart';
|
||||||
|
export './status_state.dart';
|
||||||
@@ -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/>.
|
||||||
|
|
||||||
|
enum StatusState {
|
||||||
|
initial,
|
||||||
|
success,
|
||||||
|
loading,
|
||||||
|
error;
|
||||||
|
}
|
||||||
@@ -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:flutter/widgets.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
extension StringExtension on String? {
|
||||||
|
TextWrapper? wrap({TextStyle? style, MultiColor? gradientColors}) =>
|
||||||
|
this != null
|
||||||
|
? TextWrapper(this!, style: style, gradientColors: gradientColors)
|
||||||
|
: null;
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
|
||||||
|
class MultiColor {
|
||||||
|
const MultiColor(this._colors) : _color = null;
|
||||||
|
const MultiColor.single(this._color) : _colors = null;
|
||||||
|
|
||||||
|
final List<Color>? _colors;
|
||||||
|
final Color? _color;
|
||||||
|
|
||||||
|
Color get color => _color != null
|
||||||
|
? _color!
|
||||||
|
: _colors?.isNotEmpty ?? false
|
||||||
|
? _colors!.first
|
||||||
|
: throw IndexError.withLength(
|
||||||
|
0,
|
||||||
|
_colors?.length ?? 0,
|
||||||
|
message: '_color is not defined or _colors is empty.',
|
||||||
|
);
|
||||||
|
|
||||||
|
List<Color> get colors => _colors ?? [];
|
||||||
|
|
||||||
|
bool get isGradient => (_colors?.length ?? 0) > 1;
|
||||||
|
bool get isColor => _color != null || isGradient;
|
||||||
|
|
||||||
|
static MultiColor? lerp(MultiColor? a, MultiColor? b, double t) {
|
||||||
|
if (a == null && b == null) {
|
||||||
|
return null;
|
||||||
|
} else if (a == null) {
|
||||||
|
return b;
|
||||||
|
} else if (b == null) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
if (a.isColor && b.isColor) {
|
||||||
|
return MultiColor.single(Color.lerp(a.color, b.color, t));
|
||||||
|
} else if (a.isColor && b.isGradient) {
|
||||||
|
return MultiColor(
|
||||||
|
b.colors
|
||||||
|
.map((e) => Color.lerp(a.color, e, t))
|
||||||
|
.whereType<Color>()
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
} else if (a.isGradient && b.isColor) {
|
||||||
|
return MultiColor(
|
||||||
|
a.colors
|
||||||
|
.map((e) => Color.lerp(b.color, e, t))
|
||||||
|
.whereType<Color>()
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
} else if (a.isGradient && b.isGradient) {
|
||||||
|
final colors = List<Color>.empty(growable: true);
|
||||||
|
final shortestList =
|
||||||
|
(a.colors.length > b.colors.length) ? b.colors : a.colors;
|
||||||
|
for (int i = 0; i < shortestList.length; i++) {
|
||||||
|
final lerpColor = Color.lerp(a.colors[i], b.colors[i], t);
|
||||||
|
if (lerpColor != null) {
|
||||||
|
colors.add(lerpColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return MultiColor(colors);
|
||||||
|
}
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'MultiColor(_colors: $_colors, _color: $_color)';
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
// 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_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
/// Wraps [String] and [TextStyle] into one object that can be
|
||||||
|
/// a [Text] or a [RichText].
|
||||||
|
class TextWrapper {
|
||||||
|
const TextWrapper(
|
||||||
|
this.data, {
|
||||||
|
this.style,
|
||||||
|
this.gradientColors,
|
||||||
|
this.textAlign,
|
||||||
|
this.textDirection,
|
||||||
|
this.softWrap,
|
||||||
|
this.overflow,
|
||||||
|
this.maxLines,
|
||||||
|
this.selectionColor,
|
||||||
|
});
|
||||||
|
|
||||||
|
const TextWrapper.text(this.data)
|
||||||
|
: style = null,
|
||||||
|
gradientColors = null,
|
||||||
|
textAlign = null,
|
||||||
|
textDirection = null,
|
||||||
|
softWrap = null,
|
||||||
|
overflow = null,
|
||||||
|
maxLines = null,
|
||||||
|
selectionColor = null;
|
||||||
|
|
||||||
|
/// Text to be displayed
|
||||||
|
final String data;
|
||||||
|
|
||||||
|
/// Style of the text
|
||||||
|
final TextStyle? style;
|
||||||
|
|
||||||
|
/// Colors of the gradient, if any
|
||||||
|
final MultiColor? gradientColors;
|
||||||
|
|
||||||
|
/// How the text should be aligned horizontally.
|
||||||
|
final TextAlign? textAlign;
|
||||||
|
|
||||||
|
/// The directionality of the text.
|
||||||
|
///
|
||||||
|
/// This decides how [textAlign] values like [TextAlign.start] and
|
||||||
|
/// [TextAlign.end] are interpreted.
|
||||||
|
///
|
||||||
|
/// This is also used to disambiguate how to render bidirectional text. For
|
||||||
|
/// example, if the [data] is an English phrase followed by a Hebrew phrase,
|
||||||
|
/// in a [TextDirection.ltr] context the English phrase will be on the left
|
||||||
|
/// and the Hebrew phrase to its right, while in a [TextDirection.rtl]
|
||||||
|
/// context, the English phrase will be on the right and the Hebrew phrase on
|
||||||
|
/// its left.
|
||||||
|
///
|
||||||
|
/// Defaults to the ambient [Directionality], if any.
|
||||||
|
final TextDirection? textDirection;
|
||||||
|
|
||||||
|
/// Whether the text should break at soft line breaks.
|
||||||
|
///
|
||||||
|
/// If false, the glyphs in the text will be positioned as if there was
|
||||||
|
/// unlimited horizontal space.
|
||||||
|
final bool? softWrap;
|
||||||
|
|
||||||
|
/// How visual overflow should be handled.
|
||||||
|
///
|
||||||
|
/// If this is null [TextStyle.overflow] will be used, otherwise the value
|
||||||
|
/// from the nearest [DefaultTextStyle] ancestor will be used.
|
||||||
|
final TextOverflow? overflow;
|
||||||
|
|
||||||
|
/// An optional maximum number of lines for the text to span, wrapping if
|
||||||
|
/// necessary.
|
||||||
|
/// If the text exceeds the given number of lines, it will be truncated
|
||||||
|
/// according to [overflow].
|
||||||
|
///
|
||||||
|
/// If this is 1, text will not wrap. Otherwise, text will be wrapped at the
|
||||||
|
/// edge of the box.
|
||||||
|
///
|
||||||
|
/// If this is null, but there is an ambient [DefaultTextStyle] that specifies
|
||||||
|
/// an explicit number for its [DefaultTextStyle.maxLines], then the
|
||||||
|
/// [DefaultTextStyle] value will take precedence. You can use a [RichText]
|
||||||
|
/// widget directly to entirely override the [DefaultTextStyle].
|
||||||
|
final int? maxLines;
|
||||||
|
|
||||||
|
/// The color to use when painting the selection.
|
||||||
|
///
|
||||||
|
/// This is ignored if [SelectionContainer.maybeOf] returns null
|
||||||
|
/// in the [BuildContext] of the [Text] widget.
|
||||||
|
///
|
||||||
|
/// If null, the ambient [DefaultSelectionStyle] is used (if any); failing
|
||||||
|
/// that, the selection color defaults to [DefaultSelectionStyle.defaultColor]
|
||||||
|
/// (semi-transparent grey).
|
||||||
|
final Color? selectionColor;
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
// Copyright (C) 2023 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// super 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.
|
||||||
|
//
|
||||||
|
// super 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 super program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
/// A helper class for getting theme elements.
|
||||||
|
abstract class ThemeHelper {
|
||||||
|
/// Gets a theme element from a list of styles.
|
||||||
|
/// Styles are checked in order, and the first one that passes the
|
||||||
|
/// [valueValidator] is returned.
|
||||||
|
/// Style elements are transformed using the [transform] function.
|
||||||
|
///
|
||||||
|
/// [styles]: A list of styles that need to be checked.
|
||||||
|
/// [transform]: A function that transforms each style element
|
||||||
|
/// to a [T] type.
|
||||||
|
/// [valueValidator]: An optional validation function that
|
||||||
|
/// determines if a style element is valid.
|
||||||
|
/// [combine]: A function that combines two [P] type objects to create
|
||||||
|
/// a new object.
|
||||||
|
|
||||||
|
static T? getThemeElement<P, T>(
|
||||||
|
List<P?>? styles, {
|
||||||
|
required T? Function(P?)? transform,
|
||||||
|
bool? Function(P?)? valueValidator,
|
||||||
|
P? Function(P?, P?)? combine,
|
||||||
|
}) {
|
||||||
|
final Iterable<P?>? validStyles = styles?.where(
|
||||||
|
(element) => valueValidator?.call(element) ?? (element != null),
|
||||||
|
);
|
||||||
|
return (validStyles?.isNotEmpty ?? false)
|
||||||
|
? transform?.call(
|
||||||
|
validStyles?.reduce(
|
||||||
|
(value, element) => combine?.call(value, element) ?? value,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 'package:flutter/material.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/core/utils/theme_helper.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/theme_style.dart';
|
||||||
|
|
||||||
|
/// {@template theme_resolver}
|
||||||
|
/// In charge of theme negotiation and merge.
|
||||||
|
///
|
||||||
|
/// When you build a component `Component({double? radius})`.
|
||||||
|
/// You have several possibilities:
|
||||||
|
/// 1) Pass the "radius" into the constructor, `Component(radius: 12)`.
|
||||||
|
/// 2) Set up a theme extension `ComponentThemeExtension(radius: 15)`.
|
||||||
|
/// 3) Let `wyatt_ui_kit` "negotiate" and try to find a suitable style in the
|
||||||
|
/// flutter theme.
|
||||||
|
///
|
||||||
|
/// If this negotiation phase fails, then:
|
||||||
|
/// - If the value is mandatory: a hardcoded value in "wyatt_ui_kit" is chosen.
|
||||||
|
/// - If not, the style is simply not applied.
|
||||||
|
/// {@endtemplate}
|
||||||
|
abstract class ThemeResolver<S extends ThemeStyle<S>, T, E> {
|
||||||
|
/// {@macro theme_resolver}
|
||||||
|
const ThemeResolver();
|
||||||
|
|
||||||
|
S? Function(BuildContext context, {E? extra}) get customStyleFn;
|
||||||
|
|
||||||
|
/// Compute default value from Flutter Theme or with hardcoded values.
|
||||||
|
S computeDefaultValue(
|
||||||
|
BuildContext context, {
|
||||||
|
E? extra,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Compute extension value from custom component extension.
|
||||||
|
S? computeExtensionValueFn(
|
||||||
|
BuildContext context,
|
||||||
|
T? themeExtension, {
|
||||||
|
E? extra,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Choose most suitable style for a given context.
|
||||||
|
S negotiate(BuildContext context, {E? extra}) {
|
||||||
|
final style = computeDefaultValue(context, extra: extra);
|
||||||
|
return ThemeHelper.getThemeElement<S, S>(
|
||||||
|
[
|
||||||
|
style,
|
||||||
|
computeExtensionValueFn(
|
||||||
|
context,
|
||||||
|
Theme.of(context).extension<T>(),
|
||||||
|
extra: extra,
|
||||||
|
),
|
||||||
|
customStyleFn(context, extra: extra)
|
||||||
|
],
|
||||||
|
transform: (value) => value,
|
||||||
|
combine: (value, element) => value?.mergeWith(element),
|
||||||
|
) ??
|
||||||
|
style;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
// 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 'multi_color.dart';
|
||||||
|
export 'text_wrapper.dart';
|
||||||
|
export 'theme_helper.dart';
|
||||||
|
export 'theme_resolver.dart';
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'app_bar_component.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// ComponentProxyGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
abstract class $AppBarComponentCWProxy {
|
|
||||||
AppBarComponent title(String? title);
|
|
||||||
AppBarComponent leading(Widget? leading);
|
|
||||||
AppBarComponent actions(List<Widget>? actions);
|
|
||||||
AppBarComponent key(Key? key);
|
|
||||||
AppBarComponent call({
|
|
||||||
String? title,
|
|
||||||
Widget? leading,
|
|
||||||
List<Widget>? actions,
|
|
||||||
Key? key,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// 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 './bottom_navigation_bar_component.dart';
|
||||||
|
export './top_navigation_bar_component.dart';
|
||||||
|
export 'top_app_bar_component.dart';
|
||||||
+4
-4
@@ -1,4 +1,3 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
// Copyright (C) 2023 WYATT GROUP
|
// Copyright (C) 2023 WYATT GROUP
|
||||||
// Please see the AUTHORS file for details.
|
// Please see the AUTHORS file for details.
|
||||||
//
|
//
|
||||||
@@ -15,20 +14,21 @@ import 'package:flutter/material.dart';
|
|||||||
// 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/material.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
|
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
|
||||||
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
|
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
|
||||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
|
||||||
|
|
||||||
part 'bottom_navigation_bar_component.g.dart';
|
part 'bottom_navigation_bar_component.g.dart';
|
||||||
|
|
||||||
@ComponentProxyExtension()
|
@ComponentProxyExtension()
|
||||||
abstract class BottomNavigationBarComponent extends Component
|
abstract class BottomNavigationBarComponent extends Component
|
||||||
with CopyWithMixin<$BottomNavigationBarComponentCWProxy> {
|
with CopyWithMixin<$BottomNavigationBarComponentCWProxy> {
|
||||||
final int currentIndex;
|
|
||||||
final void Function(BuildContext, int)? onTap;
|
|
||||||
const BottomNavigationBarComponent({
|
const BottomNavigationBarComponent({
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.currentIndex = 0,
|
this.currentIndex = 0,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
final int currentIndex;
|
||||||
|
final void Function(BuildContext, int)? onTap;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
// Copyright (C) 2023 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// super 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.
|
||||||
|
//
|
||||||
|
// super 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 super program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/bars/top_bar_component.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'top_app_bar_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class TopAppBarComponent extends TopBarComponent
|
||||||
|
with CopyWithMixin<$TopAppBarComponentCWProxy> {
|
||||||
|
const TopAppBarComponent({
|
||||||
|
this.title,
|
||||||
|
this.centerTitle,
|
||||||
|
super.shape,
|
||||||
|
super.systemOverlayStyle,
|
||||||
|
super.automaticallyImplyLeading,
|
||||||
|
super.flexibleSpace,
|
||||||
|
super.bottom,
|
||||||
|
super.elevation,
|
||||||
|
super.scrolledUnderElevation,
|
||||||
|
super.shadowColor,
|
||||||
|
super.surfaceTintColor,
|
||||||
|
super.backgroundColor,
|
||||||
|
super.iconTheme,
|
||||||
|
super.primary,
|
||||||
|
super.excludeHeaderSemantics,
|
||||||
|
super.toolbarHeight,
|
||||||
|
super.leadingWidth,
|
||||||
|
super.leading,
|
||||||
|
super.actions,
|
||||||
|
super.expandedWidget,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
final TextWrapper? title;
|
||||||
|
final bool? centerTitle;
|
||||||
|
}
|
||||||
+55
@@ -0,0 +1,55 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'top_app_bar_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $TopAppBarComponentCWProxy {
|
||||||
|
TopAppBarComponent title(TextWrapper? title);
|
||||||
|
TopAppBarComponent centerTitle(bool? centerTitle);
|
||||||
|
TopAppBarComponent shape(ShapeBorder? shape);
|
||||||
|
TopAppBarComponent systemOverlayStyle(
|
||||||
|
SystemUiOverlayStyle? systemOverlayStyle);
|
||||||
|
TopAppBarComponent automaticallyImplyLeading(bool? automaticallyImplyLeading);
|
||||||
|
TopAppBarComponent flexibleSpace(Widget? flexibleSpace);
|
||||||
|
TopAppBarComponent bottom(PreferredSizeWidget? bottom);
|
||||||
|
TopAppBarComponent elevation(double? elevation);
|
||||||
|
TopAppBarComponent scrolledUnderElevation(double? scrolledUnderElevation);
|
||||||
|
TopAppBarComponent shadowColor(Color? shadowColor);
|
||||||
|
TopAppBarComponent surfaceTintColor(Color? surfaceTintColor);
|
||||||
|
TopAppBarComponent backgroundColor(MultiColor? backgroundColor);
|
||||||
|
TopAppBarComponent iconTheme(IconThemeData? iconTheme);
|
||||||
|
TopAppBarComponent primary(bool? primary);
|
||||||
|
TopAppBarComponent excludeHeaderSemantics(bool? excludeHeaderSemantics);
|
||||||
|
TopAppBarComponent toolbarHeight(double? toolbarHeight);
|
||||||
|
TopAppBarComponent leadingWidth(double? leadingWidth);
|
||||||
|
TopAppBarComponent leading(Widget? leading);
|
||||||
|
TopAppBarComponent actions(List<Widget>? actions);
|
||||||
|
TopAppBarComponent expandedWidget(List<Widget>? expandedWidget);
|
||||||
|
TopAppBarComponent key(Key? key);
|
||||||
|
TopAppBarComponent call({
|
||||||
|
TextWrapper? title,
|
||||||
|
bool? centerTitle,
|
||||||
|
ShapeBorder? shape,
|
||||||
|
SystemUiOverlayStyle? systemOverlayStyle,
|
||||||
|
bool? automaticallyImplyLeading,
|
||||||
|
Widget? flexibleSpace,
|
||||||
|
PreferredSizeWidget? bottom,
|
||||||
|
double? elevation,
|
||||||
|
double? scrolledUnderElevation,
|
||||||
|
Color? shadowColor,
|
||||||
|
Color? surfaceTintColor,
|
||||||
|
MultiColor? backgroundColor,
|
||||||
|
IconThemeData? iconTheme,
|
||||||
|
bool? primary,
|
||||||
|
bool? excludeHeaderSemantics,
|
||||||
|
double? toolbarHeight,
|
||||||
|
double? leadingWidth,
|
||||||
|
Widget? leading,
|
||||||
|
List<Widget>? actions,
|
||||||
|
List<Widget>? expandedWidget,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
// 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:flutter/services.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
abstract class TopBarComponent extends Component {
|
||||||
|
const TopBarComponent({
|
||||||
|
this.leading,
|
||||||
|
this.actions,
|
||||||
|
this.automaticallyImplyLeading,
|
||||||
|
this.flexibleSpace,
|
||||||
|
this.bottom,
|
||||||
|
this.elevation,
|
||||||
|
this.scrolledUnderElevation,
|
||||||
|
this.shadowColor,
|
||||||
|
this.surfaceTintColor,
|
||||||
|
this.backgroundColor,
|
||||||
|
this.iconTheme,
|
||||||
|
this.primary,
|
||||||
|
this.excludeHeaderSemantics,
|
||||||
|
this.toolbarHeight,
|
||||||
|
this.leadingWidth,
|
||||||
|
this.systemOverlayStyle,
|
||||||
|
this.shape,
|
||||||
|
this.expandedWidget,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
final Widget? leading;
|
||||||
|
final List<Widget>? actions;
|
||||||
|
final bool? automaticallyImplyLeading;
|
||||||
|
final Widget? flexibleSpace;
|
||||||
|
final PreferredSizeWidget? bottom;
|
||||||
|
final double? elevation;
|
||||||
|
final double? scrolledUnderElevation;
|
||||||
|
final Color? shadowColor;
|
||||||
|
final Color? surfaceTintColor;
|
||||||
|
final MultiColor? backgroundColor;
|
||||||
|
final IconThemeData? iconTheme;
|
||||||
|
final bool? primary;
|
||||||
|
final bool? excludeHeaderSemantics;
|
||||||
|
final double? toolbarHeight;
|
||||||
|
final double? leadingWidth;
|
||||||
|
final SystemUiOverlayStyle? systemOverlayStyle;
|
||||||
|
final ShapeBorder? shape;
|
||||||
|
final List<Widget>? expandedWidget;
|
||||||
|
}
|
||||||
+56
@@ -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/>.
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/bars/top_bar_component.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'top_navigation_bar_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class TopNavigationBarComponent extends TopBarComponent
|
||||||
|
with CopyWithMixin<$TopNavigationBarComponentCWProxy> {
|
||||||
|
const TopNavigationBarComponent({
|
||||||
|
this.navigationItems,
|
||||||
|
this.onTap,
|
||||||
|
this.currentIndex = 0,
|
||||||
|
super.shape,
|
||||||
|
super.systemOverlayStyle,
|
||||||
|
super.automaticallyImplyLeading,
|
||||||
|
super.flexibleSpace,
|
||||||
|
super.bottom,
|
||||||
|
super.elevation,
|
||||||
|
super.scrolledUnderElevation,
|
||||||
|
super.shadowColor,
|
||||||
|
super.surfaceTintColor,
|
||||||
|
super.backgroundColor,
|
||||||
|
super.iconTheme,
|
||||||
|
super.primary,
|
||||||
|
super.excludeHeaderSemantics,
|
||||||
|
super.toolbarHeight,
|
||||||
|
super.leadingWidth,
|
||||||
|
super.leading,
|
||||||
|
super.actions,
|
||||||
|
super.expandedWidget,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
final List<TextWrapper>? navigationItems;
|
||||||
|
final int currentIndex;
|
||||||
|
final void Function(BuildContext, int)? onTap;
|
||||||
|
}
|
||||||
+60
@@ -0,0 +1,60 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'top_navigation_bar_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $TopNavigationBarComponentCWProxy {
|
||||||
|
TopNavigationBarComponent navigationItems(List<TextWrapper>? navigationItems);
|
||||||
|
TopNavigationBarComponent onTap(void Function(BuildContext, int)? onTap);
|
||||||
|
TopNavigationBarComponent currentIndex(int? currentIndex);
|
||||||
|
TopNavigationBarComponent shape(ShapeBorder? shape);
|
||||||
|
TopNavigationBarComponent systemOverlayStyle(
|
||||||
|
SystemUiOverlayStyle? systemOverlayStyle);
|
||||||
|
TopNavigationBarComponent automaticallyImplyLeading(
|
||||||
|
bool? automaticallyImplyLeading);
|
||||||
|
TopNavigationBarComponent flexibleSpace(Widget? flexibleSpace);
|
||||||
|
TopNavigationBarComponent bottom(PreferredSizeWidget? bottom);
|
||||||
|
TopNavigationBarComponent elevation(double? elevation);
|
||||||
|
TopNavigationBarComponent scrolledUnderElevation(
|
||||||
|
double? scrolledUnderElevation);
|
||||||
|
TopNavigationBarComponent shadowColor(Color? shadowColor);
|
||||||
|
TopNavigationBarComponent surfaceTintColor(Color? surfaceTintColor);
|
||||||
|
TopNavigationBarComponent backgroundColor(MultiColor? backgroundColor);
|
||||||
|
TopNavigationBarComponent iconTheme(IconThemeData? iconTheme);
|
||||||
|
TopNavigationBarComponent primary(bool? primary);
|
||||||
|
TopNavigationBarComponent excludeHeaderSemantics(
|
||||||
|
bool? excludeHeaderSemantics);
|
||||||
|
TopNavigationBarComponent toolbarHeight(double? toolbarHeight);
|
||||||
|
TopNavigationBarComponent leadingWidth(double? leadingWidth);
|
||||||
|
TopNavigationBarComponent leading(Widget? leading);
|
||||||
|
TopNavigationBarComponent actions(List<Widget>? actions);
|
||||||
|
TopNavigationBarComponent expandedWidget(List<Widget>? expandedWidget);
|
||||||
|
TopNavigationBarComponent key(Key? key);
|
||||||
|
TopNavigationBarComponent call({
|
||||||
|
List<TextWrapper>? navigationItems,
|
||||||
|
void Function(BuildContext, int)? onTap,
|
||||||
|
int? currentIndex,
|
||||||
|
ShapeBorder? shape,
|
||||||
|
SystemUiOverlayStyle? systemOverlayStyle,
|
||||||
|
bool? automaticallyImplyLeading,
|
||||||
|
Widget? flexibleSpace,
|
||||||
|
PreferredSizeWidget? bottom,
|
||||||
|
double? elevation,
|
||||||
|
double? scrolledUnderElevation,
|
||||||
|
Color? shadowColor,
|
||||||
|
Color? surfaceTintColor,
|
||||||
|
MultiColor? backgroundColor,
|
||||||
|
IconThemeData? iconTheme,
|
||||||
|
bool? primary,
|
||||||
|
bool? excludeHeaderSemantics,
|
||||||
|
double? toolbarHeight,
|
||||||
|
double? leadingWidth,
|
||||||
|
Widget? leading,
|
||||||
|
List<Widget>? actions,
|
||||||
|
List<Widget>? expandedWidget,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -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/>.
|
||||||
|
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
abstract class ButtonComponent extends Component {
|
||||||
|
const ButtonComponent({
|
||||||
|
this.disabledStyle,
|
||||||
|
this.normalStyle,
|
||||||
|
this.hoveredStyle,
|
||||||
|
this.focusedStyle,
|
||||||
|
this.tappedStyle,
|
||||||
|
this.selectedStyle,
|
||||||
|
this.invalidStyle,
|
||||||
|
this.onPressed,
|
||||||
|
super.themeResolver,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Style of this button in disabled state
|
||||||
|
final ButtonStyle<dynamic>? disabledStyle;
|
||||||
|
|
||||||
|
/// Style of this button in normal state
|
||||||
|
final ButtonStyle<dynamic>? normalStyle;
|
||||||
|
|
||||||
|
/// Style of this button in hovered state
|
||||||
|
final ButtonStyle<dynamic>? hoveredStyle;
|
||||||
|
|
||||||
|
/// Style of this button in focused state
|
||||||
|
final ButtonStyle<dynamic>? focusedStyle;
|
||||||
|
|
||||||
|
/// Style of this button in tapped state
|
||||||
|
final ButtonStyle<dynamic>? tappedStyle;
|
||||||
|
|
||||||
|
/// Style of this button in selected state
|
||||||
|
final ButtonStyle<dynamic>? selectedStyle;
|
||||||
|
|
||||||
|
/// Style of this button in invalid state
|
||||||
|
final ButtonStyle<dynamic>? invalidStyle;
|
||||||
|
|
||||||
|
/// Callback on button press
|
||||||
|
final void Function(ControlState state)? onPressed;
|
||||||
|
}
|
||||||
@@ -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 'package:flutter/widgets.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/core/utils/multi_color.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/theme_style.dart';
|
||||||
|
|
||||||
|
abstract class ButtonStyle<T> extends ThemeStyle<T> {
|
||||||
|
const ButtonStyle({
|
||||||
|
this.radius,
|
||||||
|
this.padding,
|
||||||
|
this.foregroundColors,
|
||||||
|
this.backgroundColors,
|
||||||
|
this.borderColors,
|
||||||
|
this.stroke,
|
||||||
|
this.shadow,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Button radius
|
||||||
|
///
|
||||||
|
/// Default to `BorderRadius.all(Radius.circular(4.0))`
|
||||||
|
final BorderRadiusGeometry? radius;
|
||||||
|
|
||||||
|
/// Padding and gaps of this button
|
||||||
|
///
|
||||||
|
/// Default to `ButtonTheme.padding`
|
||||||
|
final EdgeInsetsGeometry? padding;
|
||||||
|
|
||||||
|
/// Button foreground gradient colors (from left to right)
|
||||||
|
///
|
||||||
|
/// Default to `Theme.colorScheme.onPrimary`
|
||||||
|
final MultiColor? foregroundColors;
|
||||||
|
|
||||||
|
/// Button background gradient colors (from left to right)
|
||||||
|
///
|
||||||
|
/// Default to `Theme.colorScheme.primary`
|
||||||
|
final MultiColor? backgroundColors;
|
||||||
|
|
||||||
|
/// Border colors (from left to right).
|
||||||
|
///
|
||||||
|
/// Default to `null`
|
||||||
|
final MultiColor? borderColors;
|
||||||
|
|
||||||
|
/// Stroke of the border
|
||||||
|
///
|
||||||
|
/// Default to `null`
|
||||||
|
final double? stroke;
|
||||||
|
|
||||||
|
/// Drop shadow
|
||||||
|
///
|
||||||
|
/// Default to `null`
|
||||||
|
final BoxShadow? shadow;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'ButtonStyle(radius: $radius, padding: $padding, foregroundColors: '
|
||||||
|
'$foregroundColors, backgroundColors: $backgroundColors, borderColors: '
|
||||||
|
'$borderColors, stroke: $stroke, shadow: $shadow)';
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
// 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 './button_component.dart';
|
||||||
|
export './button_style.dart';
|
||||||
|
export './file_selection_button_component.dart';
|
||||||
|
export './file_selection_button_style.dart';
|
||||||
|
export './flat_button_component.dart';
|
||||||
|
export './flat_button_style.dart';
|
||||||
|
export './simple_icon_button_component.dart';
|
||||||
|
export './simple_icon_button_style.dart';
|
||||||
|
export './symbol_button_component.dart';
|
||||||
|
export './symbol_button_style.dart';
|
||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'file_selection_button_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class FileSelectionButtonComponent extends ButtonComponent
|
||||||
|
with CopyWithMixin<$FileSelectionButtonComponentCWProxy> {
|
||||||
|
const FileSelectionButtonComponent({
|
||||||
|
this.mainAxisSize = MainAxisSize.min,
|
||||||
|
this.leading,
|
||||||
|
this.title,
|
||||||
|
this.subTitle,
|
||||||
|
super.disabledStyle,
|
||||||
|
super.normalStyle,
|
||||||
|
super.hoveredStyle,
|
||||||
|
super.focusedStyle,
|
||||||
|
super.tappedStyle,
|
||||||
|
super.selectedStyle,
|
||||||
|
super.invalidStyle,
|
||||||
|
super.onPressed,
|
||||||
|
super.themeResolver,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle? get disabledStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle? get normalStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle? get hoveredStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle? get focusedStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle? get tappedStyle;
|
||||||
|
|
||||||
|
// When a file is selected
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle? get selectedStyle;
|
||||||
|
|
||||||
|
// When the input file is invalid (too large, not supported format... etc)
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle? get invalidStyle;
|
||||||
|
|
||||||
|
final MainAxisSize? mainAxisSize;
|
||||||
|
final Widget? leading;
|
||||||
|
final TextWrapper? title;
|
||||||
|
final TextWrapper? subTitle;
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'file_selection_button_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $FileSelectionButtonComponentCWProxy {
|
||||||
|
FileSelectionButtonComponent mainAxisSize(MainAxisSize? mainAxisSize);
|
||||||
|
FileSelectionButtonComponent leading(Widget? leading);
|
||||||
|
FileSelectionButtonComponent title(TextWrapper? title);
|
||||||
|
FileSelectionButtonComponent subTitle(TextWrapper? subTitle);
|
||||||
|
FileSelectionButtonComponent disabledStyle(
|
||||||
|
ButtonStyle<dynamic>? disabledStyle);
|
||||||
|
FileSelectionButtonComponent normalStyle(ButtonStyle<dynamic>? normalStyle);
|
||||||
|
FileSelectionButtonComponent hoveredStyle(ButtonStyle<dynamic>? hoveredStyle);
|
||||||
|
FileSelectionButtonComponent focusedStyle(ButtonStyle<dynamic>? focusedStyle);
|
||||||
|
FileSelectionButtonComponent tappedStyle(ButtonStyle<dynamic>? tappedStyle);
|
||||||
|
FileSelectionButtonComponent selectedStyle(
|
||||||
|
ButtonStyle<dynamic>? selectedStyle);
|
||||||
|
FileSelectionButtonComponent invalidStyle(ButtonStyle<dynamic>? invalidStyle);
|
||||||
|
FileSelectionButtonComponent onPressed(
|
||||||
|
void Function(ControlState)? onPressed);
|
||||||
|
FileSelectionButtonComponent themeResolver(
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver);
|
||||||
|
FileSelectionButtonComponent key(Key? key);
|
||||||
|
FileSelectionButtonComponent call({
|
||||||
|
MainAxisSize? mainAxisSize,
|
||||||
|
Widget? leading,
|
||||||
|
TextWrapper? title,
|
||||||
|
TextWrapper? subTitle,
|
||||||
|
ButtonStyle<dynamic>? disabledStyle,
|
||||||
|
ButtonStyle<dynamic>? normalStyle,
|
||||||
|
ButtonStyle<dynamic>? hoveredStyle,
|
||||||
|
ButtonStyle<dynamic>? focusedStyle,
|
||||||
|
ButtonStyle<dynamic>? tappedStyle,
|
||||||
|
ButtonStyle<dynamic>? selectedStyle,
|
||||||
|
ButtonStyle<dynamic>? invalidStyle,
|
||||||
|
void Function(ControlState)? onPressed,
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
+133
@@ -0,0 +1,133 @@
|
|||||||
|
// 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:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/core/utils/multi_color.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/buttons/button_style.dart';
|
||||||
|
|
||||||
|
class FileSelectionButtonStyle extends ButtonStyle<FileSelectionButtonStyle> {
|
||||||
|
const FileSelectionButtonStyle({
|
||||||
|
this.title,
|
||||||
|
this.subTitle,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.foregroundColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.borderColors,
|
||||||
|
super.stroke,
|
||||||
|
super.shadow,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Merges non-null `b` attributes in `a`
|
||||||
|
static FileSelectionButtonStyle? merge(
|
||||||
|
FileSelectionButtonStyle? a,
|
||||||
|
FileSelectionButtonStyle? b,
|
||||||
|
) {
|
||||||
|
if (b == null) {
|
||||||
|
return a?.copyWith();
|
||||||
|
}
|
||||||
|
if (a == null) {
|
||||||
|
return b.copyWith();
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.copyWith(
|
||||||
|
title: b.title,
|
||||||
|
subTitle: b.subTitle,
|
||||||
|
radius: b.radius,
|
||||||
|
padding: b.padding,
|
||||||
|
foregroundColors: b.foregroundColors,
|
||||||
|
backgroundColors: b.backgroundColors,
|
||||||
|
borderColors: b.borderColors,
|
||||||
|
stroke: b.stroke,
|
||||||
|
shadow: b.shadow,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Used for interpolation.
|
||||||
|
static FileSelectionButtonStyle? lerp(
|
||||||
|
FileSelectionButtonStyle? a,
|
||||||
|
FileSelectionButtonStyle? b,
|
||||||
|
double t,
|
||||||
|
) {
|
||||||
|
if (a == null || b == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// b.copyWith to return b attributes even if they are not lerped
|
||||||
|
return b.copyWith(
|
||||||
|
title: TextStyle.lerp(a.title, b.title, t),
|
||||||
|
subTitle: TextStyle.lerp(a.title, b.title, t),
|
||||||
|
foregroundColors: MultiColor.lerp(
|
||||||
|
a.foregroundColors,
|
||||||
|
b.foregroundColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
backgroundColors: MultiColor.lerp(
|
||||||
|
a.backgroundColors,
|
||||||
|
b.backgroundColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
borderColors: MultiColor.lerp(
|
||||||
|
a.borderColors,
|
||||||
|
b.borderColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
radius: BorderRadiusGeometry.lerp(a.radius, b.radius, t),
|
||||||
|
padding: EdgeInsetsGeometry.lerp(a.padding, b.padding, t),
|
||||||
|
stroke: lerpDouble(a.stroke, b.stroke, t),
|
||||||
|
shadow: BoxShadow.lerp(a.shadow, b.shadow, t),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Title text style
|
||||||
|
///
|
||||||
|
/// Default to `TextTheme.labelLarge`
|
||||||
|
final TextStyle? title;
|
||||||
|
|
||||||
|
/// Sub title text style
|
||||||
|
///
|
||||||
|
/// Default to `TextTheme.labelSmall`
|
||||||
|
final TextStyle? subTitle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle? mergeWith(FileSelectionButtonStyle? other) =>
|
||||||
|
FileSelectionButtonStyle.merge(this, other);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle? copyWith({
|
||||||
|
TextStyle? title,
|
||||||
|
TextStyle? subTitle,
|
||||||
|
BorderRadiusGeometry? radius,
|
||||||
|
EdgeInsetsGeometry? padding,
|
||||||
|
MultiColor? foregroundColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
double? stroke,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
}) =>
|
||||||
|
FileSelectionButtonStyle(
|
||||||
|
title: title ?? this.title,
|
||||||
|
subTitle: subTitle ?? this.subTitle,
|
||||||
|
radius: radius ?? this.radius,
|
||||||
|
padding: padding ?? this.padding,
|
||||||
|
foregroundColors: foregroundColors ?? this.foregroundColors,
|
||||||
|
backgroundColors: backgroundColors ?? this.backgroundColors,
|
||||||
|
borderColors: borderColors ?? this.borderColors,
|
||||||
|
stroke: stroke ?? this.stroke,
|
||||||
|
shadow: shadow ?? this.shadow,
|
||||||
|
);
|
||||||
|
}
|
||||||
+60
@@ -0,0 +1,60 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'flat_button_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class FlatButtonComponent extends ButtonComponent
|
||||||
|
with CopyWithMixin<$FlatButtonComponentCWProxy> {
|
||||||
|
const FlatButtonComponent({
|
||||||
|
this.mainAxisSize,
|
||||||
|
this.prefix,
|
||||||
|
this.suffix,
|
||||||
|
this.label,
|
||||||
|
super.disabledStyle,
|
||||||
|
super.normalStyle,
|
||||||
|
super.hoveredStyle,
|
||||||
|
super.focusedStyle,
|
||||||
|
super.tappedStyle,
|
||||||
|
super.onPressed,
|
||||||
|
super.themeResolver,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle? get disabledStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle? get normalStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle? get hoveredStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle? get focusedStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle? get tappedStyle;
|
||||||
|
|
||||||
|
final MainAxisSize? mainAxisSize;
|
||||||
|
final Widget? prefix;
|
||||||
|
final Widget? suffix;
|
||||||
|
final TextWrapper? label;
|
||||||
|
}
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'flat_button_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $FlatButtonComponentCWProxy {
|
||||||
|
FlatButtonComponent mainAxisSize(MainAxisSize? mainAxisSize);
|
||||||
|
FlatButtonComponent prefix(Widget? prefix);
|
||||||
|
FlatButtonComponent suffix(Widget? suffix);
|
||||||
|
FlatButtonComponent label(TextWrapper? label);
|
||||||
|
FlatButtonComponent disabledStyle(ButtonStyle<dynamic>? disabledStyle);
|
||||||
|
FlatButtonComponent normalStyle(ButtonStyle<dynamic>? normalStyle);
|
||||||
|
FlatButtonComponent hoveredStyle(ButtonStyle<dynamic>? hoveredStyle);
|
||||||
|
FlatButtonComponent focusedStyle(ButtonStyle<dynamic>? focusedStyle);
|
||||||
|
FlatButtonComponent tappedStyle(ButtonStyle<dynamic>? tappedStyle);
|
||||||
|
FlatButtonComponent onPressed(void Function(ControlState)? onPressed);
|
||||||
|
FlatButtonComponent themeResolver(
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver);
|
||||||
|
FlatButtonComponent key(Key? key);
|
||||||
|
FlatButtonComponent call({
|
||||||
|
MainAxisSize? mainAxisSize,
|
||||||
|
Widget? prefix,
|
||||||
|
Widget? suffix,
|
||||||
|
TextWrapper? label,
|
||||||
|
ButtonStyle<dynamic>? disabledStyle,
|
||||||
|
ButtonStyle<dynamic>? normalStyle,
|
||||||
|
ButtonStyle<dynamic>? hoveredStyle,
|
||||||
|
ButtonStyle<dynamic>? focusedStyle,
|
||||||
|
ButtonStyle<dynamic>? tappedStyle,
|
||||||
|
void Function(ControlState)? onPressed,
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
// 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:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/core/utils/multi_color.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/buttons/button_style.dart';
|
||||||
|
|
||||||
|
class FlatButtonStyle extends ButtonStyle<FlatButtonStyle> {
|
||||||
|
const FlatButtonStyle({
|
||||||
|
this.label,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.foregroundColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.borderColors,
|
||||||
|
super.stroke,
|
||||||
|
super.shadow,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Merges non-null `b` attributes in `a`
|
||||||
|
static FlatButtonStyle? merge(
|
||||||
|
FlatButtonStyle? a,
|
||||||
|
FlatButtonStyle? b,
|
||||||
|
) {
|
||||||
|
if (b == null) {
|
||||||
|
return a?.copyWith();
|
||||||
|
}
|
||||||
|
if (a == null) {
|
||||||
|
return b.copyWith();
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.copyWith(
|
||||||
|
label: b.label,
|
||||||
|
radius: b.radius,
|
||||||
|
padding: b.padding,
|
||||||
|
foregroundColors: b.foregroundColors,
|
||||||
|
backgroundColors: b.backgroundColors,
|
||||||
|
borderColors: b.borderColors,
|
||||||
|
stroke: b.stroke,
|
||||||
|
shadow: b.shadow,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Used for interpolation.
|
||||||
|
static FlatButtonStyle? lerp(
|
||||||
|
FlatButtonStyle? a,
|
||||||
|
FlatButtonStyle? b,
|
||||||
|
double t,
|
||||||
|
) {
|
||||||
|
if (a == null || b == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// b.copyWith to return b attributes even if they are not lerped
|
||||||
|
return b.copyWith(
|
||||||
|
label: TextStyle.lerp(a.label, b.label, t),
|
||||||
|
foregroundColors: MultiColor.lerp(
|
||||||
|
a.foregroundColors,
|
||||||
|
b.foregroundColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
backgroundColors: MultiColor.lerp(
|
||||||
|
a.backgroundColors,
|
||||||
|
b.backgroundColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
borderColors: MultiColor.lerp(
|
||||||
|
a.borderColors,
|
||||||
|
b.borderColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
radius: BorderRadiusGeometry.lerp(a.radius, b.radius, t),
|
||||||
|
padding: EdgeInsetsGeometry.lerp(a.padding, b.padding, t),
|
||||||
|
stroke: lerpDouble(a.stroke, b.stroke, t),
|
||||||
|
shadow: BoxShadow.lerp(a.shadow, b.shadow, t),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Label text style
|
||||||
|
///
|
||||||
|
/// Default to `TextTheme.labelLarge`
|
||||||
|
final TextStyle? label;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle? mergeWith(FlatButtonStyle? other) =>
|
||||||
|
FlatButtonStyle.merge(this, other);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle? copyWith({
|
||||||
|
TextStyle? label,
|
||||||
|
BorderRadiusGeometry? radius,
|
||||||
|
EdgeInsetsGeometry? padding,
|
||||||
|
MultiColor? foregroundColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
double? stroke,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
}) =>
|
||||||
|
FlatButtonStyle(
|
||||||
|
label: label ?? this.label,
|
||||||
|
radius: radius ?? this.radius,
|
||||||
|
padding: padding ?? this.padding,
|
||||||
|
foregroundColors: foregroundColors ?? this.foregroundColors,
|
||||||
|
backgroundColors: backgroundColors ?? this.backgroundColors,
|
||||||
|
borderColors: borderColors ?? this.borderColors,
|
||||||
|
stroke: stroke ?? this.stroke,
|
||||||
|
shadow: shadow ?? this.shadow,
|
||||||
|
);
|
||||||
|
}
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'simple_icon_button_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class SimpleIconButtonComponent extends ButtonComponent
|
||||||
|
with CopyWithMixin<$SimpleIconButtonComponentCWProxy> {
|
||||||
|
const SimpleIconButtonComponent({
|
||||||
|
this.icon,
|
||||||
|
super.disabledStyle,
|
||||||
|
super.normalStyle,
|
||||||
|
super.hoveredStyle,
|
||||||
|
super.focusedStyle,
|
||||||
|
super.tappedStyle,
|
||||||
|
super.onPressed,
|
||||||
|
super.themeResolver,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle? get disabledStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle? get normalStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle? get hoveredStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle? get focusedStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle? get tappedStyle;
|
||||||
|
|
||||||
|
final Icon? icon;
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'simple_icon_button_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $SimpleIconButtonComponentCWProxy {
|
||||||
|
SimpleIconButtonComponent icon(Icon? icon);
|
||||||
|
SimpleIconButtonComponent disabledStyle(ButtonStyle<dynamic>? disabledStyle);
|
||||||
|
SimpleIconButtonComponent normalStyle(ButtonStyle<dynamic>? normalStyle);
|
||||||
|
SimpleIconButtonComponent hoveredStyle(ButtonStyle<dynamic>? hoveredStyle);
|
||||||
|
SimpleIconButtonComponent focusedStyle(ButtonStyle<dynamic>? focusedStyle);
|
||||||
|
SimpleIconButtonComponent tappedStyle(ButtonStyle<dynamic>? tappedStyle);
|
||||||
|
SimpleIconButtonComponent onPressed(void Function(ControlState)? onPressed);
|
||||||
|
SimpleIconButtonComponent themeResolver(
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver);
|
||||||
|
SimpleIconButtonComponent key(Key? key);
|
||||||
|
SimpleIconButtonComponent call({
|
||||||
|
Icon? icon,
|
||||||
|
ButtonStyle<dynamic>? disabledStyle,
|
||||||
|
ButtonStyle<dynamic>? normalStyle,
|
||||||
|
ButtonStyle<dynamic>? hoveredStyle,
|
||||||
|
ButtonStyle<dynamic>? focusedStyle,
|
||||||
|
ButtonStyle<dynamic>? tappedStyle,
|
||||||
|
void Function(ControlState)? onPressed,
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
+123
@@ -0,0 +1,123 @@
|
|||||||
|
// 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:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/core/utils/multi_color.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/buttons/button_style.dart';
|
||||||
|
|
||||||
|
class SimpleIconButtonStyle extends ButtonStyle<SimpleIconButtonStyle> {
|
||||||
|
const SimpleIconButtonStyle({
|
||||||
|
this.dimension,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.foregroundColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.borderColors,
|
||||||
|
super.stroke,
|
||||||
|
super.shadow,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Merges non-null `b` attributes in `a`
|
||||||
|
static SimpleIconButtonStyle? merge(
|
||||||
|
SimpleIconButtonStyle? a,
|
||||||
|
SimpleIconButtonStyle? b,
|
||||||
|
) {
|
||||||
|
if (b == null) {
|
||||||
|
return a?.copyWith();
|
||||||
|
}
|
||||||
|
if (a == null) {
|
||||||
|
return b.copyWith();
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.copyWith(
|
||||||
|
dimension: b.dimension,
|
||||||
|
radius: b.radius,
|
||||||
|
padding: b.padding,
|
||||||
|
foregroundColors: b.foregroundColors,
|
||||||
|
backgroundColors: b.backgroundColors,
|
||||||
|
borderColors: b.borderColors,
|
||||||
|
stroke: b.stroke,
|
||||||
|
shadow: b.shadow,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Used for interpolation.
|
||||||
|
static SimpleIconButtonStyle? lerp(
|
||||||
|
SimpleIconButtonStyle? a,
|
||||||
|
SimpleIconButtonStyle? b,
|
||||||
|
double t,
|
||||||
|
) {
|
||||||
|
if (a == null || b == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// b.copyWith to return b attributes even if they are not lerped
|
||||||
|
return b.copyWith(
|
||||||
|
dimension: lerpDouble(a.dimension, b.dimension, t),
|
||||||
|
foregroundColors: MultiColor.lerp(
|
||||||
|
a.foregroundColors,
|
||||||
|
b.foregroundColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
backgroundColors: MultiColor.lerp(
|
||||||
|
a.backgroundColors,
|
||||||
|
b.backgroundColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
borderColors: MultiColor.lerp(
|
||||||
|
a.borderColors,
|
||||||
|
b.borderColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
radius: BorderRadiusGeometry.lerp(a.radius, b.radius, t),
|
||||||
|
padding: EdgeInsetsGeometry.lerp(a.padding, b.padding, t),
|
||||||
|
stroke: lerpDouble(a.stroke, b.stroke, t),
|
||||||
|
shadow: BoxShadow.lerp(a.shadow, b.shadow, t),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Dimension of this button (as a square)
|
||||||
|
///
|
||||||
|
/// Default to `context.buttonTheme.height`
|
||||||
|
final double? dimension;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle? mergeWith(SimpleIconButtonStyle? other) =>
|
||||||
|
SimpleIconButtonStyle.merge(this, other);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle copyWith({
|
||||||
|
double? dimension,
|
||||||
|
BorderRadiusGeometry? radius,
|
||||||
|
EdgeInsetsGeometry? padding,
|
||||||
|
MultiColor? foregroundColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
double? stroke,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
}) =>
|
||||||
|
SimpleIconButtonStyle(
|
||||||
|
dimension: dimension ?? this.dimension,
|
||||||
|
radius: radius ?? this.radius,
|
||||||
|
padding: padding ?? this.padding,
|
||||||
|
foregroundColors: foregroundColors ?? this.foregroundColors,
|
||||||
|
backgroundColors: backgroundColors ?? this.backgroundColors,
|
||||||
|
borderColors: borderColors ?? this.borderColors,
|
||||||
|
stroke: stroke ?? this.stroke,
|
||||||
|
shadow: shadow ?? this.shadow,
|
||||||
|
);
|
||||||
|
}
|
||||||
+62
@@ -0,0 +1,62 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'symbol_button_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class SymbolButtonComponent extends ButtonComponent
|
||||||
|
with CopyWithMixin<$SymbolButtonComponentCWProxy> {
|
||||||
|
const SymbolButtonComponent({
|
||||||
|
this.mainAxisSize = MainAxisSize.min,
|
||||||
|
this.label,
|
||||||
|
this.icon,
|
||||||
|
super.disabledStyle,
|
||||||
|
super.normalStyle,
|
||||||
|
super.hoveredStyle,
|
||||||
|
super.focusedStyle,
|
||||||
|
super.tappedStyle,
|
||||||
|
super.selectedStyle,
|
||||||
|
super.onPressed,
|
||||||
|
super.themeResolver,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle? get disabledStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle? get normalStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle? get hoveredStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle? get focusedStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle? get tappedStyle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle? get selectedStyle;
|
||||||
|
|
||||||
|
final MainAxisSize? mainAxisSize;
|
||||||
|
final Widget? icon;
|
||||||
|
final TextWrapper? label;
|
||||||
|
}
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'symbol_button_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $SymbolButtonComponentCWProxy {
|
||||||
|
SymbolButtonComponent mainAxisSize(MainAxisSize? mainAxisSize);
|
||||||
|
SymbolButtonComponent label(TextWrapper? label);
|
||||||
|
SymbolButtonComponent icon(Widget? icon);
|
||||||
|
SymbolButtonComponent disabledStyle(ButtonStyle<dynamic>? disabledStyle);
|
||||||
|
SymbolButtonComponent normalStyle(ButtonStyle<dynamic>? normalStyle);
|
||||||
|
SymbolButtonComponent hoveredStyle(ButtonStyle<dynamic>? hoveredStyle);
|
||||||
|
SymbolButtonComponent focusedStyle(ButtonStyle<dynamic>? focusedStyle);
|
||||||
|
SymbolButtonComponent tappedStyle(ButtonStyle<dynamic>? tappedStyle);
|
||||||
|
SymbolButtonComponent selectedStyle(ButtonStyle<dynamic>? selectedStyle);
|
||||||
|
SymbolButtonComponent onPressed(void Function(ControlState)? onPressed);
|
||||||
|
SymbolButtonComponent themeResolver(
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver);
|
||||||
|
SymbolButtonComponent key(Key? key);
|
||||||
|
SymbolButtonComponent call({
|
||||||
|
MainAxisSize? mainAxisSize,
|
||||||
|
TextWrapper? label,
|
||||||
|
Widget? icon,
|
||||||
|
ButtonStyle<dynamic>? disabledStyle,
|
||||||
|
ButtonStyle<dynamic>? normalStyle,
|
||||||
|
ButtonStyle<dynamic>? hoveredStyle,
|
||||||
|
ButtonStyle<dynamic>? focusedStyle,
|
||||||
|
ButtonStyle<dynamic>? tappedStyle,
|
||||||
|
ButtonStyle<dynamic>? selectedStyle,
|
||||||
|
void Function(ControlState)? onPressed,
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
+133
@@ -0,0 +1,133 @@
|
|||||||
|
// 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:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/core/utils/multi_color.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/buttons/button_style.dart';
|
||||||
|
|
||||||
|
class SymbolButtonStyle extends ButtonStyle<SymbolButtonStyle> {
|
||||||
|
const SymbolButtonStyle({
|
||||||
|
this.label,
|
||||||
|
this.dimension,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.foregroundColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.borderColors,
|
||||||
|
super.stroke,
|
||||||
|
super.shadow,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Merges non-null `b` attributes in `a`
|
||||||
|
static SymbolButtonStyle? merge(
|
||||||
|
SymbolButtonStyle? a,
|
||||||
|
SymbolButtonStyle? b,
|
||||||
|
) {
|
||||||
|
if (b == null) {
|
||||||
|
return a?.copyWith();
|
||||||
|
}
|
||||||
|
if (a == null) {
|
||||||
|
return b.copyWith();
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.copyWith(
|
||||||
|
label: b.label,
|
||||||
|
dimension: b.dimension,
|
||||||
|
radius: b.radius,
|
||||||
|
padding: b.padding,
|
||||||
|
foregroundColors: b.foregroundColors,
|
||||||
|
backgroundColors: b.backgroundColors,
|
||||||
|
borderColors: b.borderColors,
|
||||||
|
stroke: b.stroke,
|
||||||
|
shadow: b.shadow,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Used for interpolation.
|
||||||
|
static SymbolButtonStyle? lerp(
|
||||||
|
SymbolButtonStyle? a,
|
||||||
|
SymbolButtonStyle? b,
|
||||||
|
double t,
|
||||||
|
) {
|
||||||
|
if (a == null || b == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// b.copyWith to return b attributes even if they are not lerped
|
||||||
|
return b.copyWith(
|
||||||
|
label: TextStyle.lerp(a.label, b.label, t),
|
||||||
|
dimension: lerpDouble(a.dimension, b.dimension, t),
|
||||||
|
foregroundColors: MultiColor.lerp(
|
||||||
|
a.foregroundColors,
|
||||||
|
b.foregroundColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
backgroundColors: MultiColor.lerp(
|
||||||
|
a.backgroundColors,
|
||||||
|
b.backgroundColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
borderColors: MultiColor.lerp(
|
||||||
|
a.borderColors,
|
||||||
|
b.borderColors,
|
||||||
|
t,
|
||||||
|
),
|
||||||
|
radius: BorderRadiusGeometry.lerp(a.radius, b.radius, t),
|
||||||
|
padding: EdgeInsetsGeometry.lerp(a.padding, b.padding, t),
|
||||||
|
stroke: lerpDouble(a.stroke, b.stroke, t),
|
||||||
|
shadow: BoxShadow.lerp(a.shadow, b.shadow, t),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Label text style
|
||||||
|
///
|
||||||
|
/// Default to `TextTheme.labelLarge`
|
||||||
|
final TextStyle? label;
|
||||||
|
|
||||||
|
/// Dimension of this button (as a square)
|
||||||
|
///
|
||||||
|
/// Default to `context.buttonTheme.height`
|
||||||
|
final double? dimension;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle? mergeWith(SymbolButtonStyle? other) =>
|
||||||
|
SymbolButtonStyle.merge(this, other);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle? copyWith({
|
||||||
|
TextStyle? label,
|
||||||
|
double? dimension,
|
||||||
|
BorderRadiusGeometry? radius,
|
||||||
|
EdgeInsetsGeometry? padding,
|
||||||
|
MultiColor? foregroundColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
double? stroke,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
}) =>
|
||||||
|
SymbolButtonStyle(
|
||||||
|
label: label ?? this.label,
|
||||||
|
dimension: dimension ?? this.dimension,
|
||||||
|
radius: radius ?? this.radius,
|
||||||
|
padding: padding ?? this.padding,
|
||||||
|
foregroundColors: foregroundColors ?? this.foregroundColors,
|
||||||
|
backgroundColors: backgroundColors ?? this.backgroundColors,
|
||||||
|
borderColors: borderColors ?? this.borderColors,
|
||||||
|
stroke: stroke ?? this.stroke,
|
||||||
|
shadow: shadow ?? this.shadow,
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/core/utils/multi_color.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
|
||||||
|
|
||||||
|
abstract class CardComponent extends Component {
|
||||||
|
const CardComponent({
|
||||||
|
this.radius = 12,
|
||||||
|
this.padding = 25,
|
||||||
|
this.borderColors,
|
||||||
|
this.backgroundColors,
|
||||||
|
this.minSize = const Size(330, 230),
|
||||||
|
this.maxSize = const Size(330, 530),
|
||||||
|
this.shadow = const BoxShadow(
|
||||||
|
blurRadius: 30,
|
||||||
|
offset: Offset(0, 5),
|
||||||
|
color: Color.fromRGBO(0, 0, 0, 0.05),
|
||||||
|
),
|
||||||
|
this.background,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Card radius
|
||||||
|
final double? radius;
|
||||||
|
|
||||||
|
/// Padding and gaps of this card
|
||||||
|
final double? padding;
|
||||||
|
|
||||||
|
/// Border gradient color (from left to right)
|
||||||
|
final MultiColor? borderColors;
|
||||||
|
|
||||||
|
/// Card background color
|
||||||
|
final MultiColor? backgroundColors;
|
||||||
|
|
||||||
|
/// Minimum size for this card
|
||||||
|
final Size? minSize;
|
||||||
|
|
||||||
|
/// Maximum size for this card
|
||||||
|
final Size? maxSize;
|
||||||
|
|
||||||
|
/// Drop shadow
|
||||||
|
final BoxShadow? shadow;
|
||||||
|
|
||||||
|
/// Background of the card
|
||||||
|
final Widget? background;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
// 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 './information_card_component.dart';
|
||||||
|
export './portfolio_card_component.dart';
|
||||||
|
export './quote_card_component.dart';
|
||||||
|
export './skill_card_component.dart';
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/cards/card_component.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'information_card_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class InformationCardComponent extends CardComponent
|
||||||
|
with CopyWithMixin<$InformationCardComponentCWProxy> {
|
||||||
|
const InformationCardComponent({
|
||||||
|
this.icons,
|
||||||
|
this.title,
|
||||||
|
this.subtitle,
|
||||||
|
this.body,
|
||||||
|
this.axis = Axis.vertical,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.borderColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.minSize,
|
||||||
|
super.maxSize,
|
||||||
|
super.shadow,
|
||||||
|
super.background,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
final Axis? axis;
|
||||||
|
final List<Widget>? icons;
|
||||||
|
final TextWrapper? title;
|
||||||
|
final TextWrapper? subtitle;
|
||||||
|
final TextWrapper? body;
|
||||||
|
}
|
||||||
+40
@@ -0,0 +1,40 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'information_card_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $InformationCardComponentCWProxy {
|
||||||
|
InformationCardComponent icons(List<Widget>? icons);
|
||||||
|
InformationCardComponent title(TextWrapper? title);
|
||||||
|
InformationCardComponent subtitle(TextWrapper? subtitle);
|
||||||
|
InformationCardComponent body(TextWrapper? body);
|
||||||
|
InformationCardComponent axis(Axis? axis);
|
||||||
|
InformationCardComponent radius(double? radius);
|
||||||
|
InformationCardComponent padding(double? padding);
|
||||||
|
InformationCardComponent borderColors(MultiColor? borderColors);
|
||||||
|
InformationCardComponent backgroundColors(MultiColor? backgroundColors);
|
||||||
|
InformationCardComponent minSize(Size? minSize);
|
||||||
|
InformationCardComponent maxSize(Size? maxSize);
|
||||||
|
InformationCardComponent shadow(BoxShadow? shadow);
|
||||||
|
InformationCardComponent background(Widget? background);
|
||||||
|
InformationCardComponent key(Key? key);
|
||||||
|
InformationCardComponent call({
|
||||||
|
List<Widget>? icons,
|
||||||
|
TextWrapper? title,
|
||||||
|
TextWrapper? subtitle,
|
||||||
|
TextWrapper? body,
|
||||||
|
Axis? axis,
|
||||||
|
double? radius,
|
||||||
|
double? padding,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
Size? minSize,
|
||||||
|
Size? maxSize,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
Widget? background,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
+57
@@ -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/>.
|
||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/cards/card_component.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'portfolio_card_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class PortfolioCardComponent extends CardComponent
|
||||||
|
with CopyWithMixin<$PortfolioCardComponentCWProxy> {
|
||||||
|
const PortfolioCardComponent({
|
||||||
|
this.secondaryBackgroundColors,
|
||||||
|
this.showImagesOnTop,
|
||||||
|
this.keyword,
|
||||||
|
this.description,
|
||||||
|
this.logo,
|
||||||
|
this.projectName,
|
||||||
|
this.subtitle,
|
||||||
|
this.ctas,
|
||||||
|
this.assets,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.borderColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.minSize,
|
||||||
|
super.maxSize,
|
||||||
|
super.shadow,
|
||||||
|
super.background,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
final bool? showImagesOnTop;
|
||||||
|
final List<TextWrapper>? keyword;
|
||||||
|
final List<Widget>? assets;
|
||||||
|
final TextWrapper? description;
|
||||||
|
final Widget? logo;
|
||||||
|
final TextWrapper? projectName;
|
||||||
|
final TextWrapper? subtitle;
|
||||||
|
final List<Widget>? ctas;
|
||||||
|
final Color? secondaryBackgroundColors;
|
||||||
|
}
|
||||||
+49
@@ -0,0 +1,49 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'portfolio_card_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $PortfolioCardComponentCWProxy {
|
||||||
|
PortfolioCardComponent secondaryBackgroundColors(
|
||||||
|
Color? secondaryBackgroundColors);
|
||||||
|
PortfolioCardComponent showImagesOnTop(bool? showImagesOnTop);
|
||||||
|
PortfolioCardComponent keyword(List<TextWrapper>? keyword);
|
||||||
|
PortfolioCardComponent description(TextWrapper? description);
|
||||||
|
PortfolioCardComponent logo(Widget? logo);
|
||||||
|
PortfolioCardComponent projectName(TextWrapper? projectName);
|
||||||
|
PortfolioCardComponent subtitle(TextWrapper? subtitle);
|
||||||
|
PortfolioCardComponent ctas(List<Widget>? ctas);
|
||||||
|
PortfolioCardComponent assets(List<Widget>? assets);
|
||||||
|
PortfolioCardComponent radius(double? radius);
|
||||||
|
PortfolioCardComponent padding(double? padding);
|
||||||
|
PortfolioCardComponent borderColors(MultiColor? borderColors);
|
||||||
|
PortfolioCardComponent backgroundColors(MultiColor? backgroundColors);
|
||||||
|
PortfolioCardComponent minSize(Size? minSize);
|
||||||
|
PortfolioCardComponent maxSize(Size? maxSize);
|
||||||
|
PortfolioCardComponent shadow(BoxShadow? shadow);
|
||||||
|
PortfolioCardComponent background(Widget? background);
|
||||||
|
PortfolioCardComponent key(Key? key);
|
||||||
|
PortfolioCardComponent call({
|
||||||
|
Color? secondaryBackgroundColors,
|
||||||
|
bool? showImagesOnTop,
|
||||||
|
List<TextWrapper>? keyword,
|
||||||
|
TextWrapper? description,
|
||||||
|
Widget? logo,
|
||||||
|
TextWrapper? projectName,
|
||||||
|
TextWrapper? subtitle,
|
||||||
|
List<Widget>? ctas,
|
||||||
|
List<Widget>? assets,
|
||||||
|
double? radius,
|
||||||
|
double? padding,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
Size? minSize,
|
||||||
|
Size? maxSize,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
Widget? background,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/cards/card_component.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'quote_card_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class QuoteCardComponent extends CardComponent
|
||||||
|
with CopyWithMixin<$QuoteCardComponentCWProxy> {
|
||||||
|
const QuoteCardComponent({
|
||||||
|
this.avatar,
|
||||||
|
this.name,
|
||||||
|
this.subtitle,
|
||||||
|
this.gradient,
|
||||||
|
this.quote,
|
||||||
|
this.leftQuote,
|
||||||
|
this.rightQuote,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.borderColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.minSize,
|
||||||
|
super.maxSize,
|
||||||
|
super.shadow,
|
||||||
|
super.background,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
final Widget? avatar;
|
||||||
|
final TextWrapper? name;
|
||||||
|
final TextWrapper? subtitle;
|
||||||
|
final TextWrapper? quote;
|
||||||
|
|
||||||
|
final Gradient? gradient;
|
||||||
|
final Widget? leftQuote;
|
||||||
|
final Widget? rightQuote;
|
||||||
|
}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'quote_card_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $QuoteCardComponentCWProxy {
|
||||||
|
QuoteCardComponent avatar(Widget? avatar);
|
||||||
|
QuoteCardComponent name(TextWrapper? name);
|
||||||
|
QuoteCardComponent subtitle(TextWrapper? subtitle);
|
||||||
|
QuoteCardComponent gradient(Gradient? gradient);
|
||||||
|
QuoteCardComponent quote(TextWrapper? quote);
|
||||||
|
QuoteCardComponent leftQuote(Widget? leftQuote);
|
||||||
|
QuoteCardComponent rightQuote(Widget? rightQuote);
|
||||||
|
QuoteCardComponent radius(double? radius);
|
||||||
|
QuoteCardComponent padding(double? padding);
|
||||||
|
QuoteCardComponent borderColors(MultiColor? borderColors);
|
||||||
|
QuoteCardComponent backgroundColors(MultiColor? backgroundColors);
|
||||||
|
QuoteCardComponent minSize(Size? minSize);
|
||||||
|
QuoteCardComponent maxSize(Size? maxSize);
|
||||||
|
QuoteCardComponent shadow(BoxShadow? shadow);
|
||||||
|
QuoteCardComponent background(Widget? background);
|
||||||
|
QuoteCardComponent key(Key? key);
|
||||||
|
QuoteCardComponent call({
|
||||||
|
Widget? avatar,
|
||||||
|
TextWrapper? name,
|
||||||
|
TextWrapper? subtitle,
|
||||||
|
Gradient? gradient,
|
||||||
|
TextWrapper? quote,
|
||||||
|
Widget? leftQuote,
|
||||||
|
Widget? rightQuote,
|
||||||
|
double? radius,
|
||||||
|
double? padding,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
Size? minSize,
|
||||||
|
Size? maxSize,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
Widget? background,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/domain/entities/cards/card_component.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'skill_card_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class SkillCardComponent extends CardComponent
|
||||||
|
with CopyWithMixin<$SkillCardComponentCWProxy> {
|
||||||
|
const SkillCardComponent({
|
||||||
|
this.icon,
|
||||||
|
this.gradient,
|
||||||
|
this.title,
|
||||||
|
this.description,
|
||||||
|
this.skills,
|
||||||
|
this.leadingIcon,
|
||||||
|
this.secondaryBackgroundColors,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.borderColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.minSize,
|
||||||
|
super.maxSize,
|
||||||
|
super.shadow,
|
||||||
|
super.background,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
final IconData? icon;
|
||||||
|
final List<Color>? gradient;
|
||||||
|
final TextWrapper? title;
|
||||||
|
final TextWrapper? description;
|
||||||
|
final List<TextWrapper>? skills;
|
||||||
|
final IconData? leadingIcon;
|
||||||
|
final Color? secondaryBackgroundColors;
|
||||||
|
}
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'skill_card_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $SkillCardComponentCWProxy {
|
||||||
|
SkillCardComponent icon(IconData? icon);
|
||||||
|
SkillCardComponent gradient(List<Color>? gradient);
|
||||||
|
SkillCardComponent title(TextWrapper? title);
|
||||||
|
SkillCardComponent description(TextWrapper? description);
|
||||||
|
SkillCardComponent skills(List<TextWrapper>? skills);
|
||||||
|
SkillCardComponent leadingIcon(IconData? leadingIcon);
|
||||||
|
SkillCardComponent secondaryBackgroundColors(
|
||||||
|
Color? secondaryBackgroundColors);
|
||||||
|
SkillCardComponent radius(double? radius);
|
||||||
|
SkillCardComponent padding(double? padding);
|
||||||
|
SkillCardComponent borderColors(MultiColor? borderColors);
|
||||||
|
SkillCardComponent backgroundColors(MultiColor? backgroundColors);
|
||||||
|
SkillCardComponent minSize(Size? minSize);
|
||||||
|
SkillCardComponent maxSize(Size? maxSize);
|
||||||
|
SkillCardComponent shadow(BoxShadow? shadow);
|
||||||
|
SkillCardComponent background(Widget? background);
|
||||||
|
SkillCardComponent key(Key? key);
|
||||||
|
SkillCardComponent call({
|
||||||
|
IconData? icon,
|
||||||
|
List<Color>? gradient,
|
||||||
|
TextWrapper? title,
|
||||||
|
TextWrapper? description,
|
||||||
|
List<TextWrapper>? skills,
|
||||||
|
IconData? leadingIcon,
|
||||||
|
Color? secondaryBackgroundColors,
|
||||||
|
double? radius,
|
||||||
|
double? padding,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
Size? minSize,
|
||||||
|
Size? maxSize,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
Widget? background,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -15,7 +15,11 @@
|
|||||||
// 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/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/core/utils/theme_resolver.dart';
|
||||||
|
|
||||||
abstract class Component extends StatelessWidget {
|
abstract class Component extends StatelessWidget {
|
||||||
const Component({super.key});
|
const Component({this.themeResolver, super.key});
|
||||||
|
|
||||||
|
/// Theme Resolver for this component
|
||||||
|
final ThemeResolver<dynamic, dynamic, dynamic>? themeResolver;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,14 @@
|
|||||||
// 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 './app_bar_component.dart';
|
export './bars/bars.dart';
|
||||||
export './bottom_navigation_bar_component.dart';
|
export './buttons/buttons.dart';
|
||||||
export './error_widget_component.dart';
|
export './cards/cards.dart';
|
||||||
export './loading_widget_component.dart';
|
|
||||||
export './component.dart';
|
export './component.dart';
|
||||||
|
export './error_widget_component.dart';
|
||||||
|
export './loader_component.dart';
|
||||||
|
export './loader_style.dart';
|
||||||
|
export './loading_widget_component.dart';
|
||||||
|
export './rich_text_builder/rich_text_builder.dart';
|
||||||
|
export './text_inputs/text_inputs.dart';
|
||||||
|
export './theme_style.dart';
|
||||||
|
|||||||
@@ -14,16 +14,15 @@
|
|||||||
// 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:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
|
|
||||||
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
|
|
||||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
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 'error_widget_component.g.dart';
|
part 'error_widget_component.g.dart';
|
||||||
|
|
||||||
@ComponentProxyExtension()
|
@ComponentProxyExtension()
|
||||||
abstract class ErrorWidgetComponent extends Component
|
abstract class ErrorWidgetComponent extends Component
|
||||||
with CopyWithMixin<$ErrorWidgetComponentCWProxy> {
|
with CopyWithMixin<$ErrorWidgetComponentCWProxy> {
|
||||||
final String? error;
|
|
||||||
const ErrorWidgetComponent({required this.error, super.key});
|
const ErrorWidgetComponent({required this.error, super.key});
|
||||||
|
final TextWrapper? error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ part of 'error_widget_component.dart';
|
|||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
abstract class $ErrorWidgetComponentCWProxy {
|
abstract class $ErrorWidgetComponentCWProxy {
|
||||||
ErrorWidgetComponent error(String? error);
|
ErrorWidgetComponent error(TextWrapper? error);
|
||||||
ErrorWidgetComponent key(Key? key);
|
ErrorWidgetComponent key(Key? key);
|
||||||
ErrorWidgetComponent call({
|
ErrorWidgetComponent call({
|
||||||
String? error,
|
TextWrapper? error,
|
||||||
Key? key,
|
Key? key,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'loader_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class LoaderComponent extends Component
|
||||||
|
with CopyWithMixin<$LoaderComponentCWProxy> {
|
||||||
|
const LoaderComponent({
|
||||||
|
this.colors,
|
||||||
|
this.radius,
|
||||||
|
this.stroke,
|
||||||
|
this.duration,
|
||||||
|
this.flip,
|
||||||
|
super.themeResolver,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Gradient colors from start to end.
|
||||||
|
final MultiColor? colors;
|
||||||
|
|
||||||
|
/// Loader radius
|
||||||
|
final double? radius;
|
||||||
|
|
||||||
|
/// Loader stroke width
|
||||||
|
final double? stroke;
|
||||||
|
|
||||||
|
/// Animation duration
|
||||||
|
final Duration? duration;
|
||||||
|
|
||||||
|
/// Flip the animation
|
||||||
|
final bool? flip;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'loader_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $LoaderComponentCWProxy {
|
||||||
|
LoaderComponent colors(MultiColor? colors);
|
||||||
|
LoaderComponent radius(double? radius);
|
||||||
|
LoaderComponent stroke(double? stroke);
|
||||||
|
LoaderComponent duration(Duration? duration);
|
||||||
|
LoaderComponent flip(bool? flip);
|
||||||
|
LoaderComponent themeResolver(
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver);
|
||||||
|
LoaderComponent key(Key? key);
|
||||||
|
LoaderComponent call({
|
||||||
|
MultiColor? colors,
|
||||||
|
double? radius,
|
||||||
|
double? stroke,
|
||||||
|
Duration? duration,
|
||||||
|
bool? flip,
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
// 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:ui';
|
||||||
|
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
class LoaderStyle extends ThemeStyle<LoaderStyle> {
|
||||||
|
const LoaderStyle({
|
||||||
|
this.colors,
|
||||||
|
this.stroke,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Merges non-null `b` attributes in `a`
|
||||||
|
static LoaderStyle? merge(
|
||||||
|
LoaderStyle? a,
|
||||||
|
LoaderStyle? b,
|
||||||
|
) {
|
||||||
|
if (b == null) {
|
||||||
|
return a?.copyWith();
|
||||||
|
}
|
||||||
|
if (a == null) {
|
||||||
|
return b.copyWith();
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.copyWith(
|
||||||
|
colors: b.colors,
|
||||||
|
stroke: b.stroke,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Used for interpolation.
|
||||||
|
static LoaderStyle? lerp(
|
||||||
|
LoaderStyle? a,
|
||||||
|
LoaderStyle? b,
|
||||||
|
double t,
|
||||||
|
) {
|
||||||
|
if (a == null || b == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// b.copyWith to return b attributes even if they are not lerped
|
||||||
|
return b.copyWith(
|
||||||
|
colors: MultiColor.lerp(a.colors, b.colors, t),
|
||||||
|
stroke: lerpDouble(a.stroke, b.stroke, t),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Gradient colors from start to end.
|
||||||
|
final MultiColor? colors;
|
||||||
|
|
||||||
|
/// Loader stroke width
|
||||||
|
final double? stroke;
|
||||||
|
|
||||||
|
@override
|
||||||
|
LoaderStyle? mergeWith(LoaderStyle? other) => LoaderStyle.merge(this, other);
|
||||||
|
|
||||||
|
@override
|
||||||
|
LoaderStyle copyWith({
|
||||||
|
MultiColor? colors,
|
||||||
|
double? stroke,
|
||||||
|
}) =>
|
||||||
|
LoaderStyle(
|
||||||
|
colors: colors ?? this.colors,
|
||||||
|
stroke: stroke ?? this.stroke,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'LoaderStyle($colors, $stroke)';
|
||||||
|
}
|
||||||
@@ -15,15 +15,15 @@
|
|||||||
// 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/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
|
import 'package:wyatt_ui_components/src/core/mixins/copy_with_mixin.dart';
|
||||||
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
|
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
|
||||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
|
||||||
|
|
||||||
part 'loading_widget_component.g.dart';
|
part 'loading_widget_component.g.dart';
|
||||||
|
|
||||||
@ComponentProxyExtension()
|
@ComponentProxyExtension()
|
||||||
abstract class LoadingWidgetComponent extends Component
|
abstract class LoadingWidgetComponent extends Component
|
||||||
with CopyWithMixin<$LoadingWidgetComponentCWProxy> {
|
with CopyWithMixin<$LoadingWidgetComponentCWProxy> {
|
||||||
final Color? color;
|
|
||||||
const LoadingWidgetComponent({required this.color, super.key});
|
const LoadingWidgetComponent({required this.color, super.key});
|
||||||
|
final Color? color;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,120 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
|
||||||
|
class RichTextStyleParameter {
|
||||||
|
const RichTextStyleParameter(
|
||||||
|
this.defaultStyle,
|
||||||
|
this.definedStyle,
|
||||||
|
this.styleName,
|
||||||
|
);
|
||||||
|
|
||||||
|
final TextStyle? defaultStyle;
|
||||||
|
final Map<String, TextStyle> definedStyle;
|
||||||
|
final String? styleName;
|
||||||
|
|
||||||
|
TextStyle get style {
|
||||||
|
if (definedStyle.containsKey(styleName)) {
|
||||||
|
return definedStyle[styleName]!;
|
||||||
|
}
|
||||||
|
return defaultStyle ?? const TextStyle();
|
||||||
|
}
|
||||||
|
|
||||||
|
RichTextStyleParameter copyWith({
|
||||||
|
TextStyle? defaultStyle,
|
||||||
|
Map<String, TextStyle>? definedStyle,
|
||||||
|
String? styleName,
|
||||||
|
}) =>
|
||||||
|
RichTextStyleParameter(
|
||||||
|
defaultStyle ?? this.defaultStyle,
|
||||||
|
definedStyle ?? this.definedStyle,
|
||||||
|
styleName ?? this.styleName,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class RichTextNode {
|
||||||
|
RichTextNode(this.nodes);
|
||||||
|
|
||||||
|
final List<RichTextNode> nodes;
|
||||||
|
|
||||||
|
static RichTextNode from(
|
||||||
|
String content,
|
||||||
|
RegExp regex,
|
||||||
|
RichTextStyleParameter styleParameter,
|
||||||
|
) {
|
||||||
|
final matches = regex.allMatches(content);
|
||||||
|
if (matches.isNotEmpty) {
|
||||||
|
// match found -> construct node with leaf/nodes
|
||||||
|
final List<RichTextNode> nodes = [];
|
||||||
|
for (var i = 0; i < matches.length; i++) {
|
||||||
|
final previousMatch = i > 0 ? matches.elementAt(i - 1) : null;
|
||||||
|
final currentMatch = matches.elementAt(i);
|
||||||
|
// non match before
|
||||||
|
final nonMatchBefore = (previousMatch != null)
|
||||||
|
? content.substring(previousMatch.end, currentMatch.start)
|
||||||
|
: content.substring(0, currentMatch.start);
|
||||||
|
nodes
|
||||||
|
..add(RichTextNode.from(nonMatchBefore, regex, styleParameter))
|
||||||
|
// match
|
||||||
|
..add(
|
||||||
|
RichTextNode.from(
|
||||||
|
currentMatch.group(2)!,
|
||||||
|
regex,
|
||||||
|
styleParameter.copyWith(styleName: currentMatch.group(1)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// non match after
|
||||||
|
final nonMatchAfter = content.substring(matches.last.end);
|
||||||
|
nodes.add(RichTextNode.from(nonMatchAfter, regex, styleParameter));
|
||||||
|
return RichTextNode(nodes);
|
||||||
|
} else {
|
||||||
|
// match not found -> construct leaf
|
||||||
|
return RichTextLeaf(styleParameter.style, content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InlineSpan toInlineSpan(RichTextParser parser) {
|
||||||
|
final children = <InlineSpan>[];
|
||||||
|
for (final node in nodes) {
|
||||||
|
children.add(node.toInlineSpan(parser));
|
||||||
|
}
|
||||||
|
return TextSpan(children: children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class RichTextLeaf extends RichTextNode {
|
||||||
|
RichTextLeaf(this.style, this.content) : super([]);
|
||||||
|
|
||||||
|
final TextStyle style;
|
||||||
|
final String content;
|
||||||
|
|
||||||
|
@override
|
||||||
|
InlineSpan toInlineSpan(RichTextParser parser) =>
|
||||||
|
parser.nodeBuilder.call(content, style);
|
||||||
|
}
|
||||||
|
|
||||||
|
class RichTextParser {
|
||||||
|
const RichTextParser({required this.nodeBuilder});
|
||||||
|
factory RichTextParser.defaultBuilder() => RichTextParser(
|
||||||
|
nodeBuilder: (content, style) => TextSpan(
|
||||||
|
text: content,
|
||||||
|
style: style,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
final InlineSpan Function(String content, TextStyle style) nodeBuilder;
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
// 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 'parser.dart';
|
||||||
|
export 'rich_text_builder_component.dart';
|
||||||
|
export 'rich_text_builder_style.dart';
|
||||||
+56
@@ -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/>.
|
||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'rich_text_builder_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class RichTextBuilderComponent extends Component
|
||||||
|
with CopyWithMixin<$RichTextBuilderComponentCWProxy> {
|
||||||
|
const RichTextBuilderComponent({
|
||||||
|
this.text,
|
||||||
|
this.parser,
|
||||||
|
this.defaultStyle,
|
||||||
|
this.styles,
|
||||||
|
super.themeResolver,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Full text
|
||||||
|
final String? text;
|
||||||
|
|
||||||
|
/// How to build InlineSpans
|
||||||
|
final RichTextParser? parser;
|
||||||
|
|
||||||
|
/// Default TextStyle used in this rich text component.
|
||||||
|
final TextStyle? defaultStyle;
|
||||||
|
|
||||||
|
/// Used styles in this rich text component.
|
||||||
|
///
|
||||||
|
/// e.g.
|
||||||
|
/// ```dart
|
||||||
|
/// styles = {'red': TextStyle(color: Colors.red)};
|
||||||
|
/// ```
|
||||||
|
/// will transform:
|
||||||
|
/// ```text
|
||||||
|
/// This text <red>is red</red.
|
||||||
|
/// ```
|
||||||
|
/// in "This text `is red`."
|
||||||
|
final Map<String, TextStyle>? styles;
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'rich_text_builder_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $RichTextBuilderComponentCWProxy {
|
||||||
|
RichTextBuilderComponent text(String? text);
|
||||||
|
RichTextBuilderComponent parser(RichTextParser? parser);
|
||||||
|
RichTextBuilderComponent defaultStyle(TextStyle? defaultStyle);
|
||||||
|
RichTextBuilderComponent styles(Map<String, TextStyle>? styles);
|
||||||
|
RichTextBuilderComponent themeResolver(
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver);
|
||||||
|
RichTextBuilderComponent key(Key? key);
|
||||||
|
RichTextBuilderComponent call({
|
||||||
|
String? text,
|
||||||
|
RichTextParser? parser,
|
||||||
|
TextStyle? defaultStyle,
|
||||||
|
Map<String, TextStyle>? styles,
|
||||||
|
ThemeResolver<dynamic, dynamic, dynamic>? themeResolver,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
+79
@@ -0,0 +1,79 @@
|
|||||||
|
// 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/widgets.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
class RichTextBuilderStyle extends ThemeStyle<RichTextBuilderStyle> {
|
||||||
|
const RichTextBuilderStyle({
|
||||||
|
this.defaultStyle,
|
||||||
|
this.styles,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// Merges non-null `b` attributes in `a`
|
||||||
|
static RichTextBuilderStyle? merge(
|
||||||
|
RichTextBuilderStyle? a,
|
||||||
|
RichTextBuilderStyle? b,
|
||||||
|
) {
|
||||||
|
if (b == null) {
|
||||||
|
return a?.copyWith();
|
||||||
|
}
|
||||||
|
if (a == null) {
|
||||||
|
return b.copyWith();
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.copyWith(
|
||||||
|
defaultStyle: b.defaultStyle,
|
||||||
|
styles: b.styles,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Used for interpolation.
|
||||||
|
static RichTextBuilderStyle? lerp(
|
||||||
|
RichTextBuilderStyle? a,
|
||||||
|
RichTextBuilderStyle? b,
|
||||||
|
double t,
|
||||||
|
) {
|
||||||
|
if (a == null || b == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// b.copyWith to return b attributes even if they are not lerped
|
||||||
|
return b.copyWith(
|
||||||
|
defaultStyle: TextStyle.lerp(a.defaultStyle, b.defaultStyle, t),
|
||||||
|
styles: b.styles, // TODO(wyatt): compute lerp value of each styles
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Default TextStyle used in this rich text component.
|
||||||
|
final TextStyle? defaultStyle;
|
||||||
|
|
||||||
|
/// Used styles in this rich text component.
|
||||||
|
final Map<String, TextStyle>? styles;
|
||||||
|
|
||||||
|
@override
|
||||||
|
RichTextBuilderStyle? mergeWith(RichTextBuilderStyle? other) =>
|
||||||
|
RichTextBuilderStyle.merge(this, other);
|
||||||
|
|
||||||
|
@override
|
||||||
|
RichTextBuilderStyle? copyWith({
|
||||||
|
TextStyle? defaultStyle,
|
||||||
|
Map<String, TextStyle>? styles,
|
||||||
|
}) =>
|
||||||
|
RichTextBuilderStyle(
|
||||||
|
defaultStyle: defaultStyle ?? this.defaultStyle,
|
||||||
|
styles: styles ?? this.styles,
|
||||||
|
);
|
||||||
|
}
|
||||||
+173
@@ -0,0 +1,173 @@
|
|||||||
|
// 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:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
part 'text_input_component.g.dart';
|
||||||
|
|
||||||
|
@ComponentProxyExtension()
|
||||||
|
abstract class TextInputComponent extends Component
|
||||||
|
with CopyWithMixin<$TextInputComponentCWProxy> {
|
||||||
|
const TextInputComponent({
|
||||||
|
this.expand,
|
||||||
|
this.onError,
|
||||||
|
this.validator,
|
||||||
|
this.suffixText,
|
||||||
|
this.prefixText,
|
||||||
|
this.prefixIcon,
|
||||||
|
this.suffixIcon,
|
||||||
|
this.label,
|
||||||
|
this.hint,
|
||||||
|
this.normalStyle,
|
||||||
|
this.focusedStyle,
|
||||||
|
this.errorStyle,
|
||||||
|
this.disableStyle,
|
||||||
|
this.controller,
|
||||||
|
this.focusNode,
|
||||||
|
this.keyboardType,
|
||||||
|
this.smartDashesType,
|
||||||
|
this.smartQuotesType,
|
||||||
|
this.enableInteractiveSelection,
|
||||||
|
this.textInputAction,
|
||||||
|
this.textCapitalization,
|
||||||
|
this.style,
|
||||||
|
this.strutStyle,
|
||||||
|
this.textAlign,
|
||||||
|
this.textAlignVertical,
|
||||||
|
this.textDirection,
|
||||||
|
this.readOnly,
|
||||||
|
this.showCursor,
|
||||||
|
this.autofocus,
|
||||||
|
this.obscuringCharacter,
|
||||||
|
this.obscureText,
|
||||||
|
this.autocorrect,
|
||||||
|
this.enableSuggestions,
|
||||||
|
this.maxLines,
|
||||||
|
this.minLines,
|
||||||
|
this.expands,
|
||||||
|
this.maxLength,
|
||||||
|
this.maxLengthEnforcement,
|
||||||
|
this.onChanged,
|
||||||
|
this.onEditingComplete,
|
||||||
|
this.onSubmitted,
|
||||||
|
this.onAppPrivateCommand,
|
||||||
|
this.inputFormatters,
|
||||||
|
this.enabled,
|
||||||
|
this.cursorWidth,
|
||||||
|
this.cursorHeight,
|
||||||
|
this.cursorRadius,
|
||||||
|
this.cursorColor,
|
||||||
|
this.selectionHeightStyle,
|
||||||
|
this.selectionWidthStyle,
|
||||||
|
this.keyboardAppearance,
|
||||||
|
this.scrollPadding,
|
||||||
|
this.dragStartBehavior,
|
||||||
|
this.selectionControls,
|
||||||
|
this.onTap,
|
||||||
|
this.onTapOutside,
|
||||||
|
this.mouseCursor,
|
||||||
|
this.scrollController,
|
||||||
|
this.scrollPhysics,
|
||||||
|
this.autofillHints,
|
||||||
|
this.clipBehavior,
|
||||||
|
this.restorationId,
|
||||||
|
this.scribbleEnabled,
|
||||||
|
this.enableIMEPersonalizedLearning,
|
||||||
|
this.contextMenuBuilder,
|
||||||
|
this.spellCheckConfiguration,
|
||||||
|
this.magnifierConfiguration,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
final TextMagnifierConfiguration? magnifierConfiguration;
|
||||||
|
final TextEditingController? controller;
|
||||||
|
final FocusNode? focusNode;
|
||||||
|
final TextInputType? keyboardType;
|
||||||
|
final TextInputAction? textInputAction;
|
||||||
|
final TextCapitalization? textCapitalization;
|
||||||
|
final TextStyle? style;
|
||||||
|
final StrutStyle? strutStyle;
|
||||||
|
final TextAlign? textAlign;
|
||||||
|
final TextAlignVertical? textAlignVertical;
|
||||||
|
final TextDirection? textDirection;
|
||||||
|
final bool? autofocus;
|
||||||
|
final String? obscuringCharacter;
|
||||||
|
final bool? obscureText;
|
||||||
|
final bool? autocorrect;
|
||||||
|
final SmartDashesType? smartDashesType;
|
||||||
|
final SmartQuotesType? smartQuotesType;
|
||||||
|
final bool? enableSuggestions;
|
||||||
|
final int? maxLines;
|
||||||
|
final int? minLines;
|
||||||
|
final bool? expands;
|
||||||
|
final bool? readOnly;
|
||||||
|
final bool? showCursor;
|
||||||
|
final int? maxLength;
|
||||||
|
final MaxLengthEnforcement? maxLengthEnforcement;
|
||||||
|
final ValueChanged<String>? onChanged;
|
||||||
|
final VoidCallback? onEditingComplete;
|
||||||
|
final ValueChanged<String>? onSubmitted;
|
||||||
|
final AppPrivateCommandCallback? onAppPrivateCommand;
|
||||||
|
final List<TextInputFormatter>? inputFormatters;
|
||||||
|
final ValueNotifier<bool>? enabled;
|
||||||
|
final double? cursorWidth;
|
||||||
|
final double? cursorHeight;
|
||||||
|
final Radius? cursorRadius;
|
||||||
|
final Color? cursorColor;
|
||||||
|
final BoxHeightStyle? selectionHeightStyle;
|
||||||
|
final BoxWidthStyle? selectionWidthStyle;
|
||||||
|
final Brightness? keyboardAppearance;
|
||||||
|
final EdgeInsets? scrollPadding;
|
||||||
|
final bool? enableInteractiveSelection;
|
||||||
|
final TextSelectionControls? selectionControls;
|
||||||
|
final DragStartBehavior? dragStartBehavior;
|
||||||
|
final GestureTapCallback? onTap;
|
||||||
|
final TapRegionCallback? onTapOutside;
|
||||||
|
final MouseCursor? mouseCursor;
|
||||||
|
final ScrollPhysics? scrollPhysics;
|
||||||
|
final ScrollController? scrollController;
|
||||||
|
final Iterable<String>? autofillHints;
|
||||||
|
final Clip? clipBehavior;
|
||||||
|
final String? restorationId;
|
||||||
|
final bool? scribbleEnabled;
|
||||||
|
final bool? enableIMEPersonalizedLearning;
|
||||||
|
final EditableTextContextMenuBuilder? contextMenuBuilder;
|
||||||
|
final SpellCheckConfiguration? spellCheckConfiguration;
|
||||||
|
|
||||||
|
final bool Function(String)? validator;
|
||||||
|
final String? Function(String)? onError;
|
||||||
|
|
||||||
|
final TextInputStyle? normalStyle;
|
||||||
|
final TextInputStyle? focusedStyle;
|
||||||
|
final TextInputStyle? errorStyle;
|
||||||
|
final TextInputStyle? disableStyle;
|
||||||
|
|
||||||
|
final bool? expand;
|
||||||
|
|
||||||
|
final TextWrapper? label;
|
||||||
|
final TextWrapper? hint;
|
||||||
|
|
||||||
|
final TextWrapper? prefixText;
|
||||||
|
final TextWrapper? suffixText;
|
||||||
|
final Icon? prefixIcon;
|
||||||
|
final Icon? suffixIcon;
|
||||||
|
}
|
||||||
+157
@@ -0,0 +1,157 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'text_input_component.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// ComponentProxyGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class $TextInputComponentCWProxy {
|
||||||
|
TextInputComponent expand(bool? expand);
|
||||||
|
TextInputComponent onError(String Function(String)? onError);
|
||||||
|
TextInputComponent validator(bool Function(String)? validator);
|
||||||
|
TextInputComponent suffixText(TextWrapper? suffixText);
|
||||||
|
TextInputComponent prefixText(TextWrapper? prefixText);
|
||||||
|
TextInputComponent prefixIcon(Icon? prefixIcon);
|
||||||
|
TextInputComponent suffixIcon(Icon? suffixIcon);
|
||||||
|
TextInputComponent label(TextWrapper? label);
|
||||||
|
TextInputComponent hint(TextWrapper? hint);
|
||||||
|
TextInputComponent normalStyle(TextInputStyle? normalStyle);
|
||||||
|
TextInputComponent focusedStyle(TextInputStyle? focusedStyle);
|
||||||
|
TextInputComponent errorStyle(TextInputStyle? errorStyle);
|
||||||
|
TextInputComponent disableStyle(TextInputStyle? disableStyle);
|
||||||
|
TextInputComponent controller(TextEditingController? controller);
|
||||||
|
TextInputComponent focusNode(FocusNode? focusNode);
|
||||||
|
TextInputComponent keyboardType(TextInputType? keyboardType);
|
||||||
|
TextInputComponent smartDashesType(SmartDashesType? smartDashesType);
|
||||||
|
TextInputComponent smartQuotesType(SmartQuotesType? smartQuotesType);
|
||||||
|
TextInputComponent enableInteractiveSelection(
|
||||||
|
bool? enableInteractiveSelection);
|
||||||
|
TextInputComponent textInputAction(TextInputAction? textInputAction);
|
||||||
|
TextInputComponent textCapitalization(TextCapitalization? textCapitalization);
|
||||||
|
TextInputComponent style(TextStyle? style);
|
||||||
|
TextInputComponent strutStyle(StrutStyle? strutStyle);
|
||||||
|
TextInputComponent textAlign(TextAlign? textAlign);
|
||||||
|
TextInputComponent textAlignVertical(TextAlignVertical? textAlignVertical);
|
||||||
|
TextInputComponent textDirection(TextDirection? textDirection);
|
||||||
|
TextInputComponent readOnly(bool? readOnly);
|
||||||
|
TextInputComponent showCursor(bool? showCursor);
|
||||||
|
TextInputComponent autofocus(bool? autofocus);
|
||||||
|
TextInputComponent obscuringCharacter(String? obscuringCharacter);
|
||||||
|
TextInputComponent obscureText(bool? obscureText);
|
||||||
|
TextInputComponent autocorrect(bool? autocorrect);
|
||||||
|
TextInputComponent enableSuggestions(bool? enableSuggestions);
|
||||||
|
TextInputComponent maxLines(int? maxLines);
|
||||||
|
TextInputComponent minLines(int? minLines);
|
||||||
|
TextInputComponent expands(bool? expands);
|
||||||
|
TextInputComponent maxLength(int? maxLength);
|
||||||
|
TextInputComponent maxLengthEnforcement(
|
||||||
|
MaxLengthEnforcement? maxLengthEnforcement);
|
||||||
|
TextInputComponent onChanged(void Function(String)? onChanged);
|
||||||
|
TextInputComponent onEditingComplete(void Function()? onEditingComplete);
|
||||||
|
TextInputComponent onSubmitted(void Function(String)? onSubmitted);
|
||||||
|
TextInputComponent onAppPrivateCommand(
|
||||||
|
void Function(String, Map<String, dynamic>)? onAppPrivateCommand);
|
||||||
|
TextInputComponent inputFormatters(List<TextInputFormatter>? inputFormatters);
|
||||||
|
TextInputComponent enabled(ValueNotifier<bool>? enabled);
|
||||||
|
TextInputComponent cursorWidth(double? cursorWidth);
|
||||||
|
TextInputComponent cursorHeight(double? cursorHeight);
|
||||||
|
TextInputComponent cursorRadius(Radius? cursorRadius);
|
||||||
|
TextInputComponent cursorColor(Color? cursorColor);
|
||||||
|
TextInputComponent selectionHeightStyle(BoxHeightStyle? selectionHeightStyle);
|
||||||
|
TextInputComponent selectionWidthStyle(BoxWidthStyle? selectionWidthStyle);
|
||||||
|
TextInputComponent keyboardAppearance(Brightness? keyboardAppearance);
|
||||||
|
TextInputComponent scrollPadding(EdgeInsets? scrollPadding);
|
||||||
|
TextInputComponent dragStartBehavior(DragStartBehavior? dragStartBehavior);
|
||||||
|
TextInputComponent selectionControls(
|
||||||
|
TextSelectionControls? selectionControls);
|
||||||
|
TextInputComponent onTap(void Function()? onTap);
|
||||||
|
TextInputComponent onTapOutside(
|
||||||
|
void Function(PointerDownEvent)? onTapOutside);
|
||||||
|
TextInputComponent mouseCursor(MouseCursor? mouseCursor);
|
||||||
|
TextInputComponent scrollController(ScrollController? scrollController);
|
||||||
|
TextInputComponent scrollPhysics(ScrollPhysics? scrollPhysics);
|
||||||
|
TextInputComponent autofillHints(Iterable<String>? autofillHints);
|
||||||
|
TextInputComponent clipBehavior(Clip? clipBehavior);
|
||||||
|
TextInputComponent restorationId(String? restorationId);
|
||||||
|
TextInputComponent scribbleEnabled(bool? scribbleEnabled);
|
||||||
|
TextInputComponent enableIMEPersonalizedLearning(
|
||||||
|
bool? enableIMEPersonalizedLearning);
|
||||||
|
TextInputComponent contextMenuBuilder(
|
||||||
|
Widget Function(BuildContext, EditableTextState)? contextMenuBuilder);
|
||||||
|
TextInputComponent spellCheckConfiguration(
|
||||||
|
SpellCheckConfiguration? spellCheckConfiguration);
|
||||||
|
TextInputComponent magnifierConfiguration(
|
||||||
|
TextMagnifierConfiguration? magnifierConfiguration);
|
||||||
|
TextInputComponent key(Key? key);
|
||||||
|
TextInputComponent call({
|
||||||
|
bool? expand,
|
||||||
|
String Function(String)? onError,
|
||||||
|
bool Function(String)? validator,
|
||||||
|
TextWrapper? suffixText,
|
||||||
|
TextWrapper? prefixText,
|
||||||
|
Icon? prefixIcon,
|
||||||
|
Icon? suffixIcon,
|
||||||
|
TextWrapper? label,
|
||||||
|
TextWrapper? hint,
|
||||||
|
TextInputStyle? normalStyle,
|
||||||
|
TextInputStyle? focusedStyle,
|
||||||
|
TextInputStyle? errorStyle,
|
||||||
|
TextInputStyle? disableStyle,
|
||||||
|
TextEditingController? controller,
|
||||||
|
FocusNode? focusNode,
|
||||||
|
TextInputType? keyboardType,
|
||||||
|
SmartDashesType? smartDashesType,
|
||||||
|
SmartQuotesType? smartQuotesType,
|
||||||
|
bool? enableInteractiveSelection,
|
||||||
|
TextInputAction? textInputAction,
|
||||||
|
TextCapitalization? textCapitalization,
|
||||||
|
TextStyle? style,
|
||||||
|
StrutStyle? strutStyle,
|
||||||
|
TextAlign? textAlign,
|
||||||
|
TextAlignVertical? textAlignVertical,
|
||||||
|
TextDirection? textDirection,
|
||||||
|
bool? readOnly,
|
||||||
|
bool? showCursor,
|
||||||
|
bool? autofocus,
|
||||||
|
String? obscuringCharacter,
|
||||||
|
bool? obscureText,
|
||||||
|
bool? autocorrect,
|
||||||
|
bool? enableSuggestions,
|
||||||
|
int? maxLines,
|
||||||
|
int? minLines,
|
||||||
|
bool? expands,
|
||||||
|
int? maxLength,
|
||||||
|
MaxLengthEnforcement? maxLengthEnforcement,
|
||||||
|
void Function(String)? onChanged,
|
||||||
|
void Function()? onEditingComplete,
|
||||||
|
void Function(String)? onSubmitted,
|
||||||
|
void Function(String, Map<String, dynamic>)? onAppPrivateCommand,
|
||||||
|
List<TextInputFormatter>? inputFormatters,
|
||||||
|
ValueNotifier<bool>? enabled,
|
||||||
|
double? cursorWidth,
|
||||||
|
double? cursorHeight,
|
||||||
|
Radius? cursorRadius,
|
||||||
|
Color? cursorColor,
|
||||||
|
BoxHeightStyle? selectionHeightStyle,
|
||||||
|
BoxWidthStyle? selectionWidthStyle,
|
||||||
|
Brightness? keyboardAppearance,
|
||||||
|
EdgeInsets? scrollPadding,
|
||||||
|
DragStartBehavior? dragStartBehavior,
|
||||||
|
TextSelectionControls? selectionControls,
|
||||||
|
void Function()? onTap,
|
||||||
|
void Function(PointerDownEvent)? onTapOutside,
|
||||||
|
MouseCursor? mouseCursor,
|
||||||
|
ScrollController? scrollController,
|
||||||
|
ScrollPhysics? scrollPhysics,
|
||||||
|
Iterable<String>? autofillHints,
|
||||||
|
Clip? clipBehavior,
|
||||||
|
String? restorationId,
|
||||||
|
bool? scribbleEnabled,
|
||||||
|
bool? enableIMEPersonalizedLearning,
|
||||||
|
Widget Function(BuildContext, EditableTextState)? contextMenuBuilder,
|
||||||
|
SpellCheckConfiguration? spellCheckConfiguration,
|
||||||
|
TextMagnifierConfiguration? magnifierConfiguration,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
+133
@@ -0,0 +1,133 @@
|
|||||||
|
// 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_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
|
class TextInputStyle extends ThemeStyle<TextInputStyle> {
|
||||||
|
TextInputStyle({
|
||||||
|
this.labelStyle,
|
||||||
|
this.hintStyle,
|
||||||
|
this.backgroundColors,
|
||||||
|
this.borderColors,
|
||||||
|
this.boxShadow,
|
||||||
|
this.radius,
|
||||||
|
this.inputStyle,
|
||||||
|
this.iconColor,
|
||||||
|
this.prefixStyle,
|
||||||
|
this.prefixIconColor,
|
||||||
|
this.suffixStyle,
|
||||||
|
this.suffixIconColor,
|
||||||
|
});
|
||||||
|
|
||||||
|
final TextStyle? labelStyle;
|
||||||
|
final TextStyle? hintStyle;
|
||||||
|
|
||||||
|
final Color? iconColor;
|
||||||
|
final TextStyle? prefixStyle;
|
||||||
|
final Color? prefixIconColor;
|
||||||
|
final TextStyle? suffixStyle;
|
||||||
|
final Color? suffixIconColor;
|
||||||
|
|
||||||
|
final MultiColor? backgroundColors;
|
||||||
|
final Color? borderColors;
|
||||||
|
final BoxShadow? boxShadow;
|
||||||
|
final BorderRadiusGeometry? radius;
|
||||||
|
final TextStyle? inputStyle;
|
||||||
|
|
||||||
|
static TextInputStyle? merge(TextInputStyle? a, TextInputStyle? b) {
|
||||||
|
if (b == null) {
|
||||||
|
return a?.copyWith();
|
||||||
|
}
|
||||||
|
if (a == null) {
|
||||||
|
return b.copyWith();
|
||||||
|
}
|
||||||
|
return a.copyWith(
|
||||||
|
labelStyle: b.labelStyle,
|
||||||
|
hintStyle: b.hintStyle,
|
||||||
|
backgroundColors: b.backgroundColors,
|
||||||
|
borderColors: b.borderColors,
|
||||||
|
boxShadow: b.boxShadow,
|
||||||
|
radius: b.radius,
|
||||||
|
inputStyle: b.inputStyle,
|
||||||
|
iconColor: b.iconColor,
|
||||||
|
prefixStyle: b.prefixStyle,
|
||||||
|
prefixIconColor: b.prefixIconColor,
|
||||||
|
suffixIconColor: b.suffixIconColor,
|
||||||
|
suffixStyle: b.suffixStyle,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static TextInputStyle? lerp(
|
||||||
|
TextInputStyle? a,
|
||||||
|
TextInputStyle? b,
|
||||||
|
double t,
|
||||||
|
) {
|
||||||
|
if (a == null || b == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return b.copyWith(
|
||||||
|
labelStyle: TextStyle.lerp(a.labelStyle, b.labelStyle, t),
|
||||||
|
hintStyle: TextStyle.lerp(a.hintStyle, b.hintStyle, t),
|
||||||
|
backgroundColors:
|
||||||
|
MultiColor.lerp(a.backgroundColors, b.backgroundColors, t),
|
||||||
|
radius: BorderRadiusGeometry.lerp(a.radius, b.radius, t),
|
||||||
|
borderColors: Color.lerp(a.borderColors, b.borderColors, t),
|
||||||
|
boxShadow: BoxShadow.lerp(a.boxShadow, b.boxShadow, t),
|
||||||
|
inputStyle: TextStyle.lerp(a.inputStyle, b.inputStyle, t),
|
||||||
|
prefixStyle: TextStyle.lerp(a.prefixStyle, b.prefixStyle, t),
|
||||||
|
suffixStyle: TextStyle.lerp(a.suffixStyle, b.suffixStyle, t),
|
||||||
|
prefixIconColor: Color.lerp(a.prefixIconColor, b.prefixIconColor, t),
|
||||||
|
suffixIconColor: Color.lerp(a.suffixIconColor, b.suffixIconColor, t),
|
||||||
|
iconColor: Color.lerp(a.iconColor, b.iconColor, t),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
TextInputStyle? mergeWith(TextInputStyle? other) =>
|
||||||
|
TextInputStyle.merge(this, other);
|
||||||
|
|
||||||
|
@override
|
||||||
|
TextInputStyle copyWith({
|
||||||
|
TextStyle? labelStyle,
|
||||||
|
TextStyle? hintStyle,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
Color? borderColors,
|
||||||
|
BoxShadow? boxShadow,
|
||||||
|
BorderRadiusGeometry? radius,
|
||||||
|
TextStyle? inputStyle,
|
||||||
|
Color? iconColor,
|
||||||
|
TextStyle? prefixStyle,
|
||||||
|
Color? prefixIconColor,
|
||||||
|
TextStyle? suffixStyle,
|
||||||
|
Color? suffixIconColor,
|
||||||
|
}) =>
|
||||||
|
TextInputStyle(
|
||||||
|
labelStyle: labelStyle ?? this.labelStyle,
|
||||||
|
hintStyle: hintStyle ?? this.hintStyle,
|
||||||
|
backgroundColors: backgroundColors ?? this.backgroundColors,
|
||||||
|
radius: radius ?? this.radius,
|
||||||
|
borderColors: borderColors ?? this.borderColors,
|
||||||
|
boxShadow: boxShadow ?? this.boxShadow,
|
||||||
|
inputStyle: inputStyle ?? this.inputStyle,
|
||||||
|
prefixStyle: prefixStyle ?? this.prefixStyle,
|
||||||
|
suffixStyle: suffixStyle ?? this.suffixStyle,
|
||||||
|
prefixIconColor: prefixIconColor ?? this.prefixIconColor,
|
||||||
|
suffixIconColor: suffixIconColor ?? this.suffixIconColor,
|
||||||
|
iconColor: iconColor ?? this.iconColor,
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// 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 './text_input_component.dart';
|
||||||
|
export './text_input_style.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/>.
|
||||||
|
|
||||||
|
abstract class ThemeStyle<T> {
|
||||||
|
const ThemeStyle();
|
||||||
|
|
||||||
|
/// Merges non-null `other` attributes in `this` and returns a copy.
|
||||||
|
T? mergeWith(T? other);
|
||||||
|
|
||||||
|
/// Copy with (mandatory for mergeWith, needs to be simple and ignore `null`)
|
||||||
|
T? copyWith();
|
||||||
|
}
|
||||||
@@ -18,14 +18,14 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:wyatt_ui_components/src/features/features.dart';
|
import 'package:wyatt_ui_components/src/features/features.dart';
|
||||||
|
|
||||||
class ComponentTheme extends StatelessWidget {
|
class ComponentTheme extends StatelessWidget {
|
||||||
final Widget child;
|
|
||||||
final ComponentThemeData componentThemeWidget;
|
|
||||||
|
|
||||||
const ComponentTheme({
|
const ComponentTheme({
|
||||||
required this.child,
|
required this.child,
|
||||||
required this.componentThemeWidget,
|
required this.componentThemeWidget,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
final Widget child;
|
||||||
|
final ComponentThemeData componentThemeWidget;
|
||||||
|
|
||||||
static ComponentThemeData of(BuildContext context) {
|
static ComponentThemeData of(BuildContext context) {
|
||||||
final _InheritedComponentTheme? inheritedThemeComponent =
|
final _InheritedComponentTheme? inheritedThemeComponent =
|
||||||
@@ -46,11 +46,11 @@ class ComponentTheme extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _InheritedComponentTheme extends InheritedWidget {
|
class _InheritedComponentTheme extends InheritedWidget {
|
||||||
final ComponentTheme themeWidget;
|
|
||||||
const _InheritedComponentTheme(
|
const _InheritedComponentTheme(
|
||||||
this.themeWidget, {
|
this.themeWidget, {
|
||||||
required super.child,
|
required super.child,
|
||||||
});
|
});
|
||||||
|
final ComponentTheme themeWidget;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool updateShouldNotify(covariant InheritedWidget oldWidget) =>
|
bool updateShouldNotify(covariant InheritedWidget oldWidget) =>
|
||||||
|
|||||||
@@ -14,18 +14,88 @@
|
|||||||
// 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:copy_with_extension/copy_with_extension.dart';
|
||||||
import 'package:wyatt_ui_components/src/domain/entities/entities.dart';
|
import 'package:wyatt_ui_components/src/domain/entities/entities.dart';
|
||||||
|
part 'component_theme_data.g.dart';
|
||||||
|
|
||||||
|
@CopyWith()
|
||||||
class ComponentThemeData {
|
class ComponentThemeData {
|
||||||
final AppBarComponent? appBar;
|
factory ComponentThemeData({
|
||||||
final BottomNavigationBarComponent? bottomNavigationBar;
|
TopAppBarComponent? appBar,
|
||||||
final ErrorWidgetComponent? errorWidget;
|
TopNavigationBarComponent? topNavigationBarComponent,
|
||||||
final LoadingWidgetComponent? loadingWidget;
|
BottomNavigationBarComponent? bottomNavigationBar,
|
||||||
|
ErrorWidgetComponent? errorWidget,
|
||||||
|
LoadingWidgetComponent? loadingWidget,
|
||||||
|
LoaderComponent? loaderComponent,
|
||||||
|
RichTextBuilderComponent? richTextBuilderComponent,
|
||||||
|
TextInputComponent? textInputComponent,
|
||||||
|
FileSelectionButtonComponent? fileSelectionButtonComponent,
|
||||||
|
FlatButtonComponent? flatButtonComponent,
|
||||||
|
SimpleIconButtonComponent? simpleIconButtonComponent,
|
||||||
|
SymbolButtonComponent? symbolButtonComponent,
|
||||||
|
InformationCardComponent? informationCardComponent,
|
||||||
|
PortfolioCardComponent? portfolioCardComponent,
|
||||||
|
QuoteCardComponent? quoteCardComponent,
|
||||||
|
SkillCardComponent? skillCardComponent,
|
||||||
|
}) =>
|
||||||
|
ComponentThemeData.raw(
|
||||||
|
appBar: appBar,
|
||||||
|
topNavigationBarComponent: topNavigationBarComponent,
|
||||||
|
bottomNavigationBar: bottomNavigationBar,
|
||||||
|
errorWidget: errorWidget,
|
||||||
|
loadingWidget: loadingWidget,
|
||||||
|
loaderComponent: loaderComponent,
|
||||||
|
richTextBuilderComponent: richTextBuilderComponent,
|
||||||
|
textInputComponent: textInputComponent,
|
||||||
|
fileSelectionButtonComponent: fileSelectionButtonComponent,
|
||||||
|
flatButtonComponent: flatButtonComponent,
|
||||||
|
simpleIconButtonComponent: simpleIconButtonComponent,
|
||||||
|
symbolButtonComponent: symbolButtonComponent,
|
||||||
|
informationCardComponent: informationCardComponent,
|
||||||
|
portfolioCardComponent: portfolioCardComponent,
|
||||||
|
quoteCardComponent: quoteCardComponent,
|
||||||
|
skillCardComponent: skillCardComponent,
|
||||||
|
);
|
||||||
|
|
||||||
const ComponentThemeData.raw({
|
const ComponentThemeData.raw({
|
||||||
this.appBar,
|
this.appBar,
|
||||||
|
this.topNavigationBarComponent,
|
||||||
this.bottomNavigationBar,
|
this.bottomNavigationBar,
|
||||||
this.errorWidget,
|
this.errorWidget,
|
||||||
this.loadingWidget,
|
this.loadingWidget,
|
||||||
|
this.loaderComponent,
|
||||||
|
this.richTextBuilderComponent,
|
||||||
|
this.textInputComponent,
|
||||||
|
this.fileSelectionButtonComponent,
|
||||||
|
this.flatButtonComponent,
|
||||||
|
this.simpleIconButtonComponent,
|
||||||
|
this.symbolButtonComponent,
|
||||||
|
this.informationCardComponent,
|
||||||
|
this.portfolioCardComponent,
|
||||||
|
this.quoteCardComponent,
|
||||||
|
this.skillCardComponent,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final TopAppBarComponent? appBar;
|
||||||
|
|
||||||
|
final TopNavigationBarComponent? topNavigationBarComponent;
|
||||||
|
final BottomNavigationBarComponent? bottomNavigationBar;
|
||||||
|
final ErrorWidgetComponent? errorWidget;
|
||||||
|
final LoadingWidgetComponent? loadingWidget;
|
||||||
|
final LoaderComponent? loaderComponent;
|
||||||
|
|
||||||
|
final RichTextBuilderComponent? richTextBuilderComponent;
|
||||||
|
final TextInputComponent? textInputComponent;
|
||||||
|
|
||||||
|
// Buttons
|
||||||
|
final FileSelectionButtonComponent? fileSelectionButtonComponent;
|
||||||
|
final FlatButtonComponent? flatButtonComponent;
|
||||||
|
final SimpleIconButtonComponent? simpleIconButtonComponent;
|
||||||
|
final SymbolButtonComponent? symbolButtonComponent;
|
||||||
|
|
||||||
|
// Cards
|
||||||
|
final InformationCardComponent? informationCardComponent;
|
||||||
|
final PortfolioCardComponent? portfolioCardComponent;
|
||||||
|
final QuoteCardComponent? quoteCardComponent;
|
||||||
|
final SkillCardComponent? skillCardComponent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,265 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'component_theme_data.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// CopyWithGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class _$ComponentThemeDataCWProxy {
|
||||||
|
ComponentThemeData appBar(TopAppBarComponent? appBar);
|
||||||
|
|
||||||
|
ComponentThemeData topNavigationBarComponent(
|
||||||
|
TopNavigationBarComponent? topNavigationBarComponent);
|
||||||
|
|
||||||
|
ComponentThemeData bottomNavigationBar(
|
||||||
|
BottomNavigationBarComponent? bottomNavigationBar);
|
||||||
|
|
||||||
|
ComponentThemeData errorWidget(ErrorWidgetComponent? errorWidget);
|
||||||
|
|
||||||
|
ComponentThemeData loadingWidget(LoadingWidgetComponent? loadingWidget);
|
||||||
|
|
||||||
|
ComponentThemeData loaderComponent(LoaderComponent? loaderComponent);
|
||||||
|
|
||||||
|
ComponentThemeData richTextBuilderComponent(
|
||||||
|
RichTextBuilderComponent? richTextBuilderComponent);
|
||||||
|
|
||||||
|
ComponentThemeData textInputComponent(TextInputComponent? textInputComponent);
|
||||||
|
|
||||||
|
ComponentThemeData fileSelectionButtonComponent(
|
||||||
|
FileSelectionButtonComponent? fileSelectionButtonComponent);
|
||||||
|
|
||||||
|
ComponentThemeData flatButtonComponent(
|
||||||
|
FlatButtonComponent? flatButtonComponent);
|
||||||
|
|
||||||
|
ComponentThemeData simpleIconButtonComponent(
|
||||||
|
SimpleIconButtonComponent? simpleIconButtonComponent);
|
||||||
|
|
||||||
|
ComponentThemeData symbolButtonComponent(
|
||||||
|
SymbolButtonComponent? symbolButtonComponent);
|
||||||
|
|
||||||
|
ComponentThemeData informationCardComponent(
|
||||||
|
InformationCardComponent? informationCardComponent);
|
||||||
|
|
||||||
|
ComponentThemeData portfolioCardComponent(
|
||||||
|
PortfolioCardComponent? portfolioCardComponent);
|
||||||
|
|
||||||
|
ComponentThemeData quoteCardComponent(QuoteCardComponent? quoteCardComponent);
|
||||||
|
|
||||||
|
ComponentThemeData skillCardComponent(SkillCardComponent? skillCardComponent);
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ComponentThemeData(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// ComponentThemeData(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
ComponentThemeData call({
|
||||||
|
TopAppBarComponent? appBar,
|
||||||
|
TopNavigationBarComponent? topNavigationBarComponent,
|
||||||
|
BottomNavigationBarComponent? bottomNavigationBar,
|
||||||
|
ErrorWidgetComponent? errorWidget,
|
||||||
|
LoadingWidgetComponent? loadingWidget,
|
||||||
|
LoaderComponent? loaderComponent,
|
||||||
|
RichTextBuilderComponent? richTextBuilderComponent,
|
||||||
|
TextInputComponent? textInputComponent,
|
||||||
|
FileSelectionButtonComponent? fileSelectionButtonComponent,
|
||||||
|
FlatButtonComponent? flatButtonComponent,
|
||||||
|
SimpleIconButtonComponent? simpleIconButtonComponent,
|
||||||
|
SymbolButtonComponent? symbolButtonComponent,
|
||||||
|
InformationCardComponent? informationCardComponent,
|
||||||
|
PortfolioCardComponent? portfolioCardComponent,
|
||||||
|
QuoteCardComponent? quoteCardComponent,
|
||||||
|
SkillCardComponent? skillCardComponent,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfComponentThemeData.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfComponentThemeData.copyWith.fieldName(...)`
|
||||||
|
class _$ComponentThemeDataCWProxyImpl implements _$ComponentThemeDataCWProxy {
|
||||||
|
const _$ComponentThemeDataCWProxyImpl(this._value);
|
||||||
|
|
||||||
|
final ComponentThemeData _value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData appBar(TopAppBarComponent? appBar) => this(appBar: appBar);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData topNavigationBarComponent(
|
||||||
|
TopNavigationBarComponent? topNavigationBarComponent) =>
|
||||||
|
this(topNavigationBarComponent: topNavigationBarComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData bottomNavigationBar(
|
||||||
|
BottomNavigationBarComponent? bottomNavigationBar) =>
|
||||||
|
this(bottomNavigationBar: bottomNavigationBar);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData errorWidget(ErrorWidgetComponent? errorWidget) =>
|
||||||
|
this(errorWidget: errorWidget);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData loadingWidget(LoadingWidgetComponent? loadingWidget) =>
|
||||||
|
this(loadingWidget: loadingWidget);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData loaderComponent(LoaderComponent? loaderComponent) =>
|
||||||
|
this(loaderComponent: loaderComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData richTextBuilderComponent(
|
||||||
|
RichTextBuilderComponent? richTextBuilderComponent) =>
|
||||||
|
this(richTextBuilderComponent: richTextBuilderComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData textInputComponent(
|
||||||
|
TextInputComponent? textInputComponent) =>
|
||||||
|
this(textInputComponent: textInputComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData fileSelectionButtonComponent(
|
||||||
|
FileSelectionButtonComponent? fileSelectionButtonComponent) =>
|
||||||
|
this(fileSelectionButtonComponent: fileSelectionButtonComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData flatButtonComponent(
|
||||||
|
FlatButtonComponent? flatButtonComponent) =>
|
||||||
|
this(flatButtonComponent: flatButtonComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData simpleIconButtonComponent(
|
||||||
|
SimpleIconButtonComponent? simpleIconButtonComponent) =>
|
||||||
|
this(simpleIconButtonComponent: simpleIconButtonComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData symbolButtonComponent(
|
||||||
|
SymbolButtonComponent? symbolButtonComponent) =>
|
||||||
|
this(symbolButtonComponent: symbolButtonComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData informationCardComponent(
|
||||||
|
InformationCardComponent? informationCardComponent) =>
|
||||||
|
this(informationCardComponent: informationCardComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData portfolioCardComponent(
|
||||||
|
PortfolioCardComponent? portfolioCardComponent) =>
|
||||||
|
this(portfolioCardComponent: portfolioCardComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData quoteCardComponent(
|
||||||
|
QuoteCardComponent? quoteCardComponent) =>
|
||||||
|
this(quoteCardComponent: quoteCardComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ComponentThemeData skillCardComponent(
|
||||||
|
SkillCardComponent? skillCardComponent) =>
|
||||||
|
this(skillCardComponent: skillCardComponent);
|
||||||
|
|
||||||
|
@override
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ComponentThemeData(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// ComponentThemeData(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
ComponentThemeData call({
|
||||||
|
Object? appBar = const $CopyWithPlaceholder(),
|
||||||
|
Object? topNavigationBarComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? bottomNavigationBar = const $CopyWithPlaceholder(),
|
||||||
|
Object? errorWidget = const $CopyWithPlaceholder(),
|
||||||
|
Object? loadingWidget = const $CopyWithPlaceholder(),
|
||||||
|
Object? loaderComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? richTextBuilderComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? textInputComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? fileSelectionButtonComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? flatButtonComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? simpleIconButtonComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? symbolButtonComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? informationCardComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? portfolioCardComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? quoteCardComponent = const $CopyWithPlaceholder(),
|
||||||
|
Object? skillCardComponent = const $CopyWithPlaceholder(),
|
||||||
|
}) {
|
||||||
|
return ComponentThemeData(
|
||||||
|
appBar: appBar == const $CopyWithPlaceholder()
|
||||||
|
? _value.appBar
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: appBar as TopAppBarComponent?,
|
||||||
|
topNavigationBarComponent:
|
||||||
|
topNavigationBarComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.topNavigationBarComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: topNavigationBarComponent as TopNavigationBarComponent?,
|
||||||
|
bottomNavigationBar: bottomNavigationBar == const $CopyWithPlaceholder()
|
||||||
|
? _value.bottomNavigationBar
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: bottomNavigationBar as BottomNavigationBarComponent?,
|
||||||
|
errorWidget: errorWidget == const $CopyWithPlaceholder()
|
||||||
|
? _value.errorWidget
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: errorWidget as ErrorWidgetComponent?,
|
||||||
|
loadingWidget: loadingWidget == const $CopyWithPlaceholder()
|
||||||
|
? _value.loadingWidget
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: loadingWidget as LoadingWidgetComponent?,
|
||||||
|
loaderComponent: loaderComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.loaderComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: loaderComponent as LoaderComponent?,
|
||||||
|
richTextBuilderComponent:
|
||||||
|
richTextBuilderComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.richTextBuilderComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: richTextBuilderComponent as RichTextBuilderComponent?,
|
||||||
|
textInputComponent: textInputComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.textInputComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: textInputComponent as TextInputComponent?,
|
||||||
|
fileSelectionButtonComponent:
|
||||||
|
fileSelectionButtonComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.fileSelectionButtonComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: fileSelectionButtonComponent as FileSelectionButtonComponent?,
|
||||||
|
flatButtonComponent: flatButtonComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.flatButtonComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: flatButtonComponent as FlatButtonComponent?,
|
||||||
|
simpleIconButtonComponent:
|
||||||
|
simpleIconButtonComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.simpleIconButtonComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: simpleIconButtonComponent as SimpleIconButtonComponent?,
|
||||||
|
symbolButtonComponent:
|
||||||
|
symbolButtonComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.symbolButtonComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: symbolButtonComponent as SymbolButtonComponent?,
|
||||||
|
informationCardComponent:
|
||||||
|
informationCardComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.informationCardComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: informationCardComponent as InformationCardComponent?,
|
||||||
|
portfolioCardComponent:
|
||||||
|
portfolioCardComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.portfolioCardComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: portfolioCardComponent as PortfolioCardComponent?,
|
||||||
|
quoteCardComponent: quoteCardComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.quoteCardComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: quoteCardComponent as QuoteCardComponent?,
|
||||||
|
skillCardComponent: skillCardComponent == const $CopyWithPlaceholder()
|
||||||
|
? _value.skillCardComponent
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: skillCardComponent as SkillCardComponent?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension $ComponentThemeDataCopyWith on ComponentThemeData {
|
||||||
|
/// Returns a callable class that can be used as follows: `instanceOfComponentThemeData.copyWith(...)` or like so:`instanceOfComponentThemeData.copyWith.fieldName(...)`.
|
||||||
|
// ignore: library_private_types_in_public_api
|
||||||
|
_$ComponentThemeDataCWProxy get copyWith =>
|
||||||
|
_$ComponentThemeDataCWProxyImpl(this);
|
||||||
|
}
|
||||||
@@ -14,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/>.
|
||||||
|
|
||||||
export 'component_theme_data.dart';
|
|
||||||
export 'component_theme.dart';
|
export 'component_theme.dart';
|
||||||
|
export 'component_theme_data.dart';
|
||||||
|
|||||||
@@ -3,29 +3,28 @@ description: Primary ui components
|
|||||||
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_ui_components
|
repository: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_ui_components
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
|
|
||||||
|
publish_to: none
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.0 <3.0.0"
|
sdk: ">=2.17.0 <3.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter: { sdk: flutter }
|
||||||
sdk: flutter
|
copy_with_extension: ^5.0.0
|
||||||
wyatt_component_copy_with_extension:
|
wyatt_component_copy_with_extension:
|
||||||
git:
|
git:
|
||||||
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
||||||
path: packages/wyatt_component_copy_with_extension
|
path: packages/wyatt_component_copy_with_extension
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test: { sdk: flutter }
|
||||||
sdk: flutter
|
wyatt_analysis:
|
||||||
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
|
version: ^2.4.0
|
||||||
|
|
||||||
build_runner: ^2.3.3
|
build_runner: ^2.3.3
|
||||||
|
copy_with_extension_gen: ^5.0.0
|
||||||
wyatt_component_copy_with_gen:
|
wyatt_component_copy_with_gen:
|
||||||
git:
|
git:
|
||||||
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
url: ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
||||||
path: packages/wyatt_component_copy_with_gen
|
path: packages/wyatt_component_copy_with_gen
|
||||||
|
|
||||||
wyatt_analysis:
|
|
||||||
git:
|
|
||||||
url: https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages
|
|
||||||
ref: wyatt_analysis-v2.4.0
|
|
||||||
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
|
||||||
+24
@@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
+34
@@ -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"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
+72
@@ -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,69 @@
|
|||||||
|
<!--
|
||||||
|
* 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 Ui Kit
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
UIKit and Design System used in Wyatt Studio.
|
||||||
|
|
||||||
|
## Theme negotiation
|
||||||
|
|
||||||
|
When building a component, most of its attributes can be 'null'.
|
||||||
|
The `build()` method then starts to negotiate the theme in the tree to obtain the most consistent style possible.
|
||||||
|
|
||||||
|
Explanation:
|
||||||
|
|
||||||
|
When you build a component `Button({double? radius})`.
|
||||||
|
You have several possibilities:
|
||||||
|
1) Pass the "radius" into the constructor, `Button(radius: 12)`.
|
||||||
|
2) Set up a theme extension `ButtonThemeExtension(radius: 15)`.
|
||||||
|
3) Let `wyatt_ui_kit` "negotiate" and try to find a suitable style in the flutter theme.
|
||||||
|
|
||||||
|
If this negotiation phase fails, then:
|
||||||
|
- If the value is mandatory: a hardcoded value in "wyatt_ui_kit" is chosen.
|
||||||
|
- If not, the style is simply not applied.
|
||||||
|
|
||||||
|
If, for example, you don't use option 1, then the radius will be 15. If you use neither option 1 nor option 2 then the radius will be 4 as this is the [official Material Design value](https://m2.material.io/design/shape/about-shape.html#shape-customization-tool).
|
||||||
|
|
||||||
|
## 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.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
include: package:wyatt_analysis/analysis_options.flutter.yaml
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
targets:
|
||||||
|
$default:
|
||||||
|
builders:
|
||||||
|
# Typically the builder key is just the package name, run `pub run build_runner doctor` to check your config.
|
||||||
|
wyatt_component_copy_with_gen:component_copy_with_gen:
|
||||||
|
generate_for:
|
||||||
|
# Example glob for only the Dart files under `lib/models`
|
||||||
|
- lib/**/*.dart
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"projects": {
|
||||||
|
"default": "studio-landpage"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
# 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/
|
||||||
|
|
||||||
|
# Firebase
|
||||||
|
.firebase/
|
||||||
|
|
||||||
|
# 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: 32fb2f948e9b1a2d1b876ebee3558be7f51b457f
|
||||||
|
channel: stable
|
||||||
|
|
||||||
|
project_type: app
|
||||||
|
|
||||||
|
# Tracks metadata for the flutter migrate command
|
||||||
|
migration:
|
||||||
|
platforms:
|
||||||
|
- platform: root
|
||||||
|
create_revision: 32fb2f948e9b1a2d1b876ebee3558be7f51b457f
|
||||||
|
base_revision: 32fb2f948e9b1a2d1b876ebee3558be7f51b457f
|
||||||
|
- platform: macos
|
||||||
|
create_revision: 32fb2f948e9b1a2d1b876ebee3558be7f51b457f
|
||||||
|
base_revision: 32fb2f948e9b1a2d1b876ebee3558be7f51b457f
|
||||||
|
|
||||||
|
# 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,9 @@
|
|||||||
|
# Wyatt UIKIt Example
|
||||||
|
|
||||||
|
You can force the launch page. (For debug purposes).
|
||||||
|
|
||||||
|
```shell
|
||||||
|
flutter run -d macos --dart-define PAGE=1 --dart-define THEME=1
|
||||||
|
```
|
||||||
|
|
||||||
|
> This will forces `Buttons` page with `Studio` theme
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
include: package:wyatt_analysis/analysis_options.flutter.yaml
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user