Jaydeep Patel
Jaydeep Patel

Reputation: 1739

How to add/enabled ticker sound in CupertinoPicker/CupertinoDatePicker for iOS in flutter?

I am bit new for flutter. I used CupertinoDatePicker but ticker sound missing from it for iOS. so is there any way to enabled it or add it manually when the date-picker is scrolling? I checked for native iOS date-picker it's working fine only for flutter it's not working. Here is my implementation for date picker,

CupertinoDatePicker(
                    mode: CupertinoDatePickerMode.date,
                    initialDateTime: DateTime.now(),
                    onDateTimeChanged: (_) {},
                    maximumYear: DateTime.now().year,
                   )

and I imported import 'package:flutter/cupertino.dart'; for cupertino component.

Upvotes: 1

Views: 783

Answers (2)

Raj kamal
Raj kamal

Reputation: 1

Note : It's working only in IOS

You can use this on onDateTimeChanged

SystemSound.play(SystemSoundType.click);

Full code is

CupertinoDatePicker(
  mode: CupertinoDatePickerMode.date,
  initialDateTime: DateTime.now(),
  onDateTimeChanged: (value) {
    SystemSound.play(SystemSoundType.click);
  },
),

Upvotes: 0

Miguel Ruivo
Miguel Ruivo

Reputation: 17736

Theres a long time opened issue regarding this. You can track if from there.

Upvotes: 0

Related Questions