Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to null safety #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@
-
## [1.5.0] - 2020-09-16

- alignment with Flutter v1.20
- alignment with Flutter v1.20

## [1.6.0] - 2021-04-29

- Migrato to null safety. Flutter v2.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A full explanation on how to build such Widget may be found on my blog:
You should ensure that you add the following dependency in your Flutter project.
```yaml
dependencies:
flutter_range_slider: "^1.5.0"
flutter_range_slider: "^1.6.0"
```

You should then run `flutter packages upgrade` or update your packages in IntelliJ.
Expand Down
22 changes: 8 additions & 14 deletions example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,13 @@ class RangeSliderSample extends StatefulWidget {

class _RangeSliderSampleState extends State<RangeSliderSample> {
// List of RangeSliders to use, together with their parameters
List<RangeSliderData> rangeSliders;
late final List<RangeSliderData> rangeSliders = _rangeSliderDefinitions();

double _lowerValue = 20.0;
double _upperValue = 80.0;
double _lowerValueFormatter = 20.0;
double _upperValueFormatter = 20.0;

@override
void initState() {
super.initState();
rangeSliders = _rangeSliderDefinitions();
}

@override
Widget build(BuildContext context) {
return SafeArea(
Expand Down Expand Up @@ -167,7 +161,7 @@ class _RangeSliderSampleState extends State<RangeSliderSample> {
lowerValue: 25.0,
upperValue: 75.0,
divisions: 20,
overlayColor: Colors.red[100]),
overlayColor: Colors.red[100]!),
RangeSliderData(
min: 0.0,
max: 100.0,
Expand All @@ -183,7 +177,7 @@ class _RangeSliderSampleState extends State<RangeSliderSample> {
showValueIndicator: true,
valueIndicatorMaxDecimals: 0,
activeTrackColor: Colors.red,
inactiveTrackColor: Colors.red[50],
inactiveTrackColor: Colors.red[50]!,
valueIndicatorColor: Colors.green),
RangeSliderData(
min: 0.0,
Expand All @@ -210,7 +204,7 @@ class RangeSliderData {
double max;
double lowerValue;
double upperValue;
int divisions;
int? divisions;
bool showValueIndicator;
int valueIndicatorMaxDecimals;
bool forceValueIndicator;
Expand All @@ -229,10 +223,10 @@ class RangeSliderData {
static const Color defaultOverlayColor = const Color(0x290175c2);

RangeSliderData({
this.min,
this.max,
this.lowerValue,
this.upperValue,
required this.min,
required this.max,
required this.lowerValue,
required this.upperValue,
this.divisions,
this.showValueIndicator: true,
this.valueIndicatorMaxDecimals: 1,
Expand Down
Loading