Skip to content

Commit

Permalink
remove Transform.rotate, rename reverseIcon to forward
Browse files Browse the repository at this point in the history
  • Loading branch information
Overman775 committed Jun 5, 2020
1 parent 4f3e895 commit a196e0b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion example/lib/widgets/appbar/widget_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class _MyDrawer extends StatelessWidget {
),
isLead
? NeumorphicCloseButton()
: NeumorphicBackButton(reversedIcon: true),
: NeumorphicBackButton(forward: true),
],
),
),
Expand Down
11 changes: 4 additions & 7 deletions lib/src/widget/back_button.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:math' as math show pi;

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
Expand All @@ -8,14 +6,14 @@ class NeumorphicBackButton extends StatelessWidget {
final VoidCallback onPressed;
final NeumorphicStyle style;
final EdgeInsets padding;
final bool reversedIcon;
final bool forward;

const NeumorphicBackButton({
Key key,
this.onPressed,
this.style,
this.padding,
this.reversedIcon = false,
this.forward = false,
}) : super(key: key);

@override
Expand All @@ -25,9 +23,8 @@ class NeumorphicBackButton extends StatelessWidget {
style: style,
padding: padding,
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
child: reversedIcon
? Transform.rotate(
angle: 180 * math.pi / 180, child: nThemeIcons.backIcon)
child: forward
? nThemeIcons.forwardIcon
: nThemeIcons.backIcon,
onPressed: onPressed ?? () => Navigator.maybePop(context),
);
Expand Down
9 changes: 1 addition & 8 deletions lib/src/widget/close_button.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:math' as math show pi;

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_neumorphic/flutter_neumorphic.dart';
Expand All @@ -8,14 +6,12 @@ class NeumorphicCloseButton extends StatelessWidget {
final VoidCallback onPressed;
final NeumorphicStyle style;
final EdgeInsets padding;
final bool reversedIcon;

const NeumorphicCloseButton({
Key key,
this.onPressed,
this.style,
this.padding,
this.reversedIcon = false,
}) : super(key: key);

@override
Expand All @@ -25,10 +21,7 @@ class NeumorphicCloseButton extends StatelessWidget {
style: style,
padding: padding,
tooltip: MaterialLocalizations.of(context).closeButtonTooltip,
child: reversedIcon
? Transform.rotate(
angle: 180 * math.pi / 180, child: nThemeIcons.closeIcon)
: nThemeIcons.closeIcon,
child: nThemeIcons.closeIcon,
onPressed: onPressed ?? () => Navigator.maybePop(context),
);
}
Expand Down

0 comments on commit a196e0b

Please sign in to comment.