launchNumberPickerDialog function
void
launchNumberPickerDialog(- BuildContext context,
- {required int minValue,
- required int maxValue,
- int? itemCount,
- bool infiniteLoop = true,
- Axis? alignment,
- required void onChange(
- int res
)}
)
Implementation
void launchNumberPickerDialog(BuildContext context,
{required int minValue,
required int maxValue,
int? itemCount,
Icon? headerIcon,
bool infiniteLoop = true,
Axis? alignment,
required String headerMessage,
String? comment,
required void Function(int res) onChange}) =>
Navigator.of(context).push(
MaterialPageRoute<Widget>(builder: (BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Row(children: <Widget>[
const Icon(Icons.numbers_rounded),
const SizedBox(width: 8),
Text(headerMessage)
])),
body: SafeArea(
child: SingleChildScrollView(
child: _InternalNumberPicker(
infiniteLoop: infiniteLoop,
alignment: alignment,
itemCount: itemCount ??
maxValue.abs().toString().length,
minValue: minValue,
maxValue: maxValue,
onChange: onChange))));
}));