diff --git a/packages/widget_toolkit/CHANGELOG.md b/packages/widget_toolkit/CHANGELOG.md index 8f8156a1..43738fe6 100644 --- a/packages/widget_toolkit/CHANGELOG.md +++ b/packages/widget_toolkit/CHANGELOG.md @@ -1,3 +1,6 @@ +## [0.1.1] +- Added `SmallButtonType.icon` type to `SmallButton` widget + ## [0.1.0] - Fixed loading state of 'SmallButton' widget ### Breaking changes: diff --git a/packages/widget_toolkit/example/android/build.gradle b/packages/widget_toolkit/example/android/build.gradle index 58a8c74b..713d7f6e 100644 --- a/packages/widget_toolkit/example/android/build.gradle +++ b/packages/widget_toolkit/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/packages/widget_toolkit/example/lib/main.dart b/packages/widget_toolkit/example/lib/main.dart index e8cc0486..5f4eedc9 100644 --- a/packages/widget_toolkit/example/lib/main.dart +++ b/packages/widget_toolkit/example/lib/main.dart @@ -244,9 +244,25 @@ class CommonComponentsPage extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric( vertical: 10, horizontal: 15), - child: SmallButton( - onPressed: () {}, - icon: Icons.home_work_outlined, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SmallButton( + onPressed: () {}, + type: SmallButtonType.icon, + icon: Icons.home_work_outlined, + ), + SmallButton( + onPressed: () {}, + type: SmallButtonType.outline, + icon: Icons.home_work_outlined, + ), + SmallButton( + onPressed: () {}, + type: SmallButtonType.filled, + icon: Icons.home_work_outlined, + ), + ], ), ), ], diff --git a/packages/widget_toolkit/example/pubspec.lock b/packages/widget_toolkit/example/pubspec.lock index 43829ab5..69645222 100644 --- a/packages/widget_toolkit/example/pubspec.lock +++ b/packages/widget_toolkit/example/pubspec.lock @@ -752,7 +752,7 @@ packages: path: ".." relative: true source: path - version: "0.1.1" + version: "0.1.0" xml: dependency: transitive description: diff --git a/packages/widget_toolkit/lib/src/lib_ui_components/buttons/small_button.dart b/packages/widget_toolkit/lib/src/lib_ui_components/buttons/small_button.dart index cbc2fb58..520a2ead 100644 --- a/packages/widget_toolkit/lib/src/lib_ui_components/buttons/small_button.dart +++ b/packages/widget_toolkit/lib/src/lib_ui_components/buttons/small_button.dart @@ -8,7 +8,7 @@ import '../sized_loading_indicator.dart'; import 'button_color_style.dart'; import 'button_state.dart'; -enum SmallButtonType { filled, outline } +enum SmallButtonType { filled, outline, icon } class SmallButton extends StatelessWidget { final String? tooltip; @@ -122,6 +122,16 @@ class SmallButton extends StatelessWidget { onPressed: onPressed, child: icon, ); + case SmallButtonType.icon: + return IconButton( + style: IconButton.styleFrom( + padding: const EdgeInsets.all(0), + shape: const CircleBorder(), + fixedSize: const Size(48, 48), + ), + icon: icon, + onPressed: onPressed, + ); } } diff --git a/packages/widget_toolkit/pubspec.yaml b/packages/widget_toolkit/pubspec.yaml index a9c90270..d17f911f 100644 --- a/packages/widget_toolkit/pubspec.yaml +++ b/packages/widget_toolkit/pubspec.yaml @@ -1,6 +1,6 @@ name: widget_toolkit description: The Widget Toolkit package consists of several lightweight and customisable UI components that boost productivity and reduce the development time. -version: 0.1.0 +version: 0.1.1 repository: https://github.com/Prime-Holding/widget_toolkit/tree/master/packages/widget_toolkit issue_tracker: https://github.com/orgs/Prime-Holding/projects/6 homepage: https://www.primeholding.com diff --git a/packages/widget_toolkit/test/lib_ui_components/buttons/view/small_button_test.dart b/packages/widget_toolkit/test/lib_ui_components/buttons/view/small_button_test.dart index f58498b0..89eaf558 100644 --- a/packages/widget_toolkit/test/lib_ui_components/buttons/view/small_button_test.dart +++ b/packages/widget_toolkit/test/lib_ui_components/buttons/view/small_button_test.dart @@ -8,7 +8,7 @@ import '../factory/small_button_factory.dart'; void main() { runGoldenBuilderTests( 'small_button_golden_tests', - surfaceSize: const Size(700, 350), + surfaceSize: const Size(700, 500), matcherCustomPump: (widget) => widget.pump(const Duration(milliseconds: 350)), builder: GoldenBuilder.grid( @@ -46,6 +46,22 @@ void main() { ..addScenario( 'pressed outlined', smallButtonFactory( - type: SmallButtonType.outline, state: ButtonStateModel.pressed)), + type: SmallButtonType.outline, state: ButtonStateModel.pressed)) + ..addScenario( + 'loading icon', + smallButtonFactory( + type: SmallButtonType.icon, state: ButtonStateModel.loading)) + ..addScenario( + 'enabled icon', + smallButtonFactory( + type: SmallButtonType.icon, state: ButtonStateModel.enabled)) + ..addScenario( + 'disabled icon', + smallButtonFactory( + type: SmallButtonType.icon, state: ButtonStateModel.disabled)) + ..addScenario( + 'pressed icon', + smallButtonFactory( + type: SmallButtonType.icon, state: ButtonStateModel.pressed)), ); }