flutter_range_slider_dialog Plugin

GitHub last commit GitHub code size in bytes

Flutter Range Slider is a flutter package which shows a dialog with a RangeSlider within.

Overview

Data flow

  • Invoke method RangeSliderDialog.display() to display RangeSlider dialog.
  • Select the desired range.
  • Click Accept button return the selected values and close the dialog.
  • Click Cancel button to close the dialog and discard the changes.

Getting Started

1. Add library to your pubspec.yaml


dependencies:
  range_slider_dialog: ^0.0.1

2. Import library in dart file

import 'package:range_slider_dialog/range_slider_dialog.dart';

3. Example of use

await RangeSliderDialog.display<int>(context,
      minValue: minPeople ?? 1,
      maxValue: maxPeople ?? 40,
      acceptButtonText: 'ACEPTAR',
      cancelButtonText: 'CANCELAR',
      headerText: 'Gente en el plan',
      selectedRangeValues: defaultValue, onApplyButtonClick: (value) {
    print('SHOW PEOPLE DIALOG');
    print(value);
    callback(value);
    Navigator.pop(context);
  });

Parameters

ParameterTypeDescription
heightdoubleSet height of filter dialog.
widthdoubleSet width of filter dialog.
hideheaderboolHide the header
minValueintStart range value. Default to 0.
maxValueintEnd range value. Default to 40.
headerTextString?Custom header text. Default 'Select a range'
cancelButtonTextString?The text of the cancel button. Default 'CANCEL'
acceptButtonTextString?The text of the accept button. Default 'ACCEPT'
onApplyButtonClickFunction(RangeValues? selectedValues)Return the choosen RangeValues

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue. If you fixed a bug or implemented a feature, please send a pull request.

Libraries

range_slider_dialog