Skip to content

Commit

Permalink
Fix image_resizer.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoEllet authored Nov 14, 2023
1 parent 2a37387 commit 03a4fe0
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,18 @@ class ImageResizerState extends State<ImageResizer> {
}

Widget _slider({
required double value,
required bool isHeight,
required bool isWidth,
required ValueChanged<double> onChanged,
}) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Card(
child: Slider(
value: value,
max: widget.maxWidth,
value: isWidth ? _width : _height,
max: isWidth ? widget.maxWidth : widget.maxHeight,
divisions: 1000,
// Might need to be changed
label: isHeight ? context.loc.height : context.loc.width,
label: isWidth ? context.loc.width : context.loc.height,
onChanged: (val) {
setState(() {
onChanged(val);
Expand All @@ -108,8 +107,7 @@ class ImageResizerState extends State<ImageResizer> {

Widget _heightSlider() {
return _slider(
value: _height,
isHeight: true,
isWidth: false,
onChanged: (value) {
_height = value;
},
Expand All @@ -118,8 +116,7 @@ class ImageResizerState extends State<ImageResizer> {

Widget _widthSlider() {
return _slider(
value: _width,
isHeight: false,
isWidth: true,
onChanged: (value) {
_width = value;
},
Expand Down

0 comments on commit 03a4fe0

Please sign in to comment.