From 49da514165a2d2db44ed97b6804629f2e695029c Mon Sep 17 00:00:00 2001 From: MahanRahmati Date: Tue, 22 Feb 2022 17:52:40 +0330 Subject: [PATCH] 0.2.3 - Fix ArnaBaseButton - Fix ArnaBottomBarItem - Fix ArnaMasterItem - Fix ArnaSideBarItem - Fix ArnaSegmentedControl - Fix ArnaAlertDialog - Fix ArnaPopupDialo - Fix ArnaProgressIndicator - Update Readme --- CHANGELOG.md | 12 ++++++++++++ README.md | 4 ++-- lib/src/base/base_button.dart | 4 ++++ lib/src/base/bottom_bar_item.dart | 2 ++ lib/src/base/indicator.dart | 6 ++++-- lib/src/base/master_item.dart | 2 ++ lib/src/base/side_bar_item.dart | 2 ++ lib/src/base/side_scaffold.dart | 1 - lib/src/dialogs/dialog.dart | 6 ++++-- lib/src/dialogs/popup_dialog.dart | 8 ++++---- lib/src/inputs/segmented_control.dart | 7 ++++--- pubspec.yaml | 2 +- 12 files changed, 41 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a901f958..cc71a8c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 0.2.3 + +- Fix ArnaBaseButton +- Fix ArnaBottomBarItem +- Fix ArnaMasterItem +- Fix ArnaSideBarItem +- Fix ArnaSegmentedControl +- Fix ArnaAlertDialog +- Fix ArnaPopupDialo +- Fix ArnaProgressIndicator +- Update Readme + ## 0.2.2 - Add selected state to ArnaBaseButton diff --git a/README.md b/README.md index 7fb987aa..ade4e6a6 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Add Arna as a dependency in your pubspec.yaml ```yaml dependencies: - arna: ^0.2.2 + arna: ^0.2.3 ``` And import it @@ -379,7 +379,7 @@ ArnaIconButton( onPressed: () => showArnaDialog( context: context, barrierDismissible: true, - builder: (_) => ArnaAlertDialog( + dialog: ArnaAlertDialog( title: "Title", message: "Message", primary: ArnaTextButton( diff --git a/lib/src/base/base_button.dart b/lib/src/base/base_button.dart index 27fcc7e1..2587b495 100644 --- a/lib/src/base/base_button.dart +++ b/lib/src/base/base_button.dart @@ -149,6 +149,10 @@ class _ArnaBaseButtonState extends State { onTapUp: _handleTapUp, onLongPressStart: _handleTapDown, onLongPressEnd: _handleTapUp, + onHorizontalDragStart: _handleTapDown, + onHorizontalDragEnd: _handleTapUp, + onVerticalDragStart: _handleTapDown, + onVerticalDragEnd: _handleTapUp, child: FocusableActionDetector( enabled: isEnabled && widget.isFocusable, focusNode: focusNode, diff --git a/lib/src/base/bottom_bar_item.dart b/lib/src/base/bottom_bar_item.dart index 54307a8b..2c8da144 100644 --- a/lib/src/base/bottom_bar_item.dart +++ b/lib/src/base/bottom_bar_item.dart @@ -92,10 +92,12 @@ class ArnaBottomBarItem extends StatelessWidget { @override Widget build(BuildContext context) { + bool buttonSelected = selected; return Padding( padding: Styles.small, child: ArnaBaseButton( builder: (context, enabled, hover, focused, pressed, selected) { + selected = buttonSelected; return Stack( alignment: Alignment.bottomCenter, children: [ diff --git a/lib/src/base/indicator.dart b/lib/src/base/indicator.dart index ad0454c7..64176284 100644 --- a/lib/src/base/indicator.dart +++ b/lib/src/base/indicator.dart @@ -86,8 +86,10 @@ class _ArnaProgressIndicatorState extends State painter: _ProgressPainter( color: widget.accentColor ?? ArnaTheme.of(context).accentColor, value: widget.value == null - ? _controller.value * 2 * pi - : value!.clamp(0.0, 1.0) * (pi * 2.0 - .001), + ? _controller.value == 0 + ? 0.001 * 2 * pi + : _controller.value * 2 * pi + : value!.clamp(0.0, 1.0) * (pi * 2.0 - 0.001), offset: widget.value == null, ), ); diff --git a/lib/src/base/master_item.dart b/lib/src/base/master_item.dart index c1e68155..be6339e7 100644 --- a/lib/src/base/master_item.dart +++ b/lib/src/base/master_item.dart @@ -87,10 +87,12 @@ class ArnaMasterItem extends StatelessWidget { @override Widget build(BuildContext context) { Color accent = accentColor ?? ArnaTheme.of(context).accentColor; + bool buttonSelected = selected; return Padding( padding: Styles.small, child: ArnaBaseButton( builder: (context, enabled, hover, focused, pressed, selected) { + selected = buttonSelected; return Stack( alignment: Alignment.centerLeft, children: [ diff --git a/lib/src/base/side_bar_item.dart b/lib/src/base/side_bar_item.dart index 8e11aa98..be926684 100644 --- a/lib/src/base/side_bar_item.dart +++ b/lib/src/base/side_bar_item.dart @@ -98,10 +98,12 @@ class ArnaSideBarItem extends StatelessWidget { @override Widget build(BuildContext context) { Color accent = accentColor ?? ArnaTheme.of(context).accentColor; + bool buttonSelected = selected; return Padding( padding: Styles.small, child: ArnaBaseButton( builder: (context, enabled, hover, focused, pressed, selected) { + selected = buttonSelected; return Stack( alignment: Alignment.centerLeft, children: [ diff --git a/lib/src/base/side_scaffold.dart b/lib/src/base/side_scaffold.dart index 9a594ee5..423b7b58 100644 --- a/lib/src/base/side_scaffold.dart +++ b/lib/src/base/side_scaffold.dart @@ -99,7 +99,6 @@ class _ArnaSideScaffoldState extends State { width: constraints.maxWidth > 960 ? Styles.sideBarWidth : Styles.sideBarCompactWidth, - height: constraints.maxHeight, duration: Styles.basicDuration, curve: Styles.basicCurve, clipBehavior: Clip.antiAlias, diff --git a/lib/src/dialogs/dialog.dart b/lib/src/dialogs/dialog.dart index 86beef0a..a93dfcb3 100644 --- a/lib/src/dialogs/dialog.dart +++ b/lib/src/dialogs/dialog.dart @@ -203,7 +203,7 @@ Future showArnaDialog({ required ArnaAlertDialog dialog, bool barrierDismissible = false, Color barrierColor = ArnaColors.barrierColor, - String? barrierLabel, + String? barrierLabel = "label", bool useRootNavigator = true, RouteSettings? routeSettings, }) { @@ -214,7 +214,9 @@ Future showArnaDialog({ barrierDismissible: barrierDismissible, transitionDuration: Styles.basicDuration, routeSettings: routeSettings, - pageBuilder: (context, animation, secondaryAnimation) => dialog, + pageBuilder: (context, animation, secondaryAnimation) { + return dialog; + }, transitionBuilder: (_, anim, __, child) => phone(context) ? SlideTransition( position: Tween( diff --git a/lib/src/dialogs/popup_dialog.dart b/lib/src/dialogs/popup_dialog.dart index 17a11548..c8e05312 100644 --- a/lib/src/dialogs/popup_dialog.dart +++ b/lib/src/dialogs/popup_dialog.dart @@ -98,11 +98,11 @@ class _ArnaPopupDialog extends StatelessWidget { child: ClipRRect( borderRadius: Styles.borderRadius, child: ArnaScaffold( - headerBarLeading: headerBarLeading, + headerBarLeading: headerBarLeading ?? const SizedBox.shrink(), title: title, headerBarTrailing: Row( children: [ - if (headerBarTrailing != null) headerBarTrailing!, + headerBarTrailing ?? const SizedBox.shrink(), ArnaTextButton( label: "Close", onPressed: Navigator.of(context).pop, @@ -192,11 +192,11 @@ class _ArnaPopupPage extends StatelessWidget { icon: Icons.arrow_back_outlined, onPressed: () => Navigator.pop(context), ), - if (headerBarLeading != null) headerBarLeading!, + headerBarLeading ?? const SizedBox.shrink(), ], ), title: title, - headerBarTrailing: headerBarTrailing, + headerBarTrailing: headerBarTrailing ?? const SizedBox.shrink(), searchField: searchField, banner: banner, body: body, diff --git a/lib/src/inputs/segmented_control.dart b/lib/src/inputs/segmented_control.dart index 42ca342e..97c13e5d 100644 --- a/lib/src/inputs/segmented_control.dart +++ b/lib/src/inputs/segmented_control.dart @@ -109,7 +109,7 @@ class _ArnaSegmentedControlState children.add( _ArnaSegmentedControlItem( label: widget.children[currentKey], - selected: widget.groupValue == currentKey, + buttonSelected: widget.groupValue == currentKey, onPressed: () => _onPressed(currentKey), first: first, last: last, @@ -144,7 +144,7 @@ class _ArnaSegmentedControlItem extends StatelessWidget { const _ArnaSegmentedControlItem({ Key? key, required this.label, - required this.selected, + required this.buttonSelected, required this.onPressed, required this.first, required this.last, @@ -153,7 +153,7 @@ class _ArnaSegmentedControlItem extends StatelessWidget { }) : super(key: key); final String? label; - final bool selected; + final bool buttonSelected; final GestureTapCallback? onPressed; final bool first; final bool last; @@ -185,6 +185,7 @@ class _ArnaSegmentedControlItem extends StatelessWidget { Widget build(BuildContext context) { return ArnaBaseButton( builder: (context, enabled, hover, focused, pressed, selected) { + selected = buttonSelected; return AnimatedContainer( height: Styles.buttonSize - 2, duration: Styles.basicDuration, diff --git a/pubspec.yaml b/pubspec.yaml index f36211b7..a88ee96b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: arna description: Arna Framework - A unique set of widgets for building applications with Flutter. -version: 0.2.2 +version: 0.2.3 homepage: https://github.com/MahanRahmati/Arna environment: