codegrue / flutter_material_pickers

A flutter package for displaying common picker dialogs.
https://pub.dev/packages/flutter_material_pickers
MIT License
98 stars 61 forks source link

Feature Request : show two scroll picker dialog #1

Open tz182736 opened 4 years ago

tz182736 commented 4 years ago

I like to show 2 scroll picker side by side. below is my sample code.

 void selectTypeAndTime() {
    var selectedUsState = "Connecticut";
    List<String> stateList = <String>[
      'Alabama',
      'Alaska',
      'Arizona',
      'Arkansas',
      'California',
      'Colorado',
      'Connecticut',
    ];
    List<String> cityList = <String>[
      'City 1',
      'City 2',
      'City 3',
    ];
    showDialog<String>(
        context: context,
        builder: (BuildContext context) {
          return Row(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Expanded(
                child: ScrollPickerDialog(
                  items: stateList,
                  title: 'Pick Package',
                  initialItem: 'Alabama',
                ),
              ),
              Expanded(
                child: ScrollPickerDialog(
                  items: cityList,
                  title: 'Pick Package',
                  initialItem: 'City 1',
                ),
              )
            ],
          );
        });
  }
codegrue commented 4 years ago

I do want to add this concept, but in your example, I assume you would want the list of cities to filter based on the selected state? That's functionality probably beyond what the widget would provide.