GaspardMerten / date_field

Flutter DateField and DateFormField
Other
46 stars 32 forks source link

ios select date problem #9

Closed CodeOutput closed 3 years ago

CodeOutput commented 3 years ago

codes work on android but i get errors on ios. I couldn't find the reason

` class ExpiryDateField extends StatefulWidget { final Payment payment;

ExpiryDateField({Key key, @required this.payment}) : super(key: key);

@override _ExpiryDateFieldState createState() => _ExpiryDateFieldState(); }

class _ExpiryDateFieldState extends State { @override Widget build(BuildContext context) { if(widget.payment.vadeTarihi == null) { widget.payment.vadeTarihi = DateTime.now(); } return DateTimeField( decoration: InputDecoration( contentPadding: EdgeInsets.all(15.0), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( color: Colors.grey[300] ) ), focusedBorder: UnderlineInputBorder( borderSide: BorderSide( color: AppColors.zirhliOrange ) ), labelText: 'Vade Tarihi', hintText: 'Vade Tarihi', ), dateFormat: DateFormat.yMMMMd('tr_TR'), mode: DateFieldPickerMode.date, // selectedDate: widget.payment.vadeTarihi, firstDate: DateTime(DateTime.now().year, DateTime.now().month), initialDatePickerMode: DatePickerMode.day,

  onDateSelected: (DateTime date) {
    setState(() {
      if (date != null)
        setState(() {
          widget.payment.vadeTarihi = date;
        });

      print(widget.payment.vadeTarihi);
    });
  },
);

} `

image

GaspardMerten commented 3 years ago

The package has been updated to version 1.0.0.

Has your issue been solved?