flutter_settings_screens
flutter_settings_screens copied to clipboard
Time Picker Does Not Scroll When Integrated Into Setting Screen
I used the following code to create a time picker, which I have integrated into my flutter settings screens. When I run the web app on my mac in Chrome in debug mode, I can use the trackpad to scroll through the times and pick a time. When I run the app in release mode (flutter build web) in Firefox on my raspberry pi with touch screen, the time picker does not respond to touches and I cannot select a time. Thanks so much for your help.
class _DatePickerItem extends StatefulWidget { _DatePickerItem(this.uacTime, this.subtitle, this.context) { }
UACTime? uacTime = null; String subtitle = ""; BuildContext context;
@override _DatePickerItemState createState() => new _DatePickerItemState(uacTime, subtitle, context); }
class _DatePickerItemState extends State<_DatePickerItem> {
_DatePickerItemState(this.uacTime, this.subtitle, this.context); UACTime? uacTime = null; String subtitle = ""; BuildContext context;
@override Widget build(BuildContext context) { return DecoratedBox( decoration: const BoxDecoration( border: Border( top: BorderSide( color: CupertinoColors.inactiveGray, width: 0.0, ), bottom: BorderSide( color: CupertinoColors.inactiveGray, width: 0.0, ), ), ), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Text(uacTime!.subject ?? ""), CupertinoButton( onPressed: () { _showTimePicker(uacTime!, context); }, // In this example, the date value is formatted manually. You can use intl package // to format the value based on user's locale settings. child: Text( //alarm.time.toString(), uacTime!.time.toString(), style: const TextStyle( fontSize: 22.0, ), ), ), ], ), ), ); }
// This shows a CupertinoModalPopup with a reasonable fixed height which hosts CupertinoDatePicker.
void _showTimePicker(UACTime uacTime, BuildContext context) {
showCupertinoModalPopup