Skip to content

Commit

Permalink
undo typing
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisElliotUK committed Jul 27, 2023
1 parent 33f12f4 commit c93e2b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
13 changes: 7 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class MyHomePage extends StatefulWidget {

class _MyHomePageState extends State<MyHomePage> {
double _lowerValue = 50;
double _upperValue = 200;

double _lv = 50.0;
double _uv = 250.0;
Expand Down Expand Up @@ -108,7 +109,7 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: FlutterSlider<double>(
child: FlutterSlider(
handlerWidth: 30,
rtl: rtl,
handlerHeight: 30,
Expand Down Expand Up @@ -155,7 +156,7 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: FlutterSlider<double>(
child: FlutterSlider(
values: [_lv, _uv],
rangeSlider: true,
max: 500,
Expand Down Expand Up @@ -191,7 +192,7 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: FlutterSlider<double>(
child: FlutterSlider(
values: [_lv1, _uv1],
rangeSlider: true,
ignoreSteps: [
Expand Down Expand Up @@ -260,7 +261,7 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: FlutterSlider<double>(
child: FlutterSlider(
values: [_lv2, _uv2],
rangeSlider: true,
max: 25000,
Expand Down Expand Up @@ -318,7 +319,7 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: FlutterSlider<double>(
child: FlutterSlider(
key: Key('3343'),
values: [_lv3, _uv3],
rangeSlider: true,
Expand Down Expand Up @@ -360,7 +361,7 @@ class _MyHomePageState extends State<MyHomePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: FlutterSlider<double>(
child: FlutterSlider(
key: Key('3343'),
values: [_lv4, _uv4],
touchSize: 50.0,
Expand Down
10 changes: 4 additions & 6 deletions lib/another_xlider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import 'package:another_xlider/widgets/sized_box.dart';
import 'package:flutter/material.dart';
import 'dart:math';

class FlutterSlider<T> extends StatefulWidget {
class FlutterSlider extends StatefulWidget {
/// The axis on which the slider should be displayed. Can be either vertical or horizontal.
final Axis axis;

Expand All @@ -45,13 +45,13 @@ class FlutterSlider<T> extends StatefulWidget {
final FlutterSliderHandler? rightHandler;

/// Callback function that is called when the user starts dragging one of the handlers.
final void Function(int handlerIndex, T lowerValue, T upperValue)? onDragStarted;
final Function(int handlerIndex, dynamic lowerValue, dynamic upperValue)? onDragStarted;

/// Callback function that is called when the user stops dragging one of the handlers.
final void Function(int handlerIndex, T lowerValue, T upperValue)? onDragCompleted;
final Function(int handlerIndex, dynamic lowerValue, dynamic upperValue)? onDragCompleted;

/// Callback function that is called while the user is dragging one of the handlers.
final void Function(int handlerIndex, T lowerValue, T upperValue)? onDragging;
final Function(int handlerIndex, dynamic lowerValue, dynamic upperValue)? onDragging;

/// The minimum value that can be selected on the slider.
final double? min;
Expand Down Expand Up @@ -414,7 +414,6 @@ class FlutterSliderState extends State<FlutterSlider> with TickerProviderStateMi
if (layoutHeight == double.infinity) {
layoutHeight = 0;
}

_containerWidth = constraints.maxWidth;
_containerHeight = [(sliderProperSize! * widget.containerHeightFactor), layoutHeight].reduce(max);
__containerSizeWithoutPadding = _containerWidthWithoutPadding;
Expand Down Expand Up @@ -443,7 +442,6 @@ class FlutterSliderState extends State<FlutterSlider> with TickerProviderStateMi
key: containerKey,
height: _containerHeight,
width: _containerWidth,
padding: EdgeInsets.zero,
foregroundDecoration: widget.foregroundDecoration,
decoration: widget.decoration,
child: Stack(
Expand Down

0 comments on commit c93e2b6

Please sign in to comment.