Skip to content

Commit

Permalink
0.2.3
Browse files Browse the repository at this point in the history
- Fix ArnaBaseButton
- Fix ArnaBottomBarItem
- Fix ArnaMasterItem
- Fix ArnaSideBarItem
- Fix ArnaSegmentedControl
- Fix ArnaAlertDialog
- Fix ArnaPopupDialo
- Fix ArnaProgressIndicator
- Update Readme
  • Loading branch information
MahanRahmati committed Feb 22, 2022
1 parent 49fc91a commit 49da514
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 15 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -379,7 +379,7 @@ ArnaIconButton(
onPressed: () => showArnaDialog(
context: context,
barrierDismissible: true,
builder: (_) => ArnaAlertDialog(
dialog: ArnaAlertDialog(
title: "Title",
message: "Message",
primary: ArnaTextButton(
Expand Down
4 changes: 4 additions & 0 deletions lib/src/base/base_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ class _ArnaBaseButtonState extends State<ArnaBaseButton> {
onTapUp: _handleTapUp,
onLongPressStart: _handleTapDown,
onLongPressEnd: _handleTapUp,
onHorizontalDragStart: _handleTapDown,
onHorizontalDragEnd: _handleTapUp,
onVerticalDragStart: _handleTapDown,
onVerticalDragEnd: _handleTapUp,
child: FocusableActionDetector(
enabled: isEnabled && widget.isFocusable,
focusNode: focusNode,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/base/bottom_bar_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
6 changes: 4 additions & 2 deletions lib/src/base/indicator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ class _ArnaProgressIndicatorState extends State<ArnaProgressIndicator>
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,
),
);
Expand Down
2 changes: 2 additions & 0 deletions lib/src/base/master_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
2 changes: 2 additions & 0 deletions lib/src/base/side_bar_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
1 change: 0 additions & 1 deletion lib/src/base/side_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class _ArnaSideScaffoldState extends State<ArnaSideScaffold> {
width: constraints.maxWidth > 960
? Styles.sideBarWidth
: Styles.sideBarCompactWidth,
height: constraints.maxHeight,
duration: Styles.basicDuration,
curve: Styles.basicCurve,
clipBehavior: Clip.antiAlias,
Expand Down
6 changes: 4 additions & 2 deletions lib/src/dialogs/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Future<T?> showArnaDialog<T>({
required ArnaAlertDialog dialog,
bool barrierDismissible = false,
Color barrierColor = ArnaColors.barrierColor,
String? barrierLabel,
String? barrierLabel = "label",
bool useRootNavigator = true,
RouteSettings? routeSettings,
}) {
Expand All @@ -214,7 +214,9 @@ Future<T?> showArnaDialog<T>({
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(
Expand Down
8 changes: 4 additions & 4 deletions lib/src/dialogs/popup_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions lib/src/inputs/segmented_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class _ArnaSegmentedControlState<T extends Object>
children.add(
_ArnaSegmentedControlItem(
label: widget.children[currentKey],
selected: widget.groupValue == currentKey,
buttonSelected: widget.groupValue == currentKey,
onPressed: () => _onPressed(currentKey),
first: first,
last: last,
Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 49da514

Please sign in to comment.