Skip to content

Commit 8e6b5aa

Browse files
BF-68: replaced unused width property with height (#12)
1 parent 2151e92 commit 8e6b5aa

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.2.2
4+
5+
* Replaced `width` property with a changeable `height` property, you can adjust the width via outer padding
6+
37
## 1.2.1
48

59
* Upgrade the `flutter_svg` dependency from, `^0.19.1` to `^0.21.0+1`

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ packages:
176176
path: ".."
177177
relative: true
178178
source: path
179-
version: "1.2.0"
179+
version: "1.2.1"
180180
xml:
181181
dependency: transitive
182182
description:

lib/src/weight_slider_background.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ import 'package:flutter_svg/flutter_svg.dart';
33

44
class WeightBackground extends StatelessWidget {
55
final Widget child;
6+
final double height;
67

7-
const WeightBackground({Key key, this.child}) : super(key: key);
8+
const WeightBackground({Key key, this.child, this.height}) : super(key: key);
89

910
@override
1011
Widget build(BuildContext context) {
1112
return Stack(
1213
alignment: Alignment.bottomCenter,
1314
children: <Widget>[
1415
Container(
15-
height: 100.0,
16+
height: this.height,
1617
decoration: BoxDecoration(
1718
color: Color.fromRGBO(244, 244, 244, 1.0),
1819
borderRadius: new BorderRadius.circular(50.0),

lib/weight_slider.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class WeightSlider extends StatelessWidget {
99
final int minWeight;
1010
final int maxWeight;
1111
final String unit;
12-
final double width;
12+
final double height;
1313
final ValueChanged<int> onChange;
1414

1515
const WeightSlider(
@@ -18,13 +18,14 @@ class WeightSlider extends StatelessWidget {
1818
this.minWeight = 30,
1919
this.maxWeight = 130,
2020
this.unit = 'kg',
21-
this.width,
21+
this.height = 100,
2222
@required this.onChange})
2323
: super(key: key);
2424

2525
@override
2626
Widget build(BuildContext context) {
2727
return WeightBackground(
28+
height: this.height,
2829
child: LayoutBuilder(
2930
builder: (context, constraints) {
3031
return constraints.isTight
@@ -35,7 +36,7 @@ class WeightSlider extends StatelessWidget {
3536
value: this.weight,
3637
unit: this.unit,
3738
onChange: this.onChange,
38-
width: this.width ?? constraints.maxWidth,
39+
width: constraints.maxWidth,
3940
);
4041
},
4142
),

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: weight_slider
22
description: Customisable slider widget for retrieving a person's weight/mass.
3-
version: 1.2.1
3+
version: 1.2.2
44
homepage: https://covalsolutions.com
55
repository: https://github.com/coval-solutions/weight-slider
66
issue_tracker: https://github.com/coval-solutions/weight-slider/issues

0 commit comments

Comments
 (0)