Compare commits
57
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -17,11 +17,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
<a href="https://wyatt-studio.fr">
|
||||||
<a href="https://wyattapp.io">
|
|
||||||
<img width="150px" src="resources/wyatt-campus-logo.png">
|
|
||||||
</a>
|
|
||||||
<a href="https://wyatt-studio.fr">
|
|
||||||
<img width="150px" src="resources/wyatt-studio-logo.png">
|
<img width="150px" src="resources/wyatt-studio-logo.png">
|
||||||
</a>
|
</a>
|
||||||
<h1 align="center">Wyatt Packages</h1>
|
<h1 align="center">Wyatt Packages</h1>
|
||||||
@@ -44,10 +40,9 @@
|
|||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
Here is it a set of [Flutter plugins](https://flutter.io/platform-plugins/) that power up your applications.
|
Here is a set of [Flutter plugins](https://flutter.io/platform-plugins/) that enhance your applications.
|
||||||
|
|
||||||
[Flutter](https://flutter.dev) is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. Flutter is used by developers and organizations around the world, and is free
|
[Flutter](https://flutter.dev) is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop using a single codebase. It is used by developers and organizations worldwide and is free and open-source.
|
||||||
and open source.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -61,21 +56,21 @@ git clone ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-packages.git
|
|||||||
|
|
||||||
### Prerequisite
|
### Prerequisite
|
||||||
|
|
||||||
- [Flutter](https://github.com/flutter/flutter).
|
1. [Flutter](https://github.com/flutter/flutter). It is a UI toolkit developed by Google for building beautiful and natively compiled applications for mobile, web, and desktop from a single codebase.
|
||||||
|
|
||||||
- [Melos](https://github.com/invertase/melos). Used to manage Dart projects with multiple packages.
|
2. [Melos](https://github.com/invertase/melos). Melos is a tool that helps in managing Dart projects that have multiple packages. It can be installed using the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dart pub global activate melos
|
dart pub global activate melos
|
||||||
```
|
```
|
||||||
|
|
||||||
- [Mason](https://github.com/felangel/mason). Used for code generation.
|
3. [Mason](https://github.com/felangel/mason). Mason is used for code generation purposes. It can be installed by running the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dart pub global activate mason_cli
|
dart pub global activate mason_cli
|
||||||
```
|
```
|
||||||
|
|
||||||
- [Lcov](https://github.com/linux-test-project/lcov). Used to generate coverage data.
|
4. [Lcov](https://github.com/linux-test-project/lcov). Lcov is a tool used to generate coverage data. It can be installed on macOS by running the following command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# on macos
|
# on macos
|
||||||
@@ -84,38 +79,39 @@ brew install lcov
|
|||||||
|
|
||||||
- genhtml. Used to convert coverage data into html pages.
|
- genhtml. Used to convert coverage data into html pages.
|
||||||
|
|
||||||
After installing all these packages, bootstrap with `melos bs`.
|
After installation of all these packages, the project can be bootstrapped using the command `melos bs`.
|
||||||
|
|
||||||
### Create a new package
|
### Create a new package
|
||||||
|
|
||||||
Create a new package in `packages/` folder.
|
Create a new package in `packages/` folder.
|
||||||
|
To create a new package in the packages/ folder, run the following command in the terminal:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mason make wyatt_package --package_name wyatt_<name> --description A new Wyatt package --flutter_only false
|
mason make wyatt_package --package_name wyatt_<name> --description A new Wyatt package --flutter_only false
|
||||||
```
|
```
|
||||||
|
|
||||||
Then bootstrap project with `melos bs` command.
|
The <name> variable in the above command is important and must be clear and understandable.
|
||||||
|
|
||||||
|
After creating the package, bootstrap the project with the `melos bs` command.
|
||||||
|
|
||||||
#### Naming
|
#### Naming
|
||||||
|
|
||||||
In the previous instructions `<name>` variable is important.
|
In the previous instructions `<name>` variable is important.
|
||||||
It have to be clear and intelligible.
|
It have to be clear and intelligible.
|
||||||
|
|
||||||
You **MUST** use underscores.
|
1. You must use underscores in the name.
|
||||||
|
2. You must use the wyatt prefix for the package name.
|
||||||
|
3. You must name the example with a specific name.
|
||||||
|
|
||||||
You **MUST** use `wyatt` prefix for package.
|
For example, if the name is "CRUD BLOC," the following naming conventions should be used:
|
||||||
|
|
||||||
You **MUST** name example with specific name.
|
1. name: crud_bloc
|
||||||
|
2. package name: wyatt_crud_bloc
|
||||||
For example, if name is CRUD BLOC
|
3. example name: crud_bloc_example
|
||||||
|
|
||||||
- name will be crud_bloc
|
|
||||||
- so the package will be: `wyatt_crud_bloc`
|
|
||||||
- and the example will be: `crud_bloc_example`
|
|
||||||
|
|
||||||
### Create issues
|
### Create issues
|
||||||
|
|
||||||
Add the issues directly related to what you want to develop and label them correctly.
|
Create an issue for each specific feature or task you want to work on and label it correctly using the following format:
|
||||||
|
|
||||||
```
|
```
|
||||||
Type(scope): issue.
|
Type(scope): issue.
|
||||||
@@ -128,18 +124,18 @@ For example, on notification bloc package :
|
|||||||
|
|
||||||
### Branches
|
### Branches
|
||||||
|
|
||||||
Master is protected. You can't push on it. Please develop your feature on another branch. The name of your branch has to match with the issue opened.
|
The master branch is protected and cannot be pushed to directly. Please create a separate branch for each feature or task, with a name that corresponds to the related issue. The branch name should follow this format:
|
||||||
|
|
||||||
`type(scope):issue`
|
`type(scope):issue`
|
||||||
|
|
||||||
Example :
|
Example :
|
||||||
Issue :
|
For the issue:
|
||||||
|
|
||||||
- `Feature(notification_bloc): add firebase messaging data source.`
|
- `Feature(notification_bloc): add firebase messaging data source.`
|
||||||
|
|
||||||
Branch related to this issue :
|
The related branch should be named:
|
||||||
|
|
||||||
- `feature(notification_bloc)/add_firebase_messaging_data_source`
|
- `notification_bloc/feat/add_firebase_messaging_data_source`
|
||||||
|
|
||||||
### Commits
|
### Commits
|
||||||
|
|
||||||
@@ -163,12 +159,11 @@ Some examples :
|
|||||||
- `docs: update readme.` = update **this** readme file.
|
- `docs: update readme.` = update **this** readme file.
|
||||||
- `fix(crud)!: fix bug in awesome() function. (#32)` = fix a bug, `!` is important and indicate `BREAKING CHANGES` linked with the 32nd issue.
|
- `fix(crud)!: fix bug in awesome() function. (#32)` = fix a bug, `!` is important and indicate `BREAKING CHANGES` linked with the 32nd issue.
|
||||||
|
|
||||||
When you have finished developing, and are ready to close the issue, close it via your commit :
|
When you have completed your development work and are ready to resolve the related issue, you can close it via your commit message by including (close #issue_number). For example:
|
||||||
|
|
||||||
`feat(auth): add AWS support. (close #31)`
|
```shell
|
||||||
|
feat(auth): add AWS support. (close #31)
|
||||||
Note that your issue will be close after merging on master.
|
```
|
||||||
Before closing the issue, please check tests and update coverage. You might run :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
melos run test:all # this will run all tests in this project
|
melos run test:all # this will run all tests in this project
|
||||||
@@ -179,45 +174,44 @@ melos run publish:validate # this will run a validation before publish packages
|
|||||||
melos run publish # this will publish packages
|
melos run publish # this will publish packages
|
||||||
```
|
```
|
||||||
|
|
||||||
> Note that only modified package will be verified and published.
|
Please note that the issue will only be closed after it has been merged into the master branch. Before closing the issue, it is important to verify that all tests have been run and that coverage has been updated.
|
||||||
|
|
||||||
#### Merge your work
|
#### Merge your work
|
||||||
|
|
||||||
After closing your issue, some work may have been done on master in the meantime. To keep a clean git history, please rebase before opening a change request.
|
When you have completed your work and closed the related issue, it's possible that some changes may have been made to the master branch in the meantime. To maintain a clean Git history, it's recommended to rebase before creating a change request (pull request).
|
||||||
|
|
||||||
Two situations :
|
Two situations :
|
||||||
|
|
||||||
- You have not yet created your branch and have committed locally :
|
- You haven't created a branch yet and have made local commits:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git pull --rebase
|
git pull --rebase
|
||||||
```
|
```
|
||||||
|
|
||||||
- You are already working on your branch :
|
- You are already working on a branch:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git rebase -i master
|
git rebase -i master
|
||||||
```
|
```
|
||||||
|
|
||||||
If possible, please use `--fixup` on your commit in interactive rebase.
|
It's recommended to use the `--fixup` option during the interactive rebase to keep the Git history clean.
|
||||||
|
|
||||||
Then, opend your PR, get the necessary approval and merge your work. Then you're done ✅.
|
Once you have rebased, you can create a pull request, receive the necessary approvals, and then merge your work. And with that, you're done! 🎉
|
||||||
|
|
||||||
#### Update version.
|
#### Update version.
|
||||||
|
|
||||||
Once your work is on the master, you can update your package version. Please filter packages to update only your package. `--scope` is used to do it.
|
When your work has been merged into the master branch, it's time to update the package version. To update only your specific package, use the --scope option. For example, after merging changes into the `wyatt_notification_bloc` package, you can run the following command:
|
||||||
For example, after merging changes on `wyatt_otification_bloc` package, you might run :
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
melos version --scope="*wyatt_notification_bloc*"
|
melos version --scope="*wyatt_notification_bloc*"
|
||||||
```
|
```
|
||||||
|
|
||||||
In fact, melos will filter all packages that match the `wyatt_notification_block` pattern.
|
This will filter all packages that match the `wyatt_notification_bloc` pattern and update only that package.
|
||||||
|
|
||||||
You can update check all packages tests by running :
|
You can then verify that all packages and their tests are working correctly by running:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
melos run test
|
melos run test:all
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Publish your package
|
#### Publish your package
|
||||||
@@ -265,14 +259,14 @@ Here you can change `package name` and `package version`.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Status
|
|
||||||
|
|
||||||

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

|

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

|
||||||
|
|
||||||
|
This repository is maintained by Wyatt Studio but work is in progress.
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"bricks":{"wyatt_clean_code":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_clean_code","ref":"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
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ class CustomAppBar extends AppBarComponent with $CustomAppBarCWMixin {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => AppBar(
|
Widget build(BuildContext context) => AppBar(
|
||||||
title: Text(super.title ?? ''),
|
title: Text(
|
||||||
|
super.title?.text ?? '',
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -27,20 +27,18 @@ 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',
|
theme: ThemeData(
|
||||||
theme: ThemeData(
|
primarySwatch: Colors.blue,
|
||||||
primarySwatch: Colors.blue,
|
),
|
||||||
|
home: const Scaffold(
|
||||||
|
body: Home(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
home: const Scaffold(
|
);
|
||||||
body: Home(),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Home extends StatelessWidget {
|
class Home extends StatelessWidget {
|
||||||
@@ -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/control_state.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,24 @@
|
|||||||
|
// Copyright (C) 2023 WYATT GROUP
|
||||||
|
// Please see the AUTHORS file for details.
|
||||||
|
//
|
||||||
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:wyatt_ui_components/src/core/utils/text_wrapper.dart';
|
||||||
|
|
||||||
|
extension StringExtension on String? {
|
||||||
|
TextWrapper? wrap({TextStyle? style, List<Color>? gradient}) => this != null
|
||||||
|
? TextWrapper(this!, style: style, gradient: gradient)
|
||||||
|
: null;
|
||||||
|
}
|
||||||
@@ -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';
|
||||||
|
|
||||||
|
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 {
|
||||||
|
if (_color != null) {
|
||||||
|
return _color!;
|
||||||
|
}
|
||||||
|
if (_colors?.isNotEmpty ?? false) {
|
||||||
|
return _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?.isNotEmpty ?? false) && (_colors?.length ?? 0) > 1;
|
||||||
|
|
||||||
|
static MultiColor? lerp(MultiColor? a, MultiColor? b, double t) {
|
||||||
|
if (a == null && b == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (b == null) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'MultiColor(_colors: $_colors, _color: $_color)';
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
// 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';
|
||||||
|
|
||||||
|
class TextWrapper {
|
||||||
|
const TextWrapper(
|
||||||
|
this.text, {
|
||||||
|
this.style,
|
||||||
|
this.gradient,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory TextWrapper.text(String text) => TextWrapper(text);
|
||||||
|
|
||||||
|
final String text;
|
||||||
|
final TextStyle? style;
|
||||||
|
final List<Color>? gradient;
|
||||||
|
}
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
// 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';
|
||||||
|
|
||||||
|
/// {@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, T, E> {
|
||||||
|
/// {@macro theme_resolver}
|
||||||
|
const ThemeResolver();
|
||||||
|
|
||||||
|
S? Function(
|
||||||
|
BuildContext context,
|
||||||
|
S defaultValue,
|
||||||
|
T themeExtension, {
|
||||||
|
E? extra,
|
||||||
|
}) get computeExtensionValueFn;
|
||||||
|
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 values from the extension if found
|
||||||
|
S? computeExtensionValue(
|
||||||
|
BuildContext context,
|
||||||
|
S defaultValue, {
|
||||||
|
E? extra,
|
||||||
|
}) {
|
||||||
|
final themeExtension = findExtension(context);
|
||||||
|
if (themeExtension != null) {
|
||||||
|
return computeExtensionValueFn(
|
||||||
|
context,
|
||||||
|
defaultValue,
|
||||||
|
themeExtension,
|
||||||
|
extra: extra,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Compute custom value
|
||||||
|
S? computeCustomValue(
|
||||||
|
BuildContext context,
|
||||||
|
S previousPhaseValue, {
|
||||||
|
E? extra,
|
||||||
|
}) {
|
||||||
|
final customStyle = customStyleFn(context, extra: extra);
|
||||||
|
if (customStyle != null) {
|
||||||
|
return customStyle;
|
||||||
|
}
|
||||||
|
return previousPhaseValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
T? findExtension(BuildContext context) => Theme.of(context).extension<T>();
|
||||||
|
|
||||||
|
/// Choose most suitable style for a given context.
|
||||||
|
S negotiate(BuildContext context, {E? extra}) {
|
||||||
|
S style = computeDefaultValue(context, extra: extra);
|
||||||
|
style = computeExtensionValue(context, style, extra: extra) ?? style;
|
||||||
|
style = computeCustomValue(context, style, extra: extra) ?? style;
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 'multi_color.dart';
|
||||||
|
export 'text_wrapper.dart';
|
||||||
|
export 'theme_resolver.dart';
|
||||||
@@ -15,22 +15,21 @@
|
|||||||
// 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/mixins/copy_with_mixin.dart';
|
|
||||||
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.dart';
|
||||||
import 'package:wyatt_ui_components/src/domain/entities/component.dart';
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
|
||||||
part 'app_bar_component.g.dart';
|
part 'app_bar_component.g.dart';
|
||||||
|
|
||||||
@ComponentProxyExtension()
|
@ComponentProxyExtension()
|
||||||
abstract class AppBarComponent extends Component
|
abstract class AppBarComponent extends Component
|
||||||
with CopyWithMixin<$AppBarComponentCWProxy> {
|
with CopyWithMixin<$AppBarComponentCWProxy> {
|
||||||
final String? title;
|
|
||||||
final Widget? leading;
|
|
||||||
final List<Widget>? actions;
|
|
||||||
const AppBarComponent({
|
const AppBarComponent({
|
||||||
this.title,
|
this.title,
|
||||||
this.leading,
|
this.leading,
|
||||||
this.actions,
|
this.actions,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
final TextWrapper? title;
|
||||||
|
final Widget? leading;
|
||||||
|
final List<Widget>? actions;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ part of 'app_bar_component.dart';
|
|||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
abstract class $AppBarComponentCWProxy {
|
abstract class $AppBarComponentCWProxy {
|
||||||
AppBarComponent title(String? title);
|
AppBarComponent title(TextWrapper? title);
|
||||||
AppBarComponent leading(Widget? leading);
|
AppBarComponent leading(Widget? leading);
|
||||||
AppBarComponent actions(List<Widget>? actions);
|
AppBarComponent actions(List<Widget>? actions);
|
||||||
AppBarComponent key(Key? key);
|
AppBarComponent key(Key? key);
|
||||||
AppBarComponent call({
|
AppBarComponent call({
|
||||||
String? title,
|
TextWrapper? title,
|
||||||
Widget? leading,
|
Widget? leading,
|
||||||
List<Widget>? actions,
|
List<Widget>? actions,
|
||||||
Key? key,
|
Key? key,
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:wyatt_component_copy_with_extension/component_copy_with_extension.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.
|
||||||
//
|
//
|
||||||
@@ -17,18 +18,17 @@ import 'package:flutter/material.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,59 @@
|
|||||||
|
// 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,
|
||||||
|
this.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;
|
||||||
|
|
||||||
|
/// Theme Resolver for this component
|
||||||
|
final ThemeResolver<dynamic, dynamic, dynamic>? themeResolver;
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
// 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';
|
||||||
|
|
||||||
|
abstract class ButtonStyle<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;
|
||||||
|
}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
// 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 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,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
+84
@@ -0,0 +1,84 @@
|
|||||||
|
// 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:copy_with_extension/copy_with_extension.dart';
|
||||||
|
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';
|
||||||
|
|
||||||
|
part 'file_selection_button_style.g.dart';
|
||||||
|
|
||||||
|
@CopyWith()
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// 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;
|
||||||
|
}
|
||||||
+152
@@ -0,0 +1,152 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'file_selection_button_style.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// CopyWithGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class _$FileSelectionButtonStyleCWProxy {
|
||||||
|
FileSelectionButtonStyle title(TextStyle? title);
|
||||||
|
|
||||||
|
FileSelectionButtonStyle subTitle(TextStyle? subTitle);
|
||||||
|
|
||||||
|
FileSelectionButtonStyle radius(BorderRadiusGeometry? radius);
|
||||||
|
|
||||||
|
FileSelectionButtonStyle padding(EdgeInsetsGeometry? padding);
|
||||||
|
|
||||||
|
FileSelectionButtonStyle foregroundColors(MultiColor? foregroundColors);
|
||||||
|
|
||||||
|
FileSelectionButtonStyle backgroundColors(MultiColor? backgroundColors);
|
||||||
|
|
||||||
|
FileSelectionButtonStyle borderColors(MultiColor? borderColors);
|
||||||
|
|
||||||
|
FileSelectionButtonStyle stroke(double? stroke);
|
||||||
|
|
||||||
|
FileSelectionButtonStyle shadow(BoxShadow? shadow);
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FileSelectionButtonStyle(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// FileSelectionButtonStyle(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
FileSelectionButtonStyle call({
|
||||||
|
TextStyle? title,
|
||||||
|
TextStyle? subTitle,
|
||||||
|
BorderRadiusGeometry? radius,
|
||||||
|
EdgeInsetsGeometry? padding,
|
||||||
|
MultiColor? foregroundColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
double? stroke,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfFileSelectionButtonStyle.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfFileSelectionButtonStyle.copyWith.fieldName(...)`
|
||||||
|
class _$FileSelectionButtonStyleCWProxyImpl
|
||||||
|
implements _$FileSelectionButtonStyleCWProxy {
|
||||||
|
const _$FileSelectionButtonStyleCWProxyImpl(this._value);
|
||||||
|
|
||||||
|
final FileSelectionButtonStyle _value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle title(TextStyle? title) => this(title: title);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle subTitle(TextStyle? subTitle) =>
|
||||||
|
this(subTitle: subTitle);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle radius(BorderRadiusGeometry? radius) =>
|
||||||
|
this(radius: radius);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle padding(EdgeInsetsGeometry? padding) =>
|
||||||
|
this(padding: padding);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle foregroundColors(MultiColor? foregroundColors) =>
|
||||||
|
this(foregroundColors: foregroundColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle backgroundColors(MultiColor? backgroundColors) =>
|
||||||
|
this(backgroundColors: backgroundColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle borderColors(MultiColor? borderColors) =>
|
||||||
|
this(borderColors: borderColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle stroke(double? stroke) => this(stroke: stroke);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FileSelectionButtonStyle shadow(BoxShadow? shadow) => this(shadow: shadow);
|
||||||
|
|
||||||
|
@override
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FileSelectionButtonStyle(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// FileSelectionButtonStyle(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
FileSelectionButtonStyle call({
|
||||||
|
Object? title = const $CopyWithPlaceholder(),
|
||||||
|
Object? subTitle = const $CopyWithPlaceholder(),
|
||||||
|
Object? radius = const $CopyWithPlaceholder(),
|
||||||
|
Object? padding = const $CopyWithPlaceholder(),
|
||||||
|
Object? foregroundColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? backgroundColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? borderColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? stroke = const $CopyWithPlaceholder(),
|
||||||
|
Object? shadow = const $CopyWithPlaceholder(),
|
||||||
|
}) {
|
||||||
|
return FileSelectionButtonStyle(
|
||||||
|
title: title == const $CopyWithPlaceholder()
|
||||||
|
? _value.title
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: title as TextStyle?,
|
||||||
|
subTitle: subTitle == const $CopyWithPlaceholder()
|
||||||
|
? _value.subTitle
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: subTitle as TextStyle?,
|
||||||
|
radius: radius == const $CopyWithPlaceholder()
|
||||||
|
? _value.radius
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: radius as BorderRadiusGeometry?,
|
||||||
|
padding: padding == const $CopyWithPlaceholder()
|
||||||
|
? _value.padding
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: padding as EdgeInsetsGeometry?,
|
||||||
|
foregroundColors: foregroundColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.foregroundColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: foregroundColors as MultiColor?,
|
||||||
|
backgroundColors: backgroundColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.backgroundColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: backgroundColors as MultiColor?,
|
||||||
|
borderColors: borderColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.borderColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: borderColors as MultiColor?,
|
||||||
|
stroke: stroke == const $CopyWithPlaceholder()
|
||||||
|
? _value.stroke
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: stroke as double?,
|
||||||
|
shadow: shadow == const $CopyWithPlaceholder()
|
||||||
|
? _value.shadow
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: shadow as BoxShadow?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension $FileSelectionButtonStyleCopyWith on FileSelectionButtonStyle {
|
||||||
|
/// Returns a callable class that can be used as follows: `instanceOfFileSelectionButtonStyle.copyWith(...)` or like so:`instanceOfFileSelectionButtonStyle.copyWith.fieldName(...)`.
|
||||||
|
// ignore: library_private_types_in_public_api
|
||||||
|
_$FileSelectionButtonStyleCWProxy get copyWith =>
|
||||||
|
_$FileSelectionButtonStyleCWProxyImpl(this);
|
||||||
|
}
|
||||||
+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;
|
||||||
|
}
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
// 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 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,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
// 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:copy_with_extension/copy_with_extension.dart';
|
||||||
|
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';
|
||||||
|
|
||||||
|
part 'flat_button_style.g.dart';
|
||||||
|
|
||||||
|
@CopyWith()
|
||||||
|
class FlatButtonStyle extends ButtonStyle<FlatButtonStyle> {
|
||||||
|
const FlatButtonStyle({
|
||||||
|
this.label,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.foregroundColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.borderColors,
|
||||||
|
super.stroke,
|
||||||
|
super.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
|
||||||
|
String toString() =>
|
||||||
|
'FlatButtonStyle(label: $label), inherited: ${super.toString()}';
|
||||||
|
}
|
||||||
+137
@@ -0,0 +1,137 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'flat_button_style.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// CopyWithGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class _$FlatButtonStyleCWProxy {
|
||||||
|
FlatButtonStyle label(TextStyle? label);
|
||||||
|
|
||||||
|
FlatButtonStyle radius(BorderRadiusGeometry? radius);
|
||||||
|
|
||||||
|
FlatButtonStyle padding(EdgeInsetsGeometry? padding);
|
||||||
|
|
||||||
|
FlatButtonStyle foregroundColors(MultiColor? foregroundColors);
|
||||||
|
|
||||||
|
FlatButtonStyle backgroundColors(MultiColor? backgroundColors);
|
||||||
|
|
||||||
|
FlatButtonStyle borderColors(MultiColor? borderColors);
|
||||||
|
|
||||||
|
FlatButtonStyle stroke(double? stroke);
|
||||||
|
|
||||||
|
FlatButtonStyle shadow(BoxShadow? shadow);
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FlatButtonStyle(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// FlatButtonStyle(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
FlatButtonStyle call({
|
||||||
|
TextStyle? label,
|
||||||
|
BorderRadiusGeometry? radius,
|
||||||
|
EdgeInsetsGeometry? padding,
|
||||||
|
MultiColor? foregroundColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
double? stroke,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfFlatButtonStyle.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfFlatButtonStyle.copyWith.fieldName(...)`
|
||||||
|
class _$FlatButtonStyleCWProxyImpl implements _$FlatButtonStyleCWProxy {
|
||||||
|
const _$FlatButtonStyleCWProxyImpl(this._value);
|
||||||
|
|
||||||
|
final FlatButtonStyle _value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle label(TextStyle? label) => this(label: label);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle radius(BorderRadiusGeometry? radius) => this(radius: radius);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle padding(EdgeInsetsGeometry? padding) =>
|
||||||
|
this(padding: padding);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle foregroundColors(MultiColor? foregroundColors) =>
|
||||||
|
this(foregroundColors: foregroundColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle backgroundColors(MultiColor? backgroundColors) =>
|
||||||
|
this(backgroundColors: backgroundColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle borderColors(MultiColor? borderColors) =>
|
||||||
|
this(borderColors: borderColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle stroke(double? stroke) => this(stroke: stroke);
|
||||||
|
|
||||||
|
@override
|
||||||
|
FlatButtonStyle shadow(BoxShadow? shadow) => this(shadow: shadow);
|
||||||
|
|
||||||
|
@override
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FlatButtonStyle(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// FlatButtonStyle(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
FlatButtonStyle call({
|
||||||
|
Object? label = const $CopyWithPlaceholder(),
|
||||||
|
Object? radius = const $CopyWithPlaceholder(),
|
||||||
|
Object? padding = const $CopyWithPlaceholder(),
|
||||||
|
Object? foregroundColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? backgroundColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? borderColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? stroke = const $CopyWithPlaceholder(),
|
||||||
|
Object? shadow = const $CopyWithPlaceholder(),
|
||||||
|
}) {
|
||||||
|
return FlatButtonStyle(
|
||||||
|
label: label == const $CopyWithPlaceholder()
|
||||||
|
? _value.label
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: label as TextStyle?,
|
||||||
|
radius: radius == const $CopyWithPlaceholder()
|
||||||
|
? _value.radius
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: radius as BorderRadiusGeometry?,
|
||||||
|
padding: padding == const $CopyWithPlaceholder()
|
||||||
|
? _value.padding
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: padding as EdgeInsetsGeometry?,
|
||||||
|
foregroundColors: foregroundColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.foregroundColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: foregroundColors as MultiColor?,
|
||||||
|
backgroundColors: backgroundColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.backgroundColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: backgroundColors as MultiColor?,
|
||||||
|
borderColors: borderColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.borderColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: borderColors as MultiColor?,
|
||||||
|
stroke: stroke == const $CopyWithPlaceholder()
|
||||||
|
? _value.stroke
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: stroke as double?,
|
||||||
|
shadow: shadow == const $CopyWithPlaceholder()
|
||||||
|
? _value.shadow
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: shadow as BoxShadow?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension $FlatButtonStyleCopyWith on FlatButtonStyle {
|
||||||
|
/// Returns a callable class that can be used as follows: `instanceOfFlatButtonStyle.copyWith(...)` or like so:`instanceOfFlatButtonStyle.copyWith.fieldName(...)`.
|
||||||
|
// ignore: library_private_types_in_public_api
|
||||||
|
_$FlatButtonStyleCWProxy get copyWith => _$FlatButtonStyleCWProxyImpl(this);
|
||||||
|
}
|
||||||
+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;
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
// 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 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,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
+77
@@ -0,0 +1,77 @@
|
|||||||
|
// 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:copy_with_extension/copy_with_extension.dart';
|
||||||
|
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';
|
||||||
|
|
||||||
|
part 'simple_icon_button_style.g.dart';
|
||||||
|
|
||||||
|
@CopyWith()
|
||||||
|
class SimpleIconButtonStyle extends ButtonStyle<SimpleIconButtonStyle> {
|
||||||
|
const SimpleIconButtonStyle({
|
||||||
|
this.dimension,
|
||||||
|
super.radius,
|
||||||
|
super.padding,
|
||||||
|
super.foregroundColors,
|
||||||
|
super.backgroundColors,
|
||||||
|
super.borderColors,
|
||||||
|
super.stroke,
|
||||||
|
super.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;
|
||||||
|
}
|
||||||
+141
@@ -0,0 +1,141 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'simple_icon_button_style.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// CopyWithGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class _$SimpleIconButtonStyleCWProxy {
|
||||||
|
SimpleIconButtonStyle dimension(double? dimension);
|
||||||
|
|
||||||
|
SimpleIconButtonStyle radius(BorderRadiusGeometry? radius);
|
||||||
|
|
||||||
|
SimpleIconButtonStyle padding(EdgeInsetsGeometry? padding);
|
||||||
|
|
||||||
|
SimpleIconButtonStyle foregroundColors(MultiColor? foregroundColors);
|
||||||
|
|
||||||
|
SimpleIconButtonStyle backgroundColors(MultiColor? backgroundColors);
|
||||||
|
|
||||||
|
SimpleIconButtonStyle borderColors(MultiColor? borderColors);
|
||||||
|
|
||||||
|
SimpleIconButtonStyle stroke(double? stroke);
|
||||||
|
|
||||||
|
SimpleIconButtonStyle shadow(BoxShadow? shadow);
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SimpleIconButtonStyle(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// SimpleIconButtonStyle(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
SimpleIconButtonStyle call({
|
||||||
|
double? dimension,
|
||||||
|
BorderRadiusGeometry? radius,
|
||||||
|
EdgeInsetsGeometry? padding,
|
||||||
|
MultiColor? foregroundColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
double? stroke,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSimpleIconButtonStyle.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSimpleIconButtonStyle.copyWith.fieldName(...)`
|
||||||
|
class _$SimpleIconButtonStyleCWProxyImpl
|
||||||
|
implements _$SimpleIconButtonStyleCWProxy {
|
||||||
|
const _$SimpleIconButtonStyleCWProxyImpl(this._value);
|
||||||
|
|
||||||
|
final SimpleIconButtonStyle _value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle dimension(double? dimension) =>
|
||||||
|
this(dimension: dimension);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle radius(BorderRadiusGeometry? radius) =>
|
||||||
|
this(radius: radius);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle padding(EdgeInsetsGeometry? padding) =>
|
||||||
|
this(padding: padding);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle foregroundColors(MultiColor? foregroundColors) =>
|
||||||
|
this(foregroundColors: foregroundColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle backgroundColors(MultiColor? backgroundColors) =>
|
||||||
|
this(backgroundColors: backgroundColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle borderColors(MultiColor? borderColors) =>
|
||||||
|
this(borderColors: borderColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle stroke(double? stroke) => this(stroke: stroke);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SimpleIconButtonStyle shadow(BoxShadow? shadow) => this(shadow: shadow);
|
||||||
|
|
||||||
|
@override
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SimpleIconButtonStyle(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// SimpleIconButtonStyle(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
SimpleIconButtonStyle call({
|
||||||
|
Object? dimension = const $CopyWithPlaceholder(),
|
||||||
|
Object? radius = const $CopyWithPlaceholder(),
|
||||||
|
Object? padding = const $CopyWithPlaceholder(),
|
||||||
|
Object? foregroundColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? backgroundColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? borderColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? stroke = const $CopyWithPlaceholder(),
|
||||||
|
Object? shadow = const $CopyWithPlaceholder(),
|
||||||
|
}) {
|
||||||
|
return SimpleIconButtonStyle(
|
||||||
|
dimension: dimension == const $CopyWithPlaceholder()
|
||||||
|
? _value.dimension
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: dimension as double?,
|
||||||
|
radius: radius == const $CopyWithPlaceholder()
|
||||||
|
? _value.radius
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: radius as BorderRadiusGeometry?,
|
||||||
|
padding: padding == const $CopyWithPlaceholder()
|
||||||
|
? _value.padding
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: padding as EdgeInsetsGeometry?,
|
||||||
|
foregroundColors: foregroundColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.foregroundColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: foregroundColors as MultiColor?,
|
||||||
|
backgroundColors: backgroundColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.backgroundColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: backgroundColors as MultiColor?,
|
||||||
|
borderColors: borderColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.borderColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: borderColors as MultiColor?,
|
||||||
|
stroke: stroke == const $CopyWithPlaceholder()
|
||||||
|
? _value.stroke
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: stroke as double?,
|
||||||
|
shadow: shadow == const $CopyWithPlaceholder()
|
||||||
|
? _value.shadow
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: shadow as BoxShadow?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension $SimpleIconButtonStyleCopyWith on SimpleIconButtonStyle {
|
||||||
|
/// Returns a callable class that can be used as follows: `instanceOfSimpleIconButtonStyle.copyWith(...)` or like so:`instanceOfSimpleIconButtonStyle.copyWith.fieldName(...)`.
|
||||||
|
// ignore: library_private_types_in_public_api
|
||||||
|
_$SimpleIconButtonStyleCWProxy get copyWith =>
|
||||||
|
_$SimpleIconButtonStyleCWProxyImpl(this);
|
||||||
|
}
|
||||||
+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;
|
||||||
|
}
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
// 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 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,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
// 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:copy_with_extension/copy_with_extension.dart';
|
||||||
|
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';
|
||||||
|
|
||||||
|
part 'symbol_button_style.g.dart';
|
||||||
|
|
||||||
|
@CopyWith()
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
/// 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;
|
||||||
|
}
|
||||||
+150
@@ -0,0 +1,150 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'symbol_button_style.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// CopyWithGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
abstract class _$SymbolButtonStyleCWProxy {
|
||||||
|
SymbolButtonStyle label(TextStyle? label);
|
||||||
|
|
||||||
|
SymbolButtonStyle dimension(double? dimension);
|
||||||
|
|
||||||
|
SymbolButtonStyle radius(BorderRadiusGeometry? radius);
|
||||||
|
|
||||||
|
SymbolButtonStyle padding(EdgeInsetsGeometry? padding);
|
||||||
|
|
||||||
|
SymbolButtonStyle foregroundColors(MultiColor? foregroundColors);
|
||||||
|
|
||||||
|
SymbolButtonStyle backgroundColors(MultiColor? backgroundColors);
|
||||||
|
|
||||||
|
SymbolButtonStyle borderColors(MultiColor? borderColors);
|
||||||
|
|
||||||
|
SymbolButtonStyle stroke(double? stroke);
|
||||||
|
|
||||||
|
SymbolButtonStyle shadow(BoxShadow? shadow);
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SymbolButtonStyle(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// SymbolButtonStyle(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
SymbolButtonStyle call({
|
||||||
|
TextStyle? label,
|
||||||
|
double? dimension,
|
||||||
|
BorderRadiusGeometry? radius,
|
||||||
|
EdgeInsetsGeometry? padding,
|
||||||
|
MultiColor? foregroundColors,
|
||||||
|
MultiColor? backgroundColors,
|
||||||
|
MultiColor? borderColors,
|
||||||
|
double? stroke,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSymbolButtonStyle.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSymbolButtonStyle.copyWith.fieldName(...)`
|
||||||
|
class _$SymbolButtonStyleCWProxyImpl implements _$SymbolButtonStyleCWProxy {
|
||||||
|
const _$SymbolButtonStyleCWProxyImpl(this._value);
|
||||||
|
|
||||||
|
final SymbolButtonStyle _value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle label(TextStyle? label) => this(label: label);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle dimension(double? dimension) => this(dimension: dimension);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle radius(BorderRadiusGeometry? radius) =>
|
||||||
|
this(radius: radius);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle padding(EdgeInsetsGeometry? padding) =>
|
||||||
|
this(padding: padding);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle foregroundColors(MultiColor? foregroundColors) =>
|
||||||
|
this(foregroundColors: foregroundColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle backgroundColors(MultiColor? backgroundColors) =>
|
||||||
|
this(backgroundColors: backgroundColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle borderColors(MultiColor? borderColors) =>
|
||||||
|
this(borderColors: borderColors);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle stroke(double? stroke) => this(stroke: stroke);
|
||||||
|
|
||||||
|
@override
|
||||||
|
SymbolButtonStyle shadow(BoxShadow? shadow) => this(shadow: shadow);
|
||||||
|
|
||||||
|
@override
|
||||||
|
|
||||||
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SymbolButtonStyle(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||||
|
///
|
||||||
|
/// Usage
|
||||||
|
/// ```dart
|
||||||
|
/// SymbolButtonStyle(...).copyWith(id: 12, name: "My name")
|
||||||
|
/// ````
|
||||||
|
SymbolButtonStyle call({
|
||||||
|
Object? label = const $CopyWithPlaceholder(),
|
||||||
|
Object? dimension = const $CopyWithPlaceholder(),
|
||||||
|
Object? radius = const $CopyWithPlaceholder(),
|
||||||
|
Object? padding = const $CopyWithPlaceholder(),
|
||||||
|
Object? foregroundColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? backgroundColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? borderColors = const $CopyWithPlaceholder(),
|
||||||
|
Object? stroke = const $CopyWithPlaceholder(),
|
||||||
|
Object? shadow = const $CopyWithPlaceholder(),
|
||||||
|
}) {
|
||||||
|
return SymbolButtonStyle(
|
||||||
|
label: label == const $CopyWithPlaceholder()
|
||||||
|
? _value.label
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: label as TextStyle?,
|
||||||
|
dimension: dimension == const $CopyWithPlaceholder()
|
||||||
|
? _value.dimension
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: dimension as double?,
|
||||||
|
radius: radius == const $CopyWithPlaceholder()
|
||||||
|
? _value.radius
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: radius as BorderRadiusGeometry?,
|
||||||
|
padding: padding == const $CopyWithPlaceholder()
|
||||||
|
? _value.padding
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: padding as EdgeInsetsGeometry?,
|
||||||
|
foregroundColors: foregroundColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.foregroundColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: foregroundColors as MultiColor?,
|
||||||
|
backgroundColors: backgroundColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.backgroundColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: backgroundColors as MultiColor?,
|
||||||
|
borderColors: borderColors == const $CopyWithPlaceholder()
|
||||||
|
? _value.borderColors
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: borderColors as MultiColor?,
|
||||||
|
stroke: stroke == const $CopyWithPlaceholder()
|
||||||
|
? _value.stroke
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: stroke as double?,
|
||||||
|
shadow: shadow == const $CopyWithPlaceholder()
|
||||||
|
? _value.shadow
|
||||||
|
// ignore: cast_nullable_to_non_nullable
|
||||||
|
: shadow as BoxShadow?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension $SymbolButtonStyleCopyWith on SymbolButtonStyle {
|
||||||
|
/// Returns a callable class that can be used as follows: `instanceOfSymbolButtonStyle.copyWith(...)` or like so:`instanceOfSymbolButtonStyle.copyWith.fieldName(...)`.
|
||||||
|
// ignore: library_private_types_in_public_api
|
||||||
|
_$SymbolButtonStyleCWProxy get copyWith =>
|
||||||
|
_$SymbolButtonStyleCWProxyImpl(this);
|
||||||
|
}
|
||||||
@@ -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_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 List<Color>? borderColors;
|
||||||
|
|
||||||
|
/// Card background color
|
||||||
|
final List<Color>? 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(List<Color>? borderColors);
|
||||||
|
InformationCardComponent backgroundColors(List<Color>? 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,
|
||||||
|
List<Color>? borderColors,
|
||||||
|
List<Color>? 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(List<Color>? borderColors);
|
||||||
|
PortfolioCardComponent backgroundColors(List<Color>? 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,
|
||||||
|
List<Color>? borderColors,
|
||||||
|
List<Color>? 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(List<Color>? borderColors);
|
||||||
|
QuoteCardComponent backgroundColors(List<Color>? 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,
|
||||||
|
List<Color>? borderColors,
|
||||||
|
List<Color>? 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(List<Color>? borderColors);
|
||||||
|
SkillCardComponent backgroundColors(List<Color>? 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,
|
||||||
|
List<Color>? borderColors,
|
||||||
|
List<Color>? backgroundColors,
|
||||||
|
Size? minSize,
|
||||||
|
Size? maxSize,
|
||||||
|
BoxShadow? shadow,
|
||||||
|
Widget? background,
|
||||||
|
Key? key,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
export './app_bar_component.dart';
|
export './app_bar_component.dart';
|
||||||
export './bottom_navigation_bar_component.dart';
|
export './bottom_navigation_bar_component.dart';
|
||||||
|
export './buttons/buttons.dart';
|
||||||
|
export './cards/cards.dart';
|
||||||
|
export './component.dart';
|
||||||
export './error_widget_component.dart';
|
export './error_widget_component.dart';
|
||||||
export './loading_widget_component.dart';
|
export './loading_widget_component.dart';
|
||||||
export './component.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,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) =>
|
||||||
|
|||||||
@@ -17,10 +17,6 @@
|
|||||||
import 'package:wyatt_ui_components/src/domain/entities/entities.dart';
|
import 'package:wyatt_ui_components/src/domain/entities/entities.dart';
|
||||||
|
|
||||||
class ComponentThemeData {
|
class ComponentThemeData {
|
||||||
final AppBarComponent? appBar;
|
|
||||||
final BottomNavigationBarComponent? bottomNavigationBar;
|
|
||||||
final ErrorWidgetComponent? errorWidget;
|
|
||||||
final LoadingWidgetComponent? loadingWidget;
|
|
||||||
|
|
||||||
const ComponentThemeData.raw({
|
const ComponentThemeData.raw({
|
||||||
this.appBar,
|
this.appBar,
|
||||||
@@ -28,4 +24,8 @@ class ComponentThemeData {
|
|||||||
this.errorWidget,
|
this.errorWidget,
|
||||||
this.loadingWidget,
|
this.loadingWidget,
|
||||||
});
|
});
|
||||||
|
final AppBarComponent? appBar;
|
||||||
|
final BottomNavigationBarComponent? bottomNavigationBar;
|
||||||
|
final ErrorWidgetComponent? errorWidget;
|
||||||
|
final LoadingWidgetComponent? loadingWidget;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,27 @@ 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:
|
copy_with_extension: ^5.0.0
|
||||||
sdk: flutter
|
flutter: { sdk: flutter }
|
||||||
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:
|
|
||||||
sdk: flutter
|
|
||||||
|
|
||||||
build_runner: ^2.3.3
|
build_runner: ^2.3.3
|
||||||
|
copy_with_extension_gen: ^5.0.0
|
||||||
|
flutter_test: { sdk: flutter }
|
||||||
|
wyatt_analysis:
|
||||||
|
hosted: https://git.wyatt-studio.fr/api/packages/Wyatt-FOSS/pub
|
||||||
|
version: ^2.4.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,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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 191 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 103 KiB |
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"hosting": {
|
||||||
|
"public": "build/web",
|
||||||
|
"ignore": [
|
||||||
|
"firebase.json",
|
||||||
|
"**/.*",
|
||||||
|
"**/node_modules/**"
|
||||||
|
],
|
||||||
|
"rewrites": [
|
||||||
|
{
|
||||||
|
"source": "**",
|
||||||
|
"destination": "/index.html"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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/material.dart';
|
||||||
|
import 'package:gap/gap.dart';
|
||||||
|
import 'package:wyatt_ui_kit_example/buttons/file_selection_button/file_selection_buttons.dart';
|
||||||
|
import 'package:wyatt_ui_kit_example/buttons/flat_button/flat_buttons.dart';
|
||||||
|
import 'package:wyatt_ui_kit_example/buttons/simple_icon_button/simple_icon_buttons.dart';
|
||||||
|
import 'package:wyatt_ui_kit_example/buttons/symbol_button/symbol_buttons.dart';
|
||||||
|
|
||||||
|
class Buttons extends StatelessWidget {
|
||||||
|
const Buttons({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => ListView(
|
||||||
|
cacheExtent: 1000,
|
||||||
|
children: [
|
||||||
|
const Gap(20),
|
||||||
|
Align(
|
||||||
|
child: Text(
|
||||||
|
'Buttons',
|
||||||
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: const [
|
||||||
|
FlatButtons(),
|
||||||
|
Gap(20),
|
||||||
|
SymbolButtons(),
|
||||||
|
Gap(20),
|
||||||
|
SimpleIconButtons(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
const Align(child: FileSelectionButtons()),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
+121
@@ -0,0 +1,121 @@
|
|||||||
|
// 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:gap/gap.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
|
||||||
|
import 'package:wyatt_ui_kit_example/theme/constants.dart';
|
||||||
|
|
||||||
|
class FileSelectionButtons extends StatelessWidget {
|
||||||
|
const FileSelectionButtons({super.key});
|
||||||
|
|
||||||
|
Widget _leading() => const DecoratedBox(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Constants.grey2,
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
child: Icon(
|
||||||
|
Icons.file_upload_outlined,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'FileSelection Buttons',
|
||||||
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
FileSelectionButton(
|
||||||
|
leading: _leading(),
|
||||||
|
title: const TextWrapper(
|
||||||
|
'Ajouter un fichier',
|
||||||
|
),
|
||||||
|
subTitle: const TextWrapper('Taille max: 20 Mo'),
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
FileSelectionButton(
|
||||||
|
leading: _leading(),
|
||||||
|
title: const TextWrapper(
|
||||||
|
'Enabled',
|
||||||
|
),
|
||||||
|
subTitle: const TextWrapper('Subtitle'),
|
||||||
|
)
|
||||||
|
..bloc.enable()
|
||||||
|
..bloc.freeze(),
|
||||||
|
const Gap(20),
|
||||||
|
FileSelectionButton(
|
||||||
|
leading: _leading(),
|
||||||
|
title: const TextWrapper(
|
||||||
|
'Disabled',
|
||||||
|
),
|
||||||
|
subTitle: const TextWrapper('Subtitle'),
|
||||||
|
)
|
||||||
|
..bloc.disable()
|
||||||
|
..bloc.freeze(),
|
||||||
|
const Gap(20),
|
||||||
|
FileSelectionButton(
|
||||||
|
leading: _leading(),
|
||||||
|
title: const TextWrapper(
|
||||||
|
'Hovered',
|
||||||
|
),
|
||||||
|
subTitle: const TextWrapper('Subtitle'),
|
||||||
|
)
|
||||||
|
..bloc.onMouseEnter()
|
||||||
|
..bloc.freeze(),
|
||||||
|
const Gap(20),
|
||||||
|
FileSelectionButton(
|
||||||
|
leading: _leading(),
|
||||||
|
title: const TextWrapper(
|
||||||
|
'Focused',
|
||||||
|
),
|
||||||
|
subTitle: const TextWrapper('Subtitle'),
|
||||||
|
)
|
||||||
|
..bloc.onFocus()
|
||||||
|
..bloc.freeze(),
|
||||||
|
const Gap(20),
|
||||||
|
FileSelectionButton(
|
||||||
|
leading: _leading(),
|
||||||
|
title: const TextWrapper(
|
||||||
|
'Tapped',
|
||||||
|
),
|
||||||
|
subTitle: const TextWrapper('Subtitle'),
|
||||||
|
)
|
||||||
|
..bloc.onClickDown()
|
||||||
|
..bloc.freeze(),
|
||||||
|
const Gap(20),
|
||||||
|
FileSelectionButton(
|
||||||
|
leading: _leading(),
|
||||||
|
title: const TextWrapper(
|
||||||
|
'Invalid',
|
||||||
|
),
|
||||||
|
subTitle: const TextWrapper('Subtitle'),
|
||||||
|
)
|
||||||
|
..bloc.invalidate()
|
||||||
|
..bloc.freeze(),
|
||||||
|
const Gap(20),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
// 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:gap/gap.dart';
|
||||||
|
import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||||
|
import 'package:wyatt_ui_kit/wyatt_ui_kit.dart';
|
||||||
|
|
||||||
|
class FlatButtons extends StatelessWidget {
|
||||||
|
const FlatButtons({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) => Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Flat Buttons',
|
||||||
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
Center(
|
||||||
|
child: FlatButton(
|
||||||
|
label: const TextWrapper('Voir notre savoir faire'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
Center(
|
||||||
|
child: FlatButton(
|
||||||
|
label: const TextWrapper('Enabled'),
|
||||||
|
)
|
||||||
|
..bloc.enable()
|
||||||
|
..bloc.freeze(),
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
Center(
|
||||||
|
child: FlatButton(
|
||||||
|
label: const TextWrapper('Disabled'),
|
||||||
|
)
|
||||||
|
..bloc.disable()
|
||||||
|
..bloc.freeze(),
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
Center(
|
||||||
|
child: FlatButton(
|
||||||
|
label: const TextWrapper('Hovered'),
|
||||||
|
)
|
||||||
|
..bloc.onMouseEnter()
|
||||||
|
..bloc.freeze(),
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
Center(
|
||||||
|
child: FlatButton(
|
||||||
|
label: const TextWrapper('Focused'),
|
||||||
|
)
|
||||||
|
..bloc.onFocus()
|
||||||
|
..bloc.freeze(),
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
Center(
|
||||||
|
child: FlatButton(
|
||||||
|
label: const TextWrapper('Tapped'),
|
||||||
|
)
|
||||||
|
..bloc.onClickDown()
|
||||||
|
..bloc.freeze(),
|
||||||
|
),
|
||||||
|
const Gap(20),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user