From cc14b42718cc600ac990472fc6d088f35a933670 Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Tue, 9 Apr 2024 10:43:18 +0530 Subject: [PATCH 01/19] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20intl=20to?= =?UTF-8?q?=200.19.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/pubspec.lock | 82 ++++++++++++++++++++++++++++---------------- pubspec.lock | 82 ++++++++++++++++++++++++++++---------------- pubspec.yaml | 2 +- 3 files changed, 107 insertions(+), 59 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index b179b670..1a21c663 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" device_frame: dependency: transitive description: @@ -129,18 +129,10 @@ packages: dependency: transitive description: name: intl - sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.18.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" + version: "0.18.1" json_annotation: dependency: transitive description: @@ -149,6 +141,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" lints: dependency: transitive description: @@ -161,26 +177,26 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" nested: dependency: transitive description: @@ -193,10 +209,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider_linux: dependency: transitive description: @@ -318,26 +334,26 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -358,10 +374,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" vector_math: dependency: transitive description: @@ -377,6 +393,14 @@ packages: relative: true source: path version: "4.1.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" vxstate: dependency: transitive description: @@ -402,5 +426,5 @@ packages: source: hosted version: "1.0.0" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=3.0.0" diff --git a/pubspec.lock b/pubspec.lock index 18e0273c..1e3713ed 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.18.0" fake_async: dependency: transitive description: @@ -66,10 +66,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.2" flutter_test: dependency: "direct dev" description: flutter @@ -84,58 +84,74 @@ packages: dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.dev" + source: hosted + version: "0.19.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" url: "https://pub.dev" source: hosted - version: "0.18.1" - js: + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: dependency: transitive description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "2.0.1" lints: dependency: transitive description: name: lints - sha256: "6b0206b0bf4f04961fc5438198ccb3a885685cd67d4d4a32cc20ad7f8adbe015" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "3.0.0" matcher: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.11.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" sky_engine: dependency: transitive description: flutter @@ -145,26 +161,26 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -185,10 +201,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.1" vector_math: dependency: "direct main" description: @@ -197,6 +213,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" vxstate: dependency: "direct main" description: @@ -206,5 +230,5 @@ packages: source: hosted version: "2.3.0" sdks: - dart: ">=3.0.0-417 <4.0.0" + dart: ">=3.2.0-0 <4.0.0" flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index a0b30524..7462054b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - intl: + intl: ^0.19.0 vxstate: ^2.3.0 vector_math: ^2.1.4 From 02da3af3e82ec3f3aedbbbe750776547d3903bfa Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Tue, 9 Apr 2024 10:43:55 +0530 Subject: [PATCH 02/19] =?UTF-8?q?=F0=9F=94=96=20v=204.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7462054b..f85a95af 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: velocity_x description: A minimalist Flutter framework for rapidly building custom designs. -version: 4.1.0 +version: 4.2.0 homepage: https://velocityx.dev repository: https://github.com/iampawan/VelocityX documentation: https://velocityx.dev From acef3885ebd0004b8b0012a4ebe4191702a44fdb Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Sun, 15 Dec 2024 01:22:01 +0530 Subject: [PATCH 03/19] =?UTF-8?q?=F0=9F=90=9B=20Flutter=203.27=20migration?= =?UTF-8?q?=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 + example/lib/new/demo_list.dart | 2 +- example/pubspec.lock | 86 +++++++++++------- lib/src/extensions/context_ext.dart | 2 +- lib/src/extensions/list_ext.dart | 2 - lib/src/extensions/misc_ext.dart | 2 +- .../flutter/animated/animated_container.dart | 2 +- lib/src/flutter/bottom_sheet.dart | 4 +- lib/src/flutter/clippers/vx_arc.dart | 2 - lib/src/flutter/clippers/vx_diagonal.dart | 4 +- lib/src/flutter/container.dart | 2 +- lib/src/flutter/dialog.dart | 8 +- lib/src/flutter/filters.dart | 4 +- lib/src/flutter/flex.dart | 6 +- lib/src/flutter/glass.dart | 6 +- lib/src/flutter/hover.dart | 4 +- lib/src/flutter/list.dart | 4 +- lib/src/flutter/popup_menu.dart | 2 +- lib/src/flutter/rich_text.dart | 20 ++-- lib/src/flutter/timeline/timeline_widget.dart | 6 +- lib/src/flutter/toast.dart | 2 +- lib/src/flutter/universal.dart | 10 +- .../flutter/velocityx_mixins/neu_mixin.dart | 13 +-- lib/src/velocity_xx.dart | 76 +++++++++++++--- pubspec.lock | 78 ++++++++++------ pubspec.yaml | 2 +- .../flutter/failures/overlay_isolatedDiff.png | Bin 0 -> 18259 bytes test/flutter/failures/overlay_maskedDiff.png | Bin 0 -> 23196 bytes test/flutter/failures/overlay_masterImage.png | Bin 0 -> 23003 bytes test/flutter/failures/overlay_testImage.png | Bin 0 -> 23079 bytes 30 files changed, 222 insertions(+), 132 deletions(-) create mode 100644 test/flutter/failures/overlay_isolatedDiff.png create mode 100644 test/flutter/failures/overlay_maskedDiff.png create mode 100644 test/flutter/failures/overlay_masterImage.png create mode 100644 test/flutter/failures/overlay_testImage.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 17826e43..ffe4d250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [4.1.3] - Nov 23, 2023 + +- Flutter 3.27 migration fixes + + ## [4.1.2] - Nov 23, 2023 - Bug Fixes diff --git a/example/lib/new/demo_list.dart b/example/lib/new/demo_list.dart index 60528b73..d8ec4ada 100644 --- a/example/lib/new/demo_list.dart +++ b/example/lib/new/demo_list.dart @@ -137,7 +137,7 @@ class _DemoListState extends State { margin: const EdgeInsets.symmetric( horizontal: 20, vertical: 10), borderRadius: BorderRadius.circular(10), - shadowColor: Colors.black.withOpacity(0.3), + shadowColor: Colors.black.withValues(alpha: 0.3), onTap: () { Vx.log('Widget tapped!'); }, diff --git a/example/pubspec.lock b/example/pubspec.lock index 3e3ea6c4..d4ae252e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.19.0" device_frame: dependency: transitive description: @@ -133,14 +133,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.18.0" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" json_annotation: dependency: transitive description: @@ -149,6 +141,30 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" lints: dependency: transitive description: @@ -161,26 +177,26 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.15.0" nested: dependency: transitive description: @@ -193,10 +209,10 @@ packages: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider_linux: dependency: transitive description: @@ -305,39 +321,39 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -350,10 +366,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.7.3" vector_math: dependency: transitive description: @@ -369,6 +385,14 @@ packages: relative: true source: path version: "4.1.2" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" vxstate: dependency: transitive description: @@ -394,5 +418,5 @@ packages: source: hosted version: "1.0.3" sdks: - dart: ">=3.0.0 <4.0.0" - flutter: ">=3.7.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/lib/src/extensions/context_ext.dart b/lib/src/extensions/context_ext.dart index a114065c..219a6321 100644 --- a/lib/src/extensions/context_ext.dart +++ b/lib/src/extensions/context_ext.dart @@ -223,7 +223,7 @@ extension VxContextExtensions on BuildContext { /// /// A color that contrasts with the [primaryColor]. /// - Color get backgroundColor => theme.colorScheme.background; + Color get backgroundColor => theme.colorScheme.surface; /// /// The default color of [MaterialType.canvas] [Material]. diff --git a/lib/src/extensions/list_ext.dart b/lib/src/extensions/list_ext.dart index 29673a24..c5ba1cbb 100644 --- a/lib/src/extensions/list_ext.dart +++ b/lib/src/extensions/list_ext.dart @@ -75,7 +75,6 @@ extension VxListWidgetExtension on List { /// Widget aStack( {Key? key, - Clip clipBehavior = Clip.none, OverflowBarAlignment overflowAlignment = OverflowBarAlignment.start, VerticalDirection overflowDirection = VerticalDirection.down, double overflowSpacing = 0.0, @@ -83,7 +82,6 @@ extension VxListWidgetExtension on List { TextDirection? textDirection}) => AStack( key: key, - clipBehavior: clipBehavior, overflowAlignment: overflowAlignment, overflowDirection: overflowDirection, overflowSpacing: overflowSpacing, diff --git a/lib/src/extensions/misc_ext.dart b/lib/src/extensions/misc_ext.dart index c42a2a07..574d3c5d 100644 --- a/lib/src/extensions/misc_ext.dart +++ b/lib/src/extensions/misc_ext.dart @@ -111,7 +111,7 @@ extension VxColorExtension on Color { MaterialColor materialColor() => Vx.getMaterialColor(this); /// whether the color is transparent or not - bool get isTransparent => alpha == 0; + bool get isTransparent => a == 0; /// Get the swatch of the color MaterialColor get swatch => diff --git a/lib/src/flutter/animated/animated_container.dart b/lib/src/flutter/animated/animated_container.dart index 25b05f1c..6ba14ec9 100644 --- a/lib/src/flutter/animated/animated_container.dart +++ b/lib/src/flutter/animated/animated_container.dart @@ -201,7 +201,7 @@ class VxAnimatedBox extends VxWidgetBuilder VxAnimatedBox shadowOutline({Color? outlineColor}) { _boxShadow = [ BoxShadow( - color: outlineColor?.withOpacity(0.5) ?? + color: outlineColor?.withValues(alpha: 0.5) ?? const Color.fromRGBO(66, 153, 225, 0.5), blurRadius: 0.0, spreadRadius: 3.0, diff --git a/lib/src/flutter/bottom_sheet.dart b/lib/src/flutter/bottom_sheet.dart index 4bcba45f..ffd81e21 100644 --- a/lib/src/flutter/bottom_sheet.dart +++ b/lib/src/flutter/bottom_sheet.dart @@ -30,7 +30,7 @@ mixin VxBottomSheet { isScrollControlled: true, isDismissible: isDismissible, backgroundColor: - backgroundColor ?? Theme.of(context).colorScheme.background, + backgroundColor ?? Theme.of(context).colorScheme.surface, builder: (BuildContext context) { return SafeArea( bottom: isSafeAreaFromBottom, @@ -80,7 +80,7 @@ mixin VxBottomSheet { isScrollControlled: true, isDismissible: isDismissible, backgroundColor: - backgroundColor ?? Theme.of(context).colorScheme.background, + backgroundColor ?? Theme.of(context).colorScheme.surface, builder: (BuildContext context) { return SafeArea( bottom: isSafeAreaFromBottom, diff --git a/lib/src/flutter/clippers/vx_arc.dart b/lib/src/flutter/clippers/vx_arc.dart index 95cfa0b8..88eba36a 100644 --- a/lib/src/flutter/clippers/vx_arc.dart +++ b/lib/src/flutter/clippers/vx_arc.dart @@ -27,8 +27,6 @@ class VxArcClipper extends CustomClipper { return _getBottomPath(size); case VxEdge.left: return _getLeftPath(size); - default: - return _getRightPath(size); } } diff --git a/lib/src/flutter/clippers/vx_diagonal.dart b/lib/src/flutter/clippers/vx_diagonal.dart index 6abb8b03..4420ba59 100644 --- a/lib/src/flutter/clippers/vx_diagonal.dart +++ b/lib/src/flutter/clippers/vx_diagonal.dart @@ -32,9 +32,7 @@ class VxDiagonalClipper extends CustomClipper { return _getBottomLeftPath(size); case VxDiagonalPosition.bottomRight: return _getBottomRightPath(size); - default: - return _getBottomLeftPath(size); - } + } } Path _getTopLeftPath(Size size) { diff --git a/lib/src/flutter/container.dart b/lib/src/flutter/container.dart index ca08f665..d3aba966 100644 --- a/lib/src/flutter/container.dart +++ b/lib/src/flutter/container.dart @@ -197,7 +197,7 @@ class VxBox extends VxWidgetBuilder VxBox shadowOutline({Color? outlineColor}) { _boxShadow = [ BoxShadow( - color: outlineColor?.withOpacity(0.5) ?? + color: outlineColor?.withValues(alpha: 0.5) ?? const Color.fromRGBO(66, 153, 225, 0.5), blurRadius: 0.0, spreadRadius: 3.0, diff --git a/lib/src/flutter/dialog.dart b/lib/src/flutter/dialog.dart index c49a0ffd..5b04d3d3 100644 --- a/lib/src/flutter/dialog.dart +++ b/lib/src/flutter/dialog.dart @@ -241,7 +241,7 @@ class _VxDialog extends StatelessWidget { child: Container( height: 42, decoration: BoxDecoration( - color: cancelBgColor ?? Theme.of(context).colorScheme.background, + color: cancelBgColor ?? Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.vertical( bottom: Radius.circular(_circular), ), @@ -257,7 +257,7 @@ class _VxDialog extends StatelessWidget { onTap: () => onCancel(context), child: Container( decoration: BoxDecoration( - color: cancelBgColor ?? Theme.of(context).colorScheme.background, + color: cancelBgColor ?? Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.only( bottomLeft: Radius.circular(_circular), ), @@ -277,7 +277,7 @@ class _VxDialog extends StatelessWidget { onTap: () => onConfirm(context), child: Container( decoration: BoxDecoration( - color: confirmBgColor ?? Theme.of(context).colorScheme.background, + color: confirmBgColor ?? Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.only(bottomRight: Radius.circular(_circular)), ), @@ -365,7 +365,7 @@ class VxTimerButtonState extends State { Widget child = Container( height: 42, decoration: BoxDecoration( - color: widget.bgColor ?? Theme.of(context).colorScheme.background, + color: widget.bgColor ?? Theme.of(context).colorScheme.surface, borderRadius: BorderRadius.vertical( bottom: Radius.circular(_circular), ), diff --git a/lib/src/flutter/filters.dart b/lib/src/flutter/filters.dart index a5400e04..c999b3ce 100644 --- a/lib/src/flutter/filters.dart +++ b/lib/src/flutter/filters.dart @@ -359,9 +359,7 @@ class VxFilter extends VxWidgetBuilder { case VxColorFilter.polaroid: myMatrix = _polaroid; break; - default: - myMatrix = _noFilter; - } + } return this; } diff --git a/lib/src/flutter/flex.dart b/lib/src/flutter/flex.dart index 21923e65..336d79b9 100644 --- a/lib/src/flutter/flex.dart +++ b/lib/src/flutter/flex.dart @@ -429,7 +429,7 @@ class ZStack extends StatelessWidget { } class AStack extends StatelessWidget { - final Clip clipBehavior; + final OverflowBarAlignment overflowAlignment; final VerticalDirection overflowDirection; final double overflowSpacing; @@ -440,7 +440,7 @@ class AStack extends StatelessWidget { const AStack( {super.key, required this.children, - this.clipBehavior = Clip.none, + this.overflowAlignment = OverflowBarAlignment.start, this.overflowDirection = VerticalDirection.down, this.overflowSpacing = 0.0, @@ -451,7 +451,7 @@ class AStack extends StatelessWidget { Widget build(BuildContext context) { return OverflowBar( key: key, - clipBehavior: clipBehavior, + overflowAlignment: overflowAlignment, overflowDirection: overflowDirection, overflowSpacing: overflowSpacing, diff --git a/lib/src/flutter/glass.dart b/lib/src/flutter/glass.dart index 51ee31b0..fcfc000c 100644 --- a/lib/src/flutter/glass.dart +++ b/lib/src/flutter/glass.dart @@ -84,7 +84,7 @@ class VxGlassmorphic extends StatelessWidget { borderRadius: borderRadius ?? BorderRadius.circular(circularRadius!), border: border ?? Border.all( - color: Colors.white.withOpacity(0.3), + color: Colors.white.withValues(alpha: 0.3), width: 0.3, style: BorderStyle.solid), ), @@ -100,7 +100,7 @@ class VxGlassmorphic extends StatelessWidget { decoration: BoxDecoration( borderRadius: borderRadius ?? BorderRadius.circular(circularRadius!), - color: Colors.grey[100]?.withOpacity(opacity!), + color: Colors.grey[100]?.withValues(alpha: opacity!), ), child: child, ), @@ -129,7 +129,7 @@ class _PaintShadow extends CustomPainter { double? strokeWidth}) { return Paint() ..style = PaintingStyle.stroke - ..color = color!.withOpacity(0.24) + ..color = color!.withValues(alpha: 0.24) ..strokeWidth = strokeWidth! ..maskFilter = MaskFilter.blur( BlurStyle.normal, diff --git a/lib/src/flutter/hover.dart b/lib/src/flutter/hover.dart index 66f373aa..c74c6d37 100644 --- a/lib/src/flutter/hover.dart +++ b/lib/src/flutter/hover.dart @@ -28,8 +28,8 @@ class _HoverToggleState extends State with MaterialStateMixin { size: widget.size, child: MouseRegion( cursor: isHovered ? SystemMouseCursors.click : MouseCursor.defer, - onEnter: (_) => setMaterialState(MaterialState.hovered, true), - onExit: (_) => setMaterialState(MaterialState.hovered, false), + onEnter: (_) => setMaterialState(WidgetState.hovered, true), + onExit: (_) => setMaterialState(WidgetState.hovered, false), child: widget.mode == VxHoverMode.replace ? _buildReplaceableChildren() : _buildChildrenStack(), diff --git a/lib/src/flutter/list.dart b/lib/src/flutter/list.dart index 233af0ab..928dcbc5 100644 --- a/lib/src/flutter/list.dart +++ b/lib/src/flutter/list.dart @@ -184,9 +184,7 @@ class VxOrderedList extends StatelessWidget { return '${_toRomanNumeral(index)}.'; case VxListType.lowerRoman: return '${_toRomanNumeral(index).toLowerCase()}.'; - default: - return '$index.'; - } + } } String _toRomanNumeral(int number) { diff --git a/lib/src/flutter/popup_menu.dart b/lib/src/flutter/popup_menu.dart index 3be9af03..6c0635b5 100644 --- a/lib/src/flutter/popup_menu.dart +++ b/lib/src/flutter/popup_menu.dart @@ -200,7 +200,7 @@ class VxPopupMenuState extends State { Widget build(BuildContext context) { return PopScope( canPop: true, - onPopInvoked: (_) => _hideMenu(), + onPopInvokedWithResult: (_, __) => _hideMenu(), child: GestureDetector( behavior: HitTestBehavior.translucent, child: widget.child, diff --git a/lib/src/flutter/rich_text.dart b/lib/src/flutter/rich_text.dart index 89feb0e0..5c91773b 100644 --- a/lib/src/flutter/rich_text.dart +++ b/lib/src/flutter/rich_text.dart @@ -459,15 +459,16 @@ class VxRichText extends VxWidgetBuilder height: _lineHeight, textBaseline: _textBaseline ?? TextBaseline.alphabetic, wordSpacing: _wordSpacing, + ); // Create the TextSpan with the recognizer + final textSpan = TextSpan( + text: _text, + children: _textSpanChildren, + recognizer: _gestureRecognizer, // Ensure recognizer is set here + style: _themedStyle?.merge(ts) ?? _textStyle?.merge(ts) ?? ts, ); return _isIntrinsic ? Text.rich( - TextSpan( - text: _text, - children: _textSpanChildren, - recognizer: _gestureRecognizer, - style: _themedStyle?.merge(ts) ?? _textStyle?.merge(ts) ?? ts, - ), + textSpan, key: key, textAlign: _textAlign, maxLines: _maxLines, @@ -478,12 +479,7 @@ class VxRichText extends VxWidgetBuilder strutStyle: _strutStyle, ) : AutoSizeText.rich( - TextSpan( - text: _text, - children: _textSpanChildren, - recognizer: _gestureRecognizer, - style: _themedStyle?.merge(ts) ?? _textStyle?.merge(ts) ?? ts, - ), + textSpan, key: key, textAlign: _textAlign, maxLines: _maxLines, diff --git a/lib/src/flutter/timeline/timeline_widget.dart b/lib/src/flutter/timeline/timeline_widget.dart index 69bdca99..bc88fd6e 100644 --- a/lib/src/flutter/timeline/timeline_widget.dart +++ b/lib/src/flutter/timeline/timeline_widget.dart @@ -75,10 +75,10 @@ class VxTimelineState extends State firstElement: index == 0, lastElement: widget.timelineList.length == index + 1, controller: controller, - headingColor: widget.headingColor ?? - Theme.of(context).colorScheme.onBackground, + headingColor: + widget.headingColor ?? Theme.of(context).colorScheme.onSurface, descriptionColor: widget.descriptionColor ?? - Theme.of(context).colorScheme.onBackground, + Theme.of(context).colorScheme.onSurface, hideLauncher: !widget.showTrailing, trailing: widget.customTrailing, ), diff --git a/lib/src/flutter/toast.dart b/lib/src/flutter/toast.dart index 4f860f2d..2782cc54 100644 --- a/lib/src/flutter/toast.dart +++ b/lib/src/flutter/toast.dart @@ -241,7 +241,7 @@ class _VxToastViewState extends State<_VxToastView> CircularProgressIndicator( strokeWidth: 3.0, valueColor: AlwaysStoppedAnimation( - Theme.of(context).colorScheme.background, + Theme.of(context).colorScheme.surface, ), ), const SizedBox(height: 8), diff --git a/lib/src/flutter/universal.dart b/lib/src/flutter/universal.dart index da7f12bc..f6644fd8 100644 --- a/lib/src/flutter/universal.dart +++ b/lib/src/flutter/universal.dart @@ -1,8 +1,8 @@ /* -The VxUniversal widget is a versatile widget in Flutter that can be used for -various purposes. It allows you to combine multiple Flutter widgets and -apply different properties and behaviors to them using a single widget. -The VxUniversal widget supports a wide range of properties and options, +The VxUniversal widget is a versatile widget in Flutter that can be used for +various purposes. It allows you to combine multiple Flutter widgets and +apply different properties and behaviors to them using a single widget. +The VxUniversal widget supports a wide range of properties and options, making it highly customizable. Here is a breakdown of the properties and their functionalities: @@ -802,7 +802,7 @@ class VxUniversal extends StatelessWidget { Widget cardWidget(Widget current, BuildContext context) { final ThemeData theme = Theme.of(context); - final CardTheme cardTheme = CardTheme.of(context); + final CardThemeData cardTheme = CardTheme.of(context); return material(current, mType: MaterialType.card, mShadowColor: shadowColor ?? cardTheme.shadowColor ?? theme.shadowColor, diff --git a/lib/src/flutter/velocityx_mixins/neu_mixin.dart b/lib/src/flutter/velocityx_mixins/neu_mixin.dart index a4e4f84e..960b4573 100644 --- a/lib/src/flutter/velocityx_mixins/neu_mixin.dart +++ b/lib/src/flutter/velocityx_mixins/neu_mixin.dart @@ -105,10 +105,10 @@ mixin VxNeuMixin { ); Color _getNeuColor(Color baseColor, double amount) { - Map colors = { - 'r': baseColor.red, - 'g': baseColor.green, - 'b': baseColor.blue + Map colors = { + 'r': baseColor.r, + 'g': baseColor.g, + 'b': baseColor.b }; colors = colors.map((key, value) { @@ -118,8 +118,9 @@ mixin VxNeuMixin { if (value + amount > 255) { return MapEntry(key, 255); } - return MapEntry(key, (value + amount).floor()); + return MapEntry(key, (value + amount).floor().toDouble()); }); - return Color.fromRGBO(colors['r']!, colors['g']!, colors['b']!, 1); + return Color.fromRGBO( + colors['r']!.toInt(), colors['g']!.toInt(), colors['b']!.toInt(), 1); } } diff --git a/lib/src/velocity_xx.dart b/lib/src/velocity_xx.dart index d9d50f81..080fb5bb 100644 --- a/lib/src/velocity_xx.dart +++ b/lib/src/velocity_xx.dart @@ -759,21 +759,71 @@ mixin Vx { } static MaterialColor getMaterialColor(Color color) { - final int red = color.red; - final int green = color.green; - final int blue = color.blue; + final double red = color.r; + final double green = color.g; + final double blue = color.b; final Map shades = { - 50: Color.fromRGBO(red, green, blue, .1), - 100: Color.fromRGBO(red, green, blue, .2), - 200: Color.fromRGBO(red, green, blue, .3), - 300: Color.fromRGBO(red, green, blue, .4), - 400: Color.fromRGBO(red, green, blue, .5), - 500: Color.fromRGBO(red, green, blue, .6), - 600: Color.fromRGBO(red, green, blue, .7), - 700: Color.fromRGBO(red, green, blue, .8), - 800: Color.fromRGBO(red, green, blue, .9), - 900: Color.fromRGBO(red, green, blue, 1), + 50: Color.from( + alpha: .1, + red: red, + green: green, + blue: blue, + ), + 100: Color.from( + alpha: .2, + red: red, + green: green, + blue: blue, + ), + 200: Color.from( + alpha: .3, + red: red, + green: green, + blue: blue, + ), + 300: Color.from( + alpha: .4, + red: red, + green: green, + blue: blue, + ), + 400: Color.from( + alpha: .5, + red: red, + green: green, + blue: blue, + ), + 500: Color.from( + alpha: .6, + red: red, + green: green, + blue: blue, + ), + 600: Color.from( + alpha: .7, + red: red, + green: green, + blue: blue, + ), + 700: Color.from( + alpha: .8, + red: red, + green: green, + blue: blue, + ), + 800: Color.from( + alpha: .9, + red: red, + green: green, + blue: blue, + ), + 900: Color.from( + alpha: 1, + red: red, + green: green, + blue: blue, + ), }; return MaterialColor(color.value, shades); diff --git a/pubspec.lock b/pubspec.lock index ae843284..768565b4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.19.0" fake_async: dependency: transitive description: @@ -88,14 +88,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.18.1" - js: + leak_tracker: dependency: transitive description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" lints: dependency: transitive description: @@ -108,71 +124,71 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.15.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" sky_engine: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" term_glyph: dependency: transitive description: @@ -185,10 +201,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.7.3" vector_math: dependency: "direct main" description: @@ -197,6 +213,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" vxstate: dependency: "direct main" description: @@ -206,5 +230,5 @@ packages: source: hosted version: "2.3.0" sdks: - dart: ">=3.0.0 <4.0.0" - flutter: ">=2.0.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index b161f633..45ea89b4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: velocity_x description: A minimalist Flutter framework for rapidly building custom designs. -version: 4.1.2 +version: 4.1.3 homepage: https://velocityx.dev repository: https://github.com/iampawan/VelocityX documentation: https://velocityx.dev diff --git a/test/flutter/failures/overlay_isolatedDiff.png b/test/flutter/failures/overlay_isolatedDiff.png new file mode 100644 index 0000000000000000000000000000000000000000..825ba9d266b8ed0efeb65007e48de192b3069a84 GIT binary patch literal 18259 zcmeI4dr%Wc7{E_O2qH>QkfK-;R8$y5c?47}&_D!H86_kYkOV5)L24aEL=aMl7%UH~ zqNqh4)`|h-fB_XMWKu+}1rY@wJYpHkLtcVFso>D;UBU%s?8pe6(b@eYxBK0<-{ZHt zw>P;xsjwLl=QU#LG%$P zx}Dp>pW5qlj=AleE9wsMnr9x{Vx&}cX+x3pm=hQdtCZ<_wSR+PN&9Po{38&fL+ z0s?Nfw}p6kc&spJ^z@cY19Agu#jr-VZ-;fE23g`*I+))K)DdN2HfclXbZITafe#J{ zy7K|~^Z-cB{Uk{ZNI3V?sK(t|(psh^SsO@17X((cvo6~M`@$QIq;2+WsxgrBY{+}B z{2(*fCO2p}pSy9%Nfxg8#h3A@N&M~mC1Kr-dkw@>LATsEU2exM)){Rx-~?@t(&c(B zj8CR*oYR$L{dyZ7*M6S{nPKy3F{pDWGYt2cVwUH~#%yy+Qt9l$#teH|hc+)+B35^D z8ElnO))73PmYP~wKHnwoh(%{bXV1XXs?2JYx%k89DK+ym!c+!b=3?PJO>Q~aTTABK zgS>Yo)uiSEK&*568M%f$(g!5=h-D;p9`Oq#>DgVRjK~3@26qZ*g3{Ng#SPSvn*@@S zVh09WO&|{oh+HLU)XeE+@)Uq5J-dyRadfn)KrL?H7*o6XOiJ-`IvaEW#r7~G7F|Bt z(w+vAzv}47Y5x3tdN-4Tj}YkiGK9s?=Z_J2@B@R_hBXv)tSV#O8Yb6dB_-86;`~9M zN2YpQb^YSyY2TdNRcl#X*AP}EK*0%6c)HH~z`#|(?&4pbnU&wMw#UUFe}UC-^+iTJ z&5|Y|^pU1TL^SIa2rg34(IhfORPj;5d@12W4C=NK_&fl0eLEu9BkDN(JYjDT7@ z2ljcxO~2--V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Qx@f z)$LO8pmLDnCJ_R*GsXYft3=%mz2$>FM6n150uv%3Ac$bYpMwoEPQTx|ayPYbE$WUn M)sAx8%I)-j0S+_;pa1{> literal 0 HcmV?d00001 diff --git a/test/flutter/failures/overlay_masterImage.png b/test/flutter/failures/overlay_masterImage.png new file mode 100644 index 0000000000000000000000000000000000000000..a519e7d8e5f4c6c9ec15cafd4f46291768a0b2b2 GIT binary patch literal 23003 zcmeHPd0Z3M79JF36sZKQq5_5lkRl3YaiQ!aAd0xLL@bg#sLCexfj`SmOH@FFT7T?| z)TI^@Wt1HR(;)R#iP&O5p{NBF1Vm9H2!d}W0q)KJZGFDZ{Gs98d(S!dJKs6?PI6}w zx4Js1%w0McK@b(^4UFvwGKY;IN+>!TmsE;J6%j;1$=|_Y>yAKw4uYtsMSp9vsoqxO z$f+H6igrp$N=KJ{zN&22(}!+{A1AmjvEy3wJvr zSn<$5)@=5d^MV>w#*V}vSy10x^kdA`+BJNuVf306w#4WFCg6N8npm>V<)rhz+MTJF zOLnl4{;i#z#*EH_4Ov^Yv;NI&(EUzJGh&0KSyJ+M%CzLmLHUi#IWK12JXEf%_3-hc za+{!vF~wzTjU!9)YB}GRj@I1Te)U18Vc_1Qxw)BK^p`nHwDa1^ZdxnZgtRcN)9B9D zI5LW%_Rel7enp{v2?#<(oEdg*U*-09G#&GnEV(`y`aC&H+h!TI$W8U&HiK;kj1I@m z?mex(*y39op?A9Xh|C9m3h@oMd`!&Ny%exCAHZixoJ^f6ZP^Mlk5{YV@ zQZ(N54R&3R^;yX5h|NqY##`9bi#8EMO=+h`dhV^rA9)sLvU7iAK2yWnD`NDq!_k=W zijcah-(DNKZHk*k7^N>w!mfGZpNx%ZhSjbzp>IISq;M-Pbdd?q1WffjfD1Rugk1(x zJ=JjG2AOcB!BkHZhXl;^!UavEq|=#E6K{$ctnn2B0*(T6Wk*)$O8k?0p|un1d`nBp zyMg%m`QxHpA$gVIk8iZn_!A4*3V4UxMaDukAN-TxKax*{23@?<`bm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A5?G;Ea4M!16l6Iu(%DcvdU;M?z4GD#Z;RLo*EhAMa;Eya z)(htweO@`7F?_$K_SNt+cvAZqr*L#TdE4cb|2(8EY%{7e(8Tv`UZ6yn72z9|EBK-e zi7w*%6T2>+JrI?i+eGnD^Z6LUX0vw!_S;AiC_YGVpsCPHr_KOG%64%ng|lj@+_;t5 z$yiZB@mxU2+q#<>EcXUaXzA(6wxILzjTz)Z*fvdyhj`E(BnwhqbOYt3$ob&y!Q{Go zM!ADZ9(Qqr|$5%r+$W0oOdwB|Rs` z2S7dKl>-N}r?#91G1M3hW6fZ$;JF9e*>5{@pt4>V>WL9PK|k9d9Y#i zE7fv_=i(bZ5Pr5JP#5r~W{0djjy{z6G_7ssm~j3W^J2Pj)AfAxS`{2U!Uak_03PND?3< z2}lzBpOfIBO@G@ZV$Up~#`dl6U!8))IfMOirlRzlbfTRU6DZ&piHQsck`OW+NJ32F zKoWu^#QQ0aueI`Hk;$_F$AvO85!{u2jbM-guGqzQjW6*TO0l+JSTKv z)QtUmsL;_D2J~aK?8L4VQB~;oY#KQ4VGI4Rn*a`rASa+-#s5;}7JMzjKf&sbTaA)l z%CeEHtOsH`A-X$X=4N+9W>%`0zUHO1>Gi1=Ba}EhyslN$OZ<<#@BwE`kUwX3Jy-;x z8Cl#Hx~I-FbzRk|tO}X+N=q5S}i4;xT6|zPrer-Qf+oHG zwl4!n%%>nHx6t6I*`M{jRC9n)5dJ*$UgEs~)6ZgmF#E<4-_{i3iFIW5n_W$uLto0i zGjN$PJrjY>^nwG8@QjAhY40lMQz+YD!kpc0~Cd6FJ2^Y3b#W?ZuU&NW|%D8CH{^q}gvyHw0 literal 0 HcmV?d00001 diff --git a/test/flutter/failures/overlay_testImage.png b/test/flutter/failures/overlay_testImage.png new file mode 100644 index 0000000000000000000000000000000000000000..ed990886699fc0e0195855def0615b513b64868f GIT binary patch literal 23079 zcmeHPdt6Lg8{Q!%gei)2GbK(rq1#7_>P(kOb#iH%(Cv_fCZsyj4MQ{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v);$|=UN1E)y(E33YaKZN}zK^|2#qceVkpW|3n_YI7~<3fHbYDZZa_jvV1ObS#sL!I|3Zl4udnaKjy8yA z0f+!#(H_nN+_5A;Kte!5Ah0?QlK`p#ssXBDm;>SLmPc3~VR;;>3V*vA zEI!m`F=Q=g+C28GR*x&VGo_%w%IM0(Nm)mpae498`_4Sr_R5`g$h~aegZu{z4JC0+ z15TQ0z=<+&FwF%Hpnm}lnt}6bI&dxx9&i71o%{2NXHj=7=`rle3oUTcH|)9@ia$k< z6we`^NqfbdYS?uR>&cTP{@wXfsLUBjHS+agx+WqXEm(57{A8b-c|)_$<~-(Me7;v< zw}9sf{<(mE6OsS!-%W79sb%A457)!jL)V$(@1p`GT0u{|Yr!8wk9yiEJBJvE{jm6& zQoAmyZ&^-w15^w&Ms{STO2Fo=5`4r*>cQ4{oJ2)0m z-^RWR6)IsiOsM8JeSHae4tXv?0P>u;ejoRoVX8;CDPz~6f*jDGeA(UBpBz-EXE&H)4x zLIML6$uJI(5RedX%NP*@R0C84R0C84jsU!Lmhb@HP7Lb-5&{we-Zu=30hY&MAYgg? zSCq#K?#qaev(Ef0z&yIPaO7(c7s-+58b`@Tv|#fvDIg{iARr+iArR!Nt3kHu-oaOv SnZJ19=rXLG=owaC`~M4y*Xqjv literal 0 HcmV?d00001 From fb3393522708d67808bb702332be98361ea0afd5 Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Sun, 15 Dec 2024 01:27:33 +0530 Subject: [PATCH 04/19] `Update intl dependency from ^0.18.1 to ^0.19.0` --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 45ea89b4..10155198 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - intl: ^0.18.1 + intl: ^0.19.0 vxstate: ^2.3.0 vector_math: ^2.1.4 From 6d12cd55353ddf658e48c590438ad8c9a752782e Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Sun, 15 Dec 2024 01:28:49 +0530 Subject: [PATCH 05/19] `Bump version from 4.1.3 to 4.3.0 in pubspec.yaml` --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 10155198..f8028696 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: velocity_x description: A minimalist Flutter framework for rapidly building custom designs. -version: 4.1.3 +version: 4.3.0 homepage: https://velocityx.dev repository: https://github.com/iampawan/VelocityX documentation: https://velocityx.dev From a06240779d11673e25715290716db3b61665ee15 Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Sun, 15 Dec 2024 01:29:22 +0530 Subject: [PATCH 06/19] `Update CHANGELOG.md to reflect new version and breaking changes` --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffe4d250..ff225412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -## [4.1.3] - Nov 23, 2023 +## [4.3.0] - + +- Breaking changes for intl and Flutter 3.27 migration fixes + + +## [4.1.3] - - Flutter 3.27 migration fixes From 40d25de33ca6064a75a75ed59512bff88e9f6867 Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Fri, 21 Feb 2025 00:14:34 +0530 Subject: [PATCH 07/19] Fix enableFeedback default value in VxUniversal --- lib/src/flutter/universal.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/flutter/universal.dart b/lib/src/flutter/universal.dart index f6644fd8..a036555c 100644 --- a/lib/src/flutter/universal.dart +++ b/lib/src/flutter/universal.dart @@ -858,7 +858,7 @@ class VxUniversal extends StatelessWidget { radius: radius, borderRadius: borderRadius, customBorder: customBorder, - enableFeedback: enableFeedback, + enableFeedback: enableFeedback ?? false, excludeFromSemantics: excludeFromSemantics, focusNode: focusNode, canRequestFocus: canRequestFocus, From 9bfbc4676079c8776ea844f0df64e41a3589a8a8 Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Fri, 21 Feb 2025 00:14:44 +0530 Subject: [PATCH 08/19] Fix enableFeedback default value in VxUniversal for Flutter 3.29 --- CHANGELOG.md | 3 +++ pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f25dface..c9e3518e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [4.3.1] - +- Fix enableFeedback default value in VxUniversal in Flutter 3.29 + ## [4.3.0] - Jan 23, 2025 - Flutter 3.27 compatibility added diff --git a/pubspec.yaml b/pubspec.yaml index 5686f7a7..9131e195 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: velocity_x description: A minimalist Flutter framework for rapidly building custom designs. -version: 4.3.0 +version: 4.3.1 homepage: https://velocityx.dev repository: https://github.com/iampawan/VelocityX documentation: https://velocityx.dev From b514ec9ac89d5e5626c7bc07df72a76397d1586f Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Fri, 21 Feb 2025 00:20:53 +0530 Subject: [PATCH 09/19] Fix enableFeedback default value in VxUniversal for Flutter 3.29 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9e3518e..798ed354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## [4.3.1] - - Fix enableFeedback default value in VxUniversal in Flutter 3.29 +- Fix clipBehavior for aStack +- Fix TextSpan with the recognizer initialization ## [4.3.0] - Jan 23, 2025 From 0e2dc8022c3143eab8a64b850ecce1660621cb5f Mon Sep 17 00:00:00 2001 From: Shreeman Arjun Sahu Date: Thu, 5 Jun 2025 00:39:00 +0530 Subject: [PATCH 10/19] Update pubspec.lock and test files for dependency version bumps and stability improvements --- example/pubspec.lock | 76 ++++++------ .../test/failures/goldens_isolatedDiff.png | Bin 16456 -> 16446 bytes example/test/failures/goldens_maskedDiff.png | Bin 16699 -> 16688 bytes example/test/failures/goldens_masterImage.png | Bin 15485 -> 15481 bytes example/test/failures/goldens_testImage.png | Bin 15511 -> 15500 bytes pubspec.lock | 110 +++++++----------- test/flutter/rich_text_test.dart | 1 + 7 files changed, 78 insertions(+), 109 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 7c4c6473..d8320a0c 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -50,10 +50,10 @@ packages: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.12.0" auto_size_text_pk: dependency: transitive description: @@ -66,10 +66,10 @@ packages: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" build: dependency: transitive description: @@ -138,10 +138,10 @@ packages: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" charcode: dependency: transitive description: @@ -178,10 +178,10 @@ packages: dependency: transitive description: name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" code_builder: dependency: transitive description: @@ -194,10 +194,10 @@ packages: dependency: transitive description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.19.1" conventional_commit: dependency: transitive description: @@ -242,10 +242,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" file: dependency: transitive description: @@ -385,18 +385,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "10.0.8" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.9" leak_tracker_testing: dependency: transitive description: @@ -433,10 +433,10 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.17" material_color_utilities: dependency: transitive description: @@ -457,10 +457,10 @@ packages: dependency: transitive description: name: meta - sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c url: "https://pub.dev" source: hosted - version: "1.15.0" + version: "1.16.0" mime: dependency: transitive description: @@ -489,10 +489,10 @@ packages: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" platform: dependency: transitive description: @@ -606,26 +606,26 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.10.1" stack_trace: dependency: transitive description: name: stack_trace - sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.12.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" stream_transform: dependency: transitive description: @@ -638,26 +638,26 @@ packages: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.1" term_glyph: dependency: transitive description: name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" test_api: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.4" timing: dependency: transitive description: @@ -696,7 +696,7 @@ packages: path: ".." relative: true source: path - version: "4.2.1" + version: "4.3.0" very_good_analysis: dependency: "direct dev" description: @@ -709,10 +709,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" url: "https://pub.dev" source: hosted - version: "14.3.0" + version: "14.3.1" vxstate: dependency: "direct main" description: @@ -770,5 +770,5 @@ packages: source: hosted version: "2.2.2" sdks: - dart: ">=3.6.0 <4.0.0" + dart: ">=3.7.0-0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/example/test/failures/goldens_isolatedDiff.png b/example/test/failures/goldens_isolatedDiff.png index 0d9905f5a5faaa94b09bba6da6b3871603d2ab33..9cb71ec29ae18c95f9c7edcafc2d8a5a1a8c4281 100644 GIT binary patch literal 16446 zcmeHO2~d;SmX1P;3P}4<5fSKqcFXfAVvB$*A-1Trjes@+3MN5O5duWO07(p}AZVka z;zodgD{B%kERqny(t=wE0!bhN0xaGE4Oebh2?Bu(5B{+4ClE--1q9O5UA_$X<<@OoFwp46>^*pNIqJ`@p9kS+rD1@gHc)~ zE&S=5(Sp`%%L}Xv40(T9+U9<=Ba~ks5zzeLjd1Uul1s16?K*Fu`_?ON>4t)RkDZdb z(N8QQzDPbQ^uq}yn3W?0R?@p_2}z(5B>Dv7D*I{=6~8r=-<<0| z+yQZjs{??;k?5|E{Tnzpj!kZ@%ZN%e&&mD_suQGtNsuwP*FH-k55~t*V3r{JO;&#> zQ2%*ZO1^^{fr5;0hVn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g!LdHJPQ+(KGi01T$T+_-3cT3gX$srfOxa2(YMGI|cPSqlk0kWw(+ zUYp}bgZr8hhM(}uV?$vuNjb|KB@}pyC{fgc3}kh6|9#zxdCu`lax|*r;XTpKcdiJQ zCO819u!bB}r+(osDzeMtj`@1iAZiv-l#1M%5A^hLb#P~RgjDF2;b31?Bjv}nL!*=$ zb(B(|%nt!KMGm~VC#u&M!lupIXw{DG1y)=tPQrxF+;JB_*j353%F7PCC589&MIHm( zr^2Ga-RDJIr?a@tx$bE89LtCIBypXZNJFo(@C)@I7N@3$&~@!_I$(GQz3Oc67Tt;| z_bH~K#5@iKW-TVECJI{o)$Lj-8Bp)G>RCJc*p8?3lW!r8CBM||241QXtgyt2T9NoT zoao9*@#{^*qIcV}VM4Xa0PqvVc?SFfb2t{ zLVy;g&vmW0znE`90>6oJbSdPq_otmY<)$9<0Tv-0oa>BPYQm7zqb*PPwmTJiyGha< zT~=zljoO>@tP}?mCwBEQ1+v3E*rqtuLb@HAT1hK~|HgikcM0=UT}Q^x=0g4h^y>HlRXDm~KKs8`LHM255C1n6N*38%)aGIV z_McOLT@0CvjZ6RIx4!{cTU diff --git a/example/test/failures/goldens_maskedDiff.png b/example/test/failures/goldens_maskedDiff.png index 105a585ccce3a27ae74a23913daf1ca6d1c7ab1d..7973b6cc12d65eff6b12c5e1537936f299af6ee0 100644 GIT binary patch delta 5521 zcmZWtc{p3?_rIiNx?tMQbW?Pu)B5)5v}zP%3EgH)$E2B#K}iYKHYLSaA|#Tl+M)}l zqrkob&m-FDp^6 zGEwi(hx$QL4>Rs=@OhbFm$6^(?@d1Xz|0Xqb=)!|LO;^6ytdfzTi^Nu$)>)^2Ya0= zpm%r!1F&k>;sPRH!T_K>Wc9XTf>Bgg`vH5Ynvv^*EAqDh><(FGY;z?2XI&kr46Mj? zVM;aueHe#PJpj0DOMYn+GF@M634Gp8+L+)val85}*lELz{jksXae16wmumhvg+y;p zaJexs7y&217q-`@I0AJmNJR38GvBALd)giWySMJr7h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IYz%19 zGnqITEc~ScjAK@j^p+vb25) zC0)b;_i&o|NzEgpH^P58x~%>)n5T3~n9q6RW=cUWif`)YHBCqKz9yqoQ65+k(pLN< zYH?;Gp}j6n`r&K<&SV(Fnbx^=LGk2pQbtknC)hkZ2g94`Z0veEo9!`r?GbMmt9N7XowQtCFRXFR7`7Ho zZzg)qTd6fsghz z3TvcDRg+-IvBxyGg+Wwyd4*(#rOkfs(QSVBS6g2gOr@4{ynT?7&8IV17=glC^x@$f zB|T%V3q_wlF0L78K#+;f9kPhQ&9s&kWUn{}J*ay9f3)=iqL~2|Dt*h9U_tAbNzf+# vWvvWGkS|;ytptFlwAM8cJ{FZ$v=E{Eq=c4E* diff --git a/example/test/failures/goldens_masterImage.png b/example/test/failures/goldens_masterImage.png index 72895a3f57cc89d0afdd5781902f52cd32c840eb..9c50f0b8394dba34fc0072afc289576ce16902f0 100644 GIT binary patch delta 4729 zcmaJ_X;f2J*S?ggRtA+SGPe%!wkl{bP=*i@g<2X=5g8&-iwY(XR0u;NT#8oe0Mw>M z1riWs3?wLoFoZ#|qAx>`Ofm%!E0914Bmojg^4_#-eLue+cb&EFU3;H>_u0?0pM6xR ziqzk}2MG@+q@>j)*P+AjE^!=*BA0L64tw(-2Vc#<5p-J*^>UcUOazd9O~ zeR3fgRhNACWO?g}Cx6_zDg3%MWv=Om?=Ni|yXCm;!7Cn844$LfS`*(~kBO9~ZhS>u zlq>g5c+N-*SqVAYojRDM004YaH!OpeOzv?BvD9*x=^)14-Cg)NH@6}NIGFh<@k=9n z`;y@Fu2;K#SNgUYH0~wcEg%E3t%7|LWzz(n3iyaaOM5?`|&d z+XhG?bxN|`rie?QU2``^FTi-*IM3;ZkO=GP2$hG>GrUyIUS(3pd~RO7XJw#3kyhvA`ZHNcMHw`PQp+WONj>CYh3x- z%}&gdQL2#;3~zpzKAEde|2rSWy%}N8sVIyK-#y~T`*rJXH0SjxBvqkZ_5lw=gI0zs1Bx&1-KGyQGpkr8gvJNVcs9~{pj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1zs3POHe`@cmuKL zFU_Swn$2AYC;+Ur?lvKSwHW@9=tr;M>p}3-T3LbraHK$%C5XPzz7ZeHZ##!eHt*t& zSbAX_`QY2AX85rLax4KuOc6~6v?-Rz&wZRiHw<6NI za!@ncMh?*X9%m&00AX{~^Fo%a@2CtkHta>-fe53hWbfis(K>3qeH|qj^+#;BtoXtX zJx*Dgyr7BBiOc|%b|RFs1?`$e&$)3ccDg2c3=}yxlf!OBFbxl$8dvI@ikyGbec&o< z+#28Jp2dmEkf~M81Oh=&MatJR%;z5d97S=p{ziXKSs@ARR{-!n?RSd&ee~`B121j* Ac>n+a diff --git a/example/test/failures/goldens_testImage.png b/example/test/failures/goldens_testImage.png index d38993b307fb27c0999ab24876c6c09a9438d742..f278f77d2dd5213cce36c1c84f5ef266df937156 100644 GIT binary patch literal 15500 zcmeHuc~n#P_V1xsuqsldm4X8GwuR@l75yP1LqJ7E#TXm_AwpDCAQ4b842clHfm#IG z+JXW}Krsv<2?AkANFt)5RS1v?1B6M2BtTFS0)Zs&#QWYKzqj6N@BO{5-nZU@wX)6$ z>wKrZKYKX)vvbS;u&>z)n-u^6m>t-^=O_Redjf#zvgIb=f3kmE1_3WdaYuc31Jw5Q zQt->NxZMYiF9-jwEcm1tvgD03>pEznNRG%4do8}MYm=r-mJXRj_82+0gsbE zPK_D8{!g9f4-fpWJm69!HJV&!7K`~v>5iYV+6FPwe5?L^fZo8Fg&qDN*(~BTP<1)J zKaLiF(H4;U8xGRU0rJn5f2pYcSH%cZNv7bgV)9eMd6qzt=<*X|0CizE!=)WTTrDuQ7ZkMF9B%MF@?n@|HLdgd0xx0Xp!1fml&HdB)>C zx!=J96Z+zU`eqbr{&0?WAU@L_)#+p3S}QS>C=N6H}OHWn7LL&*T1Q& z>xpODY>V{g@c^Kr0!h!y`wk&dF4yE*A+A1R>#}H~+xK{=sn9soM7LVhFxe_{SQmS= zMVuk1I^BYLI&A^vmY90Z&V>u!G*+#R-(2Zyms~RX8XsT|S@h59KYex5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*%YOoTEEU^FmzdMi5VoK zK)*N)<0smAyy8BKf;sTB^L>-_V8wRQ+Nki(=5#<5Rcl&{| z?2g7VokE@{x?`BT<=YLAne=hSIBv>6R(Qd5SVWO{%8YE3jeUpf6DJsm`h`E|n@3{G ztHKM!s!h$abOTUGuD7l4dWN#6_~^bp53HZ=EgjkOiWD?+wqQS?o#p&s#?adAd0eUU zlApk>$g%BG%7uXdKT`(hnV*Ugfm`MAyYz)d#s>w!Z&y$NI-Ubw0sgK0rat83^g=i7 zaXKLZ+s><~C*kJbmD>J*!nHQ2?$=Wzz99pqY9hI?yxgbM5q{@fLyOVN;2~GHl@Ftt z(NwEgAoy&4aNk*{-JJ4^9gn(IzvyhBf$DSO1Pwy?yx3N_UN@fOlJa>Fyh&K{FE_{- z?0Ux2=>=21h&`e66W6OGF4NgrbW{6B{yy7L<$J?cG4`5RpAKtofUn?om*f=3.6.0 <4.0.0" + dart: ">=3.7.0-0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/test/flutter/rich_text_test.dart b/test/flutter/rich_text_test.dart index f1d374a8..72e7a422 100644 --- a/test/flutter/rich_text_test.dart +++ b/test/flutter/rich_text_test.dart @@ -65,6 +65,7 @@ void main() { expect(didTap, isFalse); await tester.tap(find.byKey(key)); + await tester.pumpAndSettle(); expect(didTap, isTrue); }); From a88e8d74662ec90a8ca0764e3b3718ad499b241d Mon Sep 17 00:00:00 2001 From: ShreemanMassTech Date: Sun, 17 Aug 2025 00:51:44 +0530 Subject: [PATCH 11/19] =?UTF-8?q?=F0=9F=90=9B=20fix(dependencies):=20updat?= =?UTF-8?q?e=20dependencies=20in=20pubspec=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - update versions of multiple dependencies in pubspec.yaml and pubspec.lock - includes intl, vector_math, flutter_lints, leak_tracker, test_api, vm_service, async, fake_async - ensure compatibility and stability of the project --- example/pubspec.lock | 169 +++++++++++++++++++------------------------ pubspec.lock | 46 ++++++------ pubspec.yaml | 4 +- 3 files changed, 99 insertions(+), 120 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index d8320a0c..3a9fb74f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,15 +5,10 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "03f6da266a27a4538a69295ec142cb5717d7d4e5727b84658b63e1e1509bac9c" + sha256: da0d9209ca76bde579f2da330aeb9df62b6319c834fa7baae052021b0462401f url: "https://pub.dev" source: hosted - version: "79.0.0" - _macros: - dependency: transitive - description: dart - source: sdk - version: "0.3.3" + version: "85.0.0" alchemist: dependency: "direct dev" description: @@ -26,10 +21,10 @@ packages: dependency: transitive description: name: analyzer - sha256: c9040fc56483c22a5e04a9f6a251313118b1a3c42423770623128fa484115643 + sha256: "974859dc0ff5f37bc4313244b3218c791810d03ab3470a579580279ba971a48d" url: "https://pub.dev" source: hosted - version: "7.2.0" + version: "7.7.1" ansi_styles: dependency: transitive description: @@ -42,18 +37,18 @@ packages: dependency: transitive description: name: args - sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 url: "https://pub.dev" source: hosted - version: "2.6.0" + version: "2.7.0" async: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" auto_size_text_pk: dependency: transitive description: @@ -74,50 +69,50 @@ packages: dependency: transitive description: name: build - sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0 + sha256: "6439a9c71a4e6eca8d9490c1b380a25b02675aa688137dfbe66d2062884a23ac" url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "3.0.2" build_config: dependency: transitive description: name: build_config - sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + sha256: "4f64382b97504dc2fcdf487d5aae33418e08b4703fc21249e4db6d804a4d0187" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.2.0" build_daemon: dependency: transitive description: name: build_daemon - sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948" + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" url: "https://pub.dev" source: hosted - version: "4.0.3" + version: "4.0.4" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e" + sha256: "2b21a125d66a86b9511cc3fb6c668c42e9a1185083922bf60e46d483a81a9712" url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "3.0.2" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573" + sha256: fd3c09f4bbff7fa6e8d8ef688a0b2e8a6384e6483a25af0dac75fef362bcfe6f url: "https://pub.dev" source: hosted - version: "2.4.14" + version: "2.7.0" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021" + sha256: ab27e46c8aa233e610cf6084ee6d8a22c6f873a0a9929241d8855b7a72978ae7 url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "9.3.0" built_collection: dependency: transitive description: @@ -130,10 +125,10 @@ packages: dependency: transitive description: name: built_value - sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2" + sha256: ba95c961bafcd8686d1cf63be864eb59447e795e124d98d6a27d91fcd13602fb url: "https://pub.dev" source: hosted - version: "8.9.3" + version: "8.11.1" characters: dependency: transitive description: @@ -154,18 +149,18 @@ packages: dependency: transitive description: name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.0.4" cli_launcher: dependency: transitive description: name: cli_launcher - sha256: "5e7e0282b79e8642edd6510ee468ae2976d847a0a29b3916e85f5fa1bfe24005" + sha256: "17d2744fb9a254c49ec8eda582536abe714ea0131533e24389843a4256f82eac" url: "https://pub.dev" source: hosted - version: "0.3.1" + version: "0.3.2+1" cli_util: dependency: transitive description: @@ -202,10 +197,10 @@ packages: dependency: transitive description: name: conventional_commit - sha256: dec15ad1118f029c618651a4359eb9135d8b88f761aa24e4016d061cd45948f2 + sha256: c40b1b449ce2a63fa2ce852f35e3890b1e182f5951819934c0e4a66254bc0dc3 url: "https://pub.dev" source: hosted - version: "0.6.0+1" + version: "0.6.1+1" convert: dependency: transitive description: @@ -226,10 +221,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac" + sha256: "8a0e5fba27e8ee025d2ffb4ee820b4e6e2cf5e4246a6b1a477eb66866947e0bb" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" equatable: dependency: transitive description: @@ -242,10 +237,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" file: dependency: transitive description: @@ -297,10 +292,10 @@ packages: dependency: transitive description: name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" golden_toolkit: dependency: "direct dev" description: @@ -321,10 +316,10 @@ packages: dependency: transitive description: name: http - sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.5.0" http_multi_server: dependency: transitive description: @@ -345,10 +340,10 @@ packages: dependency: transitive description: name: intl - sha256: "00f33b908655e606b86d2ade4710a231b802eec6f11e87e4ea3783fd72077a50" + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" url: "https://pub.dev" source: hosted - version: "0.20.1" + version: "0.20.2" io: dependency: transitive description: @@ -357,14 +352,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.5" - js: - dependency: transitive - description: - name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf - url: "https://pub.dev" - source: hosted - version: "0.7.1" json_annotation: dependency: "direct main" description: @@ -377,34 +364,34 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: b0a98230538fe5d0b60a22fb6bf1b6cb03471b53e3324ff6069c591679dd59c9 + sha256: ce2cf974ccdee13be2a510832d7fba0b94b364e0b0395dee42abaa51b855be27 url: "https://pub.dev" source: hosted - version: "6.9.3" + version: "6.10.0" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "11.0.1" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -421,14 +408,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" - macros: - dependency: transitive - description: - name: macros - sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" - url: "https://pub.dev" - source: hosted - version: "0.1.3-main.0" matcher: dependency: transitive description: @@ -481,10 +460,10 @@ packages: dependency: transitive description: name: package_config - sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.2.0" path: dependency: transitive description: @@ -513,10 +492,10 @@ packages: dependency: transitive description: name: process - sha256: "107d8be718f120bbba9dcd1e95e3bd325b1b4a4f07db64154635ba03f2567a0d" + sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744 url: "https://pub.dev" source: hosted - version: "5.0.3" + version: "5.0.5" prompts: dependency: transitive description: @@ -529,10 +508,10 @@ packages: dependency: transitive description: name: pub_semver - sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.2.0" pub_updater: dependency: transitive description: @@ -577,10 +556,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.0" sky_engine: dependency: transitive description: flutter @@ -590,18 +569,18 @@ packages: dependency: transitive description: name: source_gen - sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b" + sha256: "7b19d6ba131c6eb98bfcbf8d56c1a7002eba438af2e7ae6f8398b2b0f4f381e3" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "3.1.0" source_helper: dependency: transitive description: name: source_helper - sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" + sha256: a447acb083d3a5ef17f983dd36201aeea33fedadb3228fa831f2f0c92f0f3aca url: "https://pub.dev" source: hosted - version: "1.3.5" + version: "1.3.7" source_span: dependency: transitive description: @@ -654,10 +633,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" timing: dependency: transitive description: @@ -686,17 +665,17 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" velocity_x: dependency: "direct main" description: path: ".." relative: true source: path - version: "4.3.0" + version: "4.3.1" very_good_analysis: dependency: "direct dev" description: @@ -709,10 +688,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.0.2" vxstate: dependency: "direct main" description: @@ -725,34 +704,34 @@ packages: dependency: transitive description: name: watcher - sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" web: dependency: transitive description: name: web - sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" web_socket: dependency: transitive description: name: web_socket - sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" url: "https://pub.dev" source: hosted - version: "0.1.6" + version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5" + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" yaml: dependency: transitive description: @@ -770,5 +749,5 @@ packages: source: hosted version: "2.2.2" sdks: - dart: ">=3.7.0-0 <4.0.0" + dart: ">=3.8.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.lock b/pubspec.lock index 0fe19b69..594fca56 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.0" auto_size_text_pk: dependency: "direct main" description: @@ -53,10 +53,10 @@ packages: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" flutter: dependency: "direct main" description: flutter @@ -66,10 +66,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -84,42 +84,42 @@ packages: dependency: "direct main" description: name: intl - sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" url: "https://pub.dev" source: hosted - version: "0.19.0" + version: "0.20.2" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "11.0.1" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: name: lints - sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "6.0.0" matcher: dependency: transitive description: @@ -201,26 +201,26 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" vector_math: dependency: "direct main" description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.0.2" vxstate: dependency: "direct main" description: @@ -230,5 +230,5 @@ packages: source: hosted version: "2.3.0" sdks: - dart: ">=3.7.0-0 <4.0.0" + dart: ">=3.8.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 9131e195..db7b4ed6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,9 +15,9 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - intl: ^0.20.1 + intl: ^0.20.2 vxstate: ^2.3.0 - vector_math: ^2.1.4 + vector_math: ^2.2.0 dev_dependencies: flutter_test: From 2fd43c2222055001bd7dbf2f0db42e8727dbf18b Mon Sep 17 00:00:00 2001 From: ShreemanMassTech Date: Sun, 17 Aug 2025 00:52:14 +0530 Subject: [PATCH 12/19] =?UTF-8?q?=F0=9F=90=9B=20fix(flutter):=20fix=20null?= =?UTF-8?q?=20safety=20and=20toast=20position?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix animation value null safety issue in skeleton - fix buildContext type issue in toast position - set boxconstraints for height to fix the height issue in tooltip --- lib/src/flutter/common/velocity_zero.dart | 9 +++++---- lib/src/flutter/toast.dart | 2 +- lib/src/flutter/widgets.dart | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/src/flutter/common/velocity_zero.dart b/lib/src/flutter/common/velocity_zero.dart index 2df040dc..bd9a032f 100644 --- a/lib/src/flutter/common/velocity_zero.dart +++ b/lib/src/flutter/common/velocity_zero.dart @@ -17,7 +17,8 @@ import 'package:velocity_x/src/extensions/context_ext.dart'; /// /// [myBoxDesc] to reuse with [PKSkeleton] /// -Decoration myBoxDec(animation, {isCircle = false, isDark = false}) { +Decoration myBoxDec(Animation? animation, + {bool isCircle = false, bool isDark = false}) { return BoxDecoration( shape: isCircle ? BoxShape.circle : BoxShape.rectangle, gradient: LinearGradient( @@ -36,9 +37,9 @@ Decoration myBoxDec(animation, {isCircle = false, isDark = false}) { const Color(0xfff6f7f9), ], stops: [ - animation.value - 1, - animation.value, - animation.value + 1, + animation?.value - 1, + animation?.value, + animation?.value + 1, ], ), ); diff --git a/lib/src/flutter/toast.dart b/lib/src/flutter/toast.dart index 2782cc54..3f28d95c 100644 --- a/lib/src/flutter/toast.dart +++ b/lib/src/flutter/toast.dart @@ -263,7 +263,7 @@ class _VxToastViewState extends State<_VxToastView> } /// Set the toast position - dynamic buildToastPosition(context) { + dynamic buildToastPosition(BuildContext context) { dynamic backResult; if (widget.toastPosition == VxToastPosition.top) { backResult = MediaQuery.sizeOf(context).height * 1 / 6; diff --git a/lib/src/flutter/widgets.dart b/lib/src/flutter/widgets.dart index 09367742..f337c382 100644 --- a/lib/src/flutter/widgets.dart +++ b/lib/src/flutter/widgets.dart @@ -29,6 +29,7 @@ extension VxWidgetsExtension on Widget { {Key? key, Decoration? decoration, double? height, + BoxConstraints? constraints, bool? preferBelow, EdgeInsetsGeometry? padding, TextStyle? textStyle, @@ -38,7 +39,9 @@ extension VxWidgetsExtension on Widget { key: key, message: message, decoration: decoration, - height: height, + constraints: height != null + ? BoxConstraints.tightFor(height: height) + : constraints, padding: padding, preferBelow: preferBelow, textStyle: textStyle, From 3d125c917acdbfc15862469403283caef79cb6f1 Mon Sep 17 00:00:00 2001 From: ShreemanMassTech Date: Sun, 17 Aug 2025 00:53:11 +0530 Subject: [PATCH 13/19] =?UTF-8?q?=F0=9F=90=9B=20fix(drawer):=20resolve=20p?= =?UTF-8?q?opscope=20deprecated=20warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - replace onPopInvokedWithResult with onPopInvoked --- lib/src/flutter/drawer.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/flutter/drawer.dart b/lib/src/flutter/drawer.dart index fed5ae1c..69c8596c 100644 --- a/lib/src/flutter/drawer.dart +++ b/lib/src/flutter/drawer.dart @@ -83,7 +83,7 @@ mixin VxDrawer { overlayEntry = OverlayEntry( builder: (BuildContext context) => PopScope( - onPopInvokedWithResult: (_, __) => backClose, + onPopInvokedWithResult: (_, _) => backClose, child: _VxDrawer( key: key, type: type, From a8416f4ef8fc21a5dbf1d553b5da71fb69f4c1af Mon Sep 17 00:00:00 2001 From: ShreemanMassTech Date: Sun, 17 Aug 2025 00:53:30 +0530 Subject: [PATCH 14/19] =?UTF-8?q?=F0=9F=90=9B=20fix(popup=5Fmenu):=20fix?= =?UTF-8?q?=20onPopInvokedWithResult=20callback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - change arguments of onPopInvokedWithResult from (_, __) to (_, _) to avoid linting error --- lib/src/flutter/popup_menu.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/flutter/popup_menu.dart b/lib/src/flutter/popup_menu.dart index 6c0635b5..62a478e7 100644 --- a/lib/src/flutter/popup_menu.dart +++ b/lib/src/flutter/popup_menu.dart @@ -200,7 +200,7 @@ class VxPopupMenuState extends State { Widget build(BuildContext context) { return PopScope( canPop: true, - onPopInvokedWithResult: (_, __) => _hideMenu(), + onPopInvokedWithResult: (_, _) => _hideMenu(), child: GestureDetector( behavior: HitTestBehavior.translucent, child: widget.child, From 042d509147d9ac74d4c36eba247c49296f57a491 Mon Sep 17 00:00:00 2001 From: ShreemanMassTech Date: Sun, 17 Aug 2025 00:54:23 +0530 Subject: [PATCH 15/19] chore(deps): update Dart SDK version constraint - update Dart SDK version constraint to >=3.9.0 <4.0.0 --- pubspec.lock | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 594fca56..60a1449e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -230,5 +230,5 @@ packages: source: hosted version: "2.3.0" sdks: - dart: ">=3.8.0 <4.0.0" + dart: ">=3.9.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index db7b4ed6..dd546fa8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/iampawan/VelocityX documentation: https://velocityx.dev environment: - sdk: ">=3.0.0 <4.0.0" + sdk: ">=3.9.0 <4.0.0" flutter: ">=2.0.0" dependencies: From 9d3d9f6a1336c4efd08b4dd5990871f6a06f718a Mon Sep 17 00:00:00 2001 From: ShreemanMassTech Date: Sun, 17 Aug 2025 00:54:38 +0530 Subject: [PATCH 16/19] =?UTF-8?q?```=20=E2=99=BB=EF=B8=8F=20refactor(exten?= =?UTF-8?q?sions):=20improve=20code=20readability=20and=20maintainability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Enhance code formatting for better readability across multiple extension files. - Refactor conditional checks and expressions for conciseness. - Standardize the use of const constructors. - Improve code alignment. ``` --- lib/src/dart/guard.dart | 6 +- lib/src/dart/timeline.dart | 11 +- lib/src/extensions/context_ext.dart | 137 ++-- lib/src/extensions/date_time_ext.dart | 15 +- lib/src/extensions/iterable_ext.dart | 31 +- lib/src/extensions/list_ext.dart | 322 +++++---- lib/src/extensions/misc_ext.dart | 76 +- lib/src/extensions/num_ext.dart | 32 +- lib/src/extensions/string_ext.dart | 67 +- lib/src/extensions/web3_ext.dart | 4 +- .../flutter/animated/animated_container.dart | 93 +-- lib/src/flutter/animated/animated_height.dart | 37 +- lib/src/flutter/badge.dart | 69 +- lib/src/flutter/bottom_sheet.dart | 106 +-- lib/src/flutter/card.dart | 108 +-- lib/src/flutter/clippers/vx_arc.dart | 78 ++- lib/src/flutter/clippers/vx_diagonal.dart | 20 +- .../flutter/common/velocity_conditional.dart | 4 +- lib/src/flutter/common/velocity_curve.dart | 7 +- .../common/velocity_ensure_visible.dart | 2 +- .../flutter/common/velocity_responsive.dart | 66 +- lib/src/flutter/common/velocity_round.dart | 5 +- lib/src/flutter/common/velocity_two.dart | 14 +- lib/src/flutter/common/velocity_zero.dart | 66 +- lib/src/flutter/container.dart | 175 ++--- lib/src/flutter/dark_mode.dart | 24 +- lib/src/flutter/dash.dart | 56 +- lib/src/flutter/dialog.dart | 215 +++--- lib/src/flutter/divider.dart | 15 +- lib/src/flutter/drawer.dart | 117 ++-- lib/src/flutter/drop_down_button.dart | 21 +- lib/src/flutter/filters.dart | 27 +- lib/src/flutter/flex.dart | 84 +-- lib/src/flutter/gesture.dart | 193 +++-- lib/src/flutter/glass.dart | 97 ++- lib/src/flutter/hover.dart | 12 +- lib/src/flutter/icon.dart | 15 +- lib/src/flutter/json.dart | 54 +- lib/src/flutter/list.dart | 35 +- lib/src/flutter/marquee.dart | 102 ++- lib/src/flutter/misc.dart | 11 +- lib/src/flutter/navigation.dart | 10 +- lib/src/flutter/object.dart | 188 +++-- lib/src/flutter/opacity.dart | 32 +- lib/src/flutter/padding.dart | 343 ++++----- lib/src/flutter/pinview.dart | 54 +- lib/src/flutter/platforms.dart | 9 +- lib/src/flutter/popup_menu.dart | 52 +- lib/src/flutter/preview.dart | 77 +- lib/src/flutter/random.dart | 31 +- lib/src/flutter/rating.dart | 78 +-- lib/src/flutter/rich_text.dart | 23 +- lib/src/flutter/routes.dart | 33 +- lib/src/flutter/scroll.dart | 59 +- lib/src/flutter/selectable_text.dart | 21 +- lib/src/flutter/shapes.dart | 235 ++++--- lib/src/flutter/shift.dart | 18 +- lib/src/flutter/shimmer.dart | 81 +-- lib/src/flutter/sizedbox.dart | 661 +++++++----------- lib/src/flutter/skeleton.dart | 197 +++--- lib/src/flutter/stepper.dart | 114 +-- lib/src/flutter/swiper.dart | 361 +++++----- lib/src/flutter/switcher.dart | 37 +- lib/src/flutter/table.dart | 47 +- lib/src/flutter/text.dart | 52 +- lib/src/flutter/textfield.dart | 31 +- lib/src/flutter/theme.dart | 16 +- .../flutter/timeline/timeline_painter.dart | 44 +- lib/src/flutter/timeline/timeline_view.dart | 82 +-- lib/src/flutter/timeline/timeline_widget.dart | 37 +- lib/src/flutter/toast.dart | 79 +-- lib/src/flutter/transform.dart | 296 ++++---- lib/src/flutter/universal.dart | 481 +++++++------ .../velocityx_mixins/gradient_mixin.dart | 44 +- .../flutter/velocityx_mixins/neu_mixin.dart | 34 +- .../flutter/velocityx_mixins/round_mixin.dart | 30 +- .../velocityx_mixins/shadow_mixin.dart | 185 ++--- lib/src/flutter/widgets.dart | 472 ++++++------- lib/src/responsive_ui.dart | 4 +- lib/src/velocity_xx.dart | 75 +- test/flutter/card_test.dart | 81 ++- test/flutter/container_test.dart | 198 +++--- test/flutter/drop_down_button_test.dart | 35 +- test/flutter/ext_test/ext_test.dart | 4 +- test/flutter/gesture_test.dart | 104 +-- test/flutter/popup_menu_test.dart | 105 ++- test/flutter/rich_text_test.dart | 175 +++-- test/flutter/scroll_test.dart | 86 +-- test/flutter/text_test.dart | 122 ++-- 89 files changed, 4029 insertions(+), 4233 deletions(-) diff --git a/lib/src/dart/guard.dart b/lib/src/dart/guard.dart index fe4abf58..963437db 100644 --- a/lib/src/dart/guard.dart +++ b/lib/src/dart/guard.dart @@ -20,8 +20,10 @@ T? guard(T Function() callback, [T? defaultValue]) { ///default value if error was raised or return value is null ///Originally available at https://pub.dev/packages/guard -Future asyncGuard(Future Function() callback, - [T? defaultValue]) async { +Future asyncGuard( + Future Function() callback, [ + T? defaultValue, +]) async { T? result; try { diff --git a/lib/src/dart/timeline.dart b/lib/src/dart/timeline.dart index e45f299b..5c13e9a9 100644 --- a/lib/src/dart/timeline.dart +++ b/lib/src/dart/timeline.dart @@ -4,9 +4,10 @@ class VxTimelineModel { final String description; final String? actionUrl; - const VxTimelineModel( - {required this.id, - required this.heading, - required this.description, - this.actionUrl}); + const VxTimelineModel({ + required this.id, + required this.heading, + required this.description, + this.actionUrl, + }); } diff --git a/lib/src/extensions/context_ext.dart b/lib/src/extensions/context_ext.dart index 219a6321..451d3d0d 100644 --- a/lib/src/extensions/context_ext.dart +++ b/lib/src/extensions/context_ext.dart @@ -127,10 +127,11 @@ extension VxContextExtensions on BuildContext { (screenSize.width - ((screenSize.width / 100) * reducedBy)) / dividedBy; /// Divide the height proportionally by the given value - double ratio( - {double dividedBy = 1, - double reducedByW = 0.0, - double reducedByH = 0.0}) => + double ratio({ + double dividedBy = 1, + double reducedByW = 0.0, + double reducedByH = 0.0, + }) => heightTransformer(dividedBy: dividedBy, reducedBy: reducedByH) / widthTransformer(dividedBy: dividedBy, reducedBy: reducedByW); @@ -162,51 +163,36 @@ extension VxContextExtensions on BuildContext { TextStyle? get captionStyle => Theme.of(this).textTheme.bodySmall; ColorScheme get colors => theme.colorScheme; - TextStyle? get displayLarge => textTheme.displayLarge?.copyWith( - color: colors.onSurface, - ); - TextStyle? get displayMedium => textTheme.displayMedium?.copyWith( - color: colors.onSurface, - ); - TextStyle? get displaySmall => textTheme.displaySmall?.copyWith( - color: colors.onSurface, - ); - TextStyle? get headlineLarge => textTheme.headlineLarge?.copyWith( - color: colors.onSurface, - ); - TextStyle? get headlineMedium => textTheme.headlineMedium?.copyWith( - color: colors.onSurface, - ); - TextStyle? get headlineSmall => textTheme.headlineSmall?.copyWith( - color: colors.onSurface, - ); - TextStyle? get titleLarge => textTheme.titleLarge?.copyWith( - color: colors.onSurface, - ); - TextStyle? get titleMedium => textTheme.titleMedium?.copyWith( - color: colors.onSurface, - ); - TextStyle? get titleSmall => textTheme.titleSmall?.copyWith( - color: colors.onSurface, - ); - TextStyle? get labelLarge => textTheme.labelLarge?.copyWith( - color: colors.onSurface, - ); - TextStyle? get labelMedium => textTheme.labelMedium?.copyWith( - color: colors.onSurface, - ); - TextStyle? get labelSmall => textTheme.labelSmall?.copyWith( - color: colors.onSurface, - ); - TextStyle? get bodyLarge => textTheme.bodyLarge?.copyWith( - color: colors.onSurface, - ); - TextStyle? get bodyMedium => textTheme.bodyMedium?.copyWith( - color: colors.onSurface, - ); - TextStyle? get bodySmall => textTheme.bodySmall?.copyWith( - color: colors.onSurface, - ); + TextStyle? get displayLarge => + textTheme.displayLarge?.copyWith(color: colors.onSurface); + TextStyle? get displayMedium => + textTheme.displayMedium?.copyWith(color: colors.onSurface); + TextStyle? get displaySmall => + textTheme.displaySmall?.copyWith(color: colors.onSurface); + TextStyle? get headlineLarge => + textTheme.headlineLarge?.copyWith(color: colors.onSurface); + TextStyle? get headlineMedium => + textTheme.headlineMedium?.copyWith(color: colors.onSurface); + TextStyle? get headlineSmall => + textTheme.headlineSmall?.copyWith(color: colors.onSurface); + TextStyle? get titleLarge => + textTheme.titleLarge?.copyWith(color: colors.onSurface); + TextStyle? get titleMedium => + textTheme.titleMedium?.copyWith(color: colors.onSurface); + TextStyle? get titleSmall => + textTheme.titleSmall?.copyWith(color: colors.onSurface); + TextStyle? get labelLarge => + textTheme.labelLarge?.copyWith(color: colors.onSurface); + TextStyle? get labelMedium => + textTheme.labelMedium?.copyWith(color: colors.onSurface); + TextStyle? get labelSmall => + textTheme.labelSmall?.copyWith(color: colors.onSurface); + TextStyle? get bodyLarge => + textTheme.bodyLarge?.copyWith(color: colors.onSurface); + TextStyle? get bodyMedium => + textTheme.bodyMedium?.copyWith(color: colors.onSurface); + TextStyle? get bodySmall => + textTheme.bodySmall?.copyWith(color: colors.onSurface); /// /// The foreground color for widgets (knobs, text, overscroll edge effect, etc). @@ -259,7 +245,10 @@ extension VxContextExtensions on BuildContext { /// Pushes and replacing the built widget to the screen using the material fade in animation void nextReplacementPage(Widget page, {bool maintainState = true}) => _nextReplacementPage( - context: this, page: page, maintainState: maintainState); + context: this, + page: page, + maintainState: maintainState, + ); /// Removing all the widgets till defined rule, and pushes the built widget to the screen using the material fade in animation void nextAndRemoveUntilPage(Widget page) => @@ -302,27 +291,27 @@ extension VxContextExtensions on BuildContext { ScaffoldState get vxscaffold => Scaffold.of(this); } -Future _nextPage( - {required BuildContext context, - required Widget page, - bool maintainState = true}) async => - await Navigator.push( - context, - MaterialPageRoute( - builder: (context) => page, - maintainState: maintainState, - )); -Future _nextReplacementPage( - {required BuildContext context, - required Widget page, - bool maintainState = true}) async => - await Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (context) => page, - maintainState: maintainState, - )); -Future _nextAndRemoveUntilPage( - {required BuildContext context, required Widget page}) async => - await Navigator.pushAndRemoveUntil(context, - MaterialPageRoute(builder: (context) => page), (route) => false); +Future _nextPage({ + required BuildContext context, + required Widget page, + bool maintainState = true, +}) async => await Navigator.push( + context, + MaterialPageRoute(builder: (context) => page, maintainState: maintainState), +); +Future _nextReplacementPage({ + required BuildContext context, + required Widget page, + bool maintainState = true, +}) async => await Navigator.pushReplacement( + context, + MaterialPageRoute(builder: (context) => page, maintainState: maintainState), +); +Future _nextAndRemoveUntilPage({ + required BuildContext context, + required Widget page, +}) async => await Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => page), + (route) => false, +); diff --git a/lib/src/extensions/date_time_ext.dart b/lib/src/extensions/date_time_ext.dart index 2821b321..abef20e8 100644 --- a/lib/src/extensions/date_time_ext.dart +++ b/lib/src/extensions/date_time_ext.dart @@ -18,8 +18,11 @@ extension VxDateTimeExtension on DateTime { /// ///Helps in converting the [DateTime] to readable Time Ago format of String. /// - String timeAgo( - {DateTime? clock, bool? enableFromNow, bool useShortForm = false}) { + String timeAgo({ + DateTime? clock, + bool? enableFromNow, + bool useShortForm = false, + }) { final mIsFromNowEnabled = enableFromNow ?? false; final mLanguage = English(shortForm: useShortForm); final mClock = clock ?? DateTime.now(); @@ -67,9 +70,11 @@ extension VxDateTimeExtension on DateTime { } else { res = mLanguage.years(years.round()); } - return [pfx, res, sfx] - .where((s) => s.isNotEmpty) - .join(mLanguage.delimiter()); + return [ + pfx, + res, + sfx, + ].where((s) => s.isNotEmpty).join(mLanguage.delimiter()); } } diff --git a/lib/src/extensions/iterable_ext.dart b/lib/src/extensions/iterable_ext.dart index b67813fe..dd048740 100644 --- a/lib/src/extensions/iterable_ext.dart +++ b/lib/src/extensions/iterable_ext.dart @@ -202,8 +202,9 @@ extension IterableBasics2 on Iterable { return 0; } - return map((element) => test!(element) ? 1 : 0) - .reduce((value, element) => value + element); + return map( + (element) => test!(element) ? 1 : 0, + ).reduce((value, element) => value + element); } /// Returns a new [Iterable] with all elements that satisfy the @@ -331,8 +332,10 @@ extension IterableBasics2 on Iterable { /// valueTransform: (p) => p.name); /// // map = {'young': ['John', 'Carl'], 'old': ['Peter', 'Sarah']} /// ``` - Map> groupBy(K Function(T element) keySelector, - {V Function(T element)? valueTransform}) { + Map> groupBy( + K Function(T element) keySelector, { + V Function(T element)? valueTransform, + }) { ArgumentError.checkNotNull(keySelector); valueTransform ??= (element) => element as V; @@ -412,7 +415,8 @@ extension IterableBasics2 on Iterable { return null; } return reduce( - (value, element) => comparator(value, element) < 0 ? value : element); + (value, element) => comparator(value, element) < 0 ? value : element, + ); } /// Returns the maximum value based on the [comparator] function. @@ -428,7 +432,8 @@ extension IterableBasics2 on Iterable { return null; } return reduce( - (value, element) => comparator(value, element) > 0 ? value : element); + (value, element) => comparator(value, element) > 0 ? value : element, + ); } /// Returns this as sorted list using the [comparator] function. @@ -788,8 +793,10 @@ extension VxExtensionMap on Map { } /// update map and return new map - Map updateAllT(V Function(K key, V value) update, - {bool isUpdate = true}) { + Map updateAllT( + V Function(K key, V value) update, { + bool isUpdate = true, + }) { if (isUpdate) { updateAll(update); } @@ -797,8 +804,12 @@ extension VxExtensionMap on Map { } /// update map and return new map - Map updateT(K key, V Function(V value) update, - {V Function()? ifAbsent, bool isUpdate = true}) { + Map updateT( + K key, + V Function(V value) update, { + V Function()? ifAbsent, + bool isUpdate = true, + }) { if (isUpdate) { this.update(key, update, ifAbsent: ifAbsent); } diff --git a/lib/src/extensions/list_ext.dart b/lib/src/extensions/list_ext.dart index c5ba1cbb..2f66eb1e 100644 --- a/lib/src/extensions/list_ext.dart +++ b/lib/src/extensions/list_ext.dart @@ -25,108 +25,98 @@ extension VxListWidgetExtension on List { /// /// Extension for using [VStack] directly with list of widgets /// - Widget vStack( - {Key? key, - MainAxisAlignment? alignment, - CrossAxisAlignment? crossAlignment, - MainAxisSize? axisSize}) => - VStack( - this, - key: key, - alignment: alignment, - axisSize: axisSize, - crossAlignment: crossAlignment, - ); + Widget vStack({ + Key? key, + MainAxisAlignment? alignment, + CrossAxisAlignment? crossAlignment, + MainAxisSize? axisSize, + }) => VStack( + this, + key: key, + alignment: alignment, + axisSize: axisSize, + crossAlignment: crossAlignment, + ); /// /// Extension for using [HStack] directly with list of widgets /// - Widget hStack( - {Key? key, - MainAxisAlignment? alignment, - CrossAxisAlignment? crossAlignment, - MainAxisSize? axisSize}) => - HStack( - this, - key: key, - alignment: alignment, - axisSize: axisSize, - crossAlignment: crossAlignment, - ); + Widget hStack({ + Key? key, + MainAxisAlignment? alignment, + CrossAxisAlignment? crossAlignment, + MainAxisSize? axisSize, + }) => HStack( + this, + key: key, + alignment: alignment, + axisSize: axisSize, + crossAlignment: crossAlignment, + ); /// /// Extension for using [ZStack] directly with list of widgets /// - Widget zStack( - {Key? key, - AlignmentGeometry? alignment, - StackFit? fit, - Clip? clip}) => - ZStack( - this, - key: key, - alignment: alignment, - fit: fit, - clip: clip, - ); + Widget zStack({ + Key? key, + AlignmentGeometry? alignment, + StackFit? fit, + Clip? clip, + }) => ZStack(this, key: key, alignment: alignment, fit: fit, clip: clip); // /// Extension for using [OverflowBar] directly with list of widgets /// - Widget aStack( - {Key? key, - OverflowBarAlignment overflowAlignment = OverflowBarAlignment.start, - VerticalDirection overflowDirection = VerticalDirection.down, - double overflowSpacing = 0.0, - double spacing = 0.0, - TextDirection? textDirection}) => - AStack( - key: key, - overflowAlignment: overflowAlignment, - overflowDirection: overflowDirection, - overflowSpacing: overflowSpacing, - spacing: spacing, - textDirection: textDirection, - children: this, - ); + Widget aStack({ + Key? key, + OverflowBarAlignment overflowAlignment = OverflowBarAlignment.start, + VerticalDirection overflowDirection = VerticalDirection.down, + double overflowSpacing = 0.0, + double spacing = 0.0, + TextDirection? textDirection, + }) => AStack( + key: key, + overflowAlignment: overflowAlignment, + overflowDirection: overflowDirection, + overflowSpacing: overflowSpacing, + spacing: spacing, + textDirection: textDirection, + children: this, + ); /// Same as [hStack]. Added just for ease who are familiar with Flutter widgets. - Widget row( - {Key? key, - MainAxisAlignment? alignment, - CrossAxisAlignment? crossAlignment, - MainAxisSize? axisSize}) => - hStack( - key: key, - alignment: alignment, - axisSize: axisSize, - crossAlignment: crossAlignment); + Widget row({ + Key? key, + MainAxisAlignment? alignment, + CrossAxisAlignment? crossAlignment, + MainAxisSize? axisSize, + }) => hStack( + key: key, + alignment: alignment, + axisSize: axisSize, + crossAlignment: crossAlignment, + ); /// Same as [vStack]. Added just for ease who are familiar with Flutter widgets. - Widget column( - {Key? key, - MainAxisAlignment? alignment, - CrossAxisAlignment? crossAlignment, - MainAxisSize? axisSize}) => - vStack( - key: key, - alignment: alignment, - axisSize: axisSize, - crossAlignment: crossAlignment); + Widget column({ + Key? key, + MainAxisAlignment? alignment, + CrossAxisAlignment? crossAlignment, + MainAxisSize? axisSize, + }) => vStack( + key: key, + alignment: alignment, + axisSize: axisSize, + crossAlignment: crossAlignment, + ); /// Same as [zStack]. Added just for ease who are familiar with Flutter widgets. - Widget stack( - {Key? key, - AlignmentGeometry? alignment, - StackFit? fit, - Clip? clip}) => - ZStack( - this, - key: key, - alignment: alignment, - fit: fit, - clip: clip, - ); + Widget stack({ + Key? key, + AlignmentGeometry? alignment, + StackFit? fit, + Clip? clip, + }) => ZStack(this, key: key, alignment: alignment, fit: fit, clip: clip); /// /// Extension for using [VxSwiper] vertically directly with list of widgets @@ -140,61 +130,59 @@ extension VxListWidgetExtension on List { Function(int index)? onPageChanged, ScrollPhysics? scrollPhysics, Axis scrollDirection = Axis.vertical, - }) => - VxSwiper( - items: this, - height: height, - aspectRatio: aspectRatio, - enableInfiniteScroll: enableInfiniteScroll, - enlargeCenterPage: enlargeCenterPage, - onPageChanged: onPageChanged, - scrollPhysics: scrollPhysics, - scrollDirection: scrollDirection, - ); + }) => VxSwiper( + items: this, + height: height, + aspectRatio: aspectRatio, + enableInfiniteScroll: enableInfiniteScroll, + enlargeCenterPage: enlargeCenterPage, + onPageChanged: onPageChanged, + scrollPhysics: scrollPhysics, + scrollDirection: scrollDirection, + ); /// /// Extension for using [VxSwiper] directly with list of widgets /// - Widget swiper( - {Key? key, - double? height, - double aspectRatio = 16 / 9, - bool enableInfiniteScroll = true, - bool enlargeCenterPage = false, - Function(int index)? onPageChanged, - ScrollPhysics? scrollPhysics, - Axis scrollDirection = Axis.horizontal, - num viewportFraction = 0.8, - bool autoPlay = false, - bool reverse = false, - Duration? pauseAutoPlayOnTouch, - Duration autoPlayAnimationDuration = - const Duration(milliseconds: 800), - Duration autoPlayInterval = const Duration(seconds: 5), - Curve autoPlayCurve = Curves.fastOutSlowIn, - num initialPage = 0, - int realPage = 10000, - bool isFastScrollingEnabled = false}) => - VxSwiper( - items: this, - height: height, - aspectRatio: aspectRatio, - enableInfiniteScroll: enableInfiniteScroll, - enlargeCenterPage: enlargeCenterPage, - onPageChanged: onPageChanged, - scrollPhysics: scrollPhysics, - scrollDirection: scrollDirection, - viewportFraction: viewportFraction, - autoPlay: autoPlay, - pauseAutoPlayOnTouch: pauseAutoPlayOnTouch, - reverse: reverse, - autoPlayAnimationDuration: autoPlayAnimationDuration, - autoPlayCurve: autoPlayCurve, - autoPlayInterval: autoPlayInterval, - initialPage: initialPage, - realPage: realPage, - isFastScrollingEnabled: isFastScrollingEnabled, - ); + Widget swiper({ + Key? key, + double? height, + double aspectRatio = 16 / 9, + bool enableInfiniteScroll = true, + bool enlargeCenterPage = false, + Function(int index)? onPageChanged, + ScrollPhysics? scrollPhysics, + Axis scrollDirection = Axis.horizontal, + num viewportFraction = 0.8, + bool autoPlay = false, + bool reverse = false, + Duration? pauseAutoPlayOnTouch, + Duration autoPlayAnimationDuration = const Duration(milliseconds: 800), + Duration autoPlayInterval = const Duration(seconds: 5), + Curve autoPlayCurve = Curves.fastOutSlowIn, + num initialPage = 0, + int realPage = 10000, + bool isFastScrollingEnabled = false, + }) => VxSwiper( + items: this, + height: height, + aspectRatio: aspectRatio, + enableInfiniteScroll: enableInfiniteScroll, + enlargeCenterPage: enlargeCenterPage, + onPageChanged: onPageChanged, + scrollPhysics: scrollPhysics, + scrollDirection: scrollDirection, + viewportFraction: viewportFraction, + autoPlay: autoPlay, + pauseAutoPlayOnTouch: pauseAutoPlayOnTouch, + reverse: reverse, + autoPlayAnimationDuration: autoPlayAnimationDuration, + autoPlayCurve: autoPlayCurve, + autoPlayInterval: autoPlayInterval, + initialPage: initialPage, + realPage: realPage, + isFastScrollingEnabled: isFastScrollingEnabled, + ); } extension VxListStringExtension on List { @@ -209,17 +197,16 @@ extension VxListStringExtension on List { ScrollPhysics? physics, bool? primary, bool shrinkWrap = true, - }) => - VxUnorderedList( - this, - key: key, - padding: padding, - fontSize: fontSize, - color: color, - physics: physics, - primary: primary, - shrinkWrap: shrinkWrap, - ); + }) => VxUnorderedList( + this, + key: key, + padding: padding, + fontSize: fontSize, + color: color, + physics: physics, + primary: primary, + shrinkWrap: shrinkWrap, + ); /// /// Extension for using [VxOrderedList] directly with list of strings. @@ -233,26 +220,26 @@ extension VxListStringExtension on List { bool? primary, bool shrinkWrap = true, VxListType type = VxListType.decimal, - }) => - VxOrderedList( - this, - key: key, - padding: padding, - fontSize: fontSize, - color: color, - physics: physics, - primary: primary, - shrinkWrap: shrinkWrap, - type: type, - ); + }) => VxOrderedList( + this, + key: key, + padding: padding, + fontSize: fontSize, + color: color, + physics: physics, + primary: primary, + shrinkWrap: shrinkWrap, + type: type, + ); } extension ExtensionUint8List on Uint8List { List bit32ListFromUInt8List() { final Uint8List bytes = this; final int additionalLength = bytes.length % 4 > 0 ? 4 : 0; - final List result = - (bytes.length ~/ 4 + additionalLength).generate((_) => 0); + final List result = (bytes.length ~/ 4 + additionalLength).generate( + (_) => 0, + ); for (int i = 0; i < bytes.length; i++) { final int resultIdx = i ~/ 4; final int bitShiftAmount = (3 - i % 4).toInt(); @@ -321,9 +308,10 @@ extension VxExtensionList on List { List builder(E Function(T) builder) => map((T e) => builder(e)).toList(); - List generate(E Function(int index) generator, - {bool growable = true}) => - length.generate((int index) => generator(index), growable: growable); + List generate( + E Function(int index) generator, { + bool growable = true, + }) => length.generate((int index) => generator(index), growable: growable); /// list.asMap().entries.map.toList() List builderEntry(E Function(MapEntry) builder) => @@ -362,8 +350,12 @@ extension VxExtensionList on List { } /// Replace the specified area and return a new array - List replaceRangeT(int start, int end, Iterable replacement, - {bool isReplace = true}) { + List replaceRangeT( + int start, + int end, + Iterable replacement, { + bool isReplace = true, + }) { if (isReplace) { replaceRange(start, end, replacement); } diff --git a/lib/src/extensions/misc_ext.dart b/lib/src/extensions/misc_ext.dart index f516cf54..8132c885 100644 --- a/lib/src/extensions/misc_ext.dart +++ b/lib/src/extensions/misc_ext.dart @@ -10,16 +10,24 @@ extension VxGlobalKeyExtension on GlobalKey { /// screenshot /// format image format /// pixelRatio screenshot resolution ratio - Future screenshots( - {ui.ImageByteFormat? format, double? pixelRatio}) async { + Future screenshots({ + ui.ImageByteFormat? format, + double? pixelRatio, + }) async { final RenderRepaintBoundary boundary = currentContext!.findRenderObject() as RenderRepaintBoundary; final ui.Image image = await boundary.toImage( - pixelRatio: pixelRatio ?? - WidgetsBinding - .instance.platformDispatcher.implicitView!.devicePixelRatio); - final ByteData? byteData = - await image.toByteData(format: format ?? ui.ImageByteFormat.rawRgba); + pixelRatio: + pixelRatio ?? + WidgetsBinding + .instance + .platformDispatcher + .implicitView! + .devicePixelRatio, + ); + final ByteData? byteData = await image.toByteData( + format: format ?? ui.ImageByteFormat.rawRgba, + ); /// Uint8List uint8list = byteData.buffer.asUint8List(); return byteData; @@ -36,11 +44,14 @@ extension VxFutureFunctionExtension on Future Function() { void func() { if (enable) { _vxfuncThrottle[hashCode] = false; - this.call().then((_) { - _vxfuncThrottle[hashCode] = false; - }).whenComplete(() { - _vxfuncThrottle.remove(hashCode); - }); + this + .call() + .then((_) { + _vxfuncThrottle[hashCode] = false; + }) + .whenComplete(() { + _vxfuncThrottle.remove(hashCode); + }); } } @@ -115,29 +126,31 @@ extension VxColorExtension on Color { /// Get the swatch of the color MaterialColor get swatch => Colors.primaries.firstWhere( - (Color c) => c.r == r && c.g == g && c.b == b && c.a == a, - orElse: () => MaterialColor( - (a.toInt() << 24) | (r.toInt() << 16) | (g.toInt() << 8) | b.toInt(), - getMaterialColorValues)); + (Color c) => c.r == r && c.g == g && c.b == b && c.a == a, + orElse: () => MaterialColor( + (a.toInt() << 24) | (r.toInt() << 16) | (g.toInt() << 8) | b.toInt(), + getMaterialColorValues, + ), + ); /// Get MaterialColor values from the current color Map get getMaterialColorValues => { - 50: _swatchShade(50), - 100: _swatchShade(100), - 200: _swatchShade(200), - 300: _swatchShade(300), - 400: _swatchShade(400), - 500: _swatchShade(500), - 600: _swatchShade(600), - 700: _swatchShade(700), - 800: _swatchShade(800), - 900: _swatchShade(900), - }; + 50: _swatchShade(50), + 100: _swatchShade(100), + 200: _swatchShade(200), + 300: _swatchShade(300), + 400: _swatchShade(400), + 500: _swatchShade(500), + 600: _swatchShade(600), + 700: _swatchShade(700), + 800: _swatchShade(800), + 900: _swatchShade(900), + }; /// Get the shade of the color - Color _swatchShade(int swatchValue) => HSLColor.fromColor(this) - .withLightness(1 - (swatchValue / 1000)) - .toColor(); + Color _swatchShade(int swatchValue) => HSLColor.fromColor( + this, + ).withLightness(1 - (swatchValue / 1000)).toColor(); /// Get the color with brightness of the current color Color get withBrightness { @@ -151,7 +164,8 @@ extension VxColorExtension on Color { } /// Prefixes a hash sign if [leadingHashSign] is set to `true` and returns the hexadecimal string value of the color. - String toHex({bool leadingHashSign = true}) => '${leadingHashSign ? '#' : ''}' + String toHex({bool leadingHashSign = true}) => + '${leadingHashSign ? '#' : ''}' '${a.round().toRadixString(16).padLeft(2, '0')}' '${r.round().toRadixString(16).padLeft(2, '0')}' '${g.round().toRadixString(16).padLeft(2, '0')}' diff --git a/lib/src/extensions/num_ext.dart b/lib/src/extensions/num_ext.dart index bcb3e17a..4a1c0d54 100644 --- a/lib/src/extensions/num_ext.dart +++ b/lib/src/extensions/num_ext.dart @@ -60,10 +60,14 @@ extension VxNumExtension on num { } /// Create a List of the specified length - List generate(T Function(int index) generator, - {bool growable = true}) => - List.generate(toInt(), (int index) => generator(index), - growable: growable); + List generate( + T Function(int index) generator, { + bool growable = true, + }) => List.generate( + toInt(), + (int index) => generator(index), + growable: growable, + ); String padLeft(int width, [String padding = ' ']) => toString().padLeft(width, padding); @@ -104,33 +108,24 @@ extension VxNumExtension on num { /// Format numeric currency with provided locale String numCurrencyWithLocale({String locale = "en_US"}) => - intl.NumberFormat.currency( - locale: locale, - ).format(this); + intl.NumberFormat.currency(locale: locale).format(this); ///Widgets /// ///Converts the number into a [SizedBox] with the width as that number. /// - Widget get widthBox => SizedBox( - width: toDouble(), - ); + Widget get widthBox => SizedBox(width: toDouble()); /// ///Converts the number into a [SizedBox] with the height as that number. /// - Widget get heightBox => SizedBox( - height: toDouble(), - ); + Widget get heightBox => SizedBox(height: toDouble()); /// ///Converts the number into a [SizedBox] with the width & height as that number. /// - Widget get squareBox => SizedBox( - height: toDouble(), - width: toDouble(), - ); + Widget get squareBox => SizedBox(height: toDouble(), width: toDouble()); /// get file size for a number String toFileSize() { @@ -197,7 +192,8 @@ extension VxIntExtension on int { Iterable to(int end, {int by = 1}) { if (by < 1) { throw ArgumentError( - 'Invalid step size: $by. Step size must be greater than 0'); + 'Invalid step size: $by. Step size must be greater than 0', + ); } final count = ((end - this).abs() / by).ceil(); // Explicit type declaration required for function argument. diff --git a/lib/src/extensions/string_ext.dart b/lib/src/extensions/string_ext.dart index 6fad764f..594f7dff 100644 --- a/lib/src/extensions/string_ext.dart +++ b/lib/src/extensions/string_ext.dart @@ -39,16 +39,17 @@ extension VxStringExtension on String { /// Uses regex to check if the provided string is a valid email address or not /// bool validateEmail() => RegExp( - r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+") - .hasMatch(this); + r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+", + ).hasMatch(this); /// Check if String is Right to Left Language bool isRtlLanguage() { final rtlLocaleRegex = RegExp( - r'^(ar|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_]' - r'(Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))' - r'($|-|_)', - caseSensitive: false); + r'^(ar|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_]' + r'(Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))' + r'($|-|_)', + caseSensitive: false, + ); final bool rtlCheck = rtlLocaleRegex.hasMatch(this); @@ -58,7 +59,7 @@ extension VxStringExtension on String { /// Returns the string if it is not `null`, or the empty string otherwise String get orEmpty => this; -// if the string is empty perform an action + // if the string is empty perform an action String ifEmpty(Function action) => isEmpty ? action() : this; /// Returns a String without white space at all @@ -108,10 +109,9 @@ extension VxStringExtension on String { } /// Format numeric currency - String get numCurrency => - intl.NumberFormat.currency(customPattern: "#,##0.00") - .format(double.tryParse(this)) - .toString(); + String get numCurrency => intl.NumberFormat.currency( + customPattern: "#,##0.00", + ).format(double.tryParse(this)).toString(); /// Format numeric currency with provided locale String numCurrencyWithLocale({String locale = "en_US"}) => @@ -121,11 +121,15 @@ extension VxStringExtension on String { ///Capitalize all words inside a string String allWordsCapitilize() { - return toLowerCase().split(' ').map((word) { - final String leftText = - (word.length > 1) ? word.substring(1, word.length) : ''; - return word[0].toUpperCase() + leftText; - }).join(' '); + return toLowerCase() + .split(' ') + .map((word) { + final String leftText = (word.length > 1) + ? word.substring(1, word.length) + : ''; + return word[0].toUpperCase() + leftText; + }) + .join(' '); } /// Returns a value according to the contract for [Comparator] indicating @@ -152,11 +156,12 @@ extension VxStringExtension on String { /// 'word'.insert('ke', 3); // 'worked' /// 'word'.insert('y', 4); // 'wordy' /// ``` - String insert(String other, int index) => (StringBuffer() - ..write(substring(0, index)) - ..write(other) - ..write(substring(index))) - .toString(); + String insert(String other, int index) => + (StringBuffer() + ..write(substring(0, index)) + ..write(other) + ..write(substring(index))) + .toString(); /// Returns the concatenation of [other] and [this]. /// @@ -321,8 +326,10 @@ extension VxStringExtension on String { String get capitalized => this[0].toUpperCase() + substring(1); /// from fooBar to foo_bar - String get snakeCase => replaceAllMapped(_camelCaseMatcher, - (match) => '${match.start == 0 ? '' : '_'}${match[0]!.toLowerCase()}'); + String get snakeCase => replaceAllMapped( + _camelCaseMatcher, + (match) => '${match.start == 0 ? '' : '_'}${match[0]!.toLowerCase()}', + ); /// Base64 encryption String get toEncodedBase64 => base64Encode(utf8.encode(this)); @@ -334,7 +341,8 @@ extension VxStringExtension on String { List get utf8ToList { final List words = length.generate((_) => 0); for (int i = 0; i < length; i++) { - words[i >> 2] |= (codeUnitAt(i) & 0xff).toSigned(32) << + words[i >> 2] |= + (codeUnitAt(i) & 0xff).toSigned(32) << (24 - (i % 4) * 8).toSigned(32); } return words; @@ -347,7 +355,9 @@ extension VxStringExtension on String { String formatDigitPattern({int digit = 4, String pattern = ' '}) { String text = this; text = text.replaceAllMapped( - RegExp('(.{$digit})'), (Match match) => '${match.group(0)}$pattern'); + RegExp('(.{$digit})'), + (Match match) => '${match.group(0)}$pattern', + ); if (text.endsWith(pattern)) { text = text.substring(0, text.length - 1); } @@ -355,8 +365,11 @@ extension VxStringExtension on String { } /// Add pattern every x bits, starting from the end - String formatDigitPatternEnd(String text, - {int digit = 4, String pattern = ' '}) { + String formatDigitPatternEnd( + String text, { + int digit = 4, + String pattern = ' ', + }) { String temp = reverse(); temp = formatDigitPattern(digit: digit, pattern: pattern); temp = reverse(); diff --git a/lib/src/extensions/web3_ext.dart b/lib/src/extensions/web3_ext.dart index c42311f1..777e1321 100644 --- a/lib/src/extensions/web3_ext.dart +++ b/lib/src/extensions/web3_ext.dart @@ -66,9 +66,9 @@ extension VxWeb3Extension on String { /// Takes Ethereum BigDecimal value in String and convert it double get getEtherValue { final weiBigInt = BigInt.parse(this); -// Ether has 18 decimals + // Ether has 18 decimals final factor = BigInt.from(10).pow(18); -// 1 ether is 10^18 wei + // 1 ether is 10^18 wei final value = weiBigInt ~/ factor; final remainder = weiBigInt.remainder(factor); return value.toInt() + (remainder.toInt() / factor.toInt()); diff --git a/lib/src/flutter/animated/animated_container.dart b/lib/src/flutter/animated/animated_container.dart index 6ba14ec9..38933e02 100644 --- a/lib/src/flutter/animated/animated_container.dart +++ b/lib/src/flutter/animated/animated_container.dart @@ -103,13 +103,13 @@ class VxAnimatedBox extends VxWidgetBuilder /// /// Sets the size (width & height in percentage) property of the box. /// - VxAnimatedBox sizePCT( - {required BuildContext context, - required double widthPCT, - required double heightPCT}) => - this - .._width = context.percentWidth * widthPCT - .._height = context.percentHeight * heightPCT; + VxAnimatedBox sizePCT({ + required BuildContext context, + required double widthPCT, + required double heightPCT, + }) => this + .._width = context.percentWidth * widthPCT + .._height = context.percentHeight * heightPCT; /// /// Sets the height and width as square of the box. @@ -127,10 +127,11 @@ class VxAnimatedBox extends VxWidgetBuilder /// /// Sets the border of the Box. /// - VxAnimatedBox border( - {Color color = Colors.black, - double width = 1.0, - BorderStyle style = BorderStyle.solid}) { + VxAnimatedBox border({ + Color color = Colors.black, + double width = 1.0, + BorderStyle style = BorderStyle.solid, + }) { _border = Border.all(color: color, width: width, style: style); return this; } @@ -201,7 +202,8 @@ class VxAnimatedBox extends VxWidgetBuilder VxAnimatedBox shadowOutline({Color? outlineColor}) { _boxShadow = [ BoxShadow( - color: outlineColor?.withValues(alpha: 0.5) ?? + color: + outlineColor?.withValues(alpha: 0.5) ?? const Color.fromRGBO(66, 153, 225, 0.5), blurRadius: 0.0, spreadRadius: 3.0, @@ -215,52 +217,57 @@ class VxAnimatedBox extends VxWidgetBuilder /// /// Use this to convert your box to the neumorphic design. Use it wisely. /// - VxAnimatedBox neumorphic( - {Color? color, - VxCurve curve = VxCurve.concave, - double elevation = 12.0}) => - this - .._velocityNeumorph = - velocityDecoration((color ?? velocityColor)!, curve, elevation); + VxAnimatedBox neumorphic({ + Color? color, + VxCurve curve = VxCurve.concave, + double elevation = 12.0, + }) => this + .._velocityNeumorph = velocityDecoration( + (color ?? velocityColor)!, + curve, + elevation, + ); @override Widget make({Key? key}) { if (!willRender) return const VxNone(); return AnimatedContainer( - curve: velocityCurve ?? Curves.linear, - duration: velocityDuration ?? const Duration(seconds: 100), - height: _height, - width: _width, - padding: velocityPadding, - margin: _margin, - alignment: velocityAlignment, - transform: _transform, - decoration: _velocityNeumorph != null - ? BoxDecoration( - borderRadius: _isCircleRounded || (roundedValue == null) - ? null - : (radiusGeometry ?? BorderRadius.circular(roundedValue!)), - shape: _isCircleRounded ? BoxShape.circle : BoxShape.rectangle, - boxShadow: _velocityNeumorph!.shadows, - border: _border, - gradient: velocityGradient ?? _velocityNeumorph!.gradient, - image: _bgImage, - ) - : _decoration ?? + curve: velocityCurve ?? Curves.linear, + duration: velocityDuration ?? const Duration(seconds: 100), + height: _height, + width: _width, + padding: velocityPadding, + margin: _margin, + alignment: velocityAlignment, + transform: _transform, + decoration: _velocityNeumorph != null + ? BoxDecoration( + borderRadius: _isCircleRounded || (roundedValue == null) + ? null + : (radiusGeometry ?? BorderRadius.circular(roundedValue!)), + shape: _isCircleRounded ? BoxShape.circle : BoxShape.rectangle, + boxShadow: _velocityNeumorph!.shadows, + border: _border, + gradient: velocityGradient ?? _velocityNeumorph!.gradient, + image: _bgImage, + ) + : _decoration ?? BoxDecoration( color: velocityColor, borderRadius: _isCircleRounded || (roundedValue == null) ? null : (radiusGeometry ?? - BorderRadius.circular(roundedValue!)), - shape: - _isCircleRounded ? BoxShape.circle : BoxShape.rectangle, + BorderRadius.circular(roundedValue!)), + shape: _isCircleRounded + ? BoxShape.circle + : BoxShape.rectangle, boxShadow: velocityShadow ?? _boxShadow ?? [], border: _border, gradient: velocityGradient ?? _gradient, image: _bgImage, ), - child: child); + child: child, + ); } } diff --git a/lib/src/flutter/animated/animated_height.dart b/lib/src/flutter/animated/animated_height.dart index db6fb70b..ddf96889 100644 --- a/lib/src/flutter/animated/animated_height.dart +++ b/lib/src/flutter/animated/animated_height.dart @@ -13,14 +13,14 @@ class VxAnimatedHeightView extends StatefulWidget { final int? currentPageIndex; - const VxAnimatedHeightView( - {super.key, - required this.pageViewChild, - required this.computeAspectRadio, - this.notifyScroll, - required this.itemCount, - this.currentPageIndex}) - : assert(itemCount > 0); + const VxAnimatedHeightView({ + super.key, + required this.pageViewChild, + required this.computeAspectRadio, + this.notifyScroll, + required this.itemCount, + this.currentPageIndex, + }) : assert(itemCount > 0); @override State createState() { @@ -78,7 +78,7 @@ class _VxAnimatedHeightViewState extends State { child: child, onPointerDown: (event) { _currentIndex = widget.currentPageIndex; -// print("_currentIndex is $_currentIndex"); + // print("_currentIndex is $_currentIndex"); }, ); } @@ -102,24 +102,25 @@ class _VxAnimatedHeightViewState extends State { } nextIndex = nextIndex.clamp(0, widget.itemCount - 1); -// print( -// "compute ,beforeIndex is $beforeIndex , nextIndex is $nextIndex"); + // print( + // "compute ,beforeIndex is $beforeIndex , nextIndex is $nextIndex"); final double beforeRadio = getRadio(beforeIndex); final double nextRadio = getRadio(nextIndex); - final double animationValue = beforeRadio + + final double animationValue = + beforeRadio + (nextRadio - beforeRadio) * ((scroll.metrics.pixels - beforeIndex * scroll.metrics.viewportDimension) .abs() / scroll.metrics.viewportDimension); -// print( -// "compute currentRadio is ${beforeRadio},nextRadio is ${nextRadio} new radio is $animationValue,scroll.metrics.pixels is ${scroll.metrics.pixels} ," -// "beforeIndex is $beforeIndex,nextIndex is $nextIndex, animation is ${((scroll.metrics.pixels - -// beforeIndex * scroll.metrics.viewportDimension) -// .abs() / -// scroll.metrics.viewportDimension)}"); + // print( + // "compute currentRadio is ${beforeRadio},nextRadio is ${nextRadio} new radio is $animationValue,scroll.metrics.pixels is ${scroll.metrics.pixels} ," + // "beforeIndex is $beforeIndex,nextIndex is $nextIndex, animation is ${((scroll.metrics.pixels - + // beforeIndex * scroll.metrics.viewportDimension) + // .abs() / + // scroll.metrics.viewportDimension)}"); _streamController!.add(animationValue); } diff --git a/lib/src/flutter/badge.dart b/lib/src/flutter/badge.dart index f4872858..08638dcc 100644 --- a/lib/src/flutter/badge.dart +++ b/lib/src/flutter/badge.dart @@ -73,32 +73,20 @@ class VxBadge extends StatelessWidget { /// Get the Vx Round type whether [VxBadgeType.point] or [VxBadgeType.ellipse] or [VxBadgeType.round] Widget getVxRound() { if (type == VxBadgeType.point) { - return VxRound( - type: VxRoundType.point, - size: size, - color: color, - ); + return VxRound(type: VxRoundType.point, size: size, color: color); } else if (type == VxBadgeType.round) { return VxRound( type: VxRoundType.round, color: color, size: size, - child: optionalWidget ?? - Text( - getNumber(), - style: getTextStyle(), - ), + child: optionalWidget ?? Text(getNumber(), style: getTextStyle()), ); } else { return VxRound( type: VxRoundType.ellipse, color: color, size: size, - child: optionalWidget ?? - Text( - getNumber(), - style: getTextStyle(), - ), + child: optionalWidget ?? Text(getNumber(), style: getTextStyle()), ); } } @@ -112,29 +100,13 @@ class VxBadge extends StatelessWidget { } else if (position == VxBadgePosition.right) { children.add(getVxRound()); } else if (position == VxBadgePosition.leftTop) { - children.add(Positioned( - top: 0, - left: 0, - child: getVxRound(), - )); + children.add(Positioned(top: 0, left: 0, child: getVxRound())); } else if (position == VxBadgePosition.rightTop) { - children.add(Positioned( - top: 0, - right: 0, - child: getVxRound(), - )); + children.add(Positioned(top: 0, right: 0, child: getVxRound())); } else if (position == VxBadgePosition.leftBottom) { - children.add(Positioned( - bottom: 0, - left: 0, - child: getVxRound(), - )); + children.add(Positioned(bottom: 0, left: 0, child: getVxRound())); } else if (position == VxBadgePosition.rightBottom) { - children.add(Positioned( - bottom: 0, - right: 0, - child: getVxRound(), - )); + children.add(Positioned(bottom: 0, right: 0, child: getVxRound())); } if (position == VxBadgePosition.left || position == VxBadgePosition.right) { @@ -144,9 +116,7 @@ class VxBadge extends StatelessWidget { children: children, ); } else { - return Stack( - children: children, - ); + return Stack(children: children); } } } @@ -166,16 +136,15 @@ extension VxBadgeExtension on Widget { double? size, Widget? optionalWidget, VxBadgePosition position = VxBadgePosition.rightTop, - }) => - VxBadge( - textStyle: textStyle, - color: color, - limit: limit, - count: count, - position: position, - size: size, - type: type, - optionalWidget: optionalWidget, - child: this, - ); + }) => VxBadge( + textStyle: textStyle, + color: color, + limit: limit, + count: count, + position: position, + size: size, + type: type, + optionalWidget: optionalWidget, + child: this, + ); } diff --git a/lib/src/flutter/bottom_sheet.dart b/lib/src/flutter/bottom_sheet.dart index dc46b8ba..9fc1c769 100644 --- a/lib/src/flutter/bottom_sheet.dart +++ b/lib/src/flutter/bottom_sheet.dart @@ -2,21 +2,23 @@ import 'package:flutter/material.dart'; import 'package:velocity_x/src/flutter/divider.dart'; mixin VxBottomSheet { - static Future bottomSheetOptions(BuildContext context, - {List? option, - String? defaultData, - double maxHeight = 0.8, - double minHeight = 0.1, - Function(int index, String value)? onSelect, - bool roundedFromTop = false, - bool isDismissible = true, - bool showItemDivider = false, - bool enableDrag = true, - Color? barrierColor, - Color? backgroundColor, - double? elevation, - Clip? clipBehavior, - bool isSafeAreaFromBottom = false}) async { + static Future bottomSheetOptions( + BuildContext context, { + List? option, + String? defaultData, + double maxHeight = 0.8, + double minHeight = 0.1, + Function(int index, String value)? onSelect, + bool roundedFromTop = false, + bool isDismissible = true, + bool showItemDivider = false, + bool enableDrag = true, + Color? barrierColor, + Color? backgroundColor, + double? elevation, + Clip? clipBehavior, + bool isSafeAreaFromBottom = false, + }) async { final result = await showModalBottomSheet( context: context, barrierColor: barrierColor, @@ -25,7 +27,8 @@ mixin VxBottomSheet { enableDrag: enableDrag, shape: roundedFromTop ? const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical(top: Radius.circular(25.0))) + borderRadius: BorderRadius.vertical(top: Radius.circular(25.0)), + ) : null, isScrollControlled: true, isDismissible: isDismissible, @@ -54,18 +57,20 @@ mixin VxBottomSheet { return result; } - static Future bottomSheetView(BuildContext context, - {required Widget child, - double maxHeight = 0.8, - double minHeight = 0.1, - bool roundedFromTop = false, - bool isDismissible = true, - bool enableDrag = true, - Color? barrierColor, - Color? backgroundColor, - double? elevation, - Clip? clipBehavior, - bool isSafeAreaFromBottom = false}) { + static Future bottomSheetView( + BuildContext context, { + required Widget child, + double maxHeight = 0.8, + double minHeight = 0.1, + bool roundedFromTop = false, + bool isDismissible = true, + bool enableDrag = true, + Color? barrierColor, + Color? backgroundColor, + double? elevation, + Clip? clipBehavior, + bool isSafeAreaFromBottom = false, + }) { return showModalBottomSheet( context: context, barrierColor: barrierColor, @@ -74,7 +79,8 @@ mixin VxBottomSheet { enableDrag: enableDrag, shape: roundedFromTop ? const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical(top: Radius.circular(25.0))) + borderRadius: BorderRadius.vertical(top: Radius.circular(25.0)), + ) : null, isScrollControlled: true, isDismissible: isDismissible, @@ -126,16 +132,16 @@ class _VxBottomSheetOptions extends StatelessWidget { for (int i = 0; i < list!.length; i++) { if (children.isNotEmpty && showItemDivider!) { - children.add(const VxDivider( - width: 0.1, - )); + children.add(const VxDivider(width: 0.1)); } final String it = list![i]; - children.add(ListTile( - onTap: () => itemClick(context, i, it), - title: Text(it, textAlign: TextAlign.center), - selected: it == initData, - )); + children.add( + ListTile( + onTap: () => itemClick(context, i, it), + title: Text(it, textAlign: TextAlign.center), + selected: it == initData, + ), + ); } return Container( @@ -143,9 +149,7 @@ class _VxBottomSheetOptions extends StatelessWidget { maxHeight: MediaQuery.sizeOf(context).height * (maxHeight ?? 0.8), minHeight: MediaQuery.sizeOf(context).height * (minHeight ?? 0.1), ), - child: SingleChildScrollView( - child: Column(children: children), - ), + child: SingleChildScrollView(child: Column(children: children)), ); } @@ -156,14 +160,16 @@ class _VxBottomSheetOptions extends StatelessWidget { DividerTheme.of(context).color ?? Theme.of(context).dividerColor; children.add(Container(height: 16, color: effectiveColor)); - children.add(InkWell( - onTap: () => close(context), - child: Container( - height: 42, - alignment: Alignment.center, - child: const Text('Close'), + children.add( + InkWell( + onTap: () => close(context), + child: Container( + height: 42, + alignment: Alignment.center, + child: const Text('Close'), + ), ), - )); + ); return Column(children: children); } @@ -182,11 +188,7 @@ class _VxBottomSheetView extends StatelessWidget { final double? maxHeight; final double? minHeight; - const _VxBottomSheetView({ - this.child, - this.maxHeight, - this.minHeight, - }); + const _VxBottomSheetView({this.child, this.maxHeight, this.minHeight}); @override Widget build(BuildContext context) { diff --git a/lib/src/flutter/card.dart b/lib/src/flutter/card.dart index 176bed34..ba534b96 100644 --- a/lib/src/flutter/card.dart +++ b/lib/src/flutter/card.dart @@ -44,9 +44,7 @@ class VxCard extends VxWidgetBuilder VxRenderMixin { /// Creates a material design card. /// - VxCard( - this._child, - ) { + VxCard(this._child) { setChildToColor(this); setChildToPad(this); setChildToRound(this); @@ -144,7 +142,8 @@ class VxCard extends VxWidgetBuilder shape: (roundedValue != null) ? RoundedRectangleBorder( borderRadius: - radiusGeometry ?? BorderRadius.circular(roundedValue!)) + radiusGeometry ?? BorderRadius.circular(roundedValue!), + ) : _shape, shadowColor: _shadowColor, child: _child, @@ -264,22 +263,35 @@ class VxFlipState extends State with SingleTickerProviderStateMixin { void _initController() { controller = AnimationController( - value: isFront ? 0.0 : 1.0, duration: widget.duration, vsync: this); + value: isFront ? 0.0 : 1.0, + duration: widget.duration, + vsync: this, + ); _frontRotation = TweenSequence([ TweenSequenceItem( - tween: Tween(begin: 0.0, end: pi / 2) - .chain(CurveTween(curve: Curves.easeIn)), - weight: 50.0), + tween: Tween( + begin: 0.0, + end: pi / 2, + ).chain(CurveTween(curve: Curves.easeIn)), + weight: 50.0, + ), TweenSequenceItem( - tween: ConstantTween(pi / 2), weight: 50.0) + tween: ConstantTween(pi / 2), + weight: 50.0, + ), ]).animate(controller); _backRotation = TweenSequence([ TweenSequenceItem( - tween: ConstantTween(pi / 2), weight: 50.0), + tween: ConstantTween(pi / 2), + weight: 50.0, + ), TweenSequenceItem( - tween: Tween(begin: -pi / 2, end: 0.0) - .chain(CurveTween(curve: Curves.easeOut)), - weight: 50.0) + tween: Tween( + begin: -pi / 2, + end: 0.0, + ).chain(CurveTween(curve: Curves.easeOut)), + weight: 50.0, + ), ]).animate(controller); } @@ -320,48 +332,55 @@ class VxFlipState extends State with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { final child = Stack( - alignment: widget.alignment!, - fit: StackFit.passthrough, - children: [ - _buildContent(true, widget.fill == VxFill.front), - _buildContent(false, widget.fill == VxFill.back), - ]); + alignment: widget.alignment!, + fit: StackFit.passthrough, + children: [ + _buildContent(true, widget.fill == VxFill.front), + _buildContent(false, widget.fill == VxFill.back), + ], + ); if (widget.touchFlip) { return GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: animateToggle, - child: child); + behavior: HitTestBehavior.translucent, + onTap: animateToggle, + child: child, + ); } return child; } Widget _buildContent(bool front, bool isFill) { final card = IgnorePointer( - ignoring: front ? !isFront : isFront, - child: _animationCard(front ? widget.front : widget.back, - front ? _frontRotation : _backRotation)); + ignoring: front ? !isFront : isFront, + child: _animationCard( + front ? widget.front : widget.back, + front ? _frontRotation : _backRotation, + ), + ); if (isFill) return Positioned.fill(child: card); return card; } Widget _animationCard(Widget child, Animation animation) => AnimatedBuilder( - animation: animation, - builder: (_, Widget? child) { - var transform = Matrix4.identity(); - transform.setEntry(3, 2, 0.001); - if (widget.direction == Axis.vertical) { - transform.rotateX(animation.value); - } else { - transform.rotateY(animation.value); - } - return Transform( - transform: transform, - filterQuality: FilterQuality.none, - alignment: FractionalOffset.center, - child: child); - }, - child: child); + animation: animation, + builder: (_, Widget? child) { + var transform = Matrix4.identity(); + transform.setEntry(3, 2, 0.001); + if (widget.direction == Axis.vertical) { + transform.rotateX(animation.value); + } else { + transform.rotateY(animation.value); + } + return Transform( + transform: transform, + filterQuality: FilterQuality.none, + alignment: FractionalOffset.center, + child: child, + ); + }, + child: child, + ); @override void dispose() { @@ -385,9 +404,10 @@ class VxFlipState extends State with SingleTickerProviderStateMixin { /// Triggers a flip animation that reverses after the duration /// and will run for `total` /// If awaited, returns after animation completes. - Future hint( - {Duration duration = const Duration(milliseconds: 150), - Duration? total}) async { + Future hint({ + Duration duration = const Duration(milliseconds: 150), + Duration? total, + }) async { if (controller.isAnimating || controller.value != 0) return; final durationTotal = total ?? controller.duration; final completer = Completer(); diff --git a/lib/src/flutter/clippers/vx_arc.dart b/lib/src/flutter/clippers/vx_arc.dart index 88eba36a..9bdd6f25 100644 --- a/lib/src/flutter/clippers/vx_arc.dart +++ b/lib/src/flutter/clippers/vx_arc.dart @@ -37,17 +37,33 @@ class VxArcClipper extends CustomClipper { //Adds a quadratic bezier segment that curves from the current point //to the given point (x2,y2), using the control point (x1,y1). path.quadraticBezierTo( - size.width / 4, size.height, size.width / 2, size.height); + size.width / 4, + size.height, + size.width / 2, + size.height, + ); path.quadraticBezierTo( - size.width * 3 / 4, size.height, size.width, size.height - height); + size.width * 3 / 4, + size.height, + size.width, + size.height - height, + ); path.lineTo(size.width, 0.0); } else { path.moveTo(0.0, size.height); - path.quadraticBezierTo(size.width / 4, size.height - height, - size.width / 2, size.height - height); path.quadraticBezierTo( - size.width * 3 / 4, size.height - height, size.width, size.height); + size.width / 4, + size.height - height, + size.width / 2, + size.height - height, + ); + path.quadraticBezierTo( + size.width * 3 / 4, + size.height - height, + size.width, + size.height, + ); path.lineTo(size.width, 0.0); path.lineTo(0.0, 0.0); } @@ -104,18 +120,34 @@ class VxArcClipper extends CustomClipper { path.moveTo(size.width - height, 0.0); path.quadraticBezierTo( - size.width, size.height / 4, size.width, size.height / 2); + size.width, + size.height / 4, + size.width, + size.height / 2, + ); path.quadraticBezierTo( - size.width, size.height * 3 / 4, size.width - height, size.height); + size.width, + size.height * 3 / 4, + size.width - height, + size.height, + ); path.lineTo(0.0, size.height); path.lineTo(0.0, 0.0); } else { path.moveTo(size.width, 0.0); - path.quadraticBezierTo(size.width - height, size.height / 4, - size.width - height, size.height / 2); path.quadraticBezierTo( - size.width - height, size.height * 3 / 4, size.width, size.height); + size.width - height, + size.height / 4, + size.width - height, + size.height / 2, + ); + path.quadraticBezierTo( + size.width - height, + size.height * 3 / 4, + size.width, + size.height, + ); path.lineTo(0.0, size.height); path.lineTo(0.0, 0.0); } @@ -134,13 +166,14 @@ class VxArcClipper extends CustomClipper { } class VxArc extends StatelessWidget { - const VxArc( - {super.key, - required this.height, - required this.child, - this.edge = VxEdge.bottom, - this.arcType = VxArcType.convex, - this.clipShadows = const []}); + const VxArc({ + super.key, + required this.height, + required this.child, + this.edge = VxEdge.bottom, + this.arcType = VxArcType.convex, + this.clipShadows = const [], + }); /// The widget which one of [edge]s is going to be clippddddded as arc final Widget child; @@ -162,10 +195,7 @@ class VxArc extends StatelessWidget { final clipper = VxArcClipper(height, edge, arcType); return CustomPaint( painter: VxClipShadowPainter(clipper, clipShadows), - child: ClipPath( - clipper: clipper, - child: child, - ), + child: ClipPath(clipper: clipper, child: child), ); } } @@ -181,7 +211,11 @@ class VxClipShadowPainter extends CustomPainter { // ignore: avoid_function_literals_in_foreach_calls clipShadows.forEach((VxClipShadow shadow) { canvas.drawShadow( - clipper.getClip(size), shadow.color, shadow.elevation, true); + clipper.getClip(size), + shadow.color, + shadow.elevation, + true, + ); }); } diff --git a/lib/src/flutter/clippers/vx_diagonal.dart b/lib/src/flutter/clippers/vx_diagonal.dart index 3d6d367b..b26c1e22 100644 --- a/lib/src/flutter/clippers/vx_diagonal.dart +++ b/lib/src/flutter/clippers/vx_diagonal.dart @@ -107,13 +107,14 @@ class VxDiagonalClipper extends CustomClipper { } class VxDiagonal extends StatelessWidget { - const VxDiagonal( - {super.key, - required this.child, - required this.clipHeight, - this.position = VxDiagonalPosition.bottomLeft, - this.axis = Axis.horizontal, - this.clipShadows = const []}); + const VxDiagonal({ + super.key, + required this.child, + required this.clipHeight, + this.position = VxDiagonalPosition.bottomLeft, + this.axis = Axis.horizontal, + this.clipShadows = const [], + }); final Widget child; @@ -134,10 +135,7 @@ class VxDiagonal extends StatelessWidget { final clipper = VxDiagonalClipper(clipHeight, position, axis); return CustomPaint( painter: VxClipShadowPainter(clipper, clipShadows), - child: ClipPath( - clipper: clipper, - child: child, - ), + child: ClipPath(clipper: clipper, child: child), ); } } diff --git a/lib/src/flutter/common/velocity_conditional.dart b/lib/src/flutter/common/velocity_conditional.dart index 4a95bf51..cfeb5bb0 100644 --- a/lib/src/flutter/common/velocity_conditional.dart +++ b/lib/src/flutter/common/velocity_conditional.dart @@ -69,8 +69,8 @@ class VxConditional extends StatelessWidget { Widget build(BuildContext context) => condition ? builder(context) : fallback != null - ? fallback!(context) - : const Offstage(); + ? fallback!(context) + : const Offstage(); } /// Renders widgets based on switch case conditions diff --git a/lib/src/flutter/common/velocity_curve.dart b/lib/src/flutter/common/velocity_curve.dart index 69a787dc..bfb56a89 100644 --- a/lib/src/flutter/common/velocity_curve.dart +++ b/lib/src/flutter/common/velocity_curve.dart @@ -3,12 +3,7 @@ import 'package:flutter/material.dart'; /// /// [VxCurve] to provide different types of curves to the neumorphic design. [concave] is default. /// -enum VxCurve { - concave, - convex, - emboss, - flat, -} +enum VxCurve { concave, convex, emboss, flat } /// /// [VxNeumorph] class to accept list of shadows and a [Gradient] diff --git a/lib/src/flutter/common/velocity_ensure_visible.dart b/lib/src/flutter/common/velocity_ensure_visible.dart index 04a623c8..87c28ff0 100644 --- a/lib/src/flutter/common/velocity_ensure_visible.dart +++ b/lib/src/flutter/common/velocity_ensure_visible.dart @@ -110,7 +110,7 @@ class VxEnsureVisibleWhenFocusedState extends State // Wait for the keyboard to come into view await Future.any([ Future.delayed(const Duration(milliseconds: 300)), - _keyboardToggled() + _keyboardToggled(), ]); // No need to go any further if the node has not the focus diff --git a/lib/src/flutter/common/velocity_responsive.dart b/lib/src/flutter/common/velocity_responsive.dart index 932a873b..c5ec70fd 100644 --- a/lib/src/flutter/common/velocity_responsive.dart +++ b/lib/src/flutter/common/velocity_responsive.dart @@ -62,14 +62,15 @@ class VxResponsive extends StatelessWidget { /// final Widget? fallback; - const VxResponsive( - {super.key, - this.xsmall, - this.small, - this.medium, - this.large, - this.xlarge, - this.fallback}); + const VxResponsive({ + super.key, + this.xsmall, + this.small, + this.medium, + this.large, + this.xlarge, + this.fallback, + }); @override Widget build(BuildContext context) { return VxConditionalSwitch.single( @@ -99,35 +100,34 @@ class VxLayout extends StatelessWidget { BuildContext context, VxWindowSize window, BoxConstraints constraints, - ) builder; + ) + builder; final VxSizeConfig? sizeConfig; - const VxLayout({ - super.key, - required this.builder, - this.sizeConfig, - }); + const VxLayout({super.key, required this.builder, this.sizeConfig}); @override Widget build(BuildContext context) { - return LayoutBuilder(builder: (context, boxConstraints) { - VxWindowSize windowSize = VxWindowSize.small; - if (boxConstraints.maxWidth < (sizeConfig?.xsmall ?? 600)) { - windowSize = VxWindowSize.xsmall; - } else if (boxConstraints.maxWidth < (sizeConfig?.small ?? 1024)) { - windowSize = VxWindowSize.small; - } else if (boxConstraints.maxWidth < (sizeConfig?.medium ?? 1440)) { - windowSize = VxWindowSize.medium; - } else if (boxConstraints.maxWidth < (sizeConfig?.large ?? 1920)) { - windowSize = VxWindowSize.large; - } else if (boxConstraints.maxWidth < (sizeConfig?.xlarge ?? 4096)) { - windowSize = VxWindowSize.xlarge; - } else { - windowSize = VxWindowSize.xlarge; - } - return builder(context, windowSize, boxConstraints); - }); + return LayoutBuilder( + builder: (context, boxConstraints) { + VxWindowSize windowSize = VxWindowSize.small; + if (boxConstraints.maxWidth < (sizeConfig?.xsmall ?? 600)) { + windowSize = VxWindowSize.xsmall; + } else if (boxConstraints.maxWidth < (sizeConfig?.small ?? 1024)) { + windowSize = VxWindowSize.small; + } else if (boxConstraints.maxWidth < (sizeConfig?.medium ?? 1440)) { + windowSize = VxWindowSize.medium; + } else if (boxConstraints.maxWidth < (sizeConfig?.large ?? 1920)) { + windowSize = VxWindowSize.large; + } else if (boxConstraints.maxWidth < (sizeConfig?.xlarge ?? 4096)) { + windowSize = VxWindowSize.xlarge; + } else { + windowSize = VxWindowSize.xlarge; + } + return builder(context, windowSize, boxConstraints); + }, + ); } } @@ -142,8 +142,8 @@ class VxSizeConfig { } /// A typedef representing a callback function used to build the UI based on the current screen adaptation settings. -typedef VxAdaptiveChildBuilder = Widget Function( - BuildContext context, bool scaled); +typedef VxAdaptiveChildBuilder = + Widget Function(BuildContext context, bool scaled); /// Defines the different scaling options for screen adaptation. enum VxAdaptiveScaleType { diff --git a/lib/src/flutter/common/velocity_round.dart b/lib/src/flutter/common/velocity_round.dart index 9defa6ee..d586ef99 100644 --- a/lib/src/flutter/common/velocity_round.dart +++ b/lib/src/flutter/common/velocity_round.dart @@ -62,7 +62,10 @@ class VxRound extends StatelessWidget { final Radius radius = Radius.circular(tempSize / 2); return Container( constraints: BoxConstraints( - maxHeight: tempSize, minHeight: tempSize, minWidth: tempSize), + maxHeight: tempSize, + minHeight: tempSize, + minWidth: tempSize, + ), padding: const EdgeInsets.symmetric(horizontal: 4), decoration: BoxDecoration( color: color ?? Theme.of(context).primaryColorLight, diff --git a/lib/src/flutter/common/velocity_two.dart b/lib/src/flutter/common/velocity_two.dart index 9ad6ca5f..9c4ee884 100644 --- a/lib/src/flutter/common/velocity_two.dart +++ b/lib/src/flutter/common/velocity_two.dart @@ -90,7 +90,7 @@ class VxTwo extends StatelessWidget { textBaseline: TextBaseline.alphabetic, color: subtitleColor, ), - ) + ), ]; if (isHorizontal) { return Row( @@ -126,11 +126,7 @@ class VxTwoColumn extends StatelessWidget { return Column( key: key, crossAxisAlignment: CrossAxisAlignment.start, - children: [ - top, - 10.heightBox, - bottom, - ], + children: [top, 10.heightBox, bottom], ); } } @@ -150,11 +146,7 @@ class VxTwoRow extends StatelessWidget { key: key, direction: Axis.horizontal, mainAxisAlignment: MainAxisAlignment.center, - children: [ - left, - 10.widthBox, - right, - ], + children: [left, 10.widthBox, right], ); } } diff --git a/lib/src/flutter/common/velocity_zero.dart b/lib/src/flutter/common/velocity_zero.dart index bd9a032f..59958f50 100644 --- a/lib/src/flutter/common/velocity_zero.dart +++ b/lib/src/flutter/common/velocity_zero.dart @@ -17,8 +17,11 @@ import 'package:velocity_x/src/extensions/context_ext.dart'; /// /// [myBoxDesc] to reuse with [PKSkeleton] /// -Decoration myBoxDec(Animation? animation, - {bool isCircle = false, bool isDark = false}) { +Decoration myBoxDec( + Animation? animation, { + bool isCircle = false, + bool isDark = false, +}) { return BoxDecoration( shape: isCircle ? BoxShape.circle : BoxShape.rectangle, gradient: LinearGradient( @@ -36,11 +39,7 @@ Decoration myBoxDec(Animation? animation, const Color(0xffe9ebee), const Color(0xfff6f7f9), ], - stops: [ - animation?.value - 1, - animation?.value, - animation?.value + 1, - ], + stops: [animation?.value - 1, animation?.value, animation?.value + 1], ), ); } @@ -49,11 +48,12 @@ Decoration myBoxDec(Animation? animation, /// [VxZeroCard] can be used to provide a single loading card with PKSkeleton cool animation. /// class VxZeroCard extends StatefulWidget { - const VxZeroCard( - {super.key, - this.isCircularImage = true, - this.isBottomLinesActive = true, - this.isDark = false}); + const VxZeroCard({ + super.key, + this.isCircularImage = true, + this.isBottomLinesActive = true, + this.isDark = false, + }); /// if the image should be circular? By default it is true final bool isCircularImage; @@ -82,7 +82,8 @@ class VxZeroCardState extends State ); animation = Tween(begin: -1.0, end: 2.0).animate( - CurvedAnimation(curve: Curves.easeInOutSine, parent: _controller)); + CurvedAnimation(curve: Curves.easeInOutSine, parent: _controller), + ); animation!.addStatusListener((status) { if (status == AnimationStatus.completed || @@ -121,13 +122,13 @@ class VxZeroCardState extends State Container( height: context.percentHeight * 10, width: context.percentWidth * 10, - decoration: myBoxDec(animation, - isCircle: widget.isCircularImage, - isDark: widget.isDark), - ), - const SizedBox( - width: 20, + decoration: myBoxDec( + animation, + isCircle: widget.isCircularImage, + isDark: widget.isDark, + ), ), + const SizedBox(width: 20), SizedBox( height: context.percentWidth * 10, child: Column( @@ -157,22 +158,16 @@ class VxZeroCardState extends State Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const SizedBox( - height: 20, - ), + const SizedBox(height: 20), _VxLine(70, 0.7, animation, widget.isDark), - const SizedBox( - height: 10, - ), + const SizedBox(height: 10), _VxLine(80, 0.7, animation, widget.isDark), - const SizedBox( - height: 10, - ), + const SizedBox(height: 10), _VxLine(50, 0.7, animation, widget.isDark), ], ) else - const Offstage() + const Offstage(), ], ), ), @@ -204,12 +199,13 @@ class _VxLine extends StatelessWidget { /// [VxZeroList] can be used to provide a list of loading cards with PKSkeleton cool animation. /// class VxZeroList extends StatelessWidget { - const VxZeroList( - {super.key, - this.isCircularImage = true, - this.length = 10, - this.isBottomLinesActive = true, - this.isDark = false}); + const VxZeroList({ + super.key, + this.isCircularImage = true, + this.length = 10, + this.isBottomLinesActive = true, + this.isDark = false, + }); /// if the image should be circular? By default it is true final bool isCircularImage; diff --git a/lib/src/flutter/container.dart b/lib/src/flutter/container.dart index d3aba966..1071d95a 100644 --- a/lib/src/flutter/container.dart +++ b/lib/src/flutter/container.dart @@ -112,13 +112,13 @@ class VxBox extends VxWidgetBuilder /// /// Sets the size (width & height in percentage) property of the box. /// - VxBox sizePCT( - {required BuildContext context, - required double widthPCT, - required double heightPCT}) => - this - .._width = context.percentWidth * widthPCT - .._height = context.percentHeight * heightPCT; + VxBox sizePCT({ + required BuildContext context, + required double widthPCT, + required double heightPCT, + }) => this + .._width = context.percentWidth * widthPCT + .._height = context.percentHeight * heightPCT; /// /// Sets the height and width as square of the box. @@ -197,7 +197,8 @@ class VxBox extends VxWidgetBuilder VxBox shadowOutline({Color? outlineColor}) { _boxShadow = [ BoxShadow( - color: outlineColor?.withValues(alpha: 0.5) ?? + color: + outlineColor?.withValues(alpha: 0.5) ?? const Color.fromRGBO(66, 153, 225, 0.5), blurRadius: 0.0, spreadRadius: 3.0, @@ -211,10 +212,11 @@ class VxBox extends VxWidgetBuilder /// Bordering /// Sets the border of the Box. /// - VxBox border( - {Color color = Colors.black, - double width = 1.0, - BorderStyle style = BorderStyle.solid}) { + VxBox border({ + Color color = Colors.black, + double width = 1.0, + BorderStyle style = BorderStyle.solid, + }) { _border = Border.all(color: color, width: width, style: style); return this; } @@ -222,69 +224,75 @@ class VxBox extends VxWidgetBuilder /// Gradienting /// Sets the linear gradient to the decorated box. /// - VxBox linearGradient(List colors, - {AlignmentGeometry begin = Alignment.centerLeft, - AlignmentGeometry end = Alignment.centerRight, - List? stops, - TileMode tileMode = TileMode.clamp, - GradientTransform? transform}) => - this - .._gradient = LinearGradient( - colors: colors, - begin: begin, - stops: stops, - end: end, - tileMode: tileMode, - transform: transform); + VxBox linearGradient( + List colors, { + AlignmentGeometry begin = Alignment.centerLeft, + AlignmentGeometry end = Alignment.centerRight, + List? stops, + TileMode tileMode = TileMode.clamp, + GradientTransform? transform, + }) => this + .._gradient = LinearGradient( + colors: colors, + begin: begin, + stops: stops, + end: end, + tileMode: tileMode, + transform: transform, + ); /// /// Sets the radial gradient to the decorated box. /// - VxBox radialGradient(List colors, - {AlignmentGeometry center = Alignment.center, - double radius = 0.5, - List? stops, - TileMode tileMode = TileMode.clamp, - AlignmentGeometry? focal, - double focalRadius = 0.0, - GradientTransform? transform}) => - this - .._gradient = RadialGradient( - colors: colors, - center: center, - radius: radius, - focalRadius: focalRadius, - stops: stops, - focal: focal, - tileMode: tileMode, - transform: transform); + VxBox radialGradient( + List colors, { + AlignmentGeometry center = Alignment.center, + double radius = 0.5, + List? stops, + TileMode tileMode = TileMode.clamp, + AlignmentGeometry? focal, + double focalRadius = 0.0, + GradientTransform? transform, + }) => this + .._gradient = RadialGradient( + colors: colors, + center: center, + radius: radius, + focalRadius: focalRadius, + stops: stops, + focal: focal, + tileMode: tileMode, + transform: transform, + ); /// /// Sets the sweep gradient to the decorated box. /// - VxBox sweepGradient(List colors, - {AlignmentGeometry center = Alignment.center, - double startAngle = 0.0, - double endAngle = pi * 2, - List? stops, - TileMode tileMode = TileMode.clamp, - GradientTransform? transform}) => - this - .._gradient = SweepGradient( - colors: colors, - center: center, - endAngle: endAngle, - startAngle: startAngle, - stops: stops, - tileMode: tileMode, - transform: transform); + VxBox sweepGradient( + List colors, { + AlignmentGeometry center = Alignment.center, + double startAngle = 0.0, + double endAngle = pi * 2, + List? stops, + TileMode tileMode = TileMode.clamp, + GradientTransform? transform, + }) => this + .._gradient = SweepGradient( + colors: colors, + center: center, + endAngle: endAngle, + startAngle: startAngle, + stops: stops, + tileMode: tileMode, + transform: transform, + ); /// /// Sets the defined gradient to the decorated box. /// VxBox withGradient(Gradient gradient) => this.._gradient = gradient; -// DecorationImage BoxDecoration + // DecorationImage BoxDecoration /// /// Sets the background image to the decorated box. /// @@ -293,16 +301,16 @@ class VxBox extends VxWidgetBuilder /// /// Use this to convert your box to the neumorphic design. Use it wisely. /// - VxBox neumorphic( - {Color? color, - VxCurve curve = VxCurve.concave, - double elevation = 12.0}) => - this - .._velocityNeumorph = velocityDecoration( - (color ?? velocityColor)!, - curve, - elevation, - ); + VxBox neumorphic({ + Color? color, + VxCurve curve = VxCurve.concave, + double elevation = 12.0, + }) => this + .._velocityNeumorph = velocityDecoration( + (color ?? velocityColor)!, + curve, + elevation, + ); @override Widget make({Key? key}) { @@ -333,17 +341,20 @@ class VxBox extends VxWidgetBuilder image: _bgImage, ) : _decoration ?? - BoxDecoration( - color: velocityColor, - borderRadius: _isCircleRounded || (roundedValue == null) - ? null - : (radiusGeometry ?? BorderRadius.circular(roundedValue!)), - shape: _isCircleRounded ? BoxShape.circle : BoxShape.rectangle, - boxShadow: velocityShadow ?? _boxShadow ?? [], - border: _border, - gradient: velocityGradient ?? _gradient, - image: _bgImage, - ), + BoxDecoration( + color: velocityColor, + borderRadius: _isCircleRounded || (roundedValue == null) + ? null + : (radiusGeometry ?? + BorderRadius.circular(roundedValue!)), + shape: _isCircleRounded + ? BoxShape.circle + : BoxShape.rectangle, + boxShadow: velocityShadow ?? _boxShadow ?? [], + border: _border, + gradient: velocityGradient ?? _gradient, + image: _bgImage, + ), child: child, ); } diff --git a/lib/src/flutter/dark_mode.dart b/lib/src/flutter/dark_mode.dart index 63a9e486..9ba8d1c4 100644 --- a/lib/src/flutter/dark_mode.dart +++ b/lib/src/flutter/dark_mode.dart @@ -14,11 +14,12 @@ class VxDarkModeMutation extends VxMutation { } class VxDarkModeButton extends StatelessWidget { - const VxDarkModeButton( - {super.key, - this.style, - this.showSelectedIcon = false, - this.showSingleIcon = false}); + const VxDarkModeButton({ + super.key, + this.style, + this.showSelectedIcon = false, + this.showSingleIcon = false, + }); final ButtonStyle? style; final bool showSelectedIcon; @@ -26,8 +27,9 @@ class VxDarkModeButton extends StatelessWidget { @override Widget build(BuildContext context) { - VxThemeMode theme = - VxAppData().isDarkMode ? VxThemeMode.dark : VxThemeMode.light; + VxThemeMode theme = VxAppData().isDarkMode + ? VxThemeMode.dark + : VxThemeMode.light; VxState.watch(context, on: [VxDarkModeMutation]); return showSingleIcon ? IconButton( @@ -48,9 +50,13 @@ class VxDarkModeButton extends StatelessWidget { showSelectedIcon: showSelectedIcon, segments: const [ ButtonSegment( - value: VxThemeMode.light, icon: Icon(Icons.light_mode)), + value: VxThemeMode.light, + icon: Icon(Icons.light_mode), + ), ButtonSegment( - value: VxThemeMode.dark, icon: Icon(Icons.dark_mode)) + value: VxThemeMode.dark, + icon: Icon(Icons.dark_mode), + ), ], ); } diff --git a/lib/src/flutter/dash.dart b/lib/src/flutter/dash.dart index 4b1af733..b21c8cc0 100644 --- a/lib/src/flutter/dash.dart +++ b/lib/src/flutter/dash.dart @@ -4,15 +4,16 @@ import 'package:flutter/material.dart'; /// VelocityX widget to show Dashes with gaps if needed. It can be vertical or horizontal. /// class VxDash extends StatelessWidget { - const VxDash( - {super.key, - this.direction = Axis.horizontal, - this.dashColor = Colors.black, - this.length = 200, - this.dashGap = 3, - this.dashLength = 6, - this.dashThickness = 1, - this.dashBorderRadius = 0}); + const VxDash({ + super.key, + this.direction = Axis.horizontal, + this.dashColor = Colors.black, + this.length = 200, + this.dashGap = 3, + this.dashLength = 6, + this.dashThickness = 1, + this.dashBorderRadius = 0, + }); /// Direction of the dash. Default is horizontal final Axis direction; @@ -46,10 +47,9 @@ class VxDash extends StatelessWidget { } if (direction == Axis.horizontal) { return SizedBox( - width: length, - child: Row( - children: dashes, - )); + width: length, + child: Row(children: dashes), + ); } else { return Column(children: dashes); } @@ -59,20 +59,22 @@ class VxDash extends StatelessWidget { Widget step(int index, double newDashGap) { final bool isHorizontal = direction == Axis.horizontal; return Padding( - padding: EdgeInsets.fromLTRB( - 0, - 0, - isHorizontal && index != 1 ? newDashGap : 0, - isHorizontal || index == 1 ? 0 : newDashGap), - child: SizedBox( - width: isHorizontal ? dashLength : dashThickness, - height: isHorizontal ? dashThickness : dashLength, - child: DecoratedBox( - decoration: BoxDecoration( - color: dashColor, - borderRadius: - BorderRadius.all(Radius.circular(dashBorderRadius))), + padding: EdgeInsets.fromLTRB( + 0, + 0, + isHorizontal && index != 1 ? newDashGap : 0, + isHorizontal || index == 1 ? 0 : newDashGap, + ), + child: SizedBox( + width: isHorizontal ? dashLength : dashThickness, + height: isHorizontal ? dashThickness : dashLength, + child: DecoratedBox( + decoration: BoxDecoration( + color: dashColor, + borderRadius: BorderRadius.all(Radius.circular(dashBorderRadius)), ), - )); + ), + ), + ); } } diff --git a/lib/src/flutter/dialog.dart b/lib/src/flutter/dialog.dart index 5b04d3d3..dff5922c 100644 --- a/lib/src/flutter/dialog.dart +++ b/lib/src/flutter/dialog.dart @@ -32,26 +32,27 @@ mixin VxDialog { bool barrierDismissible = true, }) { showDialog( - context: context, - barrierDismissible: barrierDismissible, - builder: (context) { - return PopScope( - canPop: barrierDismissible, - child: AlertDialog( - contentPadding: EdgeInsets.zero, - content: _VxDialog( - title: title, - showClose: showClose, - content: content, - cancel: confirm, - cancelBgColor: confirmBgColor, - cancelOnPress: onPressed, - cancelTextColor: actionTextColor, - ), - shape: RoundedRectangleBorder(borderRadius: _borderRadius), + context: context, + barrierDismissible: barrierDismissible, + builder: (context) { + return PopScope( + canPop: barrierDismissible, + child: AlertDialog( + contentPadding: EdgeInsets.zero, + content: _VxDialog( + title: title, + showClose: showClose, + content: content, + cancel: confirm, + cancelBgColor: confirmBgColor, + cancelOnPress: onPressed, + cancelTextColor: actionTextColor, ), - ); - }); + shape: RoundedRectangleBorder(borderRadius: _borderRadius), + ), + ); + }, + ); } static void showConfirmation( @@ -70,30 +71,31 @@ mixin VxDialog { bool barrierDismissible = true, }) { showDialog( - context: context, - barrierDismissible: barrierDismissible, - builder: (context) { - return PopScope( - canPop: barrierDismissible, - child: AlertDialog( - contentPadding: EdgeInsets.zero, - content: _VxDialog( - title: title, - showClose: showClose, - content: content, - cancel: cancel, - confirm: confirm, - cancelBgColor: cancelBgColor, - confirmBgColor: confirmBgColor, - cancelOnPress: onCancelPress, - confirmOnPress: onConfirmPress, - confirmTextColor: confirmTextColor, - cancelTextColor: cancelTextColor, - ), - shape: RoundedRectangleBorder(borderRadius: _borderRadius), + context: context, + barrierDismissible: barrierDismissible, + builder: (context) { + return PopScope( + canPop: barrierDismissible, + child: AlertDialog( + contentPadding: EdgeInsets.zero, + content: _VxDialog( + title: title, + showClose: showClose, + content: content, + cancel: cancel, + confirm: confirm, + cancelBgColor: cancelBgColor, + confirmBgColor: confirmBgColor, + cancelOnPress: onCancelPress, + confirmOnPress: onConfirmPress, + confirmTextColor: confirmTextColor, + cancelTextColor: cancelTextColor, ), - ); - }); + shape: RoundedRectangleBorder(borderRadius: _borderRadius), + ), + ); + }, + ); } static void showTicker( @@ -109,27 +111,28 @@ mixin VxDialog { bool barrierDismissible = true, }) { showDialog( - context: context, - barrierDismissible: barrierDismissible, - builder: (context) { - return PopScope( - canPop: barrierDismissible, - child: AlertDialog( - contentPadding: EdgeInsets.zero, - content: _VxDialog( - title: title, - showClose: showClose, - content: content, - cancel: action, - cancelBgColor: actionBgColor, - cancelOnPress: onActionPress, - cancelTextColor: actionTextColor, - second: secondsToAction, - ), - shape: RoundedRectangleBorder(borderRadius: _borderRadius), + context: context, + barrierDismissible: barrierDismissible, + builder: (context) { + return PopScope( + canPop: barrierDismissible, + child: AlertDialog( + contentPadding: EdgeInsets.zero, + content: _VxDialog( + title: title, + showClose: showClose, + content: content, + cancel: action, + cancelBgColor: actionBgColor, + cancelOnPress: onActionPress, + cancelTextColor: actionTextColor, + second: secondsToAction, ), - ); - }); + shape: RoundedRectangleBorder(borderRadius: _borderRadius), + ), + ); + }, + ); } static void showCustom( @@ -138,11 +141,12 @@ mixin VxDialog { bool barrierDismissible = true, }) { showDialog( - context: context, - barrierDismissible: barrierDismissible, - builder: (context) { - return _VxCustomDialog(child: child); - }); + context: context, + barrierDismissible: barrierDismissible, + builder: (context) { + return _VxCustomDialog(child: child); + }, + ); } } @@ -206,10 +210,12 @@ class _VxDialog extends StatelessWidget { final List children = []; children.add(const SizedBox(width: 40, height: 40)); children.add(Expanded(child: titleView)); - children.add(IconButton( - icon: const Icon(Icons.close, size: 20), - onPressed: () => hide(context), - )); + children.add( + IconButton( + icon: const Icon(Icons.close, size: 20), + onPressed: () => hide(context), + ), + ); return Row(children: children); } else { return titleView; @@ -252,41 +258,48 @@ class _VxDialog extends StatelessWidget { ); } final List children = []; - children.add(Expanded( - child: InkWell( - onTap: () => onCancel(context), - child: Container( - decoration: BoxDecoration( - color: cancelBgColor ?? Theme.of(context).colorScheme.surface, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(_circular), + children.add( + Expanded( + child: InkWell( + onTap: () => onCancel(context), + child: Container( + decoration: BoxDecoration( + color: cancelBgColor ?? Theme.of(context).colorScheme.surface, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(_circular), + ), ), + height: 42, + alignment: Alignment.center, + child: getView(cancel, cancelTextColor), ), - height: 42, - alignment: Alignment.center, - child: getView(cancel, cancelTextColor), ), ), - )); - children.add(const SizedBox( - height: 42, - child: VxDivider(type: VxDividerType.vertical), - )); - children.add(Expanded( - child: InkWell( - onTap: () => onConfirm(context), - child: Container( - decoration: BoxDecoration( - color: confirmBgColor ?? Theme.of(context).colorScheme.surface, - borderRadius: - BorderRadius.only(bottomRight: Radius.circular(_circular)), + ); + children.add( + const SizedBox( + height: 42, + child: VxDivider(type: VxDividerType.vertical), + ), + ); + children.add( + Expanded( + child: InkWell( + onTap: () => onConfirm(context), + child: Container( + decoration: BoxDecoration( + color: confirmBgColor ?? Theme.of(context).colorScheme.surface, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(_circular), + ), + ), + alignment: Alignment.center, + height: 42, + child: getView(confirm, confirmTextColor), ), - alignment: Alignment.center, - height: 42, - child: getView(confirm, confirmTextColor), ), ), - )); + ); return Row(children: children); } @@ -366,9 +379,7 @@ class VxTimerButtonState extends State { height: 42, decoration: BoxDecoration( color: widget.bgColor ?? Theme.of(context).colorScheme.surface, - borderRadius: BorderRadius.vertical( - bottom: Radius.circular(_circular), - ), + borderRadius: BorderRadius.vertical(bottom: Radius.circular(_circular)), ), alignment: Alignment.center, child: getView(buttonValue, widget.textColor), diff --git a/lib/src/flutter/divider.dart b/lib/src/flutter/divider.dart index b4bcdb30..4b4ee251 100644 --- a/lib/src/flutter/divider.dart +++ b/lib/src/flutter/divider.dart @@ -1,9 +1,6 @@ import 'package:flutter/material.dart'; -enum VxDividerType { - horizontal, - vertical, -} +enum VxDividerType { horizontal, vertical } class VxDivider extends StatelessWidget { final VxDividerType type; @@ -33,19 +30,13 @@ class VxDivider extends StatelessWidget { if (type == VxDividerType.horizontal) { return Container( height: width, - margin: EdgeInsetsDirectional.only( - start: indent, - end: endIndent, - ), + margin: EdgeInsetsDirectional.only(start: indent, end: endIndent), color: effectiveColor, ); } else { return Container( width: width, - margin: EdgeInsetsDirectional.only( - top: indent, - bottom: endIndent, - ), + margin: EdgeInsetsDirectional.only(top: indent, bottom: endIndent), color: effectiveColor, ); } diff --git a/lib/src/flutter/drawer.dart b/lib/src/flutter/drawer.dart index 69c8596c..6aa09b75 100644 --- a/lib/src/flutter/drawer.dart +++ b/lib/src/flutter/drawer.dart @@ -2,12 +2,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; -enum VxDrawerType { - left, - right, - top, - bottom, -} +enum VxDrawerType { left, right, top, bottom } mixin VxDrawer { static VoidCallback showTopNotification( @@ -97,10 +92,7 @@ mixin VxDrawer { overlayState.insert(overlayEntry!); if (autoHide) { - Future.delayed( - const Duration(milliseconds: 2000), - hide, - ); + Future.delayed(const Duration(milliseconds: 2000), hide); } return hide; @@ -141,12 +133,10 @@ class _VxDrawerState extends State<_VxDrawer> with TickerProviderStateMixin { vsync: this, ); - offsetAnimation = Tween(begin: 2000, end: 0).animate( - CurvedAnimation( - parent: controller!, - curve: Curves.ease, - ), - ); + offsetAnimation = Tween( + begin: 2000, + end: 0, + ).animate(CurvedAnimation(parent: controller!, curve: Curves.ease)); WidgetsBinding.instance.addPostFrameCallback(getBoxHeight); } @@ -164,8 +154,8 @@ class _VxDrawerState extends State<_VxDrawer> with TickerProviderStateMixin { void initAnimation() { final double? size = widget.type == VxDrawerType.top || widget.type == VxDrawerType.bottom - ? boxKey.currentContext?.size?.height - : boxKey.currentContext?.size?.width; + ? boxKey.currentContext?.size?.height + : boxKey.currentContext?.size?.width; double begin; // switch case @@ -180,12 +170,10 @@ class _VxDrawerState extends State<_VxDrawer> with TickerProviderStateMixin { break; } - offsetAnimation = Tween(begin: begin, end: 0).animate( - CurvedAnimation( - parent: controller!, - curve: Curves.ease, - ), - ); + offsetAnimation = Tween( + begin: begin, + end: 0, + ).animate(CurvedAnimation(parent: controller!, curve: Curves.ease)); // Forward animation controller?.forward(); } @@ -214,26 +202,21 @@ class _VxDrawerState extends State<_VxDrawer> with TickerProviderStateMixin { break; } return AnimatedBuilder( - animation: controller!, - builder: (BuildContext context, Widget? child) { - // 方向 - if (widget.type == VxDrawerType.top || - widget.type == VxDrawerType.bottom) { - offset = Offset( - 0, - offsetAnimation!.value, - ); - } else { - offset = Offset( - offsetAnimation!.value, - 0, - ); - } - - final List children = []; - - if (widget.showMask!) { - children.add(Positioned( + animation: controller!, + builder: (BuildContext context, Widget? child) { + // 方向 + if (widget.type == VxDrawerType.top || + widget.type == VxDrawerType.bottom) { + offset = Offset(0, offsetAnimation!.value); + } else { + offset = Offset(offsetAnimation!.value, 0); + } + + final List children = []; + + if (widget.showMask!) { + children.add( + Positioned( top: 0, right: 0, bottom: 0, @@ -241,35 +224,33 @@ class _VxDrawerState extends State<_VxDrawer> with TickerProviderStateMixin { child: GestureDetector( onTap: maskTap, child: const DecoratedBox( - decoration: BoxDecoration( - color: Colors.black45, - ), - ), - ), - )); - } - - children.add( - Positioned( - top: top, - right: right, - bottom: bottom, - left: left, - child: Transform.translate( - offset: offset, - child: DecoratedBox( - key: boxKey, - decoration: const BoxDecoration(color: Colors.white), - child: Material( - child: widget.child, - ), + decoration: BoxDecoration(color: Colors.black45), ), ), ), ); + } + + children.add( + Positioned( + top: top, + right: right, + bottom: bottom, + left: left, + child: Transform.translate( + offset: offset, + child: DecoratedBox( + key: boxKey, + decoration: const BoxDecoration(color: Colors.white), + child: Material(child: widget.child), + ), + ), + ), + ); - return Stack(children: children); - }); + return Stack(children: children); + }, + ); } void maskTap() { diff --git a/lib/src/flutter/drop_down_button.dart b/lib/src/flutter/drop_down_button.dart index 10cfac7a..9d15cde2 100644 --- a/lib/src/flutter/drop_down_button.dart +++ b/lib/src/flutter/drop_down_button.dart @@ -131,8 +131,8 @@ class VxTextDropDown extends VxWidgetBuilder { VxTextDropDown focusColor(Color color) => this.._focusColor = color; -// VxTextDropDown onChange(ValueChanged function) => -// this..onChanged = function; + // VxTextDropDown onChange(ValueChanged function) => + // this..onChanged = function; @override StatefulBuilder make({Key? key}) { @@ -153,10 +153,12 @@ class VxTextDropDown extends VxWidgetBuilder { focusColor: _focusColor, isDense: _isDense, items: _items - .map>((item) => DropdownMenuItem( - value: item, - child: item.text.make(), - )) + .map>( + (item) => DropdownMenuItem( + value: item, + child: item.text.make(), + ), + ) .toList(), onChanged: (String? value) { setState(() { @@ -175,8 +177,9 @@ extension VxDropDownExtension on List { /// Extension method to directly access [VxTextDropDown] with any widget without wrapping or with dot operator. /// /// The [selectedValue] should be a part of the list of strings. - VxTextDropDown textDropDown( - {required String selectedValue, - required ValueChanged onChanged}) => + VxTextDropDown textDropDown({ + required String selectedValue, + required ValueChanged onChanged, + }) => VxTextDropDown(this, selectedValue: selectedValue, onChanged: onChanged); } diff --git a/lib/src/flutter/filters.dart b/lib/src/flutter/filters.dart index 7f0dab87..4bb104fb 100644 --- a/lib/src/flutter/filters.dart +++ b/lib/src/flutter/filters.dart @@ -27,7 +27,7 @@ enum VxColorFilter { blue, milk, sepia, - polaroid + polaroid, } /// [VxFilter] is used to apply different color filters to the child widget. @@ -60,7 +60,7 @@ class VxFilter extends VxWidgetBuilder { 0, 0, 1, - 0 + 0, ]; final List _noFilter = [ @@ -83,7 +83,7 @@ class VxFilter extends VxWidgetBuilder { 0, 0, 1, - 0 + 0, ]; final List _blue = [ @@ -106,7 +106,7 @@ class VxFilter extends VxWidgetBuilder { 0, 1.7, 1, - 0 + 0, ]; final List _yellow = [ @@ -129,7 +129,7 @@ class VxFilter extends VxWidgetBuilder { 0, 0, 1, - 0 + 0, ]; final List _pink = [ @@ -152,7 +152,7 @@ class VxFilter extends VxWidgetBuilder { 0, 0, 1, - 0.2 + 0.2, ]; final List _blackAndWhite = [ 0, @@ -174,7 +174,7 @@ class VxFilter extends VxWidgetBuilder { 1, 0, 1, - 0 + 0, ]; final List _oldTimes = [ @@ -197,7 +197,7 @@ class VxFilter extends VxWidgetBuilder { 0, 0, 1, - 0 + 0, ]; final List _coldLife = [ @@ -220,7 +220,7 @@ class VxFilter extends VxWidgetBuilder { 0, 0, 1, - 0 + 0, ]; final List _purple = [ @@ -243,7 +243,7 @@ class VxFilter extends VxWidgetBuilder { 0, 0, 1, - 0 + 0, ]; final List _milk = [ @@ -266,7 +266,7 @@ class VxFilter extends VxWidgetBuilder { 0, 0, 1, - 0 + 0, ]; final List _sepia = [ @@ -458,7 +458,6 @@ class VxFilter extends VxWidgetBuilder { /// This extension will help to provide different filters to the widget. extension FilterExtension on Widget { /// Filters the widget with a color filter. - Widget filter({VxColorFilter filter = VxColorFilter.noFilter}) => VxFilter( - child: this, - ).setFilter(filter).make(); + Widget filter({VxColorFilter filter = VxColorFilter.noFilter}) => + VxFilter(child: this).setFilter(filter).make(); } diff --git a/lib/src/flutter/flex.dart b/lib/src/flutter/flex.dart index 521c35dd..f7ef981a 100644 --- a/lib/src/flutter/flex.dart +++ b/lib/src/flutter/flex.dart @@ -42,16 +42,17 @@ class VxBlock extends Flex { /// to be necessary to disambiguate `start` or `end` values for the /// [crossAxisAlignment], the [textDirection] must not be null. // ignore: prefer_const_constructors_in_immutables - VxBlock( - {super.key, - super.mainAxisAlignment, - super.textDirection, - super.verticalDirection, - super.textBaseline, - super.children, - super.direction = Axis.vertical, - super.mainAxisSize = MainAxisSize.min, - super.crossAxisAlignment = CrossAxisAlignment.stretch}); + VxBlock({ + super.key, + super.mainAxisAlignment, + super.textDirection, + super.verticalDirection, + super.textBaseline, + super.children, + super.direction = Axis.vertical, + super.mainAxisSize = MainAxisSize.min, + super.crossAxisAlignment = CrossAxisAlignment.stretch, + }); } class VxInlineBlock extends Flex { @@ -64,16 +65,17 @@ class VxInlineBlock extends Flex { /// to be necessary to disambiguate `start` or `end` values for the /// [crossAxisAlignment], the [textDirection] must not be null. // ignore: prefer_const_constructors_in_immutables - VxInlineBlock( - {super.key, - super.textDirection, - super.verticalDirection, - super.textBaseline, - super.children, - super.direction = Axis.horizontal, - super.mainAxisSize = MainAxisSize.max, - super.mainAxisAlignment = MainAxisAlignment.start, - super.crossAxisAlignment = CrossAxisAlignment.start}); + VxInlineBlock({ + super.key, + super.textDirection, + super.verticalDirection, + super.textBaseline, + super.children, + super.direction = Axis.horizontal, + super.mainAxisSize = MainAxisSize.max, + super.mainAxisAlignment = MainAxisAlignment.start, + super.crossAxisAlignment = CrossAxisAlignment.start, + }); } /// A widget that displays its children in a vertical array. @@ -374,11 +376,13 @@ class HStack extends StatelessWidget { /// {@end-tool} /// class ZStack extends StatelessWidget { - const ZStack(this.children, - {super.key, - this.alignment = AlignmentDirectional.topStart, - this.fit = StackFit.loose, - this.clip = Clip.none}); + const ZStack( + this.children, { + super.key, + this.alignment = AlignmentDirectional.topStart, + this.fit = StackFit.loose, + this.clip = Clip.none, + }); /// List of widgets in the stack. final List children; @@ -421,11 +425,12 @@ class ZStack extends StatelessWidget { @override Widget build(BuildContext context) { return Stack( - key: key, - alignment: alignment ?? AlignmentDirectional.topStart, - fit: fit ?? StackFit.loose, - clipBehavior: clip ?? Clip.hardEdge, - children: children); + key: key, + alignment: alignment ?? AlignmentDirectional.topStart, + fit: fit ?? StackFit.loose, + clipBehavior: clip ?? Clip.hardEdge, + children: children, + ); } } @@ -438,15 +443,16 @@ class AStack extends StatelessWidget { final TextDirection? textDirection; final List children; - const AStack( - {super.key, - required this.children, - this.clipBehavior = Clip.none, - this.overflowAlignment = OverflowBarAlignment.start, - this.overflowDirection = VerticalDirection.down, - this.overflowSpacing = 0.0, - this.spacing = 0.0, - this.textDirection}); + const AStack({ + super.key, + required this.children, + this.clipBehavior = Clip.none, + this.overflowAlignment = OverflowBarAlignment.start, + this.overflowDirection = VerticalDirection.down, + this.overflowSpacing = 0.0, + this.spacing = 0.0, + this.textDirection, + }); @override Widget build(BuildContext context) { diff --git a/lib/src/flutter/gesture.dart b/lib/src/flutter/gesture.dart index b52685ae..d56db2f4 100644 --- a/lib/src/flutter/gesture.dart +++ b/lib/src/flutter/gesture.dart @@ -88,14 +88,14 @@ class VelocityXInkWellBuilder extends VxWidgetBuilder { this.._splashColor = color; /// On clicking two times. - VelocityXInkWellBuilder mdDoubleClick( - {required FnBuilderCallback onDoubleClick}) => - this.._onDoubleClick = onDoubleClick; + VelocityXInkWellBuilder mdDoubleClick({ + required FnBuilderCallback onDoubleClick, + }) => this.._onDoubleClick = onDoubleClick; /// On long pressing. - VelocityXInkWellBuilder mdLongClick( - {required FnBuilderCallback onLongClick}) => - this.._onLongClick = onLongClick; + VelocityXInkWellBuilder mdLongClick({ + required FnBuilderCallback onLongClick, + }) => this.._onLongClick = onLongClick; @override Widget make({Key? key}) { @@ -147,9 +147,11 @@ extension VxGestureExtensions on Widget { VelocityXInkWellBuilder mdLongClick(FnBuilderCallback onClick) => VelocityXInkWellBuilder.mdLongClick(this, onClick); - Widget onTap(VoidCallback? onTap, - {Key? key, - HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild}) { + Widget onTap( + VoidCallback? onTap, { + Key? key, + HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild, + }) { return MouseRegion( key: key, cursor: SystemMouseCursors.click, @@ -162,16 +164,14 @@ extension VxGestureExtensions on Widget { } InkWell onInkTap(VoidCallback? onTap, {Key? key}) { - return InkWell( - key: key, - onTap: onTap, - child: this, - ); + return InkWell(key: key, onTap: onTap, child: this); } - Widget onDoubleTap(VoidCallback? onDoubleTap, - {Key? key, - HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild}) { + Widget onDoubleTap( + VoidCallback? onDoubleTap, { + Key? key, + HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild, + }) { return MouseRegion( key: key, cursor: SystemMouseCursors.click, @@ -184,15 +184,14 @@ extension VxGestureExtensions on Widget { } InkWell onInkDoubleTap(VoidCallback? onDoubleTap, {Key? key}) { - return InkWell( - key: key, - onDoubleTap: onDoubleTap, - child: this, - ); + return InkWell(key: key, onDoubleTap: onDoubleTap, child: this); } - Widget onLongPress(VoidCallback? onLongPress, Key? key, - {HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild}) { + Widget onLongPress( + VoidCallback? onLongPress, + Key? key, { + HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild, + }) { return MouseRegion( key: key, cursor: SystemMouseCursors.click, @@ -205,21 +204,19 @@ extension VxGestureExtensions on Widget { } InkWell onInkLongPress(VoidCallback? onLongPress, {Key? key}) { - return InkWell( - key: key, - onLongPress: onLongPress, - child: this, - ); + return InkWell(key: key, onLongPress: onLongPress, child: this); } ///it is very much like onTap extension but when you put your finger on it, its color will change, ///and you can decide that whether it will have a touchFeedBack (vibration on your phone) /// - Widget onFeedBackTap(VoidCallback? onTap, - {Key? key, - HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild, - bool touchFeedBack = false}) { + Widget onFeedBackTap( + VoidCallback? onTap, { + Key? key, + HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild, + bool touchFeedBack = false, + }) { return _CallbackButton( key: key, onTap: onTap, @@ -233,29 +230,17 @@ extension VxGestureExtensions on Widget { /// Mouse Region Hover MouseRegion onMouseHover(PointerHoverEventListener? onHover, {Key? key}) { - return MouseRegion( - key: key, - onHover: onHover, - child: this, - ); + return MouseRegion(key: key, onHover: onHover, child: this); } /// Mouse Region Enter MouseRegion onMouseEnter(PointerEnterEventListener? onEnter, {Key? key}) { - return MouseRegion( - key: key, - onEnter: onEnter, - child: this, - ); + return MouseRegion(key: key, onEnter: onEnter, child: this); } /// Mouse Region Exit MouseRegion onMouseExit(PointerExitEventListener? onExit, {Key? key}) { - return MouseRegion( - key: key, - onExit: onExit, - child: this, - ); + return MouseRegion(key: key, onExit: onExit, child: this); } /// Mouse Region Enter & Exit @@ -264,22 +249,18 @@ extension VxGestureExtensions on Widget { PointerEnterEventListener? onEnter, PointerExitEventListener? onExit, }) { - return MouseRegion( - key: key, - onEnter: onEnter, - onExit: onExit, - child: this, - ); + return MouseRegion(key: key, onEnter: onEnter, onExit: onExit, child: this); } /// [MouseRegion] Full Widget - MouseRegion mouseRegion( - {Key? key, - PointerHoverEventListener? onHover, - PointerEnterEventListener? onEnter, - PointerExitEventListener? onExit, - MouseCursor mouseCursor = MouseCursor.defer, - bool opaque = true}) { + MouseRegion mouseRegion({ + Key? key, + PointerHoverEventListener? onHover, + PointerEnterEventListener? onEnter, + PointerExitEventListener? onExit, + MouseCursor mouseCursor = MouseCursor.defer, + bool opaque = true, + }) { return MouseRegion( key: key, onHover: onHover, @@ -300,14 +281,15 @@ class _CallbackButton extends StatefulWidget { final bool needHaptic; final HitTestBehavior? hitTestBehavior; - const _CallbackButton( - {super.key, - this.onTap, - this.child, - this.normalColor = Colors.transparent, - this.pressedColor = Colors.black12, - this.needHaptic = false, - this.hitTestBehavior}); + const _CallbackButton({ + super.key, + this.onTap, + this.child, + this.normalColor = Colors.transparent, + this.pressedColor = Colors.black12, + this.needHaptic = false, + this.hitTestBehavior, + }); @override _CallbackButtonState createState() => _CallbackButtonState(); @@ -326,10 +308,7 @@ class _CallbackButtonState extends State<_CallbackButton> { onTapDown: handleTapDown, onTapUp: handleTapUp, onTapCancel: handleCancel, - child: Container( - color: bgColor, - child: widget.child, - ), + child: Container(color: bgColor, child: widget.child), ), ); } @@ -378,10 +357,7 @@ class _VxTransformWidgetState extends State<_VxTransformWidget> { @override Widget build(BuildContext context) { - return Transform( - transform: widget.matrix * _matrix, - child: widget.child, - ); + return Transform(transform: widget.matrix * _matrix, child: widget.child); } void setMatrix(Matrix4? matrix) { @@ -543,8 +519,24 @@ class VxZoomState extends State with TickerProviderStateMixin { final dx = (1 - scaleby) * focalPoint.dx; final dy = (1 - scaleby) * focalPoint.dy; - final scale = - Matrix4(scaleby, 0, 0, 0, 0, scaleby, 0, 0, 0, 0, 1, 0, dx, dy, 0, 1); + final scale = Matrix4( + scaleby, + 0, + 0, + 0, + 0, + scaleby, + 0, + 0, + 0, + 0, + 1, + 0, + dx, + dy, + 0, + 1, + ); _matrix = translate * scale; @@ -557,15 +549,13 @@ class VxZoomState extends State with TickerProviderStateMixin { if (!_isZooming || _controllerReset.isAnimating) { return; } - _animationReset = Matrix4Tween( - begin: _matrix, - end: Matrix4.identity(), - ).animate( - CurvedAnimation( - parent: _controllerReset, - curve: widget.animationCurve, - ), - ); + _animationReset = Matrix4Tween(begin: _matrix, end: Matrix4.identity()) + .animate( + CurvedAnimation( + parent: _controllerReset, + curve: widget.animationCurve, + ), + ); _controllerReset ..reset() ..forward(); @@ -575,14 +565,12 @@ class VxZoomState extends State with TickerProviderStateMixin { return IgnorePointer( child: Stack( children: [ - ModalBarrier( - color: widget.modalBarrierColor, - ), + ModalBarrier(color: widget.modalBarrierColor), _VxTransformWidget( key: _transformWidget, matrix: _transformMatrix, child: widget.child, - ) + ), ], ), ); @@ -619,15 +607,14 @@ extension VxZoomExtensions on Widget { Duration animationDuration = const Duration(milliseconds: 200), Curve animationCurve = Curves.easeOut, Color? modalBarrierColor, - }) => - VxZoom( - key: key, - minScale: minScale, - maxScale: maxScale, - twoTouchOnly: twoTouchOnly, - animationDuration: animationDuration, - animationCurve: animationCurve, - modalBarrierColor: modalBarrierColor, - child: this, - ); + }) => VxZoom( + key: key, + minScale: minScale, + maxScale: maxScale, + twoTouchOnly: twoTouchOnly, + animationDuration: animationDuration, + animationCurve: animationCurve, + modalBarrierColor: modalBarrierColor, + child: this, + ); } diff --git a/lib/src/flutter/glass.dart b/lib/src/flutter/glass.dart index 886c97dd..c2471a8d 100644 --- a/lib/src/flutter/glass.dart +++ b/lib/src/flutter/glass.dart @@ -63,17 +63,18 @@ class VxGlassmorphic extends StatelessWidget { ///default is same as above example\n final BoxBorder? border; - const VxGlassmorphic( - {super.key, - this.opacity = 0.05, - this.child, - this.blur = 5, - this.border, - this.height, - this.width, - this.borderRadius, - this.circularRadius = 10.0, - this.shadowStrength = 4}); + const VxGlassmorphic({ + super.key, + this.opacity = 0.05, + this.child, + this.blur = 5, + this.border, + this.height, + this.width, + this.borderRadius, + this.circularRadius = 10.0, + this.shadowStrength = 4, + }); @override Widget build(BuildContext context) { @@ -83,20 +84,19 @@ class VxGlassmorphic extends StatelessWidget { height: height, foregroundDecoration: BoxDecoration( borderRadius: borderRadius ?? BorderRadius.circular(circularRadius!), - border: border ?? + border: + border ?? Border.all( - color: Colors.white.withValues(alpha: 0.3), - width: 0.3, - style: BorderStyle.solid), + color: Colors.white.withValues(alpha: 0.3), + width: 0.3, + style: BorderStyle.solid, + ), ), width: width, child: ClipRRect( borderRadius: borderRadius ?? BorderRadius.circular(circularRadius!), child: BackdropFilter( - filter: ImageFilter.blur( - sigmaX: blur!, - sigmaY: blur!, - ), + filter: ImageFilter.blur(sigmaX: blur!, sigmaY: blur!), child: Container( decoration: BoxDecoration( borderRadius: @@ -113,9 +113,7 @@ class VxGlassmorphic extends StatelessWidget { } class _PaintShadow extends CustomPainter { - _PaintShadow({ - this.shadowStrength = 1, - }); + _PaintShadow({this.shadowStrength = 1}); final double? shadowStrength; @@ -123,20 +121,19 @@ class _PaintShadow extends CustomPainter { return radius * 0.57735 + 0.5; } - Paint customPainter( - {double? blurStrength, - Color? color, - double? opacity, - double? strokeWidth}) { + Paint customPainter({ + double? blurStrength, + Color? color, + double? opacity, + double? strokeWidth, + }) { return Paint() ..style = PaintingStyle.stroke ..color = color!.withValues(alpha: 0.24) ..strokeWidth = strokeWidth! ..maskFilter = MaskFilter.blur( BlurStyle.normal, - convertRadiusToSigma( - blurStrength!, - ), + convertRadiusToSigma(blurStrength!), ); } @@ -146,14 +143,15 @@ class _PaintShadow extends CustomPainter { return; } final RRect rect = RRect.fromRectAndRadius( - Rect.fromPoints( - Offset(-shadowStrength! / 2, -shadowStrength! / 2), - Offset( - size.width + shadowStrength! / 2, - size.height + shadowStrength! / 2, - ), + Rect.fromPoints( + Offset(-shadowStrength! / 2, -shadowStrength! / 2), + Offset( + size.width + shadowStrength! / 2, + size.height + shadowStrength! / 2, ), - const Radius.circular(10)); + ), + const Radius.circular(10), + ); canvas.drawRRect( rect, customPainter( @@ -183,17 +181,16 @@ extension VxGlassWidgetExtension on Widget { double? shadowStrength = 4, double? circularRadius = 10, double? blur = 5, - }) => - VxGlassmorphic( - blur: blur, - border: border, - borderRadius: borderRadius, - width: width, - height: height, - key: key, - opacity: opacity, - shadowStrength: shadowStrength, - circularRadius: circularRadius, - child: this, - ); + }) => VxGlassmorphic( + blur: blur, + border: border, + borderRadius: borderRadius, + width: width, + height: height, + key: key, + opacity: opacity, + shadowStrength: shadowStrength, + circularRadius: circularRadius, + child: this, + ); } diff --git a/lib/src/flutter/hover.dart b/lib/src/flutter/hover.dart index c74c6d37..8f767e31 100644 --- a/lib/src/flutter/hover.dart +++ b/lib/src/flutter/hover.dart @@ -38,14 +38,10 @@ class _HoverToggleState extends State with MaterialStateMixin { } Widget _buildChildrenStack() { - final Widget child = - isHovered ? Opacity(opacity: 0.2, child: widget.child) : widget.child; - return Stack( - children: [ - child, - if (isHovered) widget.hoverChild, - ], - ); + final Widget child = isHovered + ? Opacity(opacity: 0.2, child: widget.child) + : widget.child; + return Stack(children: [child, if (isHovered) widget.hoverChild]); } Widget _buildReplaceableChildren() => diff --git a/lib/src/flutter/icon.dart b/lib/src/flutter/icon.dart index 459c81aa..af9737a7 100644 --- a/lib/src/flutter/icon.dart +++ b/lib/src/flutter/icon.dart @@ -12,14 +12,13 @@ extension VxIcon on Icon { Color? color, String? semanticLabel, TextDirection? textDirection, - }) => - Icon( - icon, - color: color ?? this.color, - size: size ?? this.size, - semanticLabel: semanticLabel ?? this.semanticLabel, - textDirection: textDirection ?? this.textDirection, - ); + }) => Icon( + icon, + color: color ?? this.color, + size: size ?? this.size, + semanticLabel: semanticLabel ?? this.semanticLabel, + textDirection: textDirection ?? this.textDirection, + ); /// /// Extension method to directly access [Icon]'s size without wrapping or with dot operator. diff --git a/lib/src/flutter/json.dart b/lib/src/flutter/json.dart index 5c8c8978..85d425b2 100644 --- a/lib/src/flutter/json.dart +++ b/lib/src/flutter/json.dart @@ -11,13 +11,9 @@ import 'package:velocity_x/src/velocity_xx.dart'; /// [VxJson] can be used to show json in tree view of widgets class VxJson extends StatefulWidget { - VxJson(this.json, {super.key}) - : list = [], - isList = false; + VxJson(this.json, {super.key}) : list = [], isList = false; - VxJson.list(this.list, {super.key}) - : json = list.asMap(), - isList = true; + VxJson.list(this.list, {super.key}) : json = list.asMap(), isList = true; final Map json; final List list; @@ -32,9 +28,10 @@ class _VxJsonState extends State { @override Widget build(BuildContext context) => VxUniversal( - margin: const EdgeInsets.fromLTRB(10, 0, 0, 0), - crossAxisAlignment: CrossAxisAlignment.start, - children: children); + margin: const EdgeInsets.fromLTRB(10, 0, 0, 0), + crossAxisAlignment: CrossAxisAlignment.start, + children: children, + ); List get children { final List list = []; @@ -43,11 +40,14 @@ class _VxJsonState extends State { final dynamic content = entry.value; final List row = []; if (isTap(content)) { - row.add(VxToggleRotate( + row.add( + VxToggleRotate( rad: pi / 2, clockwise: true, isRotate: (mapFlag[key.toString()]) ?? false, - child: const Icon(Icons.arrow_right_rounded, size: 18))); + child: const Icon(Icons.arrow_right_rounded, size: 18), + ), + ); } else { row.add(const SizedBox(width: 14)); } @@ -59,13 +59,14 @@ class _VxJsonState extends State { .color(content == null ? Vx.zinc500 : Vx.pink500) .make() .onDoubleTap(() { - Vx.toClipboard(key.toString()); - VxToast.show(context, msg: 'Copied $key'); - }), + Vx.toClipboard(key.toString()); + VxToast.show(context, msg: 'Copied $key'); + }), const SizedBox(width: 4), - getValueWidget(content) + getValueWidget(content), ]); - list.add(VxUniversal( + list.add( + VxUniversal( direction: Axis.horizontal, addInkWell: true, crossAxisAlignment: CrossAxisAlignment.start, @@ -75,7 +76,9 @@ class _VxJsonState extends State { mapFlag[key.toString()] = !(mapFlag[key.toString()] ?? false); setState(() {}); }, - children: row)); + children: row, + ), + ); list.add(const SizedBox(height: 4)); if ((mapFlag[key.toString()]) ?? false) { list.add(getContentWidget(content)); @@ -87,8 +90,8 @@ class _VxJsonState extends State { Widget getContentWidget(dynamic content) => content is List ? VxJson.list(content) : content is Map - ? VxJson(content) - : VxJson({content.runtimeType: content.toString()}); + ? VxJson(content) + : VxJson({content.runtimeType: content.toString()}); Widget getValueWidget(dynamic content) { String text = ''; @@ -132,10 +135,11 @@ class _VxJsonState extends State { ); } - bool isTap(dynamic content) => !(content == null || - content is int || - content is String || - content is bool || - content is double || - (content is List && content.isEmpty)); + bool isTap(dynamic content) => + !(content == null || + content is int || + content is String || + content is bool || + content is double || + (content is List && content.isEmpty)); } diff --git a/lib/src/flutter/list.dart b/lib/src/flutter/list.dart index 2fb6a6c5..08049363 100644 --- a/lib/src/flutter/list.dart +++ b/lib/src/flutter/list.dart @@ -68,8 +68,7 @@ class VxUnorderedList extends StatelessWidget { itemCount: _items.length, padding: padding, itemBuilder: (context, i) { - final mainChild = _items[i] - .selectableText + final mainChild = _items[i].selectableText .color(color) .size(fontSize) .make() @@ -83,22 +82,13 @@ class VxUnorderedList extends StatelessWidget { 10.widthBox, if (isExpandedChild) mainChild.expand() else mainChild, ]; - return HStack( - children, - crossAlignment: CrossAxisAlignment.center, - ).p8(); + return HStack(children, crossAlignment: CrossAxisAlignment.center).p8(); }, ); } } -enum VxListType { - decimal, - upperAlpha, - lowerAlpha, - upperRoman, - lowerRoman, -} +enum VxListType { decimal, upperAlpha, lowerAlpha, upperRoman, lowerRoman } class VxOrderedList extends StatelessWidget { /// Specify the list of items @@ -158,16 +148,15 @@ class VxOrderedList extends StatelessWidget { itemBuilder: (context, index) { final item = items[index]; final formattedItem = _formatItem(index + 1); - final mainChild = - item.selectableText.color(color).size(fontSize).make(); - return HStack( - [ - formattedItem.text.color(color).size(fontSize).make(), - 8.widthBox, - if (isExpandedChild) mainChild.expand() else mainChild, - ], - crossAlignment: CrossAxisAlignment.center, - ).p8(); + final mainChild = item.selectableText + .color(color) + .size(fontSize) + .make(); + return HStack([ + formattedItem.text.color(color).size(fontSize).make(), + 8.widthBox, + if (isExpandedChild) mainChild.expand() else mainChild, + ], crossAlignment: CrossAxisAlignment.center).p8(); }, ); } diff --git a/lib/src/flutter/marquee.dart b/lib/src/flutter/marquee.dart index 3ec58a8b..a0e3630c 100644 --- a/lib/src/flutter/marquee.dart +++ b/lib/src/flutter/marquee.dart @@ -57,42 +57,46 @@ class VxMarqueeState extends State } void startTimer() { - final double widgetWidth = - _key.currentContext!.findRenderObject()!.paintBounds.size.width; - final double widgetHeight = - _key.currentContext!.findRenderObject()!.paintBounds.size.height; - - timer = Timer.periodic( - Duration(milliseconds: duration), - (timer) { - final double maxScrollExtent = - scrollController!.position.maxScrollExtent; - final double pixels = scrollController!.position.pixels; - //When the distance of animateTo is greater than the maximum sliding distance, return to the specific position of the first child so that the end is exactly on the right side, and then continue to roll, creating the illusion of marquee - if (pixels + _moveDistance >= maxScrollExtent) { - if (widget.scrollAxis == Axis.horizontal) { - //maxScrollExtent is the maximum sliding distance, the non-slidable distance is not counted (that is, the width of the ListView control), maxScrollExtent + widgetWidth is the true width of the children - //(maxScrollExtent+widgetWidth-blankWidth)/2 can calculate the length of a TextView control, and then subtract widgetWidth. Calculate the offset required for the first child to shift to the rightmost - //When animateTo slides to the end, but there is still a distance from the end, this distance should be taken into account when jumpingTo pixels-maxScrollExtent - //The original calculation formula (maxScrollExtent+widgetWidth-blankWidth)/2 -widgetWidth + pixels- maxScrollExtent, the following calculation formula is simplified - position = (maxScrollExtent - blankWidth! - widgetWidth) / 2 + - pixels - - maxScrollExtent; - } else { - position = (maxScrollExtent - blankHeight! - widgetHeight) / 2 + - pixels - - maxScrollExtent; - } - scrollController!.jumpTo(position); + final double widgetWidth = _key.currentContext! + .findRenderObject()! + .paintBounds + .size + .width; + final double widgetHeight = _key.currentContext! + .findRenderObject()! + .paintBounds + .size + .height; + + timer = Timer.periodic(Duration(milliseconds: duration), (timer) { + final double maxScrollExtent = scrollController!.position.maxScrollExtent; + final double pixels = scrollController!.position.pixels; + //When the distance of animateTo is greater than the maximum sliding distance, return to the specific position of the first child so that the end is exactly on the right side, and then continue to roll, creating the illusion of marquee + if (pixels + _moveDistance >= maxScrollExtent) { + if (widget.scrollAxis == Axis.horizontal) { + //maxScrollExtent is the maximum sliding distance, the non-slidable distance is not counted (that is, the width of the ListView control), maxScrollExtent + widgetWidth is the true width of the children + //(maxScrollExtent+widgetWidth-blankWidth)/2 can calculate the length of a TextView control, and then subtract widgetWidth. Calculate the offset required for the first child to shift to the rightmost + //When animateTo slides to the end, but there is still a distance from the end, this distance should be taken into account when jumpingTo pixels-maxScrollExtent + //The original calculation formula (maxScrollExtent+widgetWidth-blankWidth)/2 -widgetWidth + pixels- maxScrollExtent, the following calculation formula is simplified + position = + (maxScrollExtent - blankWidth! - widgetWidth) / 2 + + pixels - + maxScrollExtent; + } else { + position = + (maxScrollExtent - blankHeight! - widgetHeight) / 2 + + pixels - + maxScrollExtent; } - position += _moveDistance; - scrollController!.animateTo( - position, - duration: Duration(milliseconds: duration), - curve: Curves.linear, - ); - }, - ); + scrollController!.jumpTo(position); + } + position += _moveDistance; + scrollController!.animateTo( + position, + duration: Duration(milliseconds: duration), + curve: Curves.linear, + ); + }); } @override @@ -114,23 +118,14 @@ class VxMarqueeState extends State ), ); } - return Center( - child: Text( - widget.text, - style: widget.textStyle, - ), - ); + return Center(child: Text(widget.text, style: widget.textStyle)); } Widget getCenterChild() { if (widget.scrollAxis == Axis.horizontal) { - return Container( - width: blankWidth, - ); + return Container(width: blankWidth); } else { - return Container( - height: blankHeight, - ); + return Container(height: blankHeight); } } @@ -166,11 +161,10 @@ extension VxMarqueeExtension on String { TextStyle? textStyle, Axis scrollAxis = Axis.horizontal, double ratioOfBlankToScreen = 0.25, - }) => - VxMarquee( - text: this, - textStyle: textStyle, - scrollAxis: scrollAxis, - ratioOfBlankToScreen: ratioOfBlankToScreen, - ); + }) => VxMarquee( + text: this, + textStyle: textStyle, + scrollAxis: scrollAxis, + ratioOfBlankToScreen: ratioOfBlankToScreen, + ); } diff --git a/lib/src/flutter/misc.dart b/lib/src/flutter/misc.dart index 67ec82b9..1d0da946 100644 --- a/lib/src/flutter/misc.dart +++ b/lib/src/flutter/misc.dart @@ -42,22 +42,21 @@ class VxStat extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Icon( - icon, - color: iconColor, - ), + Icon(icon, color: iconColor), const SizedBox(width: 8.0), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( label, - style: labelStyle?.merge(TextStyle(color: labelColor)) ?? + style: + labelStyle?.merge(TextStyle(color: labelColor)) ?? TextStyle(color: labelColor), ), Text( value, - style: valueStyle?.merge(TextStyle(color: valueColor)) ?? + style: + valueStyle?.merge(TextStyle(color: valueColor)) ?? TextStyle(color: valueColor), ), ], diff --git a/lib/src/flutter/navigation.dart b/lib/src/flutter/navigation.dart index fa692938..7aa4662f 100644 --- a/lib/src/flutter/navigation.dart +++ b/lib/src/flutter/navigation.dart @@ -46,10 +46,12 @@ class VxAdaptiveNavigation extends StatelessWidget { extended: dimens.maxWidth >= 800, minExtendedWidth: 180, destinations: destinations - .map((e) => NavigationRailDestination( - icon: e.icon, - label: Text(e.label), - )) + .map( + (e) => NavigationRailDestination( + icon: e.icon, + label: Text(e.label), + ), + ) .toList(), selectedIndex: selectedIndex, onDestinationSelected: onDestinationSelected, diff --git a/lib/src/flutter/object.dart b/lib/src/flutter/object.dart index 9069dcf8..cec8d98a 100644 --- a/lib/src/flutter/object.dart +++ b/lib/src/flutter/object.dart @@ -106,50 +106,46 @@ extension VxObjectExtensions on Widget { /// Can be used to wrap as cover fit of the FittedBox. Widget objectCover({Key? key}) => FittedBox( - key: key, - fit: BoxFit.cover, - alignment: Alignment.center, - child: this, - ); + key: key, + fit: BoxFit.cover, + alignment: Alignment.center, + child: this, + ); /// Can be used to wrap as a contain fit of the FittedBox. Widget objectContain({Key? key}) => FittedBox( - key: key, - fit: BoxFit.contain, - alignment: Alignment.center, - child: this, - ); + key: key, + fit: BoxFit.contain, + alignment: Alignment.center, + child: this, + ); /// Can be used to wrap as a fill fit of the FittedBox. Widget objectFill({Key? key}) => FittedBox( - key: key, - fit: BoxFit.fill, - alignment: Alignment.center, - child: this, - ); + key: key, + fit: BoxFit.fill, + alignment: Alignment.center, + child: this, + ); /// Can be used to wrap as a scaledown fit of the FittedBox. Widget objectScaleDown({Key? key}) => FittedBox( - key: key, - fit: BoxFit.scaleDown, - alignment: Alignment.center, - child: this, - ); + key: key, + fit: BoxFit.scaleDown, + alignment: Alignment.center, + child: this, + ); /// Can be used to wrap as a none fit of the FittedBox. Widget objectNone({Key? key}) => FittedBox( - key: key, - fit: BoxFit.none, - alignment: Alignment.center, - child: this, - ); + key: key, + fit: BoxFit.none, + alignment: Alignment.center, + child: this, + ); /// Can be used to align a widget to topleft. - Align objectTopLeft({ - Key? key, - double? heightFactor, - double? widthFactor, - }) => + Align objectTopLeft({Key? key, double? heightFactor, double? widthFactor}) => Align( key: key, alignment: Alignment.topLeft, @@ -163,21 +159,16 @@ extension VxObjectExtensions on Widget { Key? key, double? heightFactor, double? widthFactor, - }) => - Align( - key: key, - alignment: Alignment.topCenter, - heightFactor: heightFactor, - widthFactor: widthFactor, - child: this, - ); + }) => Align( + key: key, + alignment: Alignment.topCenter, + heightFactor: heightFactor, + widthFactor: widthFactor, + child: this, + ); /// Can be used to align a widget to topright. - Align objectTopRight({ - Key? key, - double? heightFactor, - double? widthFactor, - }) => + Align objectTopRight({Key? key, double? heightFactor, double? widthFactor}) => Align( key: key, alignment: Alignment.topRight, @@ -191,63 +182,55 @@ extension VxObjectExtensions on Widget { Key? key, double? heightFactor, double? widthFactor, - }) => - Align( - key: key, - alignment: Alignment.bottomLeft, - heightFactor: heightFactor, - widthFactor: widthFactor, - child: this, - ); + }) => Align( + key: key, + alignment: Alignment.bottomLeft, + heightFactor: heightFactor, + widthFactor: widthFactor, + child: this, + ); /// Can be used to align a widget to bottomcenter. Align objectBottomCenter({ Key? key, double? heightFactor, double? widthFactor, - }) => - Align( - key: key, - alignment: Alignment.bottomCenter, - heightFactor: heightFactor, - widthFactor: widthFactor, - child: this, - ); + }) => Align( + key: key, + alignment: Alignment.bottomCenter, + heightFactor: heightFactor, + widthFactor: widthFactor, + child: this, + ); /// Can be used to align a widget to bottomright. Align objectBottomRight({ Key? key, double? heightFactor, double? widthFactor, - }) => - Align( - key: key, - alignment: Alignment.bottomRight, - heightFactor: heightFactor, - widthFactor: widthFactor, - child: this, - ); + }) => Align( + key: key, + alignment: Alignment.bottomRight, + heightFactor: heightFactor, + widthFactor: widthFactor, + child: this, + ); /// Can be used to align a widget to centerleft. Align objectCenterLeft({ Key? key, double? heightFactor, double? widthFactor, - }) => - Align( - key: key, - alignment: Alignment.centerLeft, - heightFactor: heightFactor, - widthFactor: widthFactor, - child: this, - ); + }) => Align( + key: key, + alignment: Alignment.centerLeft, + heightFactor: heightFactor, + widthFactor: widthFactor, + child: this, + ); /// Can be used to align a widget to center. - Align objectCenter({ - Key? key, - double? heightFactor, - double? widthFactor, - }) => + Align objectCenter({Key? key, double? heightFactor, double? widthFactor}) => Align( key: key, alignment: Alignment.center, @@ -261,14 +244,13 @@ extension VxObjectExtensions on Widget { Key? key, double? heightFactor, double? widthFactor, - }) => - Align( - key: key, - alignment: Alignment.centerRight, - heightFactor: heightFactor, - widthFactor: widthFactor, - child: this, - ); + }) => Align( + key: key, + alignment: Alignment.centerRight, + heightFactor: heightFactor, + widthFactor: widthFactor, + child: this, + ); /// Can be used to align a widget to specified alignment. Align objectLERP( @@ -278,14 +260,13 @@ extension VxObjectExtensions on Widget { Key? key, double? heightFactor, double? widthFactor, - }) => - Align( - key: key, - alignment: Alignment.lerp(a, b, t)!, - heightFactor: heightFactor, - widthFactor: widthFactor, - child: this, - ); + }) => Align( + key: key, + alignment: Alignment.lerp(a, b, t)!, + heightFactor: heightFactor, + widthFactor: widthFactor, + child: this, + ); /// Can be used to align a widget to specified [x] & [y]. Align objectXY( @@ -294,12 +275,11 @@ extension VxObjectExtensions on Widget { Key? key, double? heightFactor, double? widthFactor, - }) => - Align( - key: key, - alignment: Alignment(x, y), - heightFactor: heightFactor, - widthFactor: widthFactor, - child: this, - ); + }) => Align( + key: key, + alignment: Alignment(x, y), + heightFactor: heightFactor, + widthFactor: widthFactor, + child: this, + ); } diff --git a/lib/src/flutter/opacity.dart b/lib/src/flutter/opacity.dart index caf181b7..5b48305f 100644 --- a/lib/src/flutter/opacity.dart +++ b/lib/src/flutter/opacity.dart @@ -19,49 +19,31 @@ extension VxOpacityExtension on Widget { /// /// Provide a custom opacity to any widget by using [value] /// - Widget opacity({Key? key, required double value}) => Opacity( - key: key, - opacity: value, - child: this, - ); + Widget opacity({Key? key, required double value}) => + Opacity(key: key, opacity: value, child: this); /// /// Provides 0% opacity which means fully invisible /// - Widget opacity0({Key? key}) => Opacity( - opacity: 0.0, - child: this, - ); + Widget opacity0({Key? key}) => Opacity(opacity: 0.0, child: this); /// /// Provides 25% opacity which means partially visible /// - Widget opacity25({Key? key}) => Opacity( - opacity: 0.25, - child: this, - ); + Widget opacity25({Key? key}) => Opacity(opacity: 0.25, child: this); /// /// Provides 50% opacity which means half visible /// - Widget opacity50({Key? key}) => Opacity( - opacity: 0.5, - child: this, - ); + Widget opacity50({Key? key}) => Opacity(opacity: 0.5, child: this); /// /// Provides 75% opacity which means partially invisible /// - Widget opacity75({Key? key}) => Opacity( - opacity: 0.75, - child: this, - ); + Widget opacity75({Key? key}) => Opacity(opacity: 0.75, child: this); /// /// Provides 100% opacity which means fully visible /// - Widget opacity100({Key? key}) => Opacity( - opacity: 1.0, - child: this, - ); + Widget opacity100({Key? key}) => Opacity(opacity: 1.0, child: this); } diff --git a/lib/src/flutter/padding.dart b/lib/src/flutter/padding.dart index 9822ea4f..a182019a 100644 --- a/lib/src/flutter/padding.dart +++ b/lib/src/flutter/padding.dart @@ -53,11 +53,7 @@ class VxPaddingBuilder extends VxWidgetBuilder @override Widget make({Key? key}) { - return Padding( - key: key, - padding: velocityPadding!, - child: _child, - ); + return Padding(key: key, padding: velocityPadding!, child: _child); } } @@ -68,265 +64,220 @@ extension VxPaddingExtensions on Widget { VxPaddingBuilder get pad => VxPaddingBuilder(this); /// Gives 0 padding from all sides. - Padding p0({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp0), - child: this, - ); + Padding p0({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp0), child: this); /// Gives 1dp padding from all sides. - Padding p1({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp1), - child: this, - ); + Padding p1({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp1), child: this); /// Gives 2dp padding from all sides. - Padding p2({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp2), - child: this, - ); + Padding p2({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp2), child: this); /// Gives 4dp padding from all sides. - Padding p4({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp4), - child: this, - ); + Padding p4({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp4), child: this); /// Gives 8dp padding from all sides. - Padding p8({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp8), - child: this, - ); + Padding p8({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp8), child: this); /// Gives 12dp padding from all sides. - Padding p12({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp12), - child: this, - ); + Padding p12({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp12), child: this); /// Gives 16dp padding from all sides. - Padding p16({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp16), - child: this, - ); + Padding p16({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp16), child: this); /// Gives 20dp padding from all sides. - Padding p20({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp20), - child: this, - ); + Padding p20({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp20), child: this); /// Gives 24dp padding from all sides. - Padding p24({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp24), - child: this, - ); + Padding p24({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp24), child: this); /// Gives 32dp padding from all sides. - Padding p32({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp32), - child: this, - ); + Padding p32({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp32), child: this); /// Gives 64dp padding from all sides. - Padding p64({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.all(Vx.dp64), - child: this, - ); + Padding p64({Key? key}) => + Padding(key: key, padding: const EdgeInsets.all(Vx.dp64), child: this); /// Gives 0 padding vertically. Padding py0({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp0), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp0), + child: this, + ); /// Gives 1dp padding vertically. Padding py1({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp1), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp1), + child: this, + ); /// Gives 2dp padding vertically. Padding py2({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp2), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp2), + child: this, + ); /// Gives 4dp padding vertically. Padding py4({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp4), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp4), + child: this, + ); /// Gives 8dp padding vertically. Padding py8({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp8), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp8), + child: this, + ); /// Gives 12dp padding vertically. Padding py12({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp12), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp12), + child: this, + ); /// Gives 16dp padding vertically. Padding py16({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp16), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp16), + child: this, + ); /// Gives 20dp padding vertically. Padding py20({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp20), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp20), + child: this, + ); /// Gives 24dp padding vertically. Padding py24({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp24), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp24), + child: this, + ); /// Gives 32dp padding vertically. Padding py32({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp32), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp32), + child: this, + ); /// Gives 64dp padding vertically. Padding py64({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(vertical: Vx.dp64), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(vertical: Vx.dp64), + child: this, + ); /// Gives custom padding vertically. - Padding py( - double value, { - Key? key, - }) => - Padding( - key: key, - padding: EdgeInsets.symmetric(vertical: value), - child: this, - ); + Padding py(double value, {Key? key}) => Padding( + key: key, + padding: EdgeInsets.symmetric(vertical: value), + child: this, + ); /// Gives 0 padding horizontally. Padding px0({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp0), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp0), + child: this, + ); /// Gives 1dp padding horizontally. Padding px1({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp1), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp1), + child: this, + ); /// Gives 2dp padding horizontally. Padding px2({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp2), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp2), + child: this, + ); /// Gives 4dp padding horizontally. Padding px4({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp4), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp4), + child: this, + ); /// Gives 8dp padding horizontally. Padding px8({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp8), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp8), + child: this, + ); /// Gives 12dp padding horizontally. Padding px12({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp12), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp12), + child: this, + ); /// Gives 16dp padding horizontally. Padding px16({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp16), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp16), + child: this, + ); /// Gives 20dp padding horizontally. Padding px20({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp20), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp20), + child: this, + ); /// Gives 24dp padding horizontally. Padding px24({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp24), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp24), + child: this, + ); /// Gives 32dp padding horizontally. Padding px32({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp32), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp32), + child: this, + ); /// Gives 64dp padding horizontally. Padding px64({Key? key}) => Padding( - key: key, - padding: const EdgeInsets.symmetric(horizontal: Vx.dp64), - child: this, - ); + key: key, + padding: const EdgeInsets.symmetric(horizontal: Vx.dp64), + child: this, + ); /// Gives custom padding horizontally. - Padding px( - double value, { - Key? key, - }) => - Padding( - key: key, - padding: EdgeInsets.symmetric(horizontal: value), - child: this, - ); + Padding px(double value, {Key? key}) => Padding( + key: key, + padding: EdgeInsets.symmetric(horizontal: value), + child: this, + ); /// Gives custom padding from all sides by [value]. Padding p(double value, {Key? key}) { - return Padding( - key: key, - padding: EdgeInsets.all(value), - child: this, - ); + return Padding(key: key, padding: EdgeInsets.all(value), child: this); } /// Gives custom padding from all sides by [left] [top] [right] [bottom]. @@ -336,34 +287,34 @@ extension VxPaddingExtensions on Widget { double right, double bottom, { Key? key, - }) => - Padding( - key: key, - padding: EdgeInsets.fromLTRB(left, top, right, bottom), - child: this, - ); + }) => Padding( + key: key, + padding: EdgeInsets.fromLTRB(left, top, right, bottom), + child: this, + ); /// Gives custom padding symmetrically by [v] [h]. Padding pSymmetric({Key? key, double v = 0.0, double h = 0.0}) => Padding( - key: key, - padding: EdgeInsets.symmetric( - vertical: v, - horizontal: h, - ), - child: this, - ); + key: key, + padding: EdgeInsets.symmetric(vertical: v, horizontal: h), + child: this, + ); /// Gives custom padding by only [left] [top] [right] [bottom]. - Padding pOnly( - {Key? key, - double left = 0.0, - double right = 0.0, - double top = 0.0, - double bottom = 0.0}) => - Padding( - key: key, - padding: - EdgeInsets.only(left: left, right: right, top: top, bottom: bottom), - child: this, - ); + Padding pOnly({ + Key? key, + double left = 0.0, + double right = 0.0, + double top = 0.0, + double bottom = 0.0, + }) => Padding( + key: key, + padding: EdgeInsets.only( + left: left, + right: right, + top: top, + bottom: bottom, + ), + child: this, + ); } diff --git a/lib/src/flutter/pinview.dart b/lib/src/flutter/pinview.dart index 2412c6f7..c65a1e15 100644 --- a/lib/src/flutter/pinview.dart +++ b/lib/src/flutter/pinview.dart @@ -2,10 +2,7 @@ import 'dart:ui' as ui; import 'package:flutter/material.dart'; -enum VxPinBorderType { - underline, - round, -} +enum VxPinBorderType { underline, round } /// VxPinView to give a widget where OTP or Pin screen can be created easily class VxPinView extends StatefulWidget { @@ -88,7 +85,8 @@ class VxPinViewState extends State { return CustomPaint( foregroundPainter: VxPasswordPainter( color: widget.color ?? Theme.of(context).textTheme.titleLarge?.color, - contentColor: widget.contentColor ?? + contentColor: + widget.contentColor ?? Theme.of(context).textTheme.titleLarge?.color, radius: widget.radius, type: widget.type, @@ -107,10 +105,7 @@ class VxPinViewState extends State { border: InputBorder.none, counterText: '', ), - style: const TextStyle( - color: Colors.transparent, - fontSize: 1, - ), + style: const TextStyle(color: Colors.transparent, fontSize: 1), keyboardType: widget.keyboardType, textInputAction: widget.textInputAction, focusNode: widget.focusNode, @@ -186,32 +181,16 @@ class VxPasswordPainter extends CustomPainter { (2 * index + 1) * mSize / 2 + index * space, mSize / 2, ); - final Rect rect = Rect.fromCircle( - center: offset, - radius: mSize / 2, - ); + final Rect rect = Rect.fromCircle(center: offset, radius: mSize / 2); final RRect rRect = RRect.fromRectAndRadius( rect, Radius.circular(radius), ); - canvas.drawRRect( - rRect, - paint, - ); + canvas.drawRRect(rRect, paint); } else { - final Offset offset1 = Offset( - index * mSize + index * space, - mSize, - ); - final Offset offset2 = Offset( - (index + 1) * mSize + index * space, - mSize, - ); - canvas.drawLine( - offset1, - offset2, - paint, - ); + final Offset offset1 = Offset(index * mSize + index * space, mSize); + final Offset offset2 = Offset((index + 1) * mSize + index * space, mSize); + canvas.drawLine(offset1, offset2, paint); } } @@ -226,10 +205,7 @@ class VxPasswordPainter extends CustomPainter { (2 * index + 1) * mSize / 2 + index * space, mSize / 2, ); - final Rect rect = Rect.fromCircle( - center: offset, - radius: mSize / 8, - ); + final Rect rect = Rect.fromCircle(center: offset, radius: mSize / 8); final RRect rRect = RRect.fromRectAndRadius( rect, Radius.circular(mSize / 8), @@ -247,17 +223,15 @@ class VxPasswordPainter extends CustomPainter { pb.pushStyle(ui.TextStyle(color: contentColor)); pb.addText(tempValue); - final ui.ParagraphConstraints pc = - ui.ParagraphConstraints(width: mSize / 2); + final ui.ParagraphConstraints pc = ui.ParagraphConstraints( + width: mSize / 2, + ); final ui.Paragraph paragraph = pb.build()..layout(pc); final Offset offset = Offset( (2 * index + 1) * mSize / 2 + index * space - paragraph.width / 2, mSize / 2 - paragraph.height / 2, ); - canvas.drawParagraph( - paragraph, - offset, - ); + canvas.drawParagraph(paragraph, offset); } } diff --git a/lib/src/flutter/platforms.dart b/lib/src/flutter/platforms.dart index 4fb4f92c..04a04223 100644 --- a/lib/src/flutter/platforms.dart +++ b/lib/src/flutter/platforms.dart @@ -38,8 +38,13 @@ import 'package:flutter/material.dart'; ///} /// -abstract class VxPlatform extends StatelessWidget { +abstract class VxPlatform< + A extends Widget, + I extends Widget, + W extends Widget, + D extends Widget +> + extends StatelessWidget { const VxPlatform({super.key}); @override diff --git a/lib/src/flutter/popup_menu.dart b/lib/src/flutter/popup_menu.dart index 62a478e7..9818c235 100644 --- a/lib/src/flutter/popup_menu.dart +++ b/lib/src/flutter/popup_menu.dart @@ -3,10 +3,7 @@ import 'dart:math' as math; import 'package:flutter/material.dart'; /// Provide click type either [longClick] or [singleClick] -enum VxClickType { - longClick, - singleClick, -} +enum VxClickType { longClick, singleClick } typedef MenuBuilderCallback = Widget Function(); @@ -106,9 +103,7 @@ class VxPopupMenuState extends State { children: [ GestureDetector( onTap: () => _hideMenu(), - child: Container( - color: widget.barrierColor, - ), + child: Container(color: widget.barrierColor), ), Center( child: Container( @@ -127,17 +122,11 @@ class VxPopupMenuState extends State { ), children: [ if (widget.showArrow) - LayoutId( - id: _MenuLayoutId.arrow, - child: arrow, - ), + LayoutId(id: _MenuLayoutId.arrow, child: arrow), if (widget.showArrow) LayoutId( id: _MenuLayoutId.downArrow, - child: Transform.rotate( - angle: math.pi, - child: arrow, - ), + child: Transform.rotate(angle: math.pi, child: arrow), ), LayoutId( id: _MenuLayoutId.content, @@ -231,11 +220,7 @@ class VxPopupMenuState extends State { } } -enum _MenuLayoutId { - arrow, - downArrow, - content, -} +enum _MenuLayoutId { arrow, downArrow, content } enum _MenuPosition { bottomLeft, @@ -275,16 +260,10 @@ class _MenuLayoutDelegate extends MultiChildLayoutDelegate { ); } if (hasChild(_MenuLayoutId.arrow)) { - arrowSize = layoutChild( - _MenuLayoutId.arrow, - BoxConstraints.loose(size), - ); + arrowSize = layoutChild(_MenuLayoutId.arrow, BoxConstraints.loose(size)); } if (hasChild(_MenuLayoutId.downArrow)) { - layoutChild( - _MenuLayoutId.downArrow, - BoxConstraints.loose(size), - ); + layoutChild(_MenuLayoutId.downArrow, BoxConstraints.loose(size)); } bool isTop = false; @@ -300,8 +279,9 @@ class _MenuLayoutDelegate extends MultiChildLayoutDelegate { } else if (anchorCenterX + contentSize.width / 2 > size.width) { menuPosition = isTop ? _MenuPosition.topRight : _MenuPosition.bottomRight; } else { - menuPosition = - isTop ? _MenuPosition.topCenter : _MenuPosition.bottomCenter; + menuPosition = isTop + ? _MenuPosition.topCenter + : _MenuPosition.bottomCenter; } switch (menuPosition) { @@ -316,16 +296,20 @@ class _MenuLayoutDelegate extends MultiChildLayoutDelegate { ); break; case _MenuPosition.bottomLeft: - arrowOffset = Offset(anchorCenterX - arrowSize.width / 2, - anchorBottomY + verticalMargin!); + arrowOffset = Offset( + anchorCenterX - arrowSize.width / 2, + anchorBottomY + verticalMargin!, + ); contentOffset = Offset( 0, anchorBottomY + verticalMargin! + arrowSize.height, ); break; case _MenuPosition.bottomRight: - arrowOffset = Offset(anchorCenterX - arrowSize.width / 2, - anchorBottomY + verticalMargin!); + arrowOffset = Offset( + anchorCenterX - arrowSize.width / 2, + anchorBottomY + verticalMargin!, + ); contentOffset = Offset( size.width - contentSize.width, anchorBottomY + verticalMargin! + arrowSize.height, diff --git a/lib/src/flutter/preview.dart b/lib/src/flutter/preview.dart index f2b36d30..58f027d4 100644 --- a/lib/src/flutter/preview.dart +++ b/lib/src/flutter/preview.dart @@ -62,22 +62,22 @@ class _VxPreview extends StatefulWidget { final Color unSelectPointColor; final Color selectPointColor; - const _VxPreview( - {super.key, - required this.itemCount, - required this.itemBuilder, - this.scrollDirection = Axis.horizontal, - this.defaultIndex = 0, - this.loop = true, - this.indicators = true, - this.speed = 280, - this.curve = Curves.bounceIn, - this.unSelectPointColor = Colors.white, - this.selectPointColor = Colors.red, - this.fPreviewIndicatorAxis = VxPreviewIndicatorAxis.horizontal, - this.onChanged}) - : assert(itemCount >= 1), - assert(defaultIndex >= 0); + const _VxPreview({ + super.key, + required this.itemCount, + required this.itemBuilder, + this.scrollDirection = Axis.horizontal, + this.defaultIndex = 0, + this.loop = true, + this.indicators = true, + this.speed = 280, + this.curve = Curves.bounceIn, + this.unSelectPointColor = Colors.white, + this.selectPointColor = Colors.red, + this.fPreviewIndicatorAxis = VxPreviewIndicatorAxis.horizontal, + this.onChanged, + }) : assert(itemCount >= 1), + assert(defaultIndex >= 0); @override _VxPreviewState createState() => _VxPreviewState(); @@ -105,10 +105,7 @@ class _VxPreviewState extends State<_VxPreview> { final List children = []; children.add(_pageView()); if (widget.indicators) { - children.add(Positioned( - bottom: 20, - child: _indicatorView(), - )); + children.add(Positioned(bottom: 20, child: _indicatorView())); } return Stack(alignment: Alignment.center, children: children); } @@ -134,37 +131,33 @@ class _VxPreviewState extends State<_VxPreview> { double paddingHorizontal; double paddingVertical; if (widget.fPreviewIndicatorAxis == VxPreviewIndicatorAxis.horizontal) { - child = Row( - mainAxisSize: MainAxisSize.min, - children: children, - ); + child = Row(mainAxisSize: MainAxisSize.min, children: children); paddingHorizontal = pointPaddingSpace! * 2; paddingVertical = pointPaddingSpace!; pointPaddingHorizontal = pointPaddingSpace!; } else { - child = Column( - mainAxisSize: MainAxisSize.min, - children: children, - ); + child = Column(mainAxisSize: MainAxisSize.min, children: children); paddingHorizontal = pointPaddingSpace!; paddingVertical = pointPaddingSpace! * 2; pointPaddingVertical = pointPaddingSpace!; } List.generate(widget.itemCount, (index) { - children.add(Padding( - padding: EdgeInsets.symmetric( - horizontal: pointPaddingHorizontal, - vertical: pointPaddingVertical, - ), - child: VxRound( - type: VxRoundType.point, - size: pointSize, - color: index == position! % widget.itemCount - ? widget.selectPointColor - : widget.unSelectPointColor, + children.add( + Padding( + padding: EdgeInsets.symmetric( + horizontal: pointPaddingHorizontal, + vertical: pointPaddingVertical, + ), + child: VxRound( + type: VxRoundType.point, + size: pointSize, + color: index == position! % widget.itemCount + ? widget.selectPointColor + : widget.unSelectPointColor, + ), ), - )); + ); }); return Container( @@ -175,9 +168,7 @@ class _VxPreviewState extends State<_VxPreview> { ), decoration: BoxDecoration( borderRadius: BorderRadius.all( - Radius.circular( - pointSize! + pointPaddingSpace! * 2, - ), + Radius.circular(pointSize! + pointPaddingSpace! * 2), ), color: Colors.black12, ), diff --git a/lib/src/flutter/random.dart b/lib/src/flutter/random.dart index bc36feca..890c6aea 100644 --- a/lib/src/flutter/random.dart +++ b/lib/src/flutter/random.dart @@ -19,12 +19,13 @@ class VxRandomBox extends StatefulWidget { final Widget? child; final bool changeOnRedraw; - const VxRandomBox( - {super.key, - this.width, - this.height, - this.child, - this.changeOnRedraw = true}); + const VxRandomBox({ + super.key, + this.width, + this.height, + this.child, + this.changeOnRedraw = true, + }); @override VxRandomBoxState createState() => VxRandomBoxState(); @@ -52,12 +53,14 @@ class VxRandomBoxState extends State { ///Random Color box extension method extension VxRandomContainerWidgetExtension on Widget { - VxRandomBox randomBox( - {double? width, double? height, bool changeOnRedraw = true}) => - VxRandomBox( - height: height, - width: width, - changeOnRedraw: changeOnRedraw, - child: this, - ); + VxRandomBox randomBox({ + double? width, + double? height, + bool changeOnRedraw = true, + }) => VxRandomBox( + height: height, + width: width, + changeOnRedraw: changeOnRedraw, + child: this, + ); } diff --git a/lib/src/flutter/rating.dart b/lib/src/flutter/rating.dart index 57e00c91..b6592f23 100644 --- a/lib/src/flutter/rating.dart +++ b/lib/src/flutter/rating.dart @@ -118,7 +118,8 @@ class VxRatingState extends State { break; } else if (dx > widget.size * (i - 1) + widget.padding * (i - 1) && dx < widget.size * i + widget.padding * i) { - value = (dx - widget.padding * (i - 1)) / + value = + (dx - widget.padding * (i - 1)) / (widget.size * widget.count) * widget.maxRating; break; @@ -142,7 +143,8 @@ class VxRatingState extends State { if (widget.count / fullStars() == widget.maxRating / value!) { return 0; } - final num temp = (value! % (widget.maxRating / widget.count)) / + final num temp = + (value! % (widget.maxRating / widget.count)) / (widget.maxRating / widget.count); if (widget.stepInt) { return temp.ceil(); @@ -156,28 +158,18 @@ class VxRatingState extends State { final int full = fullStars(); final List children = []; for (int i = 0; i < full; i++) { - children.add(getStarItemView( - widget.selectImage, - widget.selectionColor, - )); + children.add(getStarItemView(widget.selectImage, widget.selectionColor)); if (i < widget.count - 1) { - children.add( - SizedBox( - width: widget.padding, - ), - ); + children.add(SizedBox(width: widget.padding)); } } if (full < widget.count) { - children.add(ClipRect( - clipper: _VxClipper( - rating: star() * widget.size, - ), - child: getStarItemView( - widget.selectImage, - widget.selectionColor, + children.add( + ClipRect( + clipper: _VxClipper(rating: star() * widget.size), + child: getStarItemView(widget.selectImage, widget.selectionColor), ), - )); + ); } return children; @@ -185,11 +177,7 @@ class VxRatingState extends State { Widget getStarItemView(dynamic path, Color color) { if (path is IconData) { - return Icon( - path, - size: widget.size, - color: color, - ); + return Icon(path, size: widget.size, color: color); } else if (path is String) { return Image.asset( path, @@ -198,28 +186,15 @@ class VxRatingState extends State { color: color, ); } - return Icon( - Icons.star, - size: widget.size, - color: color, - ); + return Icon(Icons.star, size: widget.size, color: color); } List buildNormalRow() { final List children = []; for (int i = 0; i < widget.count; i++) { - children.add( - getStarItemView( - widget.normalImage, - widget.normalColor, - ), - ); + children.add(getStarItemView(widget.normalImage, widget.normalColor)); if (i < widget.count - 1) { - children.add( - SizedBox( - width: widget.padding, - ), - ); + children.add(SizedBox(width: widget.padding)); } } return children; @@ -227,21 +202,11 @@ class VxRatingState extends State { Widget buildRowRating() { final List children = []; - children.add( - Row( - children: buildNormalRow(), - ), - ); - children.add( - Row( - children: buildRow(), - ), - ); + children.add(Row(children: buildNormalRow())); + children.add(Row(children: buildRow())); return SizedBox( width: widget.count * widget.size + (widget.count - 1) * widget.padding, - child: Stack( - children: children, - ), + child: Stack(children: children), ); } } @@ -253,12 +218,7 @@ class _VxClipper extends CustomClipper { @override Rect getClip(Size size) { - return Rect.fromLTRB( - 0.0, - 0.0, - rating, - size.height, - ); + return Rect.fromLTRB(0.0, 0.0, rating, size.height); } @override diff --git a/lib/src/flutter/rich_text.dart b/lib/src/flutter/rich_text.dart index 5c91773b..fe887c5e 100644 --- a/lib/src/flutter/rich_text.dart +++ b/lib/src/flutter/rich_text.dart @@ -331,8 +331,10 @@ class VxRichText extends VxWidgetBuilder VxRichText scale(double value) => _fontSizedText(child: this, scaleFactor: value); - VxRichText _fontSizedText( - {required double scaleFactor, required VxRichText child}) { + VxRichText _fontSizedText({ + required double scaleFactor, + required VxRichText child, + }) { _scaleFactor = scaleFactor; return this; } @@ -379,8 +381,10 @@ class VxRichText extends VxWidgetBuilder VxRichText get extraBlack => _fontWeightedText(child: this, weight: FontWeight.w900); - VxRichText _fontWeightedText( - {required FontWeight weight, required VxRichText child}) { + VxRichText _fontWeightedText({ + required FontWeight weight, + required VxRichText child, + }) { _fontWeight = weight; return this; } @@ -472,8 +476,9 @@ class VxRichText extends VxWidgetBuilder key: key, textAlign: _textAlign, maxLines: _maxLines, - textScaler: - _scaleFactor == null ? null : TextScaler.linear(_scaleFactor!), + textScaler: _scaleFactor == null + ? null + : TextScaler.linear(_scaleFactor!), softWrap: _softWrap ?? true, overflow: _overflow ?? TextOverflow.clip, strutStyle: _strutStyle, @@ -701,8 +706,10 @@ class VelocityXTextSpan extends VxTextSpanBuilder VelocityXTextSpan get extraBlack => _fontWeightedText(child: this, weight: FontWeight.w900); - VelocityXTextSpan _fontWeightedText( - {required FontWeight weight, required VelocityXTextSpan child}) { + VelocityXTextSpan _fontWeightedText({ + required FontWeight weight, + required VelocityXTextSpan child, + }) { _fontWeight = weight; return this; } diff --git a/lib/src/flutter/routes.dart b/lib/src/flutter/routes.dart index 8f65528f..33dc243f 100644 --- a/lib/src/flutter/routes.dart +++ b/lib/src/flutter/routes.dart @@ -7,10 +7,11 @@ extension VxRoutesWidgetsExtension on Widget { /// Navigator.push(context, YourPage().cupertinoRoute()); /// return CupertinoPageRoute( - fullscreenDialog: fullscreenDialog, - builder: (ctx) { - return this; - }); + fullscreenDialog: fullscreenDialog, + builder: (ctx) { + return this; + }, + ); } /// Example: @@ -18,10 +19,11 @@ extension VxRoutesWidgetsExtension on Widget { /// MaterialPageRoute materialRoute({bool fullscreenDialog = false}) { return MaterialPageRoute( - fullscreenDialog: fullscreenDialog, - builder: (ctx) { - return this; - }); + fullscreenDialog: fullscreenDialog, + builder: (ctx) { + return this; + }, + ); } /// Best for showing zoomed/version of widgets like images @@ -34,14 +36,12 @@ extension VxRoutesWidgetsExtension on Widget { return this; }, transitionsBuilder: (context, animation, secondaryAnimation, child) { - final rectAnimation = _createTween(parentContext) - .chain(CurveTween(curve: Curves.ease)) - .animate(animation); + final rectAnimation = _createTween( + parentContext, + ).chain(CurveTween(curve: Curves.ease)).animate(animation); return Stack( - children: [ - PositionedTransition(rect: rectAnimation, child: child), - ], + children: [PositionedTransition(rect: rectAnimation, child: child)], ); }, ); @@ -53,9 +53,6 @@ extension VxRoutesWidgetsExtension on Widget { final rect = box.localToGlobal(Offset.zero) & box.size; final relativeRect = RelativeRect.fromSize(rect, windowSize); - return RelativeRectTween( - begin: relativeRect, - end: RelativeRect.fill, - ); + return RelativeRectTween(begin: relativeRect, end: RelativeRect.fill); } } diff --git a/lib/src/flutter/scroll.dart b/lib/src/flutter/scroll.dart index dfab8c41..105e369b 100644 --- a/lib/src/flutter/scroll.dart +++ b/lib/src/flutter/scroll.dart @@ -20,44 +20,51 @@ extension ScrollExtension on Widget { /// /// Extension method to directly access [SingleChildScrollView] vertically with any widget without wrapping or with dot operator. /// - Widget scrollVertical( - {Key? key, - ScrollController? controller, - ScrollPhysics? physics, - EdgeInsetsGeometry? padding}) => - SingleChildScrollView( - key: key, - scrollDirection: Axis.vertical, - controller: controller, - physics: physics, - padding: padding, - child: this); + Widget scrollVertical({ + Key? key, + ScrollController? controller, + ScrollPhysics? physics, + EdgeInsetsGeometry? padding, + }) => SingleChildScrollView( + key: key, + scrollDirection: Axis.vertical, + controller: controller, + physics: physics, + padding: padding, + child: this, + ); /// /// Extension method to directly access [SingleChildScrollView] horizontally with any widget without wrapping or with dot operator. /// - Widget scrollHorizontal( - {Key? key, - ScrollController? controller, - ScrollPhysics? physics, - EdgeInsetsGeometry? padding}) => - SingleChildScrollView( - key: key, - scrollDirection: Axis.horizontal, - child: this, - ); + Widget scrollHorizontal({ + Key? key, + ScrollController? controller, + ScrollPhysics? physics, + EdgeInsetsGeometry? padding, + }) => SingleChildScrollView( + key: key, + scrollDirection: Axis.horizontal, + child: this, + ); } /// Extensions for ScrollController extension VxScrollControllerExtension on ScrollController { void animToTop() { - animateTo(0, - duration: const Duration(milliseconds: 300), curve: Curves.decelerate); + animateTo( + 0, + duration: const Duration(milliseconds: 300), + curve: Curves.decelerate, + ); } void animToBottom() { - animateTo(position.maxScrollExtent, - duration: const Duration(milliseconds: 300), curve: Curves.decelerate); + animateTo( + position.maxScrollExtent, + duration: const Duration(milliseconds: 300), + curve: Curves.decelerate, + ); } void jumpToTop() { diff --git a/lib/src/flutter/selectable_text.dart b/lib/src/flutter/selectable_text.dart index 0527e399..fa4bf8f0 100644 --- a/lib/src/flutter/selectable_text.dart +++ b/lib/src/flutter/selectable_text.dart @@ -212,8 +212,10 @@ class VxSelectableTextBuilder extends VxWidgetBuilder VxSelectableTextBuilder get xl6 => _fontSizedText(child: this, scaleFactor: 4); - VxSelectableTextBuilder _fontSizedText( - {required double scaleFactor, required VxSelectableTextBuilder child}) { + VxSelectableTextBuilder _fontSizedText({ + required double scaleFactor, + required VxSelectableTextBuilder child, + }) { _scaleFactor = scaleFactor; return this; } @@ -254,8 +256,10 @@ class VxSelectableTextBuilder extends VxWidgetBuilder VxSelectableTextBuilder get extraBlack => _fontWeightedText(child: this, weight: FontWeight.w900); - VxSelectableTextBuilder _fontWeightedText( - {required FontWeight weight, required VxSelectableTextBuilder child}) { + VxSelectableTextBuilder _fontWeightedText({ + required FontWeight weight, + required VxSelectableTextBuilder child, + }) { _fontWeight = weight; return this; } @@ -344,8 +348,8 @@ class VxSelectableTextBuilder extends VxWidgetBuilder //Added context menu builder VxSelectableTextBuilder contextMenuBuilder( - Widget Function(BuildContext, EditableTextState) menuBuilder) => - this.._contextMenuBuilder = menuBuilder; + Widget Function(BuildContext, EditableTextState) menuBuilder, + ) => this.._contextMenuBuilder = menuBuilder; @override SelectableText make({Key? key}) { @@ -369,8 +373,9 @@ class VxSelectableTextBuilder extends VxWidgetBuilder onTap: _onTap as void Function()?, enableInteractiveSelection: true, showCursor: _showCursor ?? false, - textScaler: - _scaleFactor == null ? null : TextScaler.linear(_scaleFactor!), + textScaler: _scaleFactor == null + ? null + : TextScaler.linear(_scaleFactor!), style: _themedStyle?.merge(ts) ?? _textStyle?.merge(ts) ?? ts, strutStyle: _strutStyle, contextMenuBuilder: _contextMenuBuilder, diff --git a/lib/src/flutter/shapes.dart b/lib/src/flutter/shapes.dart index aa6497a5..a1e904a4 100644 --- a/lib/src/flutter/shapes.dart +++ b/lib/src/flutter/shapes.dart @@ -80,7 +80,8 @@ class VxCircle extends StatelessWidget with VxShadowMixin { height: radius ?? MediaQuery.sizeOf(context).shortestSide / 2, width: radius ?? MediaQuery.sizeOf(context).shortestSide / 2, duration: kThemeChangeDuration, - decoration: customDecoration ?? + decoration: + customDecoration ?? BoxDecoration( border: border, color: effectiveBackgroundColor, @@ -168,17 +169,20 @@ class VxCapsule extends StatelessWidget with VxShadowMixin { height: height ?? MediaQuery.sizeOf(context).shortestSide / 4, width: width ?? MediaQuery.sizeOf(context).shortestSide, duration: kThemeChangeDuration, - decoration: customDecoration ?? + decoration: + customDecoration ?? BoxDecoration( - border: border, - borderRadius: BorderRadius.circular( - MediaQuery.sizeOf(context).shortestSide / 2), - color: effectiveBackgroundColor, - shape: BoxShape.rectangle, - gradient: gradient, - image: backgroundImage, - backgroundBlendMode: blendMode, - boxShadow: velocityShadow ?? shadows ?? kElevationToShadow[0]), + border: border, + borderRadius: BorderRadius.circular( + MediaQuery.sizeOf(context).shortestSide / 2, + ), + color: effectiveBackgroundColor, + shape: BoxShape.rectangle, + gradient: gradient, + image: backgroundImage, + backgroundBlendMode: blendMode, + boxShadow: velocityShadow ?? shadows ?? kElevationToShadow[0], + ), child: child, ); } @@ -259,7 +263,8 @@ class VxEllipse extends StatelessWidget with VxShadowMixin { height: height0, width: width0, duration: kThemeChangeDuration, - decoration: customDecoration ?? + decoration: + customDecoration ?? BoxDecoration( border: border, borderRadius: BorderRadius.all(Radius.elliptical(width0, height0)), @@ -348,11 +353,10 @@ class VxBevel extends StatelessWidget with VxShadowMixin { duration: kThemeChangeDuration, decoration: ShapeDecoration( shape: BeveledRectangleBorder( - side: borderSide ?? + side: + borderSide ?? const BorderSide(width: 0.0, color: Colors.transparent), - borderRadius: BorderRadius.circular( - radius ?? 10.0, - ), + borderRadius: BorderRadius.circular(radius ?? 10.0), ), shadows: velocityShadow ?? shadows ?? kElevationToShadow[0], color: effectiveBackgroundColor, @@ -437,7 +441,8 @@ class VxContinuousRectangle extends StatelessWidget duration: kThemeChangeDuration, decoration: ShapeDecoration( shape: ContinuousRectangleBorder( - side: borderSide ?? + side: + borderSide ?? const BorderSide(width: 0.0, color: Colors.transparent), borderRadius: BorderRadius.circular(radius ?? 10.0), ), @@ -505,8 +510,11 @@ class VxTriangle extends StatelessWidget { duration: kThemeChangeDuration, child: CustomPaint( size: Size(width0, height0), - painter: _VxTriangle(effectiveBackgroundColor, - strokeWidth: strokeWidth, isStroke: strokeWidth != null), + painter: _VxTriangle( + effectiveBackgroundColor, + strokeWidth: strokeWidth, + isStroke: strokeWidth != null, + ), child: child, ), ); @@ -565,8 +573,10 @@ class VxTicket extends StatelessWidget { } return ClipPath( - clipper: - _VxTicketClipper(isTwoSide: isTwoSided!, isHardEdge: isHardEdged!), + clipper: _VxTicketClipper( + isTwoSide: isTwoSided!, + isHardEdge: isHardEdged!, + ), child: AnimatedContainer( height: height0, width: width0, @@ -584,11 +594,7 @@ class _VxTriangle extends CustomPainter { final bool isStroke; - _VxTriangle( - this.color, { - this.strokeWidth = 0.0, - this.isStroke = false, - }); + _VxTriangle(this.color, {this.strokeWidth = 0.0, this.isStroke = false}); @override void paint(Canvas canvas, Size size) { final path = Path(); @@ -633,7 +639,11 @@ class _VxTicketClipper extends CustomClipper { path.lineTo(x, y); } else { path.quadraticBezierTo( - x + increment / 2, yControlPoint, x + increment, y); + x + increment / 2, + yControlPoint, + x + increment, + y, + ); x += increment; } } @@ -646,7 +656,11 @@ class _VxTicketClipper extends CustomClipper { // path.lineTo(x, y); } else { path.quadraticBezierTo( - x - increment / 2, size.height * .15, x - increment, 0); + x - increment / 2, + size.height * .15, + x - increment, + 0, + ); x -= increment; } } @@ -676,19 +690,18 @@ extension VxShapesExtension on Widget { BlendMode? blendMode, Gradient? gradient, List? shadows, - }) => - VxCircle( - key: key, - backgroundColor: backgroundColor, - border: border, - customDecoration: customDecoration, - radius: radius, - backgroundImage: backgroundImage, - blendMode: blendMode, - gradient: gradient, - shadows: shadows, - child: this, - ); + }) => VxCircle( + key: key, + backgroundColor: backgroundColor, + border: border, + customDecoration: customDecoration, + radius: radius, + backgroundImage: backgroundImage, + blendMode: blendMode, + gradient: gradient, + shadows: shadows, + child: this, + ); /// /// Extension method to directly access [VxCapsule] with any widget without wrapping or with dot operator. @@ -705,20 +718,19 @@ extension VxShapesExtension on Widget { BlendMode? blendMode, Gradient? gradient, List? shadows, - }) => - VxCapsule( - key: key, - backgroundColor: backgroundColor, - border: border, - customDecoration: customDecoration, - width: width, - height: height, - backgroundImage: backgroundImage, - blendMode: blendMode, - gradient: gradient, - shadows: shadows, - child: this, - ); + }) => VxCapsule( + key: key, + backgroundColor: backgroundColor, + border: border, + customDecoration: customDecoration, + width: width, + height: height, + backgroundImage: backgroundImage, + blendMode: blendMode, + gradient: gradient, + shadows: shadows, + child: this, + ); /// /// Extension method to directly access [VxEllipse] with any widget without wrapping or with dot operator. @@ -735,20 +747,19 @@ extension VxShapesExtension on Widget { BlendMode? blendMode, Gradient? gradient, List? shadows, - }) => - VxEllipse( - key: key, - backgroundColor: backgroundColor, - border: border, - customDecoration: customDecoration, - width: width, - height: height, - backgroundImage: backgroundImage, - blendMode: blendMode, - gradient: gradient, - shadows: shadows, - child: this, - ); + }) => VxEllipse( + key: key, + backgroundColor: backgroundColor, + border: border, + customDecoration: customDecoration, + width: width, + height: height, + backgroundImage: backgroundImage, + blendMode: blendMode, + gradient: gradient, + shadows: shadows, + child: this, + ); /// /// Extension method to directly access [VxBevel] with any widget without wrapping or with dot operator. @@ -764,19 +775,18 @@ extension VxShapesExtension on Widget { DecorationImage? backgroundImage, Gradient? gradient, List? shadows, - }) => - VxBevel( - key: key, - backgroundColor: backgroundColor, - borderSide: borderSide, - radius: radius, - width: width, - height: height, - backgroundImage: backgroundImage, - gradient: gradient, - shadows: shadows, - child: this, - ); + }) => VxBevel( + key: key, + backgroundColor: backgroundColor, + borderSide: borderSide, + radius: radius, + width: width, + height: height, + backgroundImage: backgroundImage, + gradient: gradient, + shadows: shadows, + child: this, + ); /// /// Extension method to directly access [VxContinuousRectangle] with any widget without wrapping or with dot operator. @@ -792,19 +802,18 @@ extension VxShapesExtension on Widget { DecorationImage? backgroundImage, Gradient? gradient, List? shadows, - }) => - VxContinuousRectangle( - key: key, - backgroundColor: backgroundColor, - borderSide: borderSide, - radius: radius, - width: width, - height: height, - backgroundImage: backgroundImage, - gradient: gradient, - shadows: shadows, - child: this, - ); + }) => VxContinuousRectangle( + key: key, + backgroundColor: backgroundColor, + borderSide: borderSide, + radius: radius, + width: width, + height: height, + backgroundImage: backgroundImage, + gradient: gradient, + shadows: shadows, + child: this, + ); /// /// Extension method to directly access [VxTriangle] with any widget without wrapping or with dot operator. @@ -816,15 +825,14 @@ extension VxShapesExtension on Widget { double? width, double? height, double? strokeWidth, - }) => - VxTriangle( - key: key, - backgroundColor: backgroundColor, - width: width, - height: height, - strokeWidth: strokeWidth, - child: this, - ); + }) => VxTriangle( + key: key, + backgroundColor: backgroundColor, + width: width, + height: height, + strokeWidth: strokeWidth, + child: this, + ); /// /// Extension method to directly access [VxTicket] with any widget without wrapping or with dot operator. @@ -837,14 +845,13 @@ extension VxShapesExtension on Widget { double? height, bool? isHardEdged, bool? isTwoSided, - }) => - VxTicket( - key: key, - backgroundColor: backgroundColor, - width: width, - height: height, - isHardEdged: isHardEdged, - isTwoSided: isTwoSided, - child: this, - ); + }) => VxTicket( + key: key, + backgroundColor: backgroundColor, + width: width, + height: height, + isHardEdged: isHardEdged, + isTwoSided: isTwoSided, + child: this, + ); } diff --git a/lib/src/flutter/shift.dart b/lib/src/flutter/shift.dart index ec352623..88ac2b10 100644 --- a/lib/src/flutter/shift.dart +++ b/lib/src/flutter/shift.dart @@ -61,24 +61,12 @@ class VxShifter extends StatelessWidget { return Align( alignment: alignment, - child: Transform.translate( - offset: Offset(x, y), - child: child, - ), + child: Transform.translate(offset: Offset(x, y), child: child), ); } } extension VxShiftWidgetExt on Widget { - Widget shift( - double shift, { - Key? key, - required Alignment alignment, - }) => - VxShifter( - key: key, - alignment: alignment, - shift: shift, - child: this, - ); + Widget shift(double shift, {Key? key, required Alignment alignment}) => + VxShifter(key: key, alignment: alignment, shift: shift, child: this); } diff --git a/lib/src/flutter/shimmer.dart b/lib/src/flutter/shimmer.dart index d082c4c0..c3af1614 100644 --- a/lib/src/flutter/shimmer.dart +++ b/lib/src/flutter/shimmer.dart @@ -104,33 +104,28 @@ class VxShimmerState extends State @override Widget build(BuildContext context) => AnimatedBuilder( - animation: _controller, - child: widget.child, - builder: (BuildContext context, Widget? child) => _VxShimmer( - gradient: widget.showGradient - ? widget.gradient - : LinearGradient( - begin: Alignment.topLeft, - end: Alignment.centerRight, - colors: [ - widget.primaryColor, - widget.primaryColor, - widget.secondaryColor ?? Vx.gray200, - widget.primaryColor, - widget.primaryColor - ], - stops: const [ - 0, - 0.3, - 0.5, - 0.7, - 1 - ]), - controllerValue: _controller.value, - showShimmerEffect: widget.showAnimation, - child: child, - ), - ); + animation: _controller, + child: widget.child, + builder: (BuildContext context, Widget? child) => _VxShimmer( + gradient: widget.showGradient + ? widget.gradient + : LinearGradient( + begin: Alignment.topLeft, + end: Alignment.centerRight, + colors: [ + widget.primaryColor, + widget.primaryColor, + widget.secondaryColor ?? Vx.gray200, + widget.primaryColor, + widget.primaryColor, + ], + stops: const [0, 0.3, 0.5, 0.7, 1], + ), + controllerValue: _controller.value, + showShimmerEffect: widget.showAnimation, + child: child, + ), + ); @override void dispose() { @@ -159,9 +154,10 @@ class _VxShimmer extends SingleChildRenderObjectWidget { @override _VxShimmerFilter createRenderObject(BuildContext context) => _VxShimmerFilter( - value: controllerValue, - gradient: gradient, - showAnimation: showShimmerEffect); + value: controllerValue, + gradient: gradient, + showAnimation: showShimmerEffect, + ); @override void updateRenderObject(BuildContext context, _VxShimmerFilter shimmer) { @@ -172,7 +168,7 @@ class _VxShimmer extends SingleChildRenderObjectWidget { class _VxShimmerFilter extends RenderProxyBox { _VxShimmerFilter({this.value, this.gradient, this.showAnimation}) - : gradientPaint = Paint()..blendMode = BlendMode.srcIn; + : gradientPaint = Paint()..blendMode = BlendMode.srcIn; /// Constructs an empty [Paint] object with all fields initialized to their defaults. final Paint initialPaint = Paint(); @@ -249,16 +245,15 @@ extension VxShimmerExtension on Widget { bool showGradient = false, Color primaryColor = Colors.grey, Color? secondaryColor, - }) => - VxShimmer( - key: key, - count: count, - duration: duration, - gradient: gradient, - primaryColor: primaryColor, - secondaryColor: secondaryColor, - showAnimation: showAnimation, - showGradient: showGradient, - child: this, - ); + }) => VxShimmer( + key: key, + count: count, + duration: duration, + gradient: gradient, + primaryColor: primaryColor, + secondaryColor: secondaryColor, + showAnimation: showAnimation, + showGradient: showGradient, + child: this, + ); } diff --git a/lib/src/flutter/sizedbox.dart b/lib/src/flutter/sizedbox.dart index c999ba64..20eb8816 100644 --- a/lib/src/flutter/sizedbox.dart +++ b/lib/src/flutter/sizedbox.dart @@ -85,191 +85,108 @@ extension VxSizedBoxExtension on Widget { ///All available widths /// /// [SizedBox] widget with a specified [width] - Widget w(double width, {Key? key}) => SizedBox( - key: key, - width: width, - child: this, - ); + Widget w(double width, {Key? key}) => + SizedBox(key: key, width: width, child: this); /// [SizedBox] widget with a specified [width] percentage - Widget wPCT({ - required BuildContext context, - required double widthPCT, - }) => - SizedBox( - key: key, - width: context.percentWidth * widthPCT, - child: this, - ); + Widget wPCT({required BuildContext context, required double widthPCT}) => + SizedBox(key: key, width: context.percentWidth * widthPCT, child: this); /// [SizedBox] widget with 0% [width] of the [MediaQuery] width - Widget w0(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 0, - child: this, - ); + Widget w0(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 0, child: this); /// [SizedBox] widget with 1% [width] of the [MediaQuery] width - Widget w1(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 1, - child: this, - ); + Widget w1(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 1, child: this); /// [SizedBox] widget with 2% [width] of the [MediaQuery] width - Widget w2(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 2, - child: this, - ); + Widget w2(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 2, child: this); /// [SizedBox] widget with 4% [width] of the [MediaQuery] width - Widget w4(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 4, - child: this, - ); + Widget w4(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 4, child: this); /// [SizedBox] widget with 8% [width] of the [MediaQuery] width - Widget w8(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 8, - child: this, - ); + Widget w8(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 8, child: this); /// [SizedBox] widget with 10% [width] of the [MediaQuery] width - Widget w10(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 10, - child: this, - ); + Widget w10(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 10, child: this); /// [SizedBox] widget with 15% [width] of the [MediaQuery] width - Widget w15(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 15, - child: this, - ); + Widget w15(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 15, child: this); /// [SizedBox] widget with 16% [width] of the [MediaQuery] width - Widget w16(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 16, - child: this, - ); + Widget w16(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 16, child: this); /// [SizedBox] widget with 20% [width] of the [MediaQuery] width - Widget w20(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 20, - child: this, - ); + Widget w20(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 20, child: this); /// [SizedBox] widget with 24% [width] of the [MediaQuery] width - Widget w24(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 24, - child: this, - ); + Widget w24(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 24, child: this); /// [SizedBox] widget with 32% [width] of the [MediaQuery] width - Widget w32(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 32, - child: this, - ); + Widget w32(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 32, child: this); /// [SizedBox] widget with 40% [width] of the [MediaQuery] width - Widget w40(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 40, - child: this, - ); + Widget w40(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 40, child: this); /// [SizedBox] widget with 48% [width] of the [MediaQuery] width - Widget w48(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 48, - child: this, - ); + Widget w48(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 48, child: this); /// [SizedBox] widget with 56% [width] of the [MediaQuery] width - Widget w56(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 56, - child: this, - ); + Widget w56(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 56, child: this); /// [SizedBox] widget with 60% [width] of the [MediaQuery] width - Widget w60(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 60, - child: this, - ); + Widget w60(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 60, child: this); /// [SizedBox] widget with 64% [width] of the [MediaQuery] width - Widget w64(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 64, - child: this, - ); + Widget w64(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 64, child: this); /// [SizedBox] widget with half or 50% [width] of the [MediaQuery] width - Widget wHalf(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 50, - child: this, - ); + Widget wHalf(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 50, child: this); /// [SizedBox] widget with one-third or 33.33% [width] of the [MediaQuery] width - Widget wOneThird(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 33.333333, - child: this, - ); + Widget wOneThird(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 33.333333, child: this); /// [SizedBox] widget with two-third or 66.67% [width] of the [MediaQuery] width - Widget wTwoThird(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 66.666667, - child: this, - ); + Widget wTwoThird(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 66.666667, child: this); /// [SizedBox] widget with one-forth or 25% [width] of the [MediaQuery] width - Widget wOneForth(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 25, - child: this, - ); + Widget wOneForth(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 25, child: this); /// [SizedBox] widget with three-forth or 75% [width] of the [MediaQuery] width - Widget wThreeForth(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 75, - child: this, - ); + Widget wThreeForth(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 75, child: this); /// [SizedBox] widget with four-fifth or 80% [width] of the [MediaQuery] width - Widget wFourFifth(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 80, - child: this, - ); + Widget wFourFifth(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.percentWidth * 80, child: this); /// [SizedBox] widget with full [width] of the [MediaQuery] width - Widget wFull(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.screenWidth, - child: this, - ); + Widget wFull(BuildContext context, {Key? key}) => + SizedBox(key: key, width: context.screenWidth, child: this); ///All available heights /// [SizedBox] widget with a specified [height] - Widget h(double height) => SizedBox( - key: key, - height: height, - child: this, - ); + Widget h(double height) => SizedBox(key: key, height: height, child: this); /// [SizedBox] widget with a specified [height] percentage Widget hPCT({required BuildContext context, required double heightPCT}) => @@ -280,407 +197,334 @@ extension VxSizedBoxExtension on Widget { ); /// [SizedBox] widget with 0% [height] of the [MediaQuery] height - Widget h0(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 0, - child: this, - ); + Widget h0(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 0, child: this); /// [SizedBox] widget with 1% [height] of the [MediaQuery] height - Widget h1(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 1, - child: this, - ); + Widget h1(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 1, child: this); /// [SizedBox] widget with 2% [height] of the [MediaQuery] height - Widget h2(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 2, - child: this, - ); + Widget h2(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 2, child: this); /// [SizedBox] widget with 4% [height] of the [MediaQuery] height - Widget h4(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 4, - child: this, - ); + Widget h4(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 4, child: this); /// [SizedBox] widget with 8% [height] of the [MediaQuery] height - Widget h8(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 8, - child: this, - ); + Widget h8(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 8, child: this); /// [SizedBox] widget with 10% [height] of the [MediaQuery] height - Widget h10(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 10, - child: this, - ); + Widget h10(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 10, child: this); /// [SizedBox] widget with 15% [height] of the [MediaQuery] height - Widget h15(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 15, - child: this, - ); + Widget h15(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 15, child: this); /// [SizedBox] widget with 16% [height] of the [MediaQuery] height - Widget h16(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 16, - child: this, - ); + Widget h16(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 16, child: this); /// [SizedBox] widget with 20% [height] of the [MediaQuery] height - Widget h20(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 20, - child: this, - ); + Widget h20(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 20, child: this); /// [SizedBox] widget with 24% [height] of the [MediaQuery] height - Widget h24(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 24, - child: this, - ); + Widget h24(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 24, child: this); /// [SizedBox] widget with 32% [height] of the [MediaQuery] height - Widget h32(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 32, - child: this, - ); + Widget h32(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 32, child: this); /// [SizedBox] widget with 40% [height] of the [MediaQuery] height - Widget h40(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 40, - child: this, - ); + Widget h40(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 40, child: this); /// [SizedBox] widget with 48% [height] of the [MediaQuery] height - Widget h48(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 48, - child: this, - ); + Widget h48(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 48, child: this); /// [SizedBox] widget with 56% [height] of the [MediaQuery] height - Widget h56(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 56, - child: this, - ); + Widget h56(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 56, child: this); /// [SizedBox] widget with 60% [height] of the [MediaQuery] height - Widget h60(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 60, - child: this, - ); + Widget h60(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 60, child: this); /// [SizedBox] widget with 64% [height] of the [MediaQuery] height - Widget h64(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 64, - child: this, - ); + Widget h64(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 64, child: this); /// [SizedBox] widget with half or 50% [height] of the [MediaQuery] height - Widget hHalf(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 50, - child: this, - ); + Widget hHalf(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 50, child: this); /// [SizedBox] widget with one-third or 33.33% [height] of the [MediaQuery] height Widget hOneThird(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 33.333333, - child: this, - ); + key: key, + height: context.percentHeight * 33.333333, + child: this, + ); /// [SizedBox] widget with two-third or 66.67% [height] of the [MediaQuery] height Widget hTwoThird(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 66.666667, - child: this, - ); + key: key, + height: context.percentHeight * 66.666667, + child: this, + ); /// [SizedBox] widget with one-forth or 25% [height] of the [MediaQuery] height - Widget hOneForth(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 25, - child: this, - ); + Widget hOneForth(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 25, child: this); /// [SizedBox] widget with three-forth or 75% [height] of the [MediaQuery] height - Widget hThreeForth(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 75, - child: this, - ); + Widget hThreeForth(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 75, child: this); /// [SizedBox] widget with four-fifth or 80% [height] of the [MediaQuery] height - Widget hFourFifth(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.percentHeight * 80, - child: this, - ); + Widget hFourFifth(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.percentHeight * 80, child: this); /// [SizedBox] widget with full [height] of the [MediaQuery] height - Widget hFull(BuildContext context, {Key? key}) => SizedBox( - key: key, - height: context.screenHeight, - child: this, - ); + Widget hFull(BuildContext context, {Key? key}) => + SizedBox(key: key, height: context.screenHeight, child: this); /// All Size Width - Height /// /// [SizedBox] widget with a specified [width] & [height] - Widget wh(double width, double height) => SizedBox( - key: key, - width: width, - height: height, - child: this, - ); + Widget wh(double width, double height) => + SizedBox(key: key, width: width, height: height, child: this); /// [SizedBox] widget with a specified [width] & [height] percentage - Widget whPCT( - {required BuildContext context, - required double widthPCT, - required double heightPCT}) => - SizedBox( - key: key, - width: context.percentWidth * widthPCT, - height: context.percentHeight * heightPCT, - child: this, - ); + Widget whPCT({ + required BuildContext context, + required double widthPCT, + required double heightPCT, + }) => SizedBox( + key: key, + width: context.percentWidth * widthPCT, + height: context.percentHeight * heightPCT, + child: this, + ); /// [SizedBox] widget with 0% [width] & [height] of the [MediaQuery] width & height Widget wh0(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 0, - height: context.percentHeight * 0, - child: this, - ); + key: key, + width: context.percentWidth * 0, + height: context.percentHeight * 0, + child: this, + ); /// [SizedBox] widget with 1% [width] & [height] of the [MediaQuery] width & height Widget wh1(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 1, - height: context.percentHeight * 1, - child: this, - ); + key: key, + width: context.percentWidth * 1, + height: context.percentHeight * 1, + child: this, + ); /// [SizedBox] widget with 2% [width] & [height] of the [MediaQuery] width & height Widget wh2(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 2, - height: context.percentHeight * 2, - child: this, - ); + key: key, + width: context.percentWidth * 2, + height: context.percentHeight * 2, + child: this, + ); /// [SizedBox] widget with 4% [width] & [height] of the [MediaQuery] width & height Widget wh4(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 4, - height: context.percentHeight * 4, - child: this, - ); + key: key, + width: context.percentWidth * 4, + height: context.percentHeight * 4, + child: this, + ); /// [SizedBox] widget with 8% [width] & [height] of the [MediaQuery] width & height Widget wh8(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 8, - height: context.percentHeight * 8, - child: this, - ); + key: key, + width: context.percentWidth * 8, + height: context.percentHeight * 8, + child: this, + ); /// [SizedBox] widget with 10% [width] & [height] of the [MediaQuery] width & height Widget wh10(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 10, - height: context.percentHeight * 10, - child: this, - ); + key: key, + width: context.percentWidth * 10, + height: context.percentHeight * 10, + child: this, + ); /// [SizedBox] widget with 15% [width] & [height] of the [MediaQuery] width & height Widget wh15(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 15, - height: context.percentHeight * 15, - child: this, - ); + key: key, + width: context.percentWidth * 15, + height: context.percentHeight * 15, + child: this, + ); /// [SizedBox] widget with 16% [width] & [height] of the [MediaQuery] width & height Widget wh16(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 16, - height: context.percentHeight * 16, - child: this, - ); + key: key, + width: context.percentWidth * 16, + height: context.percentHeight * 16, + child: this, + ); /// [SizedBox] widget with 20% [width] & [height] of the [MediaQuery] width & height Widget wh20(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 20, - height: context.percentHeight * 20, - child: this, - ); + key: key, + width: context.percentWidth * 20, + height: context.percentHeight * 20, + child: this, + ); /// [SizedBox] widget with 24% [width] & [height] of the [MediaQuery] width & height Widget wh24(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 24, - height: context.percentHeight * 24, - child: this, - ); + key: key, + width: context.percentWidth * 24, + height: context.percentHeight * 24, + child: this, + ); /// [SizedBox] widget with 32% [width] & [height] of the [MediaQuery] width & height Widget wh32(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 32, - height: context.percentHeight * 32, - child: this, - ); + key: key, + width: context.percentWidth * 32, + height: context.percentHeight * 32, + child: this, + ); /// [SizedBox] widget with 40% [width] & [height] of the [MediaQuery] width & height Widget wh40(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 40, - height: context.percentHeight * 40, - child: this, - ); + key: key, + width: context.percentWidth * 40, + height: context.percentHeight * 40, + child: this, + ); /// [SizedBox] widget with 48% [width] & [height] of the [MediaQuery] width & height Widget wh48(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 48, - height: context.percentHeight * 48, - child: this, - ); + key: key, + width: context.percentWidth * 48, + height: context.percentHeight * 48, + child: this, + ); /// [SizedBox] widget with 56% [width] & [height] of the [MediaQuery] width & height Widget wh56(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 56, - height: context.percentHeight * 56, - child: this, - ); + key: key, + width: context.percentWidth * 56, + height: context.percentHeight * 56, + child: this, + ); /// [SizedBox] widget with 60% [width] & [height] of the [MediaQuery] width & height Widget wh60(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 60, - height: context.percentHeight * 60, - child: this, - ); + key: key, + width: context.percentWidth * 60, + height: context.percentHeight * 60, + child: this, + ); /// [SizedBox] widget with 64% [width] & [height] of the [MediaQuery] width & height Widget wh64(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 64, - height: context.percentHeight * 64, - child: this, - ); + key: key, + width: context.percentWidth * 64, + height: context.percentHeight * 64, + child: this, + ); /// [SizedBox] widget with half or 50% [width] & [height] of the [MediaQuery] width & height Widget whHalf(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 50, - height: context.percentHeight * 50, - child: this, - ); + key: key, + width: context.percentWidth * 50, + height: context.percentHeight * 50, + child: this, + ); /// [SizedBox] widget with one-third or 33.33% [width] & [height] of the [MediaQuery] width & height Widget whOneThird(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 33.333333, - height: context.percentHeight * 33.333333, - child: this, - ); + key: key, + width: context.percentWidth * 33.333333, + height: context.percentHeight * 33.333333, + child: this, + ); /// [SizedBox] widget with two-third or 66.67% [width] & [height] of the [MediaQuery] width & height Widget whTwoThird(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 66.666667, - height: context.percentHeight * 66.666667, - child: this, - ); + key: key, + width: context.percentWidth * 66.666667, + height: context.percentHeight * 66.666667, + child: this, + ); /// [SizedBox] widget with one-forth or 25% [width] & [height] of the [MediaQuery] width & height Widget whOneForth(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 25, - height: context.percentHeight * 25, - child: this, - ); + key: key, + width: context.percentWidth * 25, + height: context.percentHeight * 25, + child: this, + ); /// [SizedBox] widget with three-forth or 75% [width] & [height] of the [MediaQuery] width & height Widget whThreeForth(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 75, - height: context.percentHeight * 75, - child: this, - ); + key: key, + width: context.percentWidth * 75, + height: context.percentHeight * 75, + child: this, + ); /// [SizedBox] widget with four-fifth or 80% [width] & [height] of the [MediaQuery] width & height Widget whFourFifth(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.percentWidth * 80, - height: context.percentHeight * 80, - child: this, - ); + key: key, + width: context.percentWidth * 80, + height: context.percentHeight * 80, + child: this, + ); /// [SizedBox] widget with full [width] & [height] of the [MediaQuery] width & height Widget whFull(BuildContext context, {Key? key}) => SizedBox( - key: key, - width: context.screenWidth, - height: context.screenHeight, - child: this, - ); + key: key, + width: context.screenWidth, + height: context.screenHeight, + child: this, + ); /// Extension for [FractionallySizedBox] - Widget fractionalBox( - {Key? key, - required double heightFactor, - required double widthFactor, - Alignment? alignment}) => - FractionallySizedBox( - key: key, - heightFactor: heightFactor, - widthFactor: widthFactor, - alignment: alignment ?? Alignment.center, - child: this, - ); + Widget fractionalBox({ + Key? key, + required double heightFactor, + required double widthFactor, + Alignment? alignment, + }) => FractionallySizedBox( + key: key, + heightFactor: heightFactor, + widthFactor: widthFactor, + alignment: alignment ?? Alignment.center, + child: this, + ); } /// /// [SizedBox] widget with specific [width] /// class WidthBox extends StatelessWidget { - const WidthBox( - this.width, { - super.key, - }); + const WidthBox(this.width, {super.key}); /// Give [width] of the [SizedBox] final double width; @override Widget build(BuildContext context) { - return SizedBox( - width: width, - key: key, - ); + return SizedBox(width: width, key: key); } } @@ -688,20 +532,14 @@ class WidthBox extends StatelessWidget { /// [SizedBox] widget with specific [height] /// class HeightBox extends StatelessWidget { - const HeightBox( - this.height, { - super.key, - }); + const HeightBox(this.height, {super.key}); /// Give [height] of the [SizedBox] final double height; @override Widget build(BuildContext context) { - return SizedBox( - height: height, - key: key, - ); + return SizedBox(height: height, key: key); } } @@ -709,19 +547,12 @@ class HeightBox extends StatelessWidget { /// [SizedBox] widget with equal [width] & [height] /// class SquareBox extends StatelessWidget { - const SquareBox( - this.size, { - super.key, - }); + const SquareBox(this.size, {super.key}); /// Give [size] of the [SizedBox] final double size; @override Widget build(BuildContext context) { - return SizedBox( - width: size, - height: size, - key: key, - ); + return SizedBox(width: size, height: size, key: key); } } diff --git a/lib/src/flutter/skeleton.dart b/lib/src/flutter/skeleton.dart index 4fee8c74..7385b2d5 100644 --- a/lib/src/flutter/skeleton.dart +++ b/lib/src/flutter/skeleton.dart @@ -16,10 +16,7 @@ import 'package:flutter/material.dart'; const int _kDefaultMS = 1000; -enum VxSkeletonAnimationType { - shimmer, - stretch, -} +enum VxSkeletonAnimationType { shimmer, stretch } /// To show skeleton with any widget. class VxSkeleton extends StatefulWidget { @@ -41,21 +38,22 @@ class VxSkeleton extends StatefulWidget { /// Required for stretch final double? stretchWidth; - const VxSkeleton( - {super.key, - this.shape, - this.padding, - this.color, - this.shimmerColor, - this.gradient, - this.width, - this.height, - this.margin, - this.borderRadius, - this.duration, - this.active = true, - this.type = VxSkeletonAnimationType.shimmer, - this.stretchWidth}); + const VxSkeleton({ + super.key, + this.shape, + this.padding, + this.color, + this.shimmerColor, + this.gradient, + this.width, + this.height, + this.margin, + this.borderRadius, + this.duration, + this.active = true, + this.type = VxSkeletonAnimationType.shimmer, + this.stretchWidth, + }); @override VxSkeletonState createState() => VxSkeletonState(); @@ -71,10 +69,7 @@ class VxSkeletonState extends State super.initState(); final Duration duration = widget.duration ?? const Duration(milliseconds: _kDefaultMS); - _controller = AnimationController( - vsync: this, - duration: duration, - ); + _controller = AnimationController(vsync: this, duration: duration); _setupAnimationAndStart(); } @@ -86,10 +81,7 @@ class VxSkeletonState extends State void _setupAnimationAndStart() { _animation = _genTween().animate( - CurvedAnimation( - curve: Curves.linear, - parent: _controller, - ), + CurvedAnimation(curve: Curves.linear, parent: _controller), ); if (widget.type == VxSkeletonAnimationType.shimmer) { @@ -104,10 +96,7 @@ class VxSkeletonState extends State Tween _genTween() { return (widget.type == VxSkeletonAnimationType.shimmer) ? Tween(begin: -1.0, end: 2.0) - : Tween( - begin: widget.width, - end: widget.stretchWidth, - ); + : Tween(begin: widget.width, end: widget.stretchWidth); } void _handleShimmerAnimationStatus(AnimationStatus status) { @@ -146,48 +135,48 @@ class VxSkeletonState extends State @override Widget build(BuildContext context) { return AnimatedBuilder( - animation: _animation, - builder: (context, child) { - final BoxShape shape = widget.shape ?? BoxShape.rectangle; - final Color color = widget.color ?? const Color(0xFFE8E8E8); - final Color shimmerColor = - widget.shimmerColor ?? const Color(0xFFEDEDED); - final Gradient? gradient = widget.gradient ?? - (widget.type == VxSkeletonAnimationType.shimmer - ? LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: [ - color, - shimmerColor.withAlpha(200), - color - ], - stops: [ - _animation.value - 0.4, - _animation.value, - _animation.value + 0.4 - ]) - : null); - - final double? width = widget.type == VxSkeletonAnimationType.shimmer - ? widget.width - : _animation.value; - final decColor = - widget.type == VxSkeletonAnimationType.stretch ? color : null; - - return Container( - decoration: BoxDecoration( - shape: shape, - borderRadius: widget.borderRadius, - color: decColor, - gradient: gradient, - ), - padding: widget.padding, - width: width, - height: widget.height, - margin: widget.margin, - ); - }); + animation: _animation, + builder: (context, child) { + final BoxShape shape = widget.shape ?? BoxShape.rectangle; + final Color color = widget.color ?? const Color(0xFFE8E8E8); + final Color shimmerColor = + widget.shimmerColor ?? const Color(0xFFEDEDED); + final Gradient? gradient = + widget.gradient ?? + (widget.type == VxSkeletonAnimationType.shimmer + ? LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [color, shimmerColor.withAlpha(200), color], + stops: [ + _animation.value - 0.4, + _animation.value, + _animation.value + 0.4, + ], + ) + : null); + + final double? width = widget.type == VxSkeletonAnimationType.shimmer + ? widget.width + : _animation.value; + final decColor = widget.type == VxSkeletonAnimationType.stretch + ? color + : null; + + return Container( + decoration: BoxDecoration( + shape: shape, + borderRadius: widget.borderRadius, + color: decColor, + gradient: gradient, + ), + padding: widget.padding, + width: width, + height: widget.height, + margin: widget.margin, + ); + }, + ); } @override @@ -202,35 +191,35 @@ extension VxSkeletonExtension on Widget { /// Extension method to directly access [VxSkeleton] with any widget without wrapping or with dot operator. /// /// show skeleton extension - Widget skeleton( - {Key? key, - BoxShape? shape, - EdgeInsetsGeometry? padding, - Color? color, - Color? shimmerColor, - Gradient? gradient, - double? width, - double? height, - EdgeInsetsGeometry? margin, - BorderRadiusGeometry? borderRadius, - Duration? duration, - bool active = true, - VxSkeletonAnimationType type = VxSkeletonAnimationType.shimmer, - double? stretchWidth}) => - VxSkeleton( - key: key, - active: active, - color: color, - gradient: gradient, - borderRadius: borderRadius, - duration: duration, - height: height, - margin: margin, - padding: padding, - shape: shape, - shimmerColor: shimmerColor, - stretchWidth: stretchWidth, - type: type, - width: width, - ); + Widget skeleton({ + Key? key, + BoxShape? shape, + EdgeInsetsGeometry? padding, + Color? color, + Color? shimmerColor, + Gradient? gradient, + double? width, + double? height, + EdgeInsetsGeometry? margin, + BorderRadiusGeometry? borderRadius, + Duration? duration, + bool active = true, + VxSkeletonAnimationType type = VxSkeletonAnimationType.shimmer, + double? stretchWidth, + }) => VxSkeleton( + key: key, + active: active, + color: color, + gradient: gradient, + borderRadius: borderRadius, + duration: duration, + height: height, + margin: margin, + padding: padding, + shape: shape, + shimmerColor: shimmerColor, + stretchWidth: stretchWidth, + type: type, + width: width, + ); } diff --git a/lib/src/flutter/stepper.dart b/lib/src/flutter/stepper.dart index 456cb41e..87daea72 100644 --- a/lib/src/flutter/stepper.dart +++ b/lib/src/flutter/stepper.dart @@ -46,8 +46,8 @@ class VxStepper extends StatefulWidget { this.inputTextColor, this.actionButtonColor, this.actionIconColor, - }) : assert(max >= min), - assert(step >= 1); + }) : assert(max >= min), + assert(step >= 1); @override VxStepperState createState() => VxStepperState(); @@ -63,8 +63,10 @@ class VxStepperState extends State { @override void initState() { super.initState(); - recordNumber = - math.min(widget.max, math.max(widget.defaultValue, widget.min)); + recordNumber = math.min( + widget.max, + math.max(widget.defaultValue, widget.min), + ); controller = TextEditingController(text: '$recordNumber'); controller!.addListener(valueChange); @@ -75,60 +77,64 @@ class VxStepperState extends State { Widget build(BuildContext context) { final List children = []; - children.add(SizedBox( - height: _kDefaultButtonSize, - width: _kDefaultButtonSize, - child: FilledButton( - style: FilledButton.styleFrom( - shape: const CircleBorder(), - backgroundColor: widget.actionButtonColor, - padding: EdgeInsets.zero, - ), - onPressed: enableMin ? onRemove : null, - child: Icon( - Icons.remove, - color: widget.actionIconColor, - size: _kDefaultTextFontSize, + children.add( + SizedBox( + height: _kDefaultButtonSize, + width: _kDefaultButtonSize, + child: FilledButton( + style: FilledButton.styleFrom( + shape: const CircleBorder(), + backgroundColor: widget.actionButtonColor, + padding: EdgeInsets.zero, + ), + onPressed: enableMin ? onRemove : null, + child: Icon( + Icons.remove, + color: widget.actionIconColor, + size: _kDefaultTextFontSize, + ), ), ), - )); + ); children.add(const SizedBox(width: _kDefaultSpace)); - children.add(TextField( - controller: controller, - textAlign: TextAlign.center, - enabled: !widget.disableInput, - style: TextStyle(color: widget.inputTextColor), - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp("[-0-9]")), - LengthLimitingTextInputFormatter(3), - ], - decoration: const InputDecoration( - border: InputBorder.none, - ), - onEditingComplete: inputComplete, - ).wh(_kDefaultButtonSize, _kDefaultButtonSize * 1.7)); + children.add( + TextField( + controller: controller, + textAlign: TextAlign.center, + enabled: !widget.disableInput, + style: TextStyle(color: widget.inputTextColor), + keyboardType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp("[-0-9]")), + LengthLimitingTextInputFormatter(3), + ], + decoration: const InputDecoration(border: InputBorder.none), + onEditingComplete: inputComplete, + ).wh(_kDefaultButtonSize, _kDefaultButtonSize * 1.7), + ); children.add(const SizedBox(width: _kDefaultSpace)); - children.add(SizedBox( - height: _kDefaultButtonSize, - width: _kDefaultButtonSize, - child: FilledButton( - style: FilledButton.styleFrom( - shape: const CircleBorder(), - backgroundColor: widget.actionButtonColor, - padding: EdgeInsets.zero, - ), - onPressed: enableMax ? onAdd : null, - child: Icon( - Icons.add, - color: widget.actionIconColor, - size: _kDefaultTextFontSize, + children.add( + SizedBox( + height: _kDefaultButtonSize, + width: _kDefaultButtonSize, + child: FilledButton( + style: FilledButton.styleFrom( + shape: const CircleBorder(), + backgroundColor: widget.actionButtonColor, + padding: EdgeInsets.zero, + ), + onPressed: enableMax ? onAdd : null, + child: Icon( + Icons.add, + color: widget.actionIconColor, + size: _kDefaultTextFontSize, + ), ), ), - )); + ); return Row( mainAxisSize: MainAxisSize.min, @@ -147,10 +153,7 @@ class VxStepperState extends State { void onRemove() { unFocus(); int number = getNumber(); - number = math.max( - widget.min, - number - widget.step, - ); + number = math.max(widget.min, number - widget.step); if (number != recordNumber) { updateControllerValue(number); } @@ -159,10 +162,7 @@ class VxStepperState extends State { void onAdd() { unFocus(); int number = getNumber(); - number = math.min( - widget.max, - number + widget.step, - ); + number = math.min(widget.max, number + widget.step); if (number != recordNumber) { updateControllerValue(number); } diff --git a/lib/src/flutter/swiper.dart b/lib/src/flutter/swiper.dart index f55bf289..d13d9c59 100644 --- a/lib/src/flutter/swiper.dart +++ b/lib/src/flutter/swiper.dart @@ -18,65 +18,65 @@ import 'package:flutter/material.dart'; /// Use this widget [VxSwiper] to give your list a swipeable effect with full customization. class VxSwiper extends StatefulWidget { - VxSwiper( - {super.key, - required List this.items, - this.height, - this.aspectRatio = 16 / 9, - this.viewportFraction = 0.8, - this.initialPage = 0, - int realPage = 10000, - this.enableInfiniteScroll = true, - this.reverse = false, - this.autoPlay = false, - this.autoPlayInterval = const Duration(seconds: 5), - this.autoPlayAnimationDuration = const Duration(milliseconds: 800), - this.autoPlayCurve = Curves.fastOutSlowIn, - this.pauseAutoPlayOnTouch, - this.enlargeCenterPage = false, - this.onPageChanged, - this.scrollPhysics, - this.isFastScrollingEnabled = false, - this.scrollDirection = Axis.horizontal}) - : realPage = enableInfiniteScroll ? realPage + initialPage : initialPage, - itemCount = items.length, - itemBuilder = null, - pageController = PageController( - viewportFraction: viewportFraction as double, - initialPage: enableInfiniteScroll - ? realPage + (initialPage as int) - : initialPage as int, - ); - - VxSwiper.builder( - {super.key, - required this.itemCount, - required this.itemBuilder, - this.height, - this.aspectRatio = 16 / 9, - this.viewportFraction = 0.8, - this.initialPage = 0, - int realPage = 10000, - this.enableInfiniteScroll = true, - this.reverse = false, - this.autoPlay = false, - this.autoPlayInterval = const Duration(seconds: 5), - this.autoPlayAnimationDuration = const Duration(milliseconds: 800), - this.autoPlayCurve = Curves.fastOutSlowIn, - this.pauseAutoPlayOnTouch, - this.enlargeCenterPage = false, - this.onPageChanged, - this.scrollPhysics, - this.isFastScrollingEnabled = false, - this.scrollDirection = Axis.horizontal}) - : realPage = enableInfiniteScroll ? realPage + initialPage : initialPage, - items = null, - pageController = PageController( - viewportFraction: viewportFraction as double, - initialPage: enableInfiniteScroll - ? realPage + (initialPage as int) - : initialPage as int, - ); + VxSwiper({ + super.key, + required List this.items, + this.height, + this.aspectRatio = 16 / 9, + this.viewportFraction = 0.8, + this.initialPage = 0, + int realPage = 10000, + this.enableInfiniteScroll = true, + this.reverse = false, + this.autoPlay = false, + this.autoPlayInterval = const Duration(seconds: 5), + this.autoPlayAnimationDuration = const Duration(milliseconds: 800), + this.autoPlayCurve = Curves.fastOutSlowIn, + this.pauseAutoPlayOnTouch, + this.enlargeCenterPage = false, + this.onPageChanged, + this.scrollPhysics, + this.isFastScrollingEnabled = false, + this.scrollDirection = Axis.horizontal, + }) : realPage = enableInfiniteScroll ? realPage + initialPage : initialPage, + itemCount = items.length, + itemBuilder = null, + pageController = PageController( + viewportFraction: viewportFraction as double, + initialPage: enableInfiniteScroll + ? realPage + (initialPage as int) + : initialPage as int, + ); + + VxSwiper.builder({ + super.key, + required this.itemCount, + required this.itemBuilder, + this.height, + this.aspectRatio = 16 / 9, + this.viewportFraction = 0.8, + this.initialPage = 0, + int realPage = 10000, + this.enableInfiniteScroll = true, + this.reverse = false, + this.autoPlay = false, + this.autoPlayInterval = const Duration(seconds: 5), + this.autoPlayAnimationDuration = const Duration(milliseconds: 800), + this.autoPlayCurve = Curves.fastOutSlowIn, + this.pauseAutoPlayOnTouch, + this.enlargeCenterPage = false, + this.onPageChanged, + this.scrollPhysics, + this.isFastScrollingEnabled = false, + this.scrollDirection = Axis.horizontal, + }) : realPage = enableInfiniteScroll ? realPage + initialPage : initialPage, + items = null, + pageController = PageController( + viewportFraction: viewportFraction as double, + initialPage: enableInfiniteScroll + ? realPage + (initialPage as int) + : initialPage as int, + ); /// The widgets to be shown in the carousel of default constructor final List? items; @@ -195,8 +195,10 @@ class VxSwiper extends StatefulWidget { /// /// The animation lasts for the given duration and follows the given curve. /// The returned [Future] resolves when the animation completes. - Future previousPage( - {required Duration duration, required Curve curve}) { + Future previousPage({ + required Duration duration, + required Curve curve, + }) { return pageController.previousPage(duration: duration, curve: curve); } @@ -206,23 +208,34 @@ class VxSwiper extends StatefulWidget { /// without animation, and without checking if the new value is in range. void jumpToPage(int page) { final index = _getRealIndex( - pageController.page!.toInt(), realPage - initialPage as int, itemCount); - return pageController - .jumpToPage(pageController.page!.toInt() + page - index); + pageController.page!.toInt(), + realPage - initialPage as int, + itemCount, + ); + return pageController.jumpToPage( + pageController.page!.toInt() + page - index, + ); } /// Animates the controlled [VxSwiper] from the current page to the given page. /// /// The animation lasts for the given duration and follows the given curve. /// The returned [Future] resolves when the animation completes. - Future animateToPage(int page, - {required Duration duration, required Curve curve}) { + Future animateToPage( + int page, { + required Duration duration, + required Curve curve, + }) { final index = _getRealIndex( - pageController.page!.toInt(), realPage - initialPage as int, itemCount); + pageController.page!.toInt(), + realPage - initialPage as int, + itemCount, + ); return pageController.animateToPage( - pageController.page!.toInt() + page - index, - duration: duration, - curve: curve); + pageController.page!.toInt() + page - index, + duration: duration, + curve: curve, + ); } @override @@ -242,8 +255,9 @@ class VxSwiperState extends State with TickerProviderStateMixin { return widget.autoPlay ? Timer.periodic(widget.autoPlayInterval, (_) { widget.pageController.nextPage( - duration: widget.autoPlayAnimationDuration, - curve: widget.autoPlayCurve); + duration: widget.autoPlayAnimationDuration, + curve: widget.autoPlayCurve, + ); }) : null; } @@ -259,28 +273,31 @@ class VxSwiperState extends State with TickerProviderStateMixin { int? t; //Tid late double p; //Position return Listener( - onPointerMove: (pos) { - //Get pointer position when pointer moves - //If time since last scroll is undefined or over 100 milliseconds - if (t == null || DateTime.now().millisecondsSinceEpoch - t! > 100) { - t = DateTime.now().millisecondsSinceEpoch; - p = pos.position.dx; //x position - } else { - //Calculate velocity - final double v = (p - pos.position.dx) / - (DateTime.now().millisecondsSinceEpoch - t!); - if (v < -2 || v > 2) { - final vx = (v * 1.2).isFinite ? (v * 1.2).round() : 0; - //Don't run if velocity is to low - //Move to page based on velocity (increase velocity multiplier to scroll further) - widget.pageController.animateToPage( - widget.pageController.page!.toInt() + vx, - duration: const Duration(milliseconds: 400), - curve: Curves.easeOutCubic); - } + onPointerMove: (pos) { + //Get pointer position when pointer moves + //If time since last scroll is undefined or over 100 milliseconds + if (t == null || DateTime.now().millisecondsSinceEpoch - t! > 100) { + t = DateTime.now().millisecondsSinceEpoch; + p = pos.position.dx; //x position + } else { + //Calculate velocity + final double v = + (p - pos.position.dx) / + (DateTime.now().millisecondsSinceEpoch - t!); + if (v < -2 || v > 2) { + final vx = (v * 1.2).isFinite ? (v * 1.2).round() : 0; + //Don't run if velocity is to low + //Move to page based on velocity (increase velocity multiplier to scroll further) + widget.pageController.animateToPage( + widget.pageController.page!.toInt() + vx, + duration: const Duration(milliseconds: 400), + curve: Curves.easeOutCubic, + ); } - }, - child: child); + } + }, + child: child, + ); } Widget getWrapper(Widget child) { @@ -289,16 +306,18 @@ class VxSwiperState extends State with TickerProviderStateMixin { return widget.autoPlay && widget.pauseAutoPlayOnTouch != null ? addGestureDetection(wrapper) : (widget.isFastScrollingEnabled - ? fastScrollWidget(wrapper) - : wrapper); + ? fastScrollWidget(wrapper) + : wrapper); } else { - final Widget wrapper = - AspectRatio(aspectRatio: widget.aspectRatio, child: child); + final Widget wrapper = AspectRatio( + aspectRatio: widget.aspectRatio, + child: child, + ); return widget.autoPlay && widget.pauseAutoPlayOnTouch != null ? addGestureDetection(wrapper) : (widget.isFastScrollingEnabled - ? fastScrollWidget(wrapper) - : wrapper); + ? fastScrollWidget(wrapper) + : wrapper); } } @@ -313,76 +332,90 @@ class VxSwiperState extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { - return getWrapper(PageView.builder( - physics: widget.isFastScrollingEnabled - ? const ClampingScrollPhysics() - : widget.scrollPhysics, - scrollDirection: widget.scrollDirection, - controller: widget.pageController, - reverse: widget.reverse, - itemCount: widget.enableInfiniteScroll ? null : widget.itemCount, - onPageChanged: (int index) { - final int currentPage = _getRealIndex( + return getWrapper( + PageView.builder( + physics: widget.isFastScrollingEnabled + ? const ClampingScrollPhysics() + : widget.scrollPhysics, + scrollDirection: widget.scrollDirection, + controller: widget.pageController, + reverse: widget.reverse, + itemCount: widget.enableInfiniteScroll ? null : widget.itemCount, + onPageChanged: (int index) { + final int currentPage = _getRealIndex( index + (widget.initialPage as int), widget.realPage as int, - widget.itemCount); - if (widget.onPageChanged != null) { - widget.onPageChanged!(currentPage); - } - }, - itemBuilder: (BuildContext context, int i) { - final int index = _getRealIndex(i + (widget.initialPage as int), - widget.realPage as int, widget.itemCount); - - return AnimatedBuilder( - animation: widget.pageController, - child: (widget.items != null) - ? widget.items![index] - : widget.itemBuilder!(context, index), - builder: (BuildContext context, child) { - double? distortionValue = 1.0; - // if `enlargeCenterPage` is true, we must calculate the carousel item's height - // to display the visual effect - if (widget.enlargeCenterPage != null && - widget.enlargeCenterPage == true) { - double itemOffset; - // pageController.page can only be accessed after the first build, - // so in the first build we calculate the itemoffset manually - try { - itemOffset = widget.pageController.page! - i; - } catch (e) { - final BuildContext storageContext = - widget.pageController.position.context.storageContext; - final double? previousSavedPosition = - PageStorage.of(storageContext).readState(storageContext) - as double?; - if (previousSavedPosition != null) { - itemOffset = previousSavedPosition - i.toDouble(); - } else { - itemOffset = widget.realPage.toDouble() - i.toDouble(); + widget.itemCount, + ); + if (widget.onPageChanged != null) { + widget.onPageChanged!(currentPage); + } + }, + itemBuilder: (BuildContext context, int i) { + final int index = _getRealIndex( + i + (widget.initialPage as int), + widget.realPage as int, + widget.itemCount, + ); + + return AnimatedBuilder( + animation: widget.pageController, + child: (widget.items != null) + ? widget.items![index] + : widget.itemBuilder!(context, index), + builder: (BuildContext context, child) { + double? distortionValue = 1.0; + // if `enlargeCenterPage` is true, we must calculate the carousel item's height + // to display the visual effect + if (widget.enlargeCenterPage != null && + widget.enlargeCenterPage == true) { + double itemOffset; + // pageController.page can only be accessed after the first build, + // so in the first build we calculate the itemoffset manually + try { + itemOffset = widget.pageController.page! - i; + } catch (e) { + final BuildContext storageContext = + widget.pageController.position.context.storageContext; + final double? previousSavedPosition = + PageStorage.of(storageContext).readState(storageContext) + as double?; + if (previousSavedPosition != null) { + itemOffset = previousSavedPosition - i.toDouble(); + } else { + itemOffset = widget.realPage.toDouble() - i.toDouble(); + } } + final distortionRatio = (1 - (itemOffset.abs() * 0.3)).clamp( + 0.0, + 1.0, + ); + distortionValue = Curves.easeOut.transform(distortionRatio); } - final distortionRatio = - (1 - (itemOffset.abs() * 0.3)).clamp(0.0, 1.0); - distortionValue = Curves.easeOut.transform(distortionRatio); - } - final double height = widget.height ?? - MediaQuery.sizeOf(context).width * (1 / widget.aspectRatio); - - if (widget.scrollDirection == Axis.horizontal) { - return Center( - child: - SizedBox(height: distortionValue * height, child: child)); - } else { - return Center( + final double height = + widget.height ?? + MediaQuery.sizeOf(context).width * (1 / widget.aspectRatio); + + if (widget.scrollDirection == Axis.horizontal) { + return Center( child: SizedBox( - width: distortionValue * MediaQuery.sizeOf(context).width, - child: child)); - } - }, - ); - }, - )); + height: distortionValue * height, + child: child, + ), + ); + } else { + return Center( + child: SizedBox( + width: distortionValue * MediaQuery.sizeOf(context).width, + child: child, + ), + ); + } + }, + ); + }, + ), + ); } } diff --git a/lib/src/flutter/switcher.dart b/lib/src/flutter/switcher.dart index e9e7e283..90beffac 100644 --- a/lib/src/flutter/switcher.dart +++ b/lib/src/flutter/switcher.dart @@ -90,11 +90,12 @@ class VxStateSwitcherState extends State { } return getStatePage( placeholder: ElevatedButton( - onPressed: () { - setState(() => _pageState = VxPageState.loading); - widget.onRetry?.call(); - }, - child: const Text("Retry")), + onPressed: () { + setState(() => _pageState = VxPageState.loading); + widget.onRetry?.call(); + }, + child: const Text("Retry"), + ), text: "Nothing to show", ); @@ -106,11 +107,12 @@ class VxStateSwitcherState extends State { return getStatePage( text: "Some error occured, please try again", placeholder: ElevatedButton( - onPressed: () { - setState(() => _pageState = VxPageState.loading); - widget.onRetry?.call(); - }, - child: const Text("Retry")), + onPressed: () { + setState(() => _pageState = VxPageState.loading); + widget.onRetry?.call(); + }, + child: const Text("Retry"), + ), ); /// Normal content page @@ -122,10 +124,7 @@ class VxStateSwitcherState extends State { /// Loading Widget _getIndicator(BuildContext context) { return Theme.of(context).platform == TargetPlatform.iOS - ? const CupertinoActivityIndicator( - animating: true, - radius: 16.0, - ) + ? const CupertinoActivityIndicator(animating: true, radius: 16.0) : CircularProgressIndicator( strokeWidth: 2.0, valueColor: AlwaysStoppedAnimation(Theme.of(context).primaryColor), @@ -138,10 +137,7 @@ class VxStateSwitcherState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - text, - style: const TextStyle(fontSize: 16), - ), + Text(text, style: const TextStyle(fontSize: 16)), const SizedBox(height: 15), placeholder!, ], @@ -154,10 +150,7 @@ class VxStateSwitcherState extends State { class VxSwitcher extends StatelessWidget { final Widget child; - const VxSwitcher({ - super.key, - required this.child, - }); + const VxSwitcher({super.key, required this.child}); @override Widget build(BuildContext context) { diff --git a/lib/src/flutter/table.dart b/lib/src/flutter/table.dart index 1975168c..59e07a95 100644 --- a/lib/src/flutter/table.dart +++ b/lib/src/flutter/table.dart @@ -18,14 +18,15 @@ import 'velocityx_mixins/color_mixin.dart'; /// A widget that uses the table layout algorithm for its children. class VxTable extends VxWidgetBuilder with VxColorMixin { - VxTable( - {this.tableBorder, - this.columnWidths, - this.defaultColumnWidth = const FlexColumnWidth(1.0), - this.defaultVerticalAlignment = TableCellVerticalAlignment.top, - this.textBaseline, - this.textDirection, - this.children = const []}) { + VxTable({ + this.tableBorder, + this.columnWidths, + this.defaultColumnWidth = const FlexColumnWidth(1.0), + this.defaultVerticalAlignment = TableCellVerticalAlignment.top, + this.textBaseline, + this.textDirection, + this.children = const [], + }) { setChildToColor(this); } @@ -43,16 +44,15 @@ class VxTable extends VxWidgetBuilder with VxColorMixin { } VxTable get simpleBorder { - tableBorder = TableBorder.all( - color: velocityColor ?? Colors.black, - ); + tableBorder = TableBorder.all(color: velocityColor ?? Colors.black); return this; } VxTable get roundedBorder { tableBorder = TableBorder.all( - color: velocityColor ?? Colors.black, - borderRadius: BorderRadius.circular(8.0)); + color: velocityColor ?? Colors.black, + borderRadius: BorderRadius.circular(8.0), + ); return this; } @@ -62,21 +62,28 @@ class VxTable extends VxWidgetBuilder with VxColorMixin { } VxTable withFlexFactor(double flexFactor) { - columnWidths = children.asMap().map((key, value) => - MapEntry(key, FlexColumnWidth(flexFactor))); + columnWidths = children.asMap().map( + (key, value) => + MapEntry(key, FlexColumnWidth(flexFactor)), + ); return this; } VxTable withFixedFactor(double fixedFactor) { - columnWidths = children.asMap().map((key, value) => - MapEntry(key, FixedColumnWidth(fixedFactor))); + columnWidths = children.asMap().map( + (key, value) => + MapEntry(key, FixedColumnWidth(fixedFactor)), + ); return this; } VxTable withIntrinsicFactor(double intrinsicFactor) { - columnWidths = children.asMap().map((key, value) => - MapEntry( - key, IntrinsicColumnWidth(flex: intrinsicFactor))); + columnWidths = children.asMap().map( + (key, value) => MapEntry( + key, + IntrinsicColumnWidth(flex: intrinsicFactor), + ), + ); return this; } diff --git a/lib/src/flutter/text.dart b/lib/src/flutter/text.dart index ffe41c09..04ff8961 100644 --- a/lib/src/flutter/text.dart +++ b/lib/src/flutter/text.dart @@ -373,8 +373,10 @@ class VxTextBuilder extends VxWidgetBuilder VxTextBuilder scale(double value) => _fontSizedText(child: this, scaleFactor: value); - VxTextBuilder _fontSizedText( - {required double scaleFactor, required VxTextBuilder child}) { + VxTextBuilder _fontSizedText({ + required double scaleFactor, + required VxTextBuilder child, + }) { _fontSize = _fontSize ?? 14.0; _scaleFactor = scaleFactor; return this; @@ -476,11 +478,14 @@ class VxTextBuilder extends VxWidgetBuilder /// Sets [Shadow] as specified in request *#127* VxTextBuilder shadow( - double offsetX, double offsetY, double blurRadius, Color color) => - this - .._shadowBlur = blurRadius - .._shadowColor = color - .._shadowOffset = Offset(offsetX, offsetY); + double offsetX, + double offsetY, + double blurRadius, + Color color, + ) => this + .._shadowBlur = blurRadius + .._shadowColor = color + .._shadowOffset = Offset(offsetX, offsetY); /// Sets [Shadow] blur VxTextBuilder shadowBlur(double blur) => this.._shadowBlur = blur; @@ -499,21 +504,25 @@ class VxTextBuilder extends VxWidgetBuilder } final sdw = [ Shadow( - blurRadius: _shadowBlur, color: _shadowColor, offset: _shadowOffset) + blurRadius: _shadowBlur, + color: _shadowColor, + offset: _shadowOffset, + ), ]; final ts = TextStyle( - color: velocityColor, - fontSize: _fontSize, - fontStyle: _fontStyle, - fontFamily: _fontFamily, - fontWeight: _fontWeight, - letterSpacing: _letterSpacing, - decoration: _decoration, - height: _lineHeight, - textBaseline: _textBaseline ?? TextBaseline.alphabetic, - wordSpacing: _wordSpacing, - shadows: _shadowBlur > 0 ? sdw : null); + color: velocityColor, + fontSize: _fontSize, + fontStyle: _fontStyle, + fontFamily: _fontFamily, + fontWeight: _fontWeight, + letterSpacing: _letterSpacing, + decoration: _decoration, + height: _lineHeight, + textBaseline: _textBaseline ?? TextBaseline.alphabetic, + wordSpacing: _wordSpacing, + shadows: _shadowBlur > 0 ? sdw : null, + ); final textWidget = _isIntrinsic ? Text( @@ -521,8 +530,9 @@ class VxTextBuilder extends VxWidgetBuilder key: key, textAlign: _textAlign, maxLines: _maxLines, - textScaler: - _scaleFactor == null ? null : TextScaler.linear(_scaleFactor!), + textScaler: _scaleFactor == null + ? null + : TextScaler.linear(_scaleFactor!), style: _themedStyle?.merge(ts) ?? _textStyle?.merge(ts) ?? ts, softWrap: _softWrap ?? true, overflow: _overflow ?? TextOverflow.clip, diff --git a/lib/src/flutter/textfield.dart b/lib/src/flutter/textfield.dart index 1263b788..eb7bf722 100644 --- a/lib/src/flutter/textfield.dart +++ b/lib/src/flutter/textfield.dart @@ -200,14 +200,12 @@ class VxTextFieldState extends State { // Clear Button if (widget.clear && focusNode!.hasFocus && (tempValue.isNotEmpty)) { - children.add(GestureDetector( - onTap: clear, - child: Icon( - Icons.clear, - size: tempSize, - color: tempColor, + children.add( + GestureDetector( + onTap: clear, + child: Icon(Icons.clear, size: tempSize, color: tempColor), ), - )); + ); } // Password Button @@ -215,14 +213,16 @@ class VxTextFieldState extends State { if (children.isNotEmpty) { children.add(const SizedBox(width: 8)); } - children.add(GestureDetector( - onTap: togglePwd, - child: Icon( - obscureText ? Icons.visibility : Icons.visibility_off, - size: tempSize, - color: tempColor, + children.add( + GestureDetector( + onTap: togglePwd, + child: Icon( + obscureText ? Icons.visibility : Icons.visibility_off, + size: tempSize, + color: tempColor, + ), ), - )); + ); } if (children.isNotEmpty) { @@ -284,7 +284,8 @@ class VxTextFieldState extends State { } } else if (widget.borderType == VxTextFieldBorderType.underLine) { return UnderlineInputBorder( - borderSide: BorderSide(color: tempColor, width: 1)); + borderSide: BorderSide(color: tempColor, width: 1), + ); } return null; } diff --git a/lib/src/flutter/theme.dart b/lib/src/flutter/theme.dart index c8f30fa8..6557a118 100644 --- a/lib/src/flutter/theme.dart +++ b/lib/src/flutter/theme.dart @@ -21,24 +21,16 @@ extension VxThemeExtension on Widget { /// /// Extension method to directly access dark [Theme] with any widget without wrapping or with dot operator. /// - Theme darkTheme({Key? key}) => Theme( - data: ThemeData.dark(), - child: this, - ); + Theme darkTheme({Key? key}) => Theme(data: ThemeData.dark(), child: this); /// /// Extension method to directly access light [Theme] with any widget without wrapping or with dot operator. /// - Theme lightTheme({Key? key}) => Theme( - data: ThemeData.light(), - child: this, - ); + Theme lightTheme({Key? key}) => Theme(data: ThemeData.light(), child: this); /// /// Extension method to directly access [Theme] with custom [ThemeData] with any widget without wrapping or with dot operator. /// - Theme customTheme({Key? key, required ThemeData? themeData}) => Theme( - data: themeData!, - child: this, - ); + Theme customTheme({Key? key, required ThemeData? themeData}) => + Theme(data: themeData!, child: this); } diff --git a/lib/src/flutter/timeline/timeline_painter.dart b/lib/src/flutter/timeline/timeline_painter.dart index e75d30f1..618f862c 100644 --- a/lib/src/flutter/timeline/timeline_painter.dart +++ b/lib/src/flutter/timeline/timeline_painter.dart @@ -23,20 +23,20 @@ class VxTimelinePainter extends CustomPainter { final Animation controller; final Animation height; - VxTimelinePainter( - {required this.lineColor, - required this.backgroundColor, - required this.trailingColor, - this.firstElement = false, - this.lastElement = false, - required this.controller}) - : height = Tween(begin: 0.0, end: 1.0).animate( - CurvedAnimation( - parent: controller, - curve: const Interval(0.45, 1.0, curve: Curves.ease), - ), - ), - super(repaint: controller); + VxTimelinePainter({ + required this.lineColor, + required this.backgroundColor, + required this.trailingColor, + this.firstElement = false, + this.lastElement = false, + required this.controller, + }) : height = Tween(begin: 0.0, end: 1.0).animate( + CurvedAnimation( + parent: controller, + curve: const Interval(0.45, 1.0, curve: Curves.ease), + ), + ), + super(repaint: controller); @override void paint(Canvas canvas, Size size) { @@ -55,19 +55,25 @@ class VxTimelinePainter extends CustomPainter { final Offset offsetCenter = size.center(const Offset(0.0, -4.0)); final Offset offsetBottom = size.bottomCenter(const Offset(0.0, 0.0)); final Offset renderOffset = Offset( - offsetBottom.dx, offsetBottom.dy * (0.5 + (controller.value / 2))); + offsetBottom.dx, + offsetBottom.dy * (0.5 + (controller.value / 2)), + ); canvas.drawLine(offsetCenter, renderOffset, lineStroke); } else if (lastElement) { final Offset offsetTopCenter = size.topCenter(const Offset(0.0, 0.0)); final Offset offsetCenter = size.center(const Offset(0.0, -4.0)); - final Offset renderOffset = - Offset(offsetCenter.dx, offsetCenter.dy * controller.value); + final Offset renderOffset = Offset( + offsetCenter.dx, + offsetCenter.dy * controller.value, + ); canvas.drawLine(offsetTopCenter, renderOffset, lineStroke); } else { final Offset offsetTopCenter = size.topCenter(const Offset(0.0, 0.0)); final Offset offsetBottom = size.bottomCenter(const Offset(0.0, 0.0)); - final Offset renderOffset = - Offset(offsetBottom.dx, offsetBottom.dy * controller.value); + final Offset renderOffset = Offset( + offsetBottom.dx, + offsetBottom.dy * controller.value, + ); canvas.drawLine(offsetTopCenter, renderOffset, lineStroke); } diff --git a/lib/src/flutter/timeline/timeline_view.dart b/lib/src/flutter/timeline/timeline_view.dart index 0f8cca80..3c02209e 100644 --- a/lib/src/flutter/timeline/timeline_view.dart +++ b/lib/src/flutter/timeline/timeline_view.dart @@ -20,19 +20,20 @@ import 'timeline_painter.dart'; /// To show a timeline view with filled dot and title, subtitle. class VxTimelineView extends StatelessWidget { - const VxTimelineView( - {super.key, - required this.lineColor, - required this.backgroundColor, - required this.trailingColor, - required this.model, - this.firstElement = false, - this.lastElement = false, - this.controller, - this.headingColor, - this.descriptionColor, - this.hideLauncher = true, - this.trailing}); + const VxTimelineView({ + super.key, + required this.lineColor, + required this.backgroundColor, + required this.trailingColor, + required this.model, + this.firstElement = false, + this.lastElement = false, + this.controller, + this.headingColor, + this.descriptionColor, + this.hideLauncher = true, + this.trailing, + }); final Color lineColor; final Color backgroundColor; final Color trailingColor; @@ -50,12 +51,13 @@ class VxTimelineView extends StatelessWidget { width: 40.0, child: CustomPaint( painter: VxTimelinePainter( - lineColor: lineColor, - backgroundColor: backgroundColor, - trailingColor: trailingColor, - firstElement: firstElement, - lastElement: lastElement, - controller: controller!), + lineColor: lineColor, + backgroundColor: backgroundColor, + trailingColor: trailingColor, + firstElement: firstElement, + lastElement: lastElement, + controller: controller!, + ), ), ); } @@ -71,9 +73,7 @@ class VxTimelineView extends StatelessWidget { model.heading.length > 47 ? "${model.heading.substring(0, 47)}..." : model.heading, - style: TextStyle( - color: headingColor ?? Colors.black, - ), + style: TextStyle(color: headingColor ?? Colors.black), ), ), Expanded( @@ -81,13 +81,11 @@ class VxTimelineView extends StatelessWidget { model.description.length > 50 ? "${model.description.substring(0, 50)}..." : model - .description, // To prevent overflowing of text to the next element, the text is truncated if greater than 75 characters - style: TextStyle( - color: descriptionColor ?? Colors.black, - ), + .description, // To prevent overflowing of text to the next element, the text is truncated if greater than 75 characters + style: TextStyle(color: descriptionColor ?? Colors.black), textScaler: const TextScaler.linear(1.25), ), - ) + ), ], ); } @@ -98,25 +96,17 @@ class VxTimelineView extends StatelessWidget { color: backgroundColor, padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 0.0), child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - AnimatedBuilder( - builder: _buildLine, - animation: controller!, - ), - Expanded( - child: _buildContentColumn(context), - ), - if (!hideLauncher) - if (trailing != null) - trailing! - else - Icon( - Icons.open_in_new, - color: trailingColor, - size: 20, - ) - ]), + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + AnimatedBuilder(builder: _buildLine, animation: controller!), + Expanded(child: _buildContentColumn(context)), + if (!hideLauncher) + if (trailing != null) + trailing! + else + Icon(Icons.open_in_new, color: trailingColor, size: 20), + ], + ), ); } diff --git a/lib/src/flutter/timeline/timeline_widget.dart b/lib/src/flutter/timeline/timeline_widget.dart index bc88fd6e..0372a010 100644 --- a/lib/src/flutter/timeline/timeline_widget.dart +++ b/lib/src/flutter/timeline/timeline_widget.dart @@ -20,18 +20,19 @@ class VxTimeline extends StatefulWidget { final bool showTrailing; final Widget? customTrailing; - const VxTimeline( - {super.key, - required this.timelineList, - this.lineColor, - this.backgroundColor, - this.trailingColor, - this.headingColor, - this.descriptionColor, - this.onItemTap, - this.animationDuration, - this.showTrailing = false, - this.customTrailing}); + const VxTimeline({ + super.key, + required this.timelineList, + this.lineColor, + this.backgroundColor, + this.trailingColor, + this.headingColor, + this.descriptionColor, + this.onItemTap, + this.animationDuration, + this.showTrailing = false, + this.customTrailing, + }); @override VxTimelineState createState() { @@ -49,9 +50,9 @@ class VxTimelineState extends State void initState() { super.initState(); controller = AnimationController( - duration: - widget.animationDuration ?? const Duration(milliseconds: 1000), - vsync: this); + duration: widget.animationDuration ?? const Duration(milliseconds: 1000), + vsync: this, + ); controller!.forward(); } @@ -67,7 +68,8 @@ class VxTimelineState extends State child: VxTimelineView( lineColor: widget.lineColor ?? Theme.of(context).colorScheme.secondary, - backgroundColor: widget.backgroundColor ?? + backgroundColor: + widget.backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, trailingColor: widget.trailingColor ?? Theme.of(context).colorScheme.secondary, @@ -77,7 +79,8 @@ class VxTimelineState extends State controller: controller, headingColor: widget.headingColor ?? Theme.of(context).colorScheme.onSurface, - descriptionColor: widget.descriptionColor ?? + descriptionColor: + widget.descriptionColor ?? Theme.of(context).colorScheme.onSurface, hideLauncher: !widget.showTrailing, trailing: widget.customTrailing, diff --git a/lib/src/flutter/toast.dart b/lib/src/flutter/toast.dart index 3f28d95c..ce9c25c2 100644 --- a/lib/src/flutter/toast.dart +++ b/lib/src/flutter/toast.dart @@ -18,16 +18,9 @@ import 'package:flutter/material.dart'; import 'package:velocity_x/src/extensions/context_ext.dart'; /// Toast position -enum VxToastPosition { - top, - center, - bottom, -} +enum VxToastPosition { top, center, bottom } -enum VxToastType { - text, - loading, -} +enum VxToastType { text, loading } mixin VxToast { static void show( @@ -97,17 +90,18 @@ Function _showToast( final GlobalKey<_VxToastViewState> key = GlobalKey(); final OverlayEntry overlayEntry = OverlayEntry( - builder: (BuildContext context) => _VxToastView( - msg, - key: key, - bgColor: bgColor, - textColor: textColor, - textSize: textSize, - toastPosition: position, - pdHorizontal: pdHorizontal, - pdVertical: pdVertical, - type: type, - )); + builder: (BuildContext context) => _VxToastView( + msg, + key: key, + bgColor: bgColor, + textColor: textColor, + textSize: textSize, + toastPosition: position, + pdHorizontal: pdHorizontal, + pdVertical: pdVertical, + type: type, + ), + ); /// Inserting the overlay entry to the state overlayState.insert(overlayEntry); @@ -198,10 +192,7 @@ class _VxToastViewState extends State<_VxToastView> widget.type == VxToastType.loading) { return toastView; } - return Positioned( - top: buildToastPosition(context), - child: toastView, - ); + return Positioned(top: buildToastPosition(context), child: toastView); } /// Building the toast widget @@ -252,7 +243,7 @@ class _VxToastViewState extends State<_VxToastView> color: widget.textColor ?? context.textTheme.bodyLarge!.color, ), - ) + ), ], ), ), @@ -309,16 +300,17 @@ extension VxToastExtension on BuildContext { VxToastPosition position = VxToastPosition.bottom, double pdHorizontal = 20, double pdVertical = 10, - }) => - VxToast.show(this, - msg: msg, - bgColor: bgColor, - pdHorizontal: pdHorizontal, - pdVertical: pdVertical, - position: position, - showTime: showTime, - textColor: textColor, - textSize: textSize); + }) => VxToast.show( + this, + msg: msg, + bgColor: bgColor, + pdHorizontal: pdHorizontal, + pdVertical: pdVertical, + position: position, + showTime: showTime, + textColor: textColor, + textSize: textSize, + ); /// Show loading dialog Function showLoading({ @@ -328,12 +320,13 @@ extension VxToastExtension on BuildContext { double textSize = 14, double pdHorizontal = 20, double pdVertical = 10, - }) => - VxToast.showLoading(this, - msg: msg, - bgColor: bgColor, - pdHorizontal: pdHorizontal, - pdVertical: pdVertical, - textColor: textColor, - textSize: textSize); + }) => VxToast.showLoading( + this, + msg: msg, + bgColor: bgColor, + pdHorizontal: pdHorizontal, + pdVertical: pdVertical, + textColor: textColor, + textSize: textSize, + ); } diff --git a/lib/src/flutter/transform.dart b/lib/src/flutter/transform.dart index ae3adaa5..a6331bdc 100644 --- a/lib/src/flutter/transform.dart +++ b/lib/src/flutter/transform.dart @@ -23,16 +23,17 @@ typedef VxToggleBuilder = Widget Function(Widget child); /// VxToggleRotate to rotate and animate any widget class VxToggleRotate extends StatefulWidget { - const VxToggleRotate( - {super.key, - required this.child, - this.onTap, - this.rad = math.pi / 2, - this.clockwise = true, - this.duration = const Duration(milliseconds: 200), - this.curve = Curves.fastOutSlowIn, - this.toggleBuilder, - this.isRotate = false}); + const VxToggleRotate({ + super.key, + required this.child, + this.onTap, + this.rad = math.pi / 2, + this.clockwise = true, + this.duration = const Duration(milliseconds: 200), + this.curve = Curves.fastOutSlowIn, + this.toggleBuilder, + this.isRotate = false, + }); final Widget child; @@ -86,8 +87,10 @@ class _VxToggleRotateState extends State void listener() { if (mounted) { - setState(() => - _rad = (_rotated ? (1 - _rotate.value) : _rotate.value) * widget.rad); + setState( + () => _rad = + (_rotated ? (1 - _rotate.value) : _rotate.value) * widget.rad, + ); } } @@ -111,9 +114,10 @@ class _VxToggleRotateState extends State @override Widget build(BuildContext context) { Widget current = Transform( - transform: Matrix4.rotationZ(widget.clockwise ? _rad : -_rad), - alignment: Alignment.center, - child: widget.child); + transform: Matrix4.rotationZ(widget.clockwise ? _rad : -_rad), + alignment: Alignment.center, + child: widget.child, + ); if (widget.toggleBuilder != null) { current = widget.toggleBuilder!(current); } @@ -125,26 +129,26 @@ class _VxToggleRotateState extends State } extension VxToggleExtension on Widget { - Widget toggleRotate( - {Key? key, - GestureTapCallback? onTap, - double rad = math.pi / 2, - bool clockwise = true, - Duration duration = const Duration(milliseconds: 200), - Curve curve = Curves.fastOutSlowIn, - VxToggleBuilder? toggleBuilder, - bool isRotate = false}) => - VxToggleRotate( - key: key, - clockwise: clockwise, - curve: curve, - duration: duration, - isRotate: isRotate, - onTap: onTap, - rad: rad, - toggleBuilder: toggleBuilder, - child: this, - ); + Widget toggleRotate({ + Key? key, + GestureTapCallback? onTap, + double rad = math.pi / 2, + bool clockwise = true, + Duration duration = const Duration(milliseconds: 200), + Curve curve = Curves.fastOutSlowIn, + VxToggleBuilder? toggleBuilder, + bool isRotate = false, + }) => VxToggleRotate( + key: key, + clockwise: clockwise, + curve: curve, + duration: duration, + isRotate: isRotate, + onTap: onTap, + rad: rad, + toggleBuilder: toggleBuilder, + child: this, + ); } /// @@ -155,14 +159,17 @@ extension VxTransformExtension on Widget { /// Extension method to give 3D look to any widget without wrapping or with dot operator. /// Widget perspective({Key? key}) => Transform( - key: key, - transform: Matrix4.identity()..setEntry(3, 2, 0.001), - child: this, - ); + key: key, + transform: Matrix4.identity()..setEntry(3, 2, 0.001), + child: this, + ); /// Extension method to set an offset of any widget - Widget offset( - {Key? key, required Offset offset, bool transformHitTests = true}) { + Widget offset({ + Key? key, + required Offset offset, + bool transformHitTests = true, + }) { return Transform.translate( key: key, transformHitTests: transformHitTests, @@ -174,236 +181,175 @@ extension VxTransformExtension on Widget { /// /// Extension method to horizontally flip any widget without wrapping or with dot operator. /// - Widget flipHorizontal({Key? key}) => Transform( - key: key, - transform: Matrix4.rotationY(math.pi), - child: this, - ); + Widget flipHorizontal({Key? key}) => + Transform(key: key, transform: Matrix4.rotationY(math.pi), child: this); /// /// Extension method to rotate along Y-axis any widget without wrapping or with dot operator. /// Widget flipY({Key? key, double? radian}) => Transform( - key: key, - transform: Matrix4.rotationY(radian ?? 90), - child: this, - ); + key: key, + transform: Matrix4.rotationY(radian ?? 90), + child: this, + ); /// /// Extension method to vertically flip any widget without wrapping or with dot operator. /// - Widget flipVertical({Key? key}) => Transform( - key: key, - transform: Matrix4.rotationX(math.pi), - child: this, - ); + Widget flipVertical({Key? key}) => + Transform(key: key, transform: Matrix4.rotationX(math.pi), child: this); /// /// Extension method to rotate along X-axis any widget without wrapping or with dot operator. /// Widget flipX({Key? key, double? radian}) => Transform( - key: key, - transform: Matrix4.rotationX(radian ?? 90), - child: this, - ); + key: key, + transform: Matrix4.rotationX(radian ?? 90), + child: this, + ); /// /// Extension method to rotate any widget by 0 degrees without wrapping or with dot operator. /// - Widget rotate0({Key? key}) => Transform.rotate( - key: key, - angle: 0, - child: this, - ); + Widget rotate0({Key? key}) => + Transform.rotate(key: key, angle: 0, child: this); /// /// Extension method to rotate any widget by specified [degrees] without wrapping or with dot operator. /// - Widget rotate(double degrees, - {Key? key, Alignment alignment = Alignment.center, Offset? origin}) => - Transform.rotate( - key: key, - angle: _degreeToRad(degrees), - alignment: alignment, - origin: origin, - child: this, - ); + Widget rotate( + double degrees, { + Key? key, + Alignment alignment = Alignment.center, + Offset? origin, + }) => Transform.rotate( + key: key, + angle: _degreeToRad(degrees), + alignment: alignment, + origin: origin, + child: this, + ); /// /// Extension method to rotate any widget by 45 degrees without wrapping or with dot operator. /// - Widget rotate45({Key? key}) => Transform.rotate( - key: key, - angle: math.pi / 4, - child: this, - ); + Widget rotate45({Key? key}) => + Transform.rotate(key: key, angle: math.pi / 4, child: this); /// /// Extension method to rotate any widget by 60 degrees without wrapping or with dot operator. /// - Widget rotate60({Key? key}) => Transform.rotate( - key: key, - angle: math.pi / 3, - child: this, - ); + Widget rotate60({Key? key}) => + Transform.rotate(key: key, angle: math.pi / 3, child: this); /// /// Extension method to rotate any widget by 90 degrees without wrapping or with dot operator. /// - Widget rotate90({Key? key}) => Transform.rotate( - key: key, - angle: math.pi / 2, - child: this, - ); + Widget rotate90({Key? key}) => + Transform.rotate(key: key, angle: math.pi / 2, child: this); /// /// Extension method to rotate any widget by 180 degrees without wrapping or with dot operator. /// - Widget rotate180({Key? key}) => Transform.rotate( - key: key, - angle: math.pi, - child: this, - ); + Widget rotate180({Key? key}) => + Transform.rotate(key: key, angle: math.pi, child: this); /// /// Extension method to rotate any widget by 180 degrees anti-clockwise without wrapping or with dot operator. /// - Widget rotateN180({Key? key}) => Transform.rotate( - key: key, - angle: -math.pi, - child: this, - ); + Widget rotateN180({Key? key}) => + Transform.rotate(key: key, angle: -math.pi, child: this); /// /// Extension method to rotate any widget by 90 degrees anti-clockwise without wrapping or with dot operator. /// - Widget rotateN90({Key? key}) => Transform.rotate( - key: key, - angle: -math.pi / 2, - child: this, - ); + Widget rotateN90({Key? key}) => + Transform.rotate(key: key, angle: -math.pi / 2, child: this); /// /// Extension method to rotate any widget by 45 degrees anti-clockwise without wrapping or with dot operator. /// - Widget rotateN45({Key? key}) => Transform.rotate( - key: key, - angle: -math.pi / 4, - child: this, - ); + Widget rotateN45({Key? key}) => + Transform.rotate(key: key, angle: -math.pi / 4, child: this); /// /// Extension method to rotate any widget by 60 degrees anti-clockwise without wrapping or with dot operator. /// - Widget rotateN60({Key? key}) => Transform.rotate( - key: key, - angle: -math.pi / 3, - child: this, - ); + Widget rotateN60({Key? key}) => + Transform.rotate(key: key, angle: -math.pi / 3, child: this); /// /// Extension method to scale any widget by specified [scalevalue] without wrapping or with dot operator. /// - Widget scale( - {Key? key, - double? scaleValue, - Offset? origin, - Alignment alignment = Alignment.center}) => - Transform.scale( - key: key, - scale: scaleValue ?? 0, - alignment: alignment, - origin: origin, - child: this, - ); + Widget scale({ + Key? key, + double? scaleValue, + Offset? origin, + Alignment alignment = Alignment.center, + }) => Transform.scale( + key: key, + scale: scaleValue ?? 0, + alignment: alignment, + origin: origin, + child: this, + ); /// /// Extension method to rotate any widget by 0 without wrapping or with dot operator. /// - Widget scale0({Key? key}) => Transform.scale( - key: key, - scale: 0, - child: this, - ); + Widget scale0({Key? key}) => Transform.scale(key: key, scale: 0, child: this); /// /// Extension method to rotate any widget by 0.5 without wrapping or with dot operator. /// - Widget scale50({Key? key}) => Transform.scale( - key: key, - scale: 0.5, - child: this, - ); + Widget scale50({Key? key}) => + Transform.scale(key: key, scale: 0.5, child: this); /// /// Extension method to rotate any widget by 0.75 without wrapping or with dot operator. /// - Widget scale75({Key? key}) => Transform.scale( - key: key, - scale: 0.75, - child: this, - ); + Widget scale75({Key? key}) => + Transform.scale(key: key, scale: 0.75, child: this); /// /// Extension method to rotate any widget by 0.9 without wrapping or with dot operator. /// - Widget scale90({Key? key}) => Transform.scale( - key: key, - scale: 0.9, - child: this, - ); + Widget scale90({Key? key}) => + Transform.scale(key: key, scale: 0.9, child: this); /// /// Extension method to rotate any widget by 0.95 without wrapping or with dot operator. /// - Widget scale95({Key? key}) => Transform.scale( - key: key, - scale: 0.95, - child: this, - ); + Widget scale95({Key? key}) => + Transform.scale(key: key, scale: 0.95, child: this); /// /// Extension method to rotate any widget by 1.0 without wrapping or with dot operator. /// - Widget scale100({Key? key}) => Transform.scale( - key: key, - scale: 1, - child: this, - ); + Widget scale100({Key? key}) => + Transform.scale(key: key, scale: 1, child: this); /// /// Extension method to rotate any widget by 1.05 without wrapping or with dot operator. /// - Widget scale105({Key? key}) => Transform.scale( - key: key, - scale: 1.05, - child: this, - ); + Widget scale105({Key? key}) => + Transform.scale(key: key, scale: 1.05, child: this); /// /// Extension method to rotate any widget by 1.1 without wrapping or with dot operator. /// - Widget scale110({Key? key}) => Transform.scale( - key: key, - scale: 1.1, - child: this, - ); + Widget scale110({Key? key}) => + Transform.scale(key: key, scale: 1.1, child: this); /// /// Extension method to rotate any widget by 1.5 without wrapping or with dot operator. /// - Widget scale150({Key? key}) => Transform.scale( - key: key, - scale: 1.5, - child: this, - ); + Widget scale150({Key? key}) => + Transform.scale(key: key, scale: 1.5, child: this); /// /// Extension method to rotate any widget by 2 without wrapping or with dot operator. /// - Widget scale200({Key? key}) => Transform.scale( - key: key, - scale: 2.0, - child: this, - ); + Widget scale200({Key? key}) => + Transform.scale(key: key, scale: 2.0, child: this); } diff --git a/lib/src/flutter/universal.dart b/lib/src/flutter/universal.dart index a036555c..58e8491a 100644 --- a/lib/src/flutter/universal.dart +++ b/lib/src/flutter/universal.dart @@ -596,10 +596,11 @@ class VxUniversal extends StatelessWidget { if (alignment != null) { current = Align( - alignment: alignment!, - widthFactor: widthFactor, - heightFactor: heightFactor, - child: current); + alignment: alignment!, + widthFactor: widthFactor, + heightFactor: heightFactor, + child: current, + ); } if (intrinsicWidth) { current = IntrinsicWidth(child: current); @@ -615,30 +616,38 @@ class VxUniversal extends StatelessWidget { if (decoration != null && clipBehavior != null && clipBehavior != Clip.none) { - current = clipWidget(current, - clipper: _DecorationClipper( - textDirection: Directionality.of(context), - decoration: decoration!)); + current = clipWidget( + current, + clipper: _DecorationClipper( + textDirection: Directionality.of(context), + decoration: decoration!, + ), + ); } if (decoration != null && !addInkWell) { current = DecoratedBox(decoration: decoration!, child: current); } if (foregroundDecoration != null) { current = DecoratedBox( - decoration: foregroundDecoration!, - position: DecorationPosition.foreground, - child: current); + decoration: foregroundDecoration!, + position: DecorationPosition.foreground, + child: current, + ); } if (transform != null) { - current = - Transform(transform: transform!, origin: origin, child: current); + current = Transform( + transform: transform!, + origin: origin, + child: current, + ); } if (enabled || onTap != null || onDoubleTap != null || onLongPress != null) { - current = - addInkWell ? inkWellWidget(current) : gestureDetectorWidget(current); + current = addInkWell + ? inkWellWidget(current) + : gestureDetectorWidget(current); } if (shrink) { current = SizedBox.shrink(child: current); @@ -678,7 +687,12 @@ class VxUniversal extends StatelessWidget { } if (left != null || top != null || right != null || bottom != null) { current = Positioned( - left: left, top: top, right: right, bottom: bottom, child: current); + left: left, + top: top, + right: right, + bottom: bottom, + child: current, + ); } if (gaussian) { backdropFilter(current); @@ -700,24 +714,29 @@ class VxUniversal extends StatelessWidget { } if (safeLeft || safeTop || safeRight || safeBottom) { current = SafeArea( - left: safeLeft, - top: safeTop, - right: safeRight, - bottom: safeBottom, - child: current); + left: safeLeft, + top: safeTop, + right: safeRight, + bottom: safeBottom, + child: current, + ); } return current; } Widget annotatedRegionWidget(Widget current) => AnnotatedRegion( - sized: sized, value: systemOverlayStyle!, child: current); + sized: sized, + value: systemOverlayStyle!, + child: current, + ); Widget fittedBox(Widget current) => FittedBox( - fit: fit!, - alignment: alignment ?? Alignment.center, - clipBehavior: clipBehavior ?? Clip.none, - child: current); + fit: fit!, + alignment: alignment ?? Alignment.center, + clipBehavior: clipBehavior ?? Clip.none, + child: current, + ); Widget builderWidget(Widget current) { if (builder is StatefulWidgetBuilder) { @@ -735,9 +754,10 @@ class VxUniversal extends StatelessWidget { : Padding(padding: _paddingIncludingDecoration!, child: current); Widget backdropFilter(Widget current) => BackdropFilter( - filter: - filter ?? ImageFilter.blur(sigmaX: fuzzyDegree, sigmaY: fuzzyDegree), - child: current); + filter: + filter ?? ImageFilter.blur(sigmaX: fuzzyDegree, sigmaY: fuzzyDegree), + child: current, + ); Widget offstageWidget(Widget current) => Offstage(offstage: offstage, child: current); @@ -746,238 +766,261 @@ class VxUniversal extends StatelessWidget { Widget clipWidget(Widget current, {CustomClipper? clipper}) { if (isOval) { return ClipOval( - clipBehavior: clipBehavior ?? Clip.antiAlias, child: current); + clipBehavior: clipBehavior ?? Clip.antiAlias, + child: current, + ); } else if (clipper is CustomClipper || isClipRect) { return ClipRect( - clipper: clipper is CustomClipper ? clipper : null, - clipBehavior: clipBehavior ?? Clip.hardEdge, - child: current); + clipper: clipper is CustomClipper ? clipper : null, + clipBehavior: clipBehavior ?? Clip.hardEdge, + child: current, + ); } else if (clipper is CustomClipper) { return ClipPath( - clipper: clipper, - clipBehavior: clipBehavior ?? Clip.antiAlias, - child: current); + clipper: clipper, + clipBehavior: clipBehavior ?? Clip.antiAlias, + child: current, + ); } else if (clipper is CustomClipper || isClipRRect) { return ClipRRect( - borderRadius: borderRadius, - clipper: clipper is CustomClipper ? clipper : null, - clipBehavior: clipBehavior ?? Clip.antiAlias, - child: current); + borderRadius: borderRadius, + clipper: clipper is CustomClipper ? clipper : null, + clipBehavior: clipBehavior ?? Clip.antiAlias, + child: current, + ); } return current; } Widget circleAvatarWidget(Widget current) => CircleAvatar( - backgroundColor: color, - backgroundImage: backgroundImage, - onBackgroundImageError: onBackgroundImageError, - foregroundColor: foregroundColor, - radius: radius, - minRadius: minRadius, - maxRadius: maxRadius, - child: current); + backgroundColor: color, + backgroundImage: backgroundImage, + onBackgroundImageError: onBackgroundImageError, + foregroundColor: foregroundColor, + radius: radius, + minRadius: minRadius, + maxRadius: maxRadius, + child: current, + ); Widget heroWidget(Widget current) => Hero( - tag: heroTag!, - createRectTween: createRectTween, - flightShuttleBuilder: flightShuttleBuilder, - placeholderBuilder: placeholderBuilder, - transitionOnUserGestures: transitionOnUserGestures, - child: current); + tag: heroTag!, + createRectTween: createRectTween, + flightShuttleBuilder: flightShuttleBuilder, + placeholderBuilder: placeholderBuilder, + transitionOnUserGestures: transitionOnUserGestures, + child: current, + ); Widget visibilityWidget(Widget current) => Visibility( - replacement: replacement, - visible: visible, - maintainState: maintainState, - maintainAnimation: maintainAnimation, - maintainSize: maintainSize, - maintainSemantics: maintainSemantics, - maintainInteractivity: maintainInteractivity, - child: current); + replacement: replacement, + visible: visible, + maintainState: maintainState, + maintainAnimation: maintainAnimation, + maintainSize: maintainSize, + maintainSemantics: maintainSemantics, + maintainInteractivity: maintainInteractivity, + child: current, + ); Widget flexibleWidget(Widget current) => Flexible( - flex: flex ?? 1, - fit: expanded ? FlexFit.tight : FlexFit.loose, - child: current); + flex: flex ?? 1, + fit: expanded ? FlexFit.tight : FlexFit.loose, + child: current, + ); Widget cardWidget(Widget current, BuildContext context) { final ThemeData theme = Theme.of(context); final CardThemeData cardTheme = CardTheme.of(context); - return material(current, - mType: MaterialType.card, - mShadowColor: shadowColor ?? cardTheme.shadowColor ?? theme.shadowColor, - mColor: color ?? cardTheme.color ?? theme.cardColor, - mElevation: elevation ?? cardTheme.elevation ?? 10, - mShape: shape ?? - cardTheme.shape ?? - RoundedRectangleBorder( - borderRadius: borderRadius == BorderRadius.zero - ? BorderRadius.circular(4) - : borderRadius), - mClipBehavior: clipBehavior ?? cardTheme.clipBehavior ?? Clip.none, - mBorderOnForeground: true); + return material( + current, + mType: MaterialType.card, + mShadowColor: shadowColor ?? cardTheme.shadowColor ?? theme.shadowColor, + mColor: color ?? cardTheme.color ?? theme.cardColor, + mElevation: elevation ?? cardTheme.elevation ?? 10, + mShape: + shape ?? + cardTheme.shape ?? + RoundedRectangleBorder( + borderRadius: borderRadius == BorderRadius.zero + ? BorderRadius.circular(4) + : borderRadius, + ), + mClipBehavior: clipBehavior ?? cardTheme.clipBehavior ?? Clip.none, + mBorderOnForeground: true, + ); } - Material material(Widget current, - {required MaterialType mType, - Color? mShadowColor, - Color? mColor, - TextStyle? mTextStyle, - required double mElevation, - BorderRadiusGeometry? mBorderRadius, - ShapeBorder? mShape, - required bool mBorderOnForeground, - required Clip mClipBehavior}) => - Material( - color: mColor, - type: mType, - elevation: mElevation, - shadowColor: mShadowColor, - textStyle: mTextStyle, - borderRadius: (mShape != null || shape != null) ? null : borderRadius, - shape: mShape ?? shape, - borderOnForeground: mBorderOnForeground, - clipBehavior: mClipBehavior, - child: current); + Material material( + Widget current, { + required MaterialType mType, + Color? mShadowColor, + Color? mColor, + TextStyle? mTextStyle, + required double mElevation, + BorderRadiusGeometry? mBorderRadius, + ShapeBorder? mShape, + required bool mBorderOnForeground, + required Clip mClipBehavior, + }) => Material( + color: mColor, + type: mType, + elevation: mElevation, + shadowColor: mShadowColor, + textStyle: mTextStyle, + borderRadius: (mShape != null || shape != null) ? null : borderRadius, + shape: mShape ?? shape, + borderOnForeground: mBorderOnForeground, + clipBehavior: mClipBehavior, + child: current, + ); Widget inkWellWidget(Widget current) => Ink( - decoration: decoration, - child: InkWell( - onTap: onTap, - onLongPress: onLongPress, - onDoubleTap: onDoubleTap, - onTapDown: onTapDown, - onTapCancel: onTapCancel, - onHighlightChanged: onHighlightChanged, - onHover: onHover, - focusColor: focusColor, - hoverColor: hoverColor, - highlightColor: highlightColor, - splashColor: splashColor, - splashFactory: splashFactory, - radius: radius, - borderRadius: borderRadius, - customBorder: customBorder, - enableFeedback: enableFeedback ?? false, - excludeFromSemantics: excludeFromSemantics, - focusNode: focusNode, - canRequestFocus: canRequestFocus, - onFocusChange: onFocusChange, - autofocus: autoFocus, - child: current)); + decoration: decoration, + child: InkWell( + onTap: onTap, + onLongPress: onLongPress, + onDoubleTap: onDoubleTap, + onTapDown: onTapDown, + onTapCancel: onTapCancel, + onHighlightChanged: onHighlightChanged, + onHover: onHover, + focusColor: focusColor, + hoverColor: hoverColor, + highlightColor: highlightColor, + splashColor: splashColor, + splashFactory: splashFactory, + radius: radius, + borderRadius: borderRadius, + customBorder: customBorder, + enableFeedback: enableFeedback ?? false, + excludeFromSemantics: excludeFromSemantics, + focusNode: focusNode, + canRequestFocus: canRequestFocus, + onFocusChange: onFocusChange, + autofocus: autoFocus, + child: current, + ), + ); Widget singleChildScrollViewWidget(Widget current) => SingleChildScrollView( - physics: physics, - reverse: reverse, - primary: primary, - dragStartBehavior: dragStartBehavior, - controller: scrollController, - scrollDirection: scrollDirection ?? direction, - clipBehavior: clipBehavior ?? Clip.hardEdge, - child: current); + physics: physics, + reverse: reverse, + primary: primary, + dragStartBehavior: dragStartBehavior, + controller: scrollController, + scrollDirection: scrollDirection ?? direction, + clipBehavior: clipBehavior ?? Clip.hardEdge, + child: current, + ); Widget flexWidget(List children) => Flex( - mainAxisAlignment: mainAxisAlignment, - crossAxisAlignment: crossAxisAlignment, - direction: direction, - textBaseline: textBaseline, - verticalDirection: verticalDirection, - textDirection: textDirection, - mainAxisSize: mainAxisSize, - children: children); + mainAxisAlignment: mainAxisAlignment, + crossAxisAlignment: crossAxisAlignment, + direction: direction, + textBaseline: textBaseline, + verticalDirection: verticalDirection, + textDirection: textDirection, + mainAxisSize: mainAxisSize, + children: children, + ); Widget wrapWidget(List children) => Wrap( - direction: direction, - alignment: wrapAlignment, - spacing: wrapSpacing, - runAlignment: runAlignment, - runSpacing: runSpacing, - crossAxisAlignment: wrapCrossAlignment, - clipBehavior: clipBehavior ?? Clip.none, - verticalDirection: verticalDirection, - textDirection: textDirection, - children: children); + direction: direction, + alignment: wrapAlignment, + spacing: wrapSpacing, + runAlignment: runAlignment, + runSpacing: runSpacing, + crossAxisAlignment: wrapCrossAlignment, + clipBehavior: clipBehavior ?? Clip.none, + verticalDirection: verticalDirection, + textDirection: textDirection, + children: children, + ); Widget stackWidget(List children) => Stack( - alignment: alignment ?? AlignmentDirectional.topStart, - textDirection: textDirection, - fit: stackFit, - clipBehavior: clipBehavior ?? Clip.hardEdge, - children: children); + alignment: alignment ?? AlignmentDirectional.topStart, + textDirection: textDirection, + fit: stackFit, + clipBehavior: clipBehavior ?? Clip.hardEdge, + children: children, + ); Widget gestureDetectorWidget(Widget current) => GestureDetector( - onTapDown: onTapDown, - onTapUp: onTapUp, - onTap: onTap, - onTapCancel: onTapCancel, - onSecondaryTapDown: onSecondaryTapDown, - onSecondaryTapUp: onSecondaryTapUp, - onSecondaryTapCancel: onSecondaryTapCancel, - onDoubleTap: onDoubleTap, - onSecondaryTap: onSecondaryTap, - onSecondaryLongPressMoveUpdate: onSecondaryLongPressMoveUpdate, - onSecondaryLongPressUp: onSecondaryLongPressUp, - onSecondaryLongPress: onSecondaryLongPress, - onSecondaryLongPressEnd: onSecondaryLongPressEnd, - onSecondaryLongPressStart: onSecondaryLongPressStart, - onLongPress: onLongPress, - onLongPressStart: onLongPressStart, - onLongPressMoveUpdate: onLongPressMoveUpdate, - onLongPressUp: onLongPressUp, - onLongPressEnd: onLongPressEnd, - onVerticalDragDown: onVerticalDragDown, - onVerticalDragStart: onVerticalDragStart, - onVerticalDragUpdate: onVerticalDragUpdate, - onVerticalDragEnd: onVerticalDragEnd, - onVerticalDragCancel: onVerticalDragCancel, - onHorizontalDragDown: onHorizontalDragDown, - onHorizontalDragStart: onHorizontalDragStart, - onHorizontalDragUpdate: onHorizontalDragUpdate, - onHorizontalDragEnd: onHorizontalDragEnd, - onHorizontalDragCancel: onHorizontalDragCancel, - onForcePressStart: onForcePressStart, - onForcePressPeak: onForcePressPeak, - onForcePressUpdate: onForcePressUpdate, - onForcePressEnd: onForcePressEnd, - onPanDown: onPanDown, - onPanStart: onPanStart, - onPanUpdate: onPanUpdate, - onPanEnd: onPanEnd, - onPanCancel: onPanCancel, - onScaleStart: onScaleStart, - onScaleUpdate: onScaleUpdate, - onScaleEnd: onScaleEnd, - behavior: behavior, - excludeFromSemantics: excludeFromSemantics, - dragStartBehavior: dragStartBehavior, - child: current); + onTapDown: onTapDown, + onTapUp: onTapUp, + onTap: onTap, + onTapCancel: onTapCancel, + onSecondaryTapDown: onSecondaryTapDown, + onSecondaryTapUp: onSecondaryTapUp, + onSecondaryTapCancel: onSecondaryTapCancel, + onDoubleTap: onDoubleTap, + onSecondaryTap: onSecondaryTap, + onSecondaryLongPressMoveUpdate: onSecondaryLongPressMoveUpdate, + onSecondaryLongPressUp: onSecondaryLongPressUp, + onSecondaryLongPress: onSecondaryLongPress, + onSecondaryLongPressEnd: onSecondaryLongPressEnd, + onSecondaryLongPressStart: onSecondaryLongPressStart, + onLongPress: onLongPress, + onLongPressStart: onLongPressStart, + onLongPressMoveUpdate: onLongPressMoveUpdate, + onLongPressUp: onLongPressUp, + onLongPressEnd: onLongPressEnd, + onVerticalDragDown: onVerticalDragDown, + onVerticalDragStart: onVerticalDragStart, + onVerticalDragUpdate: onVerticalDragUpdate, + onVerticalDragEnd: onVerticalDragEnd, + onVerticalDragCancel: onVerticalDragCancel, + onHorizontalDragDown: onHorizontalDragDown, + onHorizontalDragStart: onHorizontalDragStart, + onHorizontalDragUpdate: onHorizontalDragUpdate, + onHorizontalDragEnd: onHorizontalDragEnd, + onHorizontalDragCancel: onHorizontalDragCancel, + onForcePressStart: onForcePressStart, + onForcePressPeak: onForcePressPeak, + onForcePressUpdate: onForcePressUpdate, + onForcePressEnd: onForcePressEnd, + onPanDown: onPanDown, + onPanStart: onPanStart, + onPanUpdate: onPanUpdate, + onPanEnd: onPanEnd, + onPanCancel: onPanCancel, + onScaleStart: onScaleStart, + onScaleUpdate: onScaleUpdate, + onScaleEnd: onScaleEnd, + behavior: behavior, + excludeFromSemantics: excludeFromSemantics, + dragStartBehavior: dragStartBehavior, + child: current, + ); Widget universal(Widget current, {GestureTapCallback? onTap}) => VxUniversal( - heroTag: heroTag, - visible: visible, - constraints: constraints, - addInkWell: onTap != null && addInkWell, - borderRadius: borderRadius, - highlightColor: highlightColor, - hoverColor: hoverColor, - splashColor: splashColor, - focusColor: focusColor, - mainAxisSize: MainAxisSize.min, - onTap: onTap, - width: width, - height: height, - margin: margin, - color: color, - decoration: decoration, - padding: padding, - alignment: alignment, - child: current); + heroTag: heroTag, + visible: visible, + constraints: constraints, + addInkWell: onTap != null && addInkWell, + borderRadius: borderRadius, + highlightColor: highlightColor, + hoverColor: hoverColor, + splashColor: splashColor, + focusColor: focusColor, + mainAxisSize: MainAxisSize.min, + onTap: onTap, + width: width, + height: height, + margin: margin, + color: color, + decoration: decoration, + padding: padding, + alignment: alignment, + child: current, + ); } /// A clipper that uses [Decoration.getClipPath] to clip. class _DecorationClipper extends CustomClipper { _DecorationClipper({TextDirection? textDirection, required this.decoration}) - : textDirection = textDirection ?? TextDirection.ltr; + : textDirection = textDirection ?? TextDirection.ltr; final TextDirection textDirection; final Decoration decoration; diff --git a/lib/src/flutter/velocityx_mixins/gradient_mixin.dart b/lib/src/flutter/velocityx_mixins/gradient_mixin.dart index 2550ca27..1057e8f2 100644 --- a/lib/src/flutter/velocityx_mixins/gradient_mixin.dart +++ b/lib/src/flutter/velocityx_mixins/gradient_mixin.dart @@ -27,27 +27,33 @@ mixin VxGradientMixin { } T gradientFrom({required Color from, List? stops}) => _gradientIt( - child: _childToGradient, - gradient: LinearGradient(colors: [from, Vx.gray100], stops: stops)); - - T gradientVia( - {required Color from, - required Color via, - required Color to, - List? stops}) => - _gradientIt( - child: _childToGradient, - gradient: LinearGradient(colors: [from, via, to], stops: stops)); - - T gradientFromTo( - {required Color from, required Color to, List? stops}) => - _gradientIt( - child: _childToGradient, - gradient: LinearGradient(colors: [from, to], stops: stops)); + child: _childToGradient, + gradient: LinearGradient(colors: [from, Vx.gray100], stops: stops), + ); + + T gradientVia({ + required Color from, + required Color via, + required Color to, + List? stops, + }) => _gradientIt( + child: _childToGradient, + gradient: LinearGradient(colors: [from, via, to], stops: stops), + ); + + T gradientFromTo({ + required Color from, + required Color to, + List? stops, + }) => _gradientIt( + child: _childToGradient, + gradient: LinearGradient(colors: [from, to], stops: stops), + ); T gradientTo({required Color to, List? stops}) => _gradientIt( - child: _childToGradient, - gradient: LinearGradient(colors: [Vx.gray100, to], stops: stops)); + child: _childToGradient, + gradient: LinearGradient(colors: [Vx.gray100, to], stops: stops), + ); T _gradientIt({required Gradient gradient, required T child}) { velocityGradient = gradient; diff --git a/lib/src/flutter/velocityx_mixins/neu_mixin.dart b/lib/src/flutter/velocityx_mixins/neu_mixin.dart index c22c0462..ca03ed50 100644 --- a/lib/src/flutter/velocityx_mixins/neu_mixin.dart +++ b/lib/src/flutter/velocityx_mixins/neu_mixin.dart @@ -39,7 +39,7 @@ mixin VxNeuMixin { color: _getNeuColor(color0, emboss ? elevation : 0 - elevation), offset: Offset(elevation, elevation), blurRadius: elevation, - ) + ), ]; if (emboss) { @@ -70,20 +70,14 @@ mixin VxNeuMixin { _gradient = _getFlatGradients(colorValue, elevation); break; } - return VxNeumorph( - shadowList, - _gradient, - ); + return VxNeumorph(shadowList, _gradient); } Gradient _getFlatGradients(Color baseColor, double depth) => LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - baseColor, - baseColor, - ], - ); + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [baseColor, baseColor], + ); Gradient _getConcaveGradients(Color baseColor, double depth) => LinearGradient( @@ -96,19 +90,19 @@ mixin VxNeuMixin { ); Gradient _getConvexGradients(Color baseColor, double depth) => LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - _getNeuColor(baseColor, depth), - _getNeuColor(baseColor, 0 - depth), - ], - ); + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + _getNeuColor(baseColor, depth), + _getNeuColor(baseColor, 0 - depth), + ], + ); Color _getNeuColor(Color baseColor, double amount) { Map colors = { 'r': baseColor.r.toInt(), 'g': baseColor.g.toInt(), - 'b': baseColor.b.toInt() + 'b': baseColor.b.toInt(), }; colors = colors.map((key, value) { diff --git a/lib/src/flutter/velocityx_mixins/round_mixin.dart b/lib/src/flutter/velocityx_mixins/round_mixin.dart index aebb610c..7fb86ee6 100644 --- a/lib/src/flutter/velocityx_mixins/round_mixin.dart +++ b/lib/src/flutter/velocityx_mixins/round_mixin.dart @@ -23,36 +23,41 @@ mixin VxRoundMixin { T topRightRounded({double? value}) { roundedValue = value ?? 15.0; - radiusGeometry = - BorderRadius.only(topRight: Radius.circular(roundedValue!)); + radiusGeometry = BorderRadius.only( + topRight: Radius.circular(roundedValue!), + ); return _childToRound; } T bottomLeftRounded({double? value}) { roundedValue = value ?? 15.0; - radiusGeometry = - BorderRadius.only(bottomLeft: Radius.circular(roundedValue!)); + radiusGeometry = BorderRadius.only( + bottomLeft: Radius.circular(roundedValue!), + ); return _childToRound; } T bottomRightRounded({double? value}) { roundedValue = value ?? 15.0; - radiusGeometry = - BorderRadius.only(bottomRight: Radius.circular(roundedValue!)); + radiusGeometry = BorderRadius.only( + bottomRight: Radius.circular(roundedValue!), + ); return _childToRound; } T leftRounded({double? value}) { roundedValue = value ?? 15.0; - radiusGeometry = - BorderRadius.horizontal(left: Radius.circular(roundedValue!)); + radiusGeometry = BorderRadius.horizontal( + left: Radius.circular(roundedValue!), + ); return _childToRound; } T rightRounded({double? value}) { roundedValue = value ?? 15.0; - radiusGeometry = - BorderRadius.horizontal(right: Radius.circular(roundedValue!)); + radiusGeometry = BorderRadius.horizontal( + right: Radius.circular(roundedValue!), + ); return _childToRound; } @@ -64,8 +69,9 @@ mixin VxRoundMixin { T bottomRounded({double? value}) { roundedValue = value ?? 15.0; - radiusGeometry = - BorderRadius.vertical(bottom: Radius.circular(roundedValue!)); + radiusGeometry = BorderRadius.vertical( + bottom: Radius.circular(roundedValue!), + ); return _childToRound; } diff --git a/lib/src/flutter/velocityx_mixins/shadow_mixin.dart b/lib/src/flutter/velocityx_mixins/shadow_mixin.dart index a6436411..d0b4c27f 100644 --- a/lib/src/flutter/velocityx_mixins/shadow_mixin.dart +++ b/lib/src/flutter/velocityx_mixins/shadow_mixin.dart @@ -25,91 +25,106 @@ mixin VxShadowMixin { } /// Shadowing - T get outerShadowSm => _addShadow(shadows: [ - const BoxShadow( - offset: Offset(0, 1), - blurRadius: 2, - spreadRadius: 0, - color: Color.fromRGBO(0, 0, 0, 0.05)) - ]); - - T get outerShadow => _addShadow(shadows: [ - const BoxShadow( - offset: Offset(0, 1), - blurRadius: 3, - spreadRadius: 0, - color: Color.fromRGBO(0, 0, 0, 0.1), - ), - const BoxShadow( - offset: Offset(0, 1), - blurRadius: 2, - spreadRadius: 0, - color: Color.fromRGBO(0, 0, 0, 0.06), - ) - ]); - - T get outerShadowMd => _addShadow(shadows: [ - const BoxShadow( - offset: Offset(0, 4), - blurRadius: 6, - spreadRadius: -1, - color: Color.fromRGBO(0, 0, 0, 0.1), - ), - const BoxShadow( - offset: Offset(0, 2), - blurRadius: 4, - spreadRadius: -1, - color: Color.fromRGBO(0, 0, 0, 0.06), - ) - ]); - - T get outerShadowLg => _addShadow(shadows: [ - const BoxShadow( - offset: Offset(0, 10), - blurRadius: 15, - spreadRadius: -3, - color: Color.fromRGBO(0, 0, 0, 0.1), - ), - const BoxShadow( - offset: Offset(0, 4), - blurRadius: 6, - spreadRadius: -2, - color: Color.fromRGBO(0, 0, 0, 0.05), - ) - ]); - - T get outerShadowXl => _addShadow(shadows: [ - const BoxShadow( - offset: Offset(0, 20), - blurRadius: 25, - spreadRadius: -5, - color: Color.fromRGBO(0, 0, 0, 0.1), - ), - const BoxShadow( - offset: Offset(0, 10), - blurRadius: 10, - spreadRadius: -5, - color: Color.fromRGBO(0, 0, 0, 0.04), - ) - ]); - - T get outerShadow2Xl => _addShadow(shadows: [ - const BoxShadow( - offset: Offset(0, 25), - blurRadius: 50, - spreadRadius: -12, - color: Color.fromRGBO(0, 0, 0, 0.25), - ), - ]); - - T get outerShadow3Xl => _addShadow(shadows: [ - const BoxShadow( - offset: Offset(0, 35), - blurRadius: 60, - spreadRadius: -15, - color: Color.fromRGBO(0, 0, 0, 0.3), - ), - ]); + T get outerShadowSm => _addShadow( + shadows: [ + const BoxShadow( + offset: Offset(0, 1), + blurRadius: 2, + spreadRadius: 0, + color: Color.fromRGBO(0, 0, 0, 0.05), + ), + ], + ); + + T get outerShadow => _addShadow( + shadows: [ + const BoxShadow( + offset: Offset(0, 1), + blurRadius: 3, + spreadRadius: 0, + color: Color.fromRGBO(0, 0, 0, 0.1), + ), + const BoxShadow( + offset: Offset(0, 1), + blurRadius: 2, + spreadRadius: 0, + color: Color.fromRGBO(0, 0, 0, 0.06), + ), + ], + ); + + T get outerShadowMd => _addShadow( + shadows: [ + const BoxShadow( + offset: Offset(0, 4), + blurRadius: 6, + spreadRadius: -1, + color: Color.fromRGBO(0, 0, 0, 0.1), + ), + const BoxShadow( + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: -1, + color: Color.fromRGBO(0, 0, 0, 0.06), + ), + ], + ); + + T get outerShadowLg => _addShadow( + shadows: [ + const BoxShadow( + offset: Offset(0, 10), + blurRadius: 15, + spreadRadius: -3, + color: Color.fromRGBO(0, 0, 0, 0.1), + ), + const BoxShadow( + offset: Offset(0, 4), + blurRadius: 6, + spreadRadius: -2, + color: Color.fromRGBO(0, 0, 0, 0.05), + ), + ], + ); + + T get outerShadowXl => _addShadow( + shadows: [ + const BoxShadow( + offset: Offset(0, 20), + blurRadius: 25, + spreadRadius: -5, + color: Color.fromRGBO(0, 0, 0, 0.1), + ), + const BoxShadow( + offset: Offset(0, 10), + blurRadius: 10, + spreadRadius: -5, + color: Color.fromRGBO(0, 0, 0, 0.04), + ), + ], + ); + + T get outerShadow2Xl => _addShadow( + shadows: [ + const BoxShadow( + offset: Offset(0, 25), + blurRadius: 50, + spreadRadius: -12, + color: Color.fromRGBO(0, 0, 0, 0.25), + ), + ], + ); + + T get outerShadow3Xl => _addShadow( + shadows: [ + const BoxShadow( + offset: Offset(0, 35), + blurRadius: 60, + spreadRadius: -15, + color: Color.fromRGBO(0, 0, 0, 0.3), + ), + ], + ); /// Shadowing T get noneShadow => _addShadow(shadows: kElevationToShadow[0]); diff --git a/lib/src/flutter/widgets.dart b/lib/src/flutter/widgets.dart index f337c382..cbc51c3b 100644 --- a/lib/src/flutter/widgets.dart +++ b/lib/src/flutter/widgets.dart @@ -25,30 +25,31 @@ extension VxWidgetsExtension on Widget { Widget when(bool condition) => condition ? this : const VxNone(); ///Tooltip as accessibility - Widget tooltip(String message, - {Key? key, - Decoration? decoration, - double? height, - BoxConstraints? constraints, - bool? preferBelow, - EdgeInsetsGeometry? padding, - TextStyle? textStyle, - Duration? waitDuration, - EdgeInsetsGeometry? margin}) => - Tooltip( - key: key, - message: message, - decoration: decoration, - constraints: height != null - ? BoxConstraints.tightFor(height: height) - : constraints, - padding: padding, - preferBelow: preferBelow, - textStyle: textStyle, - waitDuration: waitDuration, - margin: margin, - child: this, - ); + Widget tooltip( + String message, { + Key? key, + Decoration? decoration, + double? height, + BoxConstraints? constraints, + bool? preferBelow, + EdgeInsetsGeometry? padding, + TextStyle? textStyle, + Duration? waitDuration, + EdgeInsetsGeometry? margin, + }) => Tooltip( + key: key, + message: message, + decoration: decoration, + constraints: height != null + ? BoxConstraints.tightFor(height: height) + : constraints, + padding: padding, + preferBelow: preferBelow, + textStyle: textStyle, + waitDuration: waitDuration, + margin: margin, + child: this, + ); ///Hides a widget Widget hide({Key? key, bool isVisible = false, bool maintainSize = false}) => @@ -73,51 +74,43 @@ extension VxWidgetsExtension on Widget { double verticalMargin = 10.0, bool showArrow = true, VxClickType clickType = VxClickType.singleClick, - }) => - VxPopupMenu( - key: key, - clickType: clickType, - controller: controller, - arrowColor: arrowColor, - arrowSize: arrowSize, - barrierColor: barrierColor, - horizontalMargin: horizontalMargin, - showArrow: showArrow, - verticalMargin: verticalMargin, - menuBuilder: menuBuilder, - child: this, - ); + }) => VxPopupMenu( + key: key, + clickType: clickType, + controller: controller, + arrowColor: arrowColor, + arrowSize: arrowSize, + barrierColor: barrierColor, + horizontalMargin: horizontalMargin, + showArrow: showArrow, + verticalMargin: verticalMargin, + menuBuilder: menuBuilder, + child: this, + ); /// Widget to show exception Widget errorWidget(Object ex) => ErrorWidget(ex); /// Extension for [Expanded] Expanded expand({Key? key, int flex = 1}) { - return Expanded( - key: key, - flex: flex, - child: this, - ); + return Expanded(key: key, flex: flex, child: this); } /// Extension for [Flexible] Flexible flexible({Key? key, int flex = 1}) { - return Flexible( - key: key, - flex: flex, - child: this, - ); + return Flexible(key: key, flex: flex, child: this); } /// Extension for Stack [Positioned] - Widget positioned( - {double? top, - double? bottom, - double? left, - double? right, - double? height, - double? width, - bool isFilled = false}) { + Widget positioned({ + double? top, + double? bottom, + double? left, + double? right, + double? height, + double? width, + bool isFilled = false, + }) { return isFilled ? Positioned.fill( key: key, @@ -142,9 +135,7 @@ extension VxWidgetsExtension on Widget { /// Extension for coloring a widget with [DecoratedBox] DecoratedBox backgroundColor(Color? color) { return DecoratedBox( - decoration: BoxDecoration( - color: color, - ), + decoration: BoxDecoration(color: color), child: this, ); } @@ -162,18 +153,12 @@ extension VxWidgetsExtension on Widget { /// Extension for aspectRatio with [AspectRatio] AspectRatio aspectRatio(double aspectRatio) { - return AspectRatio( - aspectRatio: aspectRatio, - child: this, - ); + return AspectRatio(aspectRatio: aspectRatio, child: this); } /// Extension for adding a corner radius a widget with [ClipRRect] ClipRRect cornerRadius(double radius) { - return ClipRRect( - borderRadius: BorderRadius.circular(radius), - child: this, - ); + return ClipRRect(borderRadius: BorderRadius.circular(radius), child: this); } /// Extension for creating a half shape using [VxHalfClipper] @@ -187,8 +172,10 @@ extension VxWidgetsExtension on Widget { } /// Extension for creating a oval shape using [ClipOval] - Widget clipOval( - {Clip clipBehavior = Clip.antiAlias, CustomClipper? clipper}) { + Widget clipOval({ + Clip clipBehavior = Clip.antiAlias, + CustomClipper? clipper, + }) { return ClipOval( key: key, clipBehavior: clipBehavior, @@ -223,67 +210,65 @@ extension VxWidgetsExtension on Widget { } /// Extension method for [Material] Widget - Widget material( - {Key? key, - MaterialType type = MaterialType.canvas, - Duration animationDuration = kThemeAnimationDuration, - bool borderOnForeground = true, - BorderRadiusGeometry? borderRadius, - Clip clipBehavior = Clip.none, - Color? color, - double elevation = 0.0, - Color? shadowColor, - ShapeBorder? shape, - TextStyle? textStyle}) => - Material( - key: key, - type: type, - animationDuration: animationDuration, - borderOnForeground: borderOnForeground, - borderRadius: borderRadius, - clipBehavior: clipBehavior, - color: color, - elevation: elevation, - shadowColor: shadowColor, - shape: shape, - textStyle: textStyle, - child: this, - ); + Widget material({ + Key? key, + MaterialType type = MaterialType.canvas, + Duration animationDuration = kThemeAnimationDuration, + bool borderOnForeground = true, + BorderRadiusGeometry? borderRadius, + Clip clipBehavior = Clip.none, + Color? color, + double elevation = 0.0, + Color? shadowColor, + ShapeBorder? shape, + TextStyle? textStyle, + }) => Material( + key: key, + type: type, + animationDuration: animationDuration, + borderOnForeground: borderOnForeground, + borderRadius: borderRadius, + clipBehavior: clipBehavior, + color: color, + elevation: elevation, + shadowColor: shadowColor, + shape: shape, + textStyle: textStyle, + child: this, + ); /// Extension method for [SafeArea] Widget - Widget safeArea( - {Key? key, - EdgeInsets minimum = EdgeInsets.zero, - bool maintainBottomViewPadding = false, - bool top = true, - bool bottom = true, - bool left = true, - bool right = true}) => - SafeArea( - key: key, - minimum: minimum, - maintainBottomViewPadding: maintainBottomViewPadding, - top: top, - bottom: bottom, - left: left, - right: right, - child: this, - ); + Widget safeArea({ + Key? key, + EdgeInsets minimum = EdgeInsets.zero, + bool maintainBottomViewPadding = false, + bool top = true, + bool bottom = true, + bool left = true, + bool right = true, + }) => SafeArea( + key: key, + minimum: minimum, + maintainBottomViewPadding: maintainBottomViewPadding, + top: top, + bottom: bottom, + left: left, + right: right, + child: this, + ); /// Extension method for [ShaderMask] Widget Widget shaderMask({ required Gradient gradient, Key? key, BlendMode blendMode = BlendMode.modulate, - }) => - ShaderMask( - blendMode: blendMode, - key: key, - shaderCallback: (bounds) => gradient.createShader( - Rect.fromLTWH(0, 0, bounds.width, bounds.height), - ), - child: this, - ); + }) => ShaderMask( + blendMode: blendMode, + key: key, + shaderCallback: (bounds) => + gradient.createShader(Rect.fromLTWH(0, 0, bounds.width, bounds.height)), + child: this, + ); /// Extension method for [VxInnerShadow] Widget Widget innerShadow({ @@ -291,14 +276,13 @@ extension VxWidgetsExtension on Widget { double blur = 2.0, Color color = Colors.black38, Offset offset = const Offset(2, 2), - }) => - VxInnerShadow( - key: key, - blur: blur, - color: color, - offset: offset, - child: this, - ); + }) => VxInnerShadow( + key: key, + blur: blur, + color: color, + offset: offset, + child: this, + ); /// Extension method for [SliverToBoxAdapter] Widget Widget toSliverBox({Key? key}) => SliverToBoxAdapter(key: key, child: this); @@ -306,25 +290,29 @@ extension VxWidgetsExtension on Widget { SliverToBoxAdapter sliverToBoxAdapter({Key? key}) => SliverToBoxAdapter(key: key, child: this); - BackdropFilter backdropFilter( - {Key? key, ImageFilter? filter, double fuzzyDegree = 4}) => - BackdropFilter( - key: key, - filter: filter ?? - ImageFilter.blur(sigmaX: fuzzyDegree, sigmaY: fuzzyDegree), - child: this); - - FittedBox fittedBox( - {Key? key, - BoxFit fit = BoxFit.contain, - AlignmentGeometry alignment = Alignment.center, - Clip clipBehavior = Clip.none}) => - FittedBox( - key: key, - fit: fit, - alignment: alignment, - clipBehavior: clipBehavior, - child: this); + BackdropFilter backdropFilter({ + Key? key, + ImageFilter? filter, + double fuzzyDegree = 4, + }) => BackdropFilter( + key: key, + filter: + filter ?? ImageFilter.blur(sigmaX: fuzzyDegree, sigmaY: fuzzyDegree), + child: this, + ); + + FittedBox fittedBox({ + Key? key, + BoxFit fit = BoxFit.contain, + AlignmentGeometry alignment = Alignment.center, + Clip clipBehavior = Clip.none, + }) => FittedBox( + key: key, + fit: fit, + alignment: alignment, + clipBehavior: clipBehavior, + child: this, + ); /// Wrap widget with [ColoredBox] ColoredBox color(Color color, {Key? key}) => @@ -344,51 +332,49 @@ extension VxWidgetsExtension on Widget { HeroFlightShuttleBuilder? flightShuttleBuilder, HeroPlaceholderBuilder? placeholderBuilder, bool transitionOnUserGestures = false, - }) => - Hero( - key: key, - createRectTween: createRectTween, - flightShuttleBuilder: flightShuttleBuilder, - placeholderBuilder: placeholderBuilder, - transitionOnUserGestures: transitionOnUserGestures, - tag: tag, - child: this); + }) => Hero( + key: key, + createRectTween: createRectTween, + flightShuttleBuilder: flightShuttleBuilder, + placeholderBuilder: placeholderBuilder, + transitionOnUserGestures: transitionOnUserGestures, + tag: tag, + child: this, + ); List asList() => [this]; } extension StringWidgetsExtension on String { - Widget circularAssetImage( - {Key? key, - double radius = 35.0, - Color bgColor = Colors.white, - Color? fgColor, - Widget? child}) => - CircleAvatar( - key: key, - radius: radius, - backgroundColor: bgColor, - foregroundColor: fgColor, - backgroundImage: AssetImage(this), - child: child, - ); + Widget circularAssetImage({ + Key? key, + double radius = 35.0, + Color bgColor = Colors.white, + Color? fgColor, + Widget? child, + }) => CircleAvatar( + key: key, + radius: radius, + backgroundColor: bgColor, + foregroundColor: fgColor, + backgroundImage: AssetImage(this), + child: child, + ); - Widget circularNetworkImage( - {Key? key, - double radius = 65.0, - Color bgColor = Colors.white, - Color? fgColor, - Widget? child}) => - CircleAvatar( - key: key, - radius: radius, - backgroundColor: bgColor, - foregroundColor: fgColor, - backgroundImage: NetworkImage( - this, - ), - child: child, - ); + Widget circularNetworkImage({ + Key? key, + double radius = 65.0, + Color bgColor = Colors.white, + Color? fgColor, + Widget? child, + }) => CircleAvatar( + key: key, + radius: radius, + backgroundColor: bgColor, + foregroundColor: fgColor, + backgroundImage: NetworkImage(this), + child: child, + ); Widget circularAssetShadowImage({ Key? key, @@ -398,30 +384,26 @@ extension StringWidgetsExtension on String { double height = 40.0, double blurRadius = 3.0, double borderRadius = 50.0, - }) => - Container( - key: key, - margin: margin, - padding: padding, - width: width, - height: height, - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - image: DecorationImage(image: AssetImage(this)), - borderRadius: BorderRadius.circular(borderRadius), - boxShadow: [ - BoxShadow( - color: Colors.black, - blurRadius: blurRadius, - offset: const Offset( - 0.0, - 0.0, - ), - ) - ], + }) => Container( + key: key, + margin: margin, + padding: padding, + width: width, + height: height, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + image: DecorationImage(image: AssetImage(this)), + borderRadius: BorderRadius.circular(borderRadius), + boxShadow: [ + BoxShadow( + color: Colors.black, + blurRadius: blurRadius, + offset: const Offset(0.0, 0.0), ), - ); + ], + ), + ); } class _KeepAliveWidget extends StatefulWidget { @@ -445,18 +427,19 @@ class _KeepAliveState extends State<_KeepAliveWidget> } } -typedef AnimationUpdateCallBack = Function( - T animationVal, double controllerVal); +typedef AnimationUpdateCallBack = + Function(T animationVal, double controllerVal); /// To perform forward animation in a simpler way -AnimationController withAnimation( - {required TickerProvider vsync, - required Tween tween, - required AnimationUpdateCallBack callBack, - Duration duration = const Duration(seconds: 1), - double initialValue = 0.0, - Curve curve = Curves.linear, - Animation? customAnimation}) { +AnimationController withAnimation({ + required TickerProvider vsync, + required Tween tween, + required AnimationUpdateCallBack callBack, + Duration duration = const Duration(seconds: 1), + double initialValue = 0.0, + Curve curve = Curves.linear, + Animation? customAnimation, +}) { final AnimationController controller = AnimationController( vsync: vsync, duration: duration, @@ -476,20 +459,24 @@ AnimationController withAnimation( } /// To perform repeat animation in a simpler way -AnimationController withRepeatAnimation( - {required TickerProvider vsync, - required Tween tween, - required AnimationUpdateCallBack callBack, - Duration duration = const Duration(seconds: 1), - double initialValue = 0.0, - Curve curve = Curves.linear, - double? lowerBound, - double? upperBound, - bool isRepeatReversed = false, - Duration? repeatPeriod, - Animation? customAnimation}) { +AnimationController withRepeatAnimation({ + required TickerProvider vsync, + required Tween tween, + required AnimationUpdateCallBack callBack, + Duration duration = const Duration(seconds: 1), + double initialValue = 0.0, + Curve curve = Curves.linear, + double? lowerBound, + double? upperBound, + bool isRepeatReversed = false, + Duration? repeatPeriod, + Animation? customAnimation, +}) { final AnimationController controller = AnimationController( - vsync: vsync, duration: duration, value: initialValue); + vsync: vsync, + duration: duration, + value: initialValue, + ); final curveAnimation = CurvedAnimation(parent: controller, curve: curve); final Animation animation = customAnimation ?? tween.animate(curveAnimation); animation.addListener(() { @@ -498,13 +485,14 @@ AnimationController withRepeatAnimation( controller .repeat( - min: lowerBound, - max: upperBound, - period: repeatPeriod, - reverse: isRepeatReversed) + min: lowerBound, + max: upperBound, + period: repeatPeriod, + reverse: isRepeatReversed, + ) .whenCompleteOrCancel(() { - controller.dispose(); - }); + controller.dispose(); + }); return controller; } @@ -531,7 +519,9 @@ class VxInnerShadow extends SingleChildRenderObjectWidget { @override void updateRenderObject( - BuildContext context, RenderInnerShadow renderObject) { + BuildContext context, + RenderInnerShadow renderObject, + ) { renderObject ..color = color ..blur = blur diff --git a/lib/src/responsive_ui.dart b/lib/src/responsive_ui.dart index 514f6feb..24cea5d2 100644 --- a/lib/src/responsive_ui.dart +++ b/lib/src/responsive_ui.dart @@ -80,8 +80,8 @@ abstract class MobileDeviceInfo { factory MobileDeviceInfo(MediaQueryData data) => data.orientation == Orientation.portrait - ? _PortraitDeviceInfo(data.size.width) - : _LandscapeDeviceInfo(data.size.width); + ? _PortraitDeviceInfo(data.size.width) + : _LandscapeDeviceInfo(data.size.width); MobileDeviceInfo._(this._width); diff --git a/lib/src/velocity_xx.dart b/lib/src/velocity_xx.dart index 6f58b4e4..2fadc31e 100644 --- a/lib/src/velocity_xx.dart +++ b/lib/src/velocity_xx.dart @@ -603,35 +603,34 @@ mixin Vx { double top, double right, double bottom, - ) => - EdgeInsets.fromLTRB(left, top, right, bottom); + ) => EdgeInsets.fromLTRB(left, top, right, bottom); /// [EdgeInsets] with custom symmetric [v] for vertical and [h] for horizontal value static EdgeInsets mSymmetric({double v = 0.0, double h = 0.0}) => - EdgeInsets.symmetric( - vertical: v, - horizontal: h, - ); + EdgeInsets.symmetric(vertical: v, horizontal: h); /// [EdgeInsets] with custom [left], [right], [top] & [bottom] values - static EdgeInsets mOnly( - {double left = 0.0, - double right = 0.0, - double top = 0.0, - double bottom = 0.0}) => - EdgeInsets.only(left: left, right: right, top: top, bottom: bottom); + static EdgeInsets mOnly({ + double left = 0.0, + double right = 0.0, + double top = 0.0, + double bottom = 0.0, + }) => EdgeInsets.only(left: left, right: right, top: top, bottom: bottom); /// [ShapeBorder] with border radius 7.5 - static ShapeBorder roundedSm = - RoundedRectangleBorder(borderRadius: BorderRadius.circular(7.5)); + static ShapeBorder roundedSm = RoundedRectangleBorder( + borderRadius: BorderRadius.circular(7.5), + ); /// [ShapeBorder] with border radius 15 - static ShapeBorder rounded = - RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)); + static ShapeBorder rounded = RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15), + ); /// [ShapeBorder] with border radius 30 - static ShapeBorder roundedLg = - RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)); + static ShapeBorder roundedLg = RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ); /// [ShapeBorder] with custom border [radius] static ShapeBorder withRounded(double radius) => @@ -660,7 +659,8 @@ mixin Vx { final String message = msg.toString(); if (hasDottedLine) { debugPrint( - '👇🏻┌------------------------------------------------------------------------------👨🏻‍💻'); + '👇🏻┌------------------------------------------------------------------------------👨🏻‍💻', + ); } const int limitLength = 800; if (message.length < limitLength) { @@ -674,8 +674,10 @@ mixin Vx { outStr.clear(); final int lastIndex = index + 1; if (message.length - lastIndex < limitLength) { - final String remainderStr = - message.substring(lastIndex, message.length); + final String remainderStr = message.substring( + lastIndex, + message.length, + ); debugPrint(remainderStr); break; } @@ -684,7 +686,8 @@ mixin Vx { } if (hasDottedLine) { debugPrint( - '👆🏻└------------------------------------------------------------------------------👨🏻‍💻'); + '👆🏻└------------------------------------------------------------------------------👨🏻‍💻', + ); } } @@ -745,8 +748,10 @@ mixin Vx { for (int i = 0; i < hex.length; i = i + 2) { splitted.add(hex.substring(i, i + 2)); } - final String asciiText = List.generate(splitted.length, - (i) => String.fromCharCode(int.parse(splitted[i], radix: 16))).join(); + final String asciiText = List.generate( + splitted.length, + (i) => String.fromCharCode(int.parse(splitted[i], radix: 16)), + ).join(); return asciiText; } @@ -805,7 +810,11 @@ mixin Vx { /// Get Random Non-Primary Color static Color get randomColor => Color.fromARGB( - 100, Random().nextInt(255), Random().nextInt(255), Random().nextInt(255)); + 100, + Random().nextInt(255), + Random().nextInt(255), + Random().nextInt(255), + ); /// Uses [PathUrlStrategy] on the web, which removes hashes from URLs. This /// must be called at app startup, before `runApp` is called. @@ -846,11 +855,12 @@ class VxAppData { /// Wrap your app with [VxApp] to use [VxState] and [VxStore]. class VxApp extends StatefulWidget { - const VxApp( - {super.key, - required this.builder, - required this.store, - this.interceptors = const []}); + const VxApp({ + super.key, + required this.builder, + required this.store, + this.interceptors = const [], + }); final VxAppBuilder? builder; final VxStore store; final List? interceptors; @@ -867,8 +877,9 @@ class _VxAppState extends State { store: widget.store, interceptors: widget.interceptors!, child: VxConsumer( - mutations: const {VxDarkModeMutation}, - builder: (context, _, status) => widget.builder!(context, appData)), + mutations: const {VxDarkModeMutation}, + builder: (context, _, status) => widget.builder!(context, appData), + ), ); } } diff --git a/test/flutter/card_test.dart b/test/flutter/card_test.dart index a6495399..b4462fee 100644 --- a/test/flutter/card_test.dart +++ b/test/flutter/card_test.dart @@ -19,63 +19,78 @@ void main() { group("Group all card tests", () { testWidgets("Card creates card widget", (WidgetTester tester) async { const Key key = Key('key'); - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: const Text('VelocityX').card.make(key: key), - )); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: const Text('VelocityX').card.make(key: key), + ), + ); expect(find.byKey(key), findsOneWidget); }); testWidgets('Card widget responds to padding', (WidgetTester tester) async { - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: const Text('Velocity').card.p16.make(), - )); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: const Text('Velocity').card.p16.make(), + ), + ); expect(tester.getTopLeft(find.byType(Card)), const Offset(0.0, 0.0)); expect(tester.getTopLeft(find.byType(Text)), const Offset(16.0, 16.0)); }); testWidgets('Card Widget responds to color', (WidgetTester tester) async { - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: const Text('Velocity').card.blue600.make(), - )); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: const Text('Velocity').card.blue600.make(), + ), + ); expect(tester.widget(find.byType(Card)).color, Vx.blue600); }); - testWidgets('Card widget responds to zero Elevation', - (WidgetTester tester) async { - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: const Text('Velocity').card.zero.make(), - )); + testWidgets('Card widget responds to zero Elevation', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: const Text('Velocity').card.zero.make(), + ), + ); expect(tester.widget(find.byType(Card)).elevation, 0); }); - testWidgets('Card widget responds to custom Elevation', - (WidgetTester tester) async { - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: const Text('Velocity').card.elevation(20).make(), - )); + testWidgets('Card widget responds to custom Elevation', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: const Text('Velocity').card.elevation(20).make(), + ), + ); expect(tester.widget(find.byType(Card)).elevation, 20); }); - testWidgets('Card Widget responds to custom shape', - (WidgetTester tester) async { - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: const Text('Velocity').card.withRounded(value: 15).make(), - )); + testWidgets('Card Widget responds to custom shape', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: const Text('Velocity').card.withRounded(value: 15).make(), + ), + ); - final roundedRectangleBorder = tester - .widget(find.byType(Card)) - .shape as RoundedRectangleBorder; + final roundedRectangleBorder = + tester.widget(find.byType(Card)).shape + as RoundedRectangleBorder; expect(roundedRectangleBorder.borderRadius, BorderRadius.circular(15)); }); }); diff --git a/test/flutter/container_test.dart b/test/flutter/container_test.dart index 1ed272ee..ff1cd604 100644 --- a/test/flutter/container_test.dart +++ b/test/flutter/container_test.dart @@ -18,10 +18,12 @@ import 'package:velocity_x/velocity_x.dart'; void main() { group("Group all container tests", () { testWidgets('box creates a Container', (WidgetTester tester) async { - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: const Text('Velocity').box.make(), - )); + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: const Text('Velocity').box.make(), + ), + ); expect(find.byType(Container), findsOneWidget); }); @@ -39,12 +41,15 @@ void main() { expect(find.byKey(key), findsOneWidget); }); - testWidgets('VelocityBox reponds to height and width', - (WidgetTester tester) async { + testWidgets('VelocityBox reponds to height and width', ( + WidgetTester tester, + ) async { const Key key = Key('Key'); - await tester.pumpWidget(Material( - child: Center(child: VxBox().height(100).width(500).make(key: key)), - )); + await tester.pumpWidget( + Material( + child: Center(child: VxBox().height(100).width(500).make(key: key)), + ), + ); final size = tester.getRect(find.byKey(key)); expect(size.height, 100); @@ -52,14 +57,16 @@ void main() { }); testWidgets('VelocityBox reponds to padding', (WidgetTester tester) async { - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: Material( - child: Center( - child: VxBox(child: const Text('VelocityX')).p16.make(), + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Material( + child: Center( + child: VxBox(child: const Text('VelocityX')).p16.make(), + ), ), ), - )); + ); final containerRect = tester.getRect(find.byType(Container)); final textRect = tester.getRect(find.byType(Text)); @@ -70,18 +77,21 @@ void main() { expect(containerRect.bottom, textRect.bottom + 16); }); - testWidgets('VelocityBox reponds to custom padding', - (WidgetTester tester) async { - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: Material( - child: Center( - child: VxBox(child: const Text('VelocityX')) - .padding(const EdgeInsets.fromLTRB(16, 10, 5, 18)) - .make(), + testWidgets('VelocityBox reponds to custom padding', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Material( + child: Center( + child: VxBox( + child: const Text('VelocityX'), + ).padding(const EdgeInsets.fromLTRB(16, 10, 5, 18)).make(), + ), ), ), - )); + ); final containerRect = tester.getRect(find.byType(Container)); final textRect = tester.getRect(find.byType(Text)); @@ -94,22 +104,25 @@ void main() { testWidgets('VelocityBox responds to color', (WidgetTester tester) async { await tester.pumpWidget(VxBox().height(50).width(50).red200.make()); - final decoration = tester - .widget(find.byType(Container)) - .decoration as BoxDecoration; + final decoration = + tester.widget(find.byType(Container)).decoration + as BoxDecoration; expect(decoration.color, Vx.red200); }); - testWidgets('VelocityBox reponds to alignment', - (WidgetTester tester) async { - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: Material( - child: Center( - child: VxBox(child: const Text('VelocityX')).alignCenter.make(), + testWidgets('VelocityBox reponds to alignment', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Material( + child: Center( + child: VxBox(child: const Text('VelocityX')).alignCenter.make(), + ), ), ), - )); + ); final containerRect = tester.getRect(find.byType(Container)); final textRect = tester.getRect(find.byType(Text)); @@ -124,77 +137,90 @@ void main() { // box shadow defined for shadowLg final shadow = [ const BoxShadow( - color: Color(0x33000000), - offset: Offset(0.0, 2.0), - blurRadius: 4.0, - spreadRadius: -1.0, - blurStyle: BlurStyle.normal), + color: Color(0x33000000), + offset: Offset(0.0, 2.0), + blurRadius: 4.0, + spreadRadius: -1.0, + blurStyle: BlurStyle.normal, + ), const BoxShadow( - color: Color(0x24000000), - offset: Offset(0.0, 4.0), - blurRadius: 5.0, - spreadRadius: 0.0, - blurStyle: BlurStyle.normal), + color: Color(0x24000000), + offset: Offset(0.0, 4.0), + blurRadius: 5.0, + spreadRadius: 0.0, + blurStyle: BlurStyle.normal, + ), const BoxShadow( - color: Color(0x1f000000), - offset: Offset(0.0, 1.0), - blurRadius: 10.0, - spreadRadius: 0.0, - blurStyle: BlurStyle.normal) + color: Color(0x1f000000), + offset: Offset(0.0, 1.0), + blurRadius: 10.0, + spreadRadius: 0.0, + blurStyle: BlurStyle.normal, + ), ]; - final decoration = tester - .widget(find.byType(Container)) - .decoration as BoxDecoration; + final decoration = + tester.widget(find.byType(Container)).decoration + as BoxDecoration; expect(decoration.boxShadow, shadow); }); - testWidgets('VelocityBox responds to border radius', - (WidgetTester tester) async { + testWidgets('VelocityBox responds to border radius', ( + WidgetTester tester, + ) async { await tester.pumpWidget(VxBox().height(40).width(40).roundedFull.make()); - final decoration = tester - .widget(find.byType(Container)) - .decoration as BoxDecoration; + final decoration = + tester.widget(find.byType(Container)).decoration + as BoxDecoration; // when borderRadius is roundedFull, the shape is BoxShape.circle expect(decoration.shape, BoxShape.circle); }); - testWidgets('VelocityBox responds to custom border radius', - (WidgetTester tester) async { + testWidgets('VelocityBox responds to custom border radius', ( + WidgetTester tester, + ) async { await tester.pumpWidget( - VxBox().height(40).width(40).withRounded(value: 19).make()); + VxBox().height(40).width(40).withRounded(value: 19).make(), + ); - final decoration = tester - .widget(find.byType(Container)) - .decoration as BoxDecoration; + final decoration = + tester.widget(find.byType(Container)).decoration + as BoxDecoration; expect(decoration.borderRadius, BorderRadius.circular(19)); }); - testWidgets('VelocityBox responds to gradient', - (WidgetTester tester) async { - await tester.pumpWidget(VxBox() - .height(40) - .width(40) - .linearGradient([Vx.red300, Vx.blue600]).make()); - - final decoration = tester - .widget(find.byType(Container)) - .decoration as BoxDecoration; - expect(decoration.gradient, - const LinearGradient(colors: [Vx.red300, Vx.blue600])); + testWidgets('VelocityBox responds to gradient', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + VxBox().height(40).width(40).linearGradient([ + Vx.red300, + Vx.blue600, + ]).make(), + ); + + final decoration = + tester.widget(find.byType(Container)).decoration + as BoxDecoration; + expect( + decoration.gradient, + const LinearGradient(colors: [Vx.red300, Vx.blue600]), + ); }); testWidgets('VelocityBox responds to border', (WidgetTester tester) async { - await tester.pumpWidget(VxBox() - .width(100) - .height(100) - .border(color: Vx.green100, width: 3) - .make()); - - final decoration = tester - .widget(find.byType(Container)) - .decoration as BoxDecoration; + await tester.pumpWidget( + VxBox() + .width(100) + .height(100) + .border(color: Vx.green100, width: 3) + .make(), + ); + + final decoration = + tester.widget(find.byType(Container)).decoration + as BoxDecoration; expect(decoration.border!.isUniform, true); expect(decoration.border!.top.width, 3); expect(decoration.border!.top.color, Vx.green100); diff --git a/test/flutter/drop_down_button_test.dart b/test/flutter/drop_down_button_test.dart index c1507822..8fdf9aa7 100644 --- a/test/flutter/drop_down_button_test.dart +++ b/test/flutter/drop_down_button_test.dart @@ -16,25 +16,28 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:velocity_x/velocity_x.dart'; void main() { - testWidgets('user is able to select value from drop down', - (WidgetTester tester) async { + testWidgets('user is able to select value from drop down', ( + WidgetTester tester, + ) async { String? value = 'HEY'; - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: MaterialApp( - home: Material( - child: ['HELLO', 'HEY', 'HOLA'] - .textDropDown( - selectedValue: value, - onChanged: (cvalue) { - value = cvalue; - }, - ) - .make() - .centered(), + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: MaterialApp( + home: Material( + child: ['HELLO', 'HEY', 'HOLA'] + .textDropDown( + selectedValue: value, + onChanged: (cvalue) { + value = cvalue; + }, + ) + .make() + .centered(), + ), ), ), - )); + ); // Expects one widget with Text HEY expect(find.text('HEY'), findsOneWidget); diff --git a/test/flutter/ext_test/ext_test.dart b/test/flutter/ext_test/ext_test.dart index 01c96613..83549129 100644 --- a/test/flutter/ext_test/ext_test.dart +++ b/test/flutter/ext_test/ext_test.dart @@ -30,9 +30,7 @@ void main() { }); test('toEther', () { - final value = VxWeb3.toEther( - fromWei: BigInt.from(1000000000000000), - ); + final value = VxWeb3.toEther(fromWei: BigInt.from(1000000000000000)); expect(0.001, value); }); diff --git a/test/flutter/gesture_test.dart b/test/flutter/gesture_test.dart index 0cb947cc..db4fa7c4 100644 --- a/test/flutter/gesture_test.dart +++ b/test/flutter/gesture_test.dart @@ -16,20 +16,22 @@ import 'package:velocity_x/velocity_x.dart'; void main() { group("Group all gesture tests", () { - testWidgets('onTap for GestureDetector is working correctly', - (WidgetTester tester) async { + testWidgets('onTap for GestureDetector is working correctly', ( + WidgetTester tester, + ) async { bool didTap = false; - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: Material( - child: 'VelocityX' - .text - .make() - .click(() => didTap = true) - .make() - .centered(), + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Material( + child: 'VelocityX'.text + .make() + .click(() => didTap = true) + .make() + .centered(), + ), ), - )); + ); expect(didTap, isFalse); await tester.tap(find.text('VelocityX')); @@ -37,20 +39,22 @@ void main() { expect(didTap, isTrue); }); - testWidgets('onLongPress for GestureDetector is working correctly', - (WidgetTester tester) async { + testWidgets('onLongPress for GestureDetector is working correctly', ( + WidgetTester tester, + ) async { bool didLongPress = false; - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: Material( - child: 'VelocityX' - .text - .make() - .longClick(() => didLongPress = true) - .make() - .centered(), + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Material( + child: 'VelocityX'.text + .make() + .longClick(() => didLongPress = true) + .make() + .centered(), + ), ), - )); + ); expect(didLongPress, isFalse); await tester.longPress(find.text('VelocityX')); @@ -58,20 +62,22 @@ void main() { expect(didLongPress, isTrue); }); - testWidgets('onTap for InkWell is working correctly', - (WidgetTester tester) async { + testWidgets('onTap for InkWell is working correctly', ( + WidgetTester tester, + ) async { bool didTap = false; - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: Material( - child: 'VelocityX' - .text - .make() - .mdClick(() => didTap = true) - .make() - .centered(), + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Material( + child: 'VelocityX'.text + .make() + .mdClick(() => didTap = true) + .make() + .centered(), + ), ), - )); + ); expect(didTap, isFalse); await tester.tap(find.text('VelocityX')); @@ -79,20 +85,22 @@ void main() { expect(didTap, isTrue); }); - testWidgets('onLongPress for InkWell is working correctly', - (WidgetTester tester) async { + testWidgets('onLongPress for InkWell is working correctly', ( + WidgetTester tester, + ) async { bool didLongPress = false; - await tester.pumpWidget(Directionality( - textDirection: TextDirection.ltr, - child: Material( - child: 'VelocityX' - .text - .make() - .mdLongClick(() => didLongPress = true) - .make() - .centered(), + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Material( + child: 'VelocityX'.text + .make() + .mdLongClick(() => didLongPress = true) + .make() + .centered(), + ), ), - )); + ); expect(didLongPress, isFalse); await tester.longPress(find.text('VelocityX')); diff --git a/test/flutter/popup_menu_test.dart b/test/flutter/popup_menu_test.dart index 911051ed..d5ac55ee 100644 --- a/test/flutter/popup_menu_test.dart +++ b/test/flutter/popup_menu_test.dart @@ -25,70 +25,55 @@ void main() { group("Popup Menu test", () { testWidgets("Popup Menu widget test", (WidgetTester tester) async { const Key key = Key('key'); - await tester.pumpWidget(MaterialApp( + await tester.pumpWidget( + MaterialApp( home: VxPopupMenu( - key: key, - menuBuilder: () => ClipRRect( - borderRadius: BorderRadius.circular(5), - child: IntrinsicWidth( - child: VStack( - [ - ItemModel( - "Chat", - Icons.chat_bubble, - ), - ItemModel( - "Add", - Icons.group_add, - ) - ] - .map( - (item) => GestureDetector( - behavior: HitTestBehavior.translucent, - onTap: () { - Vx.log(item.title); - }, - child: HStack( - [ - Icon( - item.icon, - size: 15, - color: Colors.white, - ), - Expanded( - child: Text( - item.title, - style: const TextStyle( - color: Colors.white, - fontSize: 12, + key: key, + menuBuilder: () => ClipRRect( + borderRadius: BorderRadius.circular(5), + child: IntrinsicWidth( + child: VStack( + [ + ItemModel("Chat", Icons.chat_bubble), + ItemModel("Add", Icons.group_add), + ] + .map( + (item) => GestureDetector( + behavior: HitTestBehavior.translucent, + onTap: () { + Vx.log(item.title); + }, + child: HStack( + [ + Icon(item.icon, size: 15, color: Colors.white), + Expanded( + child: + Text( + item.title, + style: const TextStyle( + color: Colors.white, + fontSize: 12, + ), + ).box + .margin(Vx.mOnly(left: 10)) + .padding(Vx.mSymmetric(v: 10)) + .make(), ), - ) - .box - .margin(Vx.mOnly(left: 10)) - .padding(Vx.mSymmetric(v: 10)) - .make(), - ), - ], - ).box.height(40).padding(Vx.mSymmetric(h: 20)).make(), - ), - ) - .toList(), - crossAlignment: CrossAxisAlignment.stretch, + ], + ).box.height(40).padding(Vx.mSymmetric(h: 20)).make(), + ), + ) + .toList(), + crossAlignment: CrossAxisAlignment.stretch, + ), + ).box.color(const Color(0xFF4C4C4C)).make(), ), - ) - .box - .color( - const Color(0xFF4C4C4C), - ) - .make(), + clickType: VxClickType.singleClick, + verticalMargin: -10, + child: Container(padding: Vx.m20, child: const Icon(Icons.menu)), + ), ), - clickType: VxClickType.singleClick, - verticalMargin: -10, - child: Container( - padding: Vx.m20, - child: const Icon(Icons.menu), - ), - ))); + ); expect(find.byKey(key), findsOneWidget); await tester.tap(find.byKey(key)); diff --git a/test/flutter/rich_text_test.dart b/test/flutter/rich_text_test.dart index 72e7a422..4428ef84 100644 --- a/test/flutter/rich_text_test.dart +++ b/test/flutter/rich_text_test.dart @@ -18,31 +18,36 @@ import 'package:velocity_x/velocity_x.dart'; void main() { Directionality directionalityWidget({required Widget child}) => - Directionality( - textDirection: TextDirection.ltr, - child: child, - ); + Directionality(textDirection: TextDirection.ltr, child: child); group("Group all rich text tests", () { - testWidgets('richText creates RichText Widget', - (WidgetTester tester) async { + testWidgets('richText creates RichText Widget', ( + WidgetTester tester, + ) async { const Key key = Key('key'); await tester.pumpWidget( - directionalityWidget(child: 'VelocityX'.richText.make(key: key))); + directionalityWidget(child: 'VelocityX'.richText.make(key: key)), + ); expect(find.byKey(key), findsOneWidget); // The rich text is type of AutoSizeText const expect(tester.widget(find.byKey(key)).runtimeType, AutoSizeText); - expect(tester.widget(find.byKey(key)).textSpan!.text, - 'VelocityX'); + expect( + tester.widget(find.byKey(key)).textSpan!.text, + 'VelocityX', + ); }); - testWidgets('VelocityXRichTextBuilder responds to children', - (WidgetTester tester) async { + testWidgets('VelocityXRichTextBuilder responds to children', ( + WidgetTester tester, + ) async { const Key key = Key('key'); - await tester.pumpWidget(directionalityWidget( - child: 'VelocityX' - .richText - .withTextSpanChildren([' Hey '.textSpan.make()]).make(key: key))); + await tester.pumpWidget( + directionalityWidget( + child: 'VelocityX'.richText + .withTextSpanChildren([' Hey '.textSpan.make()]) + .make(key: key), + ), + ); final AutoSizeText autoSizeText = tester.widget(find.byKey(key)); // expect( @@ -53,8 +58,9 @@ void main() { expect(autoSizeText.textSpan!.children!.length, 1); }); - testWidgets('VelocityXRichTextBuilder responds to onTap', - (WidgetTester tester) async { + testWidgets('VelocityXRichTextBuilder responds to onTap', ( + WidgetTester tester, + ) async { const Key key = Key('key'); bool didTap = false; await tester.pumpWidget( @@ -69,15 +75,18 @@ void main() { expect(didTap, isTrue); }); - testWidgets('VelocityXRichTextBuilder children responds to onTap', - (WidgetTester tester) async { + testWidgets('VelocityXRichTextBuilder children responds to onTap', ( + WidgetTester tester, + ) async { const Key key = Key('key'); bool didTap = false; await tester.pumpWidget( directionalityWidget( - child: 'VelocityX'.richText.withTextSpanChildren([ - ' Hey '.textSpan.tap(() => didTap = true).make() - ]).make(key: key), + child: 'VelocityX'.richText + .withTextSpanChildren([ + ' Hey '.textSpan.tap(() => didTap = true).make(), + ]) + .make(key: key), ), ); @@ -86,83 +95,109 @@ void main() { expect(didTap, isTrue); }); - testWidgets('VelocityXRichTextBuilder responds to decoration', - (WidgetTester tester) async { + testWidgets('VelocityXRichTextBuilder responds to decoration', ( + WidgetTester tester, + ) async { const Key key = Key('key'); - await tester.pumpWidget(directionalityWidget( - child: 'VelocityX'.richText.underline.make(key: key))); + await tester.pumpWidget( + directionalityWidget( + child: 'VelocityX'.richText.underline.make(key: key), + ), + ); expect( - tester - .widget(find.byKey(key)) - .textSpan! - .style! - .decoration, - TextDecoration.underline); + tester + .widget(find.byKey(key)) + .textSpan! + .style! + .decoration, + TextDecoration.underline, + ); }); - testWidgets('VelocityXRichTextBuilder responds to color', - (WidgetTester tester) async { + testWidgets('VelocityXRichTextBuilder responds to color', ( + WidgetTester tester, + ) async { const Key key = Key('key'); - await tester.pumpWidget(directionalityWidget( - child: 'VelocityX'.richText.green100.make(key: key))); + await tester.pumpWidget( + directionalityWidget( + child: 'VelocityX'.richText.green100.make(key: key), + ), + ); expect( - tester.widget(find.byKey(key)).textSpan!.style!.color, - Vx.green100); + tester.widget(find.byKey(key)).textSpan!.style!.color, + Vx.green100, + ); }); - testWidgets('VelocityXRichTextBuilder responds to color', - (WidgetTester tester) async { + testWidgets('VelocityXRichTextBuilder responds to color', ( + WidgetTester tester, + ) async { const Key key = Key('key'); - await tester.pumpWidget(directionalityWidget( - child: 'VelocityX'.richText.green100.make(key: key))); + await tester.pumpWidget( + directionalityWidget( + child: 'VelocityX'.richText.green100.make(key: key), + ), + ); expect( - tester.widget(find.byKey(key)).textSpan!.style!.color, - Vx.green100); + tester.widget(find.byKey(key)).textSpan!.style!.color, + Vx.green100, + ); }); - testWidgets('VelocityXRichTextBuilder responds to fontSize', - (WidgetTester tester) async { + testWidgets('VelocityXRichTextBuilder responds to fontSize', ( + WidgetTester tester, + ) async { const Key key = Key('key'); - await tester.pumpWidget(directionalityWidget( - child: 'VelocityX'.richText.size(20).make(key: key))); + await tester.pumpWidget( + directionalityWidget( + child: 'VelocityX'.richText.size(20).make(key: key), + ), + ); expect( - tester - .widget(find.byKey(key)) - .textSpan! - .style! - .fontSize, - 20); + tester.widget(find.byKey(key)).textSpan!.style!.fontSize, + 20, + ); }); - testWidgets('VelocityXRichTextBuilder responds to letterSpacing', - (WidgetTester tester) async { + testWidgets('VelocityXRichTextBuilder responds to letterSpacing', ( + WidgetTester tester, + ) async { const Key key = Key('key'); - await tester.pumpWidget(directionalityWidget( - child: 'VelocityX'.richText.letterSpacing(4).make(key: key))); + await tester.pumpWidget( + directionalityWidget( + child: 'VelocityX'.richText.letterSpacing(4).make(key: key), + ), + ); expect( - tester - .widget(find.byKey(key)) - .textSpan! - .style! - .letterSpacing, - 4); + tester + .widget(find.byKey(key)) + .textSpan! + .style! + .letterSpacing, + 4, + ); }); - testWidgets('VelocityXRichTextBuilder responds to lineHeight', - (WidgetTester tester) async { + testWidgets('VelocityXRichTextBuilder responds to lineHeight', ( + WidgetTester tester, + ) async { const Key key = Key('key'); - await tester.pumpWidget(directionalityWidget( - child: 'VelocityX'.richText.heightSnug.make(key: key))); + await tester.pumpWidget( + directionalityWidget( + child: 'VelocityX'.richText.heightSnug.make(key: key), + ), + ); // The value of heightSnug is 0.875 expect( - tester.widget(find.byKey(key)).textSpan!.style!.height, - 0.875); + tester.widget(find.byKey(key)).textSpan!.style!.height, + 0.875, + ); }); }); } diff --git a/test/flutter/scroll_test.dart b/test/flutter/scroll_test.dart index 1328b988..9583e41e 100644 --- a/test/flutter/scroll_test.dart +++ b/test/flutter/scroll_test.dart @@ -17,47 +17,44 @@ import 'package:velocity_x/velocity_x.dart'; void main() { group("Group all Scroll tests", () { testWidgets( - 'scollVertical extension create vertical SingleChildScrollView ', - (WidgetTester tester) async { - await tester.pumpWidget(Container( - height: 1000, - ).scrollVertical()); + 'scollVertical extension create vertical SingleChildScrollView ', + (WidgetTester tester) async { + await tester.pumpWidget(Container(height: 1000).scrollVertical()); - expect(find.byType(SingleChildScrollView), findsOneWidget); - expect( - tester - .widget(find.byType(SingleChildScrollView)) - .scrollDirection, - Axis.vertical, - ); - }); + expect(find.byType(SingleChildScrollView), findsOneWidget); + expect( + tester + .widget(find.byType(SingleChildScrollView)) + .scrollDirection, + Axis.vertical, + ); + }, + ); testWidgets( - 'scrollHorizontal extension create horizontal SingleChildScrollView ', - (WidgetTester tester) async { - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: Container( - width: 1000, - ).scrollHorizontal(), - ), - ); + 'scrollHorizontal extension create horizontal SingleChildScrollView ', + (WidgetTester tester) async { + await tester.pumpWidget( + Directionality( + textDirection: TextDirection.ltr, + child: Container(width: 1000).scrollHorizontal(), + ), + ); - expect(find.byType(SingleChildScrollView), findsOneWidget); - expect( - tester - .widget(find.byType(SingleChildScrollView)) - .scrollDirection, - Axis.horizontal, - ); - }); + expect(find.byType(SingleChildScrollView), findsOneWidget); + expect( + tester + .widget(find.byType(SingleChildScrollView)) + .scrollDirection, + Axis.horizontal, + ); + }, + ); - testWidgets('scollVertical is working correctly ', - (WidgetTester tester) async { - await tester.pumpWidget(Container( - height: 1000, - ).scrollVertical()); + testWidgets('scollVertical is working correctly ', ( + WidgetTester tester, + ) async { + await tester.pumpWidget(Container(height: 1000).scrollVertical()); final RenderBox box = tester.renderObject(find.byType(Container)); // convert the Offset(0,0) of Container to Global coordinates @@ -65,20 +62,21 @@ void main() { expect(box.localToGlobal(Offset.zero), equals(Offset.zero)); // perform the scroll up action await tester.drag( - find.byType(SingleChildScrollView), const Offset(-200.0, -300.0)); + find.byType(SingleChildScrollView), + const Offset(-200.0, -300.0), + ); // once the scroll up is performed, the starting point of Container // will Offset(0,-300) expect(box.localToGlobal(Offset.zero), equals(const Offset(0.0, -300.0))); }); - testWidgets('scrollHorizontal is working correctly ', - (WidgetTester tester) async { + testWidgets('scrollHorizontal is working correctly ', ( + WidgetTester tester, + ) async { await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, - child: Container( - width: 1600, - ).scrollHorizontal(), + child: Container(width: 1600).scrollHorizontal(), ), ); @@ -88,7 +86,9 @@ void main() { expect(box.localToGlobal(Offset.zero), equals(Offset.zero)); // perform the scroll left action await tester.drag( - find.byType(SingleChildScrollView), const Offset(-300.0, 0.0)); + find.byType(SingleChildScrollView), + const Offset(-300.0, 0.0), + ); // once the scroll left is performed, the starting point of Container // will Offset(-300,0) expect(box.localToGlobal(Offset.zero), equals(const Offset(-300.0, 0.0))); diff --git a/test/flutter/text_test.dart b/test/flutter/text_test.dart index a8da7d82..969c9dc9 100644 --- a/test/flutter/text_test.dart +++ b/test/flutter/text_test.dart @@ -19,10 +19,7 @@ import 'package:velocity_x/velocity_x.dart'; void main() { Directionality getDirectionalityWidget({required Widget child}) => - Directionality( - textDirection: TextDirection.ltr, - child: child, - ); + Directionality(textDirection: TextDirection.ltr, child: child); group("New features from Delikin", () { test("String to DateString", () async { @@ -53,9 +50,7 @@ void main() { group("Group all text tests", () { testWidgets('text used on String creates a Text Widget', (tester) async { await tester.pumpWidget( - getDirectionalityWidget( - child: 'VelocityX'.text.make(), - ), + getDirectionalityWidget(child: 'VelocityX'.text.make()), ); expect( @@ -66,9 +61,7 @@ void main() { testWidgets('Text widget responds to Font Scale', (tester) async { await tester.pumpWidget( - getDirectionalityWidget( - child: 'VelocityX'.text.xs.make(), - ), + getDirectionalityWidget(child: 'VelocityX'.text.xs.make()), ); // Scale Factor for xs is 0.75 @@ -80,9 +73,7 @@ void main() { testWidgets('Text widget responds to fontSize', (tester) async { await tester.pumpWidget( - getDirectionalityWidget( - child: "VelocityX".text.size(24).make(), - ), + getDirectionalityWidget(child: "VelocityX".text.size(24).make()), ); expect( @@ -93,9 +84,7 @@ void main() { testWidgets('Text widget responds to FontWeight', (tester) async { await tester.pumpWidget( - getDirectionalityWidget( - child: 'VelocityX'.text.medium.make(), - ), + getDirectionalityWidget(child: 'VelocityX'.text.medium.make()), ); // Font Weight for medium is 500 @@ -110,7 +99,8 @@ void main() { testWidgets('Text widget responds to FontStyle', (tester) async { await tester.pumpWidget( - getDirectionalityWidget(child: 'VelocityX'.text.italic.make())); + getDirectionalityWidget(child: 'VelocityX'.text.italic.make()), + ); expect( tester.widget(find.byType(AutoSizeText)).style!.fontStyle, @@ -120,82 +110,106 @@ void main() { testWidgets('Text widget responds to alignment', (tester) async { await tester.pumpWidget( - getDirectionalityWidget(child: 'VelocityX'.text.start.make())); + getDirectionalityWidget(child: 'VelocityX'.text.start.make()), + ); - expect(tester.widget(find.byType(AutoSizeText)).textAlign, - TextAlign.start); + expect( + tester.widget(find.byType(AutoSizeText)).textAlign, + TextAlign.start, + ); }); testWidgets('Text widget responds to letter spacing', (tester) async { await tester.pumpWidget( - getDirectionalityWidget(child: 'VelocityX'.text.tightest.make())); + getDirectionalityWidget(child: 'VelocityX'.text.tightest.make()), + ); expect( - tester - .widget(find.byType(AutoSizeText)) - .style! - .letterSpacing, - -3.0); + tester + .widget(find.byType(AutoSizeText)) + .style! + .letterSpacing, + -3.0, + ); }); - testWidgets('Text widget responds to custom letter spacing', - (tester) async { - await tester.pumpWidget(getDirectionalityWidget( - child: 'VelocityX'.text.letterSpacing(4.0).make())); + testWidgets('Text widget responds to custom letter spacing', ( + tester, + ) async { + await tester.pumpWidget( + getDirectionalityWidget( + child: 'VelocityX'.text.letterSpacing(4.0).make(), + ), + ); expect( - tester - .widget(find.byType(AutoSizeText)) - .style! - .letterSpacing, - 4.0); + tester + .widget(find.byType(AutoSizeText)) + .style! + .letterSpacing, + 4.0, + ); }); testWidgets('Text widget responds to TextDecoration', (tester) async { await tester.pumpWidget( - getDirectionalityWidget(child: 'VelocityX'.text.underline.make())); + getDirectionalityWidget(child: 'VelocityX'.text.underline.make()), + ); expect( - tester - .widget(find.byType(AutoSizeText)) - .style! - .decoration, - TextDecoration.underline); + tester + .widget(find.byType(AutoSizeText)) + .style! + .decoration, + TextDecoration.underline, + ); }); testWidgets('Text widget responds to line height', (tester) async { await tester.pumpWidget( - getDirectionalityWidget(child: 'VelocityX'.text.heightSnug.make())); + getDirectionalityWidget(child: 'VelocityX'.text.heightSnug.make()), + ); // Line Height or heightSnug is 0.875 expect( - tester.widget(find.byType(AutoSizeText)).style!.height, - 0.875); + tester.widget(find.byType(AutoSizeText)).style!.height, + 0.875, + ); }); testWidgets('Text widget responds to text utilities', (tester) async { await tester.pumpWidget( - getDirectionalityWidget(child: 'VelocityX'.text.uppercase.make())); + getDirectionalityWidget(child: 'VelocityX'.text.uppercase.make()), + ); - expect(tester.widget(find.byType(AutoSizeText)).data, - 'VELOCITYX'); + expect( + tester.widget(find.byType(AutoSizeText)).data, + 'VELOCITYX', + ); }); testWidgets('key is properly assigned', (tester) async { - await tester.pumpWidget(getDirectionalityWidget( - child: 'VelocityX'.text.uppercase.make(key: const Key("key")))); + await tester.pumpWidget( + getDirectionalityWidget( + child: 'VelocityX'.text.uppercase.make(key: const Key("key")), + ), + ); - expect(tester.widget(find.byKey(const Key('key'))).runtimeType, - AutoSizeText); + expect( + tester.widget(find.byKey(const Key('key'))).runtimeType, + AutoSizeText, + ); }); testWidgets('Text widget responds to color', (tester) async { await tester.pumpWidget( - getDirectionalityWidget(child: 'VelocityX'.text.red300.make())); + getDirectionalityWidget(child: 'VelocityX'.text.red300.make()), + ); expect( - tester.widget(find.byType(AutoSizeText)).style!.color, - Vx.red300); + tester.widget(find.byType(AutoSizeText)).style!.color, + Vx.red300, + ); }); }); } From 2fb9e9c2b2e298ac703efc32218be194e10c8271 Mon Sep 17 00:00:00 2001 From: ShreemanMassTech Date: Sun, 17 Aug 2025 00:59:09 +0530 Subject: [PATCH 17/19] =?UTF-8?q?=F0=9F=90=9B=20fix(flutter):=20address=20?= =?UTF-8?q?null=20safety=20issues=20in=20viewport=20finding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - handles potential null value of RenderObject - changes `RenderAbstractViewport.of` to `RenderAbstractViewport.maybeOf` --- lib/src/flutter/common/velocity_ensure_visible.dart | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/src/flutter/common/velocity_ensure_visible.dart b/lib/src/flutter/common/velocity_ensure_visible.dart index 87c28ff0..d006d761 100644 --- a/lib/src/flutter/common/velocity_ensure_visible.dart +++ b/lib/src/flutter/common/velocity_ensure_visible.dart @@ -51,15 +51,13 @@ class VxEnsureVisibleWhenFocused extends StatefulWidget { final Duration duration; @override - VxEnsureVisibleWhenFocusedState createState() => - VxEnsureVisibleWhenFocusedState(); + VxEnsureVisibleWhenFocusedState createState() => VxEnsureVisibleWhenFocusedState(); } /// /// We implement the WidgetsBindingObserver to be notified of any change to the window metrics /// -class VxEnsureVisibleWhenFocusedState extends State - with WidgetsBindingObserver { +class VxEnsureVisibleWhenFocusedState extends State with WidgetsBindingObserver { @override void initState() { super.initState(); @@ -121,7 +119,7 @@ class VxEnsureVisibleWhenFocusedState extends State // Find the object which has the focus // ignore: use_build_context_synchronously final RenderObject? object = context.findRenderObject(); - final RenderAbstractViewport viewport = RenderAbstractViewport.of(object); + final RenderAbstractViewport? viewport = RenderAbstractViewport.maybeOf(object); // If we are not working in a Scrollable, skip this routine // ignore: unnecessary_null_comparison @@ -140,8 +138,7 @@ class VxEnsureVisibleWhenFocusedState extends State if (position.pixels > viewport.getOffsetToReveal(object!, 0.0).offset) { // Move down to the top of the viewport alignment = 0.0; - } else if (position.pixels < - viewport.getOffsetToReveal(object, 1.0).offset) { + } else if (position.pixels < viewport.getOffsetToReveal(object, 1.0).offset) { // Move up to the bottom of the viewport alignment = 1.0; } else { From 8273c7125a0aa3c9807280c84c7f8691f0d9f41f Mon Sep 17 00:00:00 2001 From: ShreemanMassTech Date: Sun, 17 Aug 2025 01:02:24 +0530 Subject: [PATCH 18/19] =?UTF-8?q?=E2=9C=A8=20feat(core):=20enhance=20code?= =?UTF-8?q?=20formatting=20and=20update=20dependencies=20=20=20-=20?= =?UTF-8?q?=E3=80=90style=E3=80=91:=20Configure=20code=20formatter=20to=20?= =?UTF-8?q?preserve=20trailing=20commas=20and=20set=20page=20width=20to=20?= =?UTF-8?q?260.=20=20=20-=20=E3=80=90build=E3=80=91:=20Update=20Flutter=20?= =?UTF-8?q?SDK=20version=20to=20>=3D3.0.0.=20=20=20-=20=E3=80=90build?= =?UTF-8?q?=E3=80=91:=20Bump=20package=20version=20to=204.4.0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analysis_options.yaml | 3 +++ pubspec.yaml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index eeee8595..2dbb3429 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -19,3 +19,6 @@ linter: - unnecessary_statements - unsafe_html - use_super_parameters +formatter: + trailing_commas: preserve + page_width: 260 \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index dd546fa8..23cd0962 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,13 +1,13 @@ name: velocity_x description: A minimalist Flutter framework for rapidly building custom designs. -version: 4.3.1 +version: 4.4.0 homepage: https://velocityx.dev repository: https://github.com/iampawan/VelocityX documentation: https://velocityx.dev environment: sdk: ">=3.9.0 <4.0.0" - flutter: ">=2.0.0" + flutter: ">=3.0.0" dependencies: auto_size_text_pk: ^3.0.0 From 60a22f1b716ef5f26ad78ee70a381df90373882a Mon Sep 17 00:00:00 2001 From: ShreemanMassTech Date: Sun, 17 Aug 2025 01:03:19 +0530 Subject: [PATCH 19/19] =?UTF-8?q?=F0=9F=93=9D=20docs(changelog):=20update?= =?UTF-8?q?=20changelog=20for=20version=204.4.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add detailed release notes for version 4.4.0 - include breaking changes, features, fixes, and chores --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 798ed354..9d925be4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ + + + +## [4.4.0] - +- **BREAKING CHANGE**: Minimum supported Flutter version is now 3.0.0. +- feat(core): Enhanced code formatting with a wider page width and preserved trailing commas for better readability. +- chore: Updated various dependencies. +- chore(deps): Updated Dart SDK constraint to `>=3.9.0 <4.0.0`. +- fix(dependencies): Updated various dependencies for improved stability and compatibility. +- fix(flutter): Fixed null safety issue in skeleton animation. +- fix(flutter): Resolved `BuildContext` type issue in toast positioning. +- fix(flutter): Added `BoxConstraints` to fix height issue in tooltips. +- fix(drawer): Replaced deprecated `onPopInvokedWithResult` with `onPopInvoked` to resolve warning. +- fix(flutter): Addressed null safety issues in viewport finding by handling potential null `RenderObject`. +- chore: General code quality improvements including formatting, refactoring, and standardization of `const` constructors. + ## [4.3.1] - - Fix enableFeedback default value in VxUniversal in Flutter 3.29 - Fix clipBehavior for aStack