TimeField constructor

TimeField({
  1. Key? key,
  2. TextEditingController? controller,
  3. double? fontSize,
  4. Color? fontColor,
  5. int? maxLength = 8,
  6. String inputMask = "##:##:##",
  7. double? radius,
  8. Color? borderColor,
  9. String? hintText = "HH:mm:ss",
  10. bool? enabled = true,
  11. bool? showMeridian = false,
  12. Color? fillColor,
  13. TextStyle? inputStyle,
})

Implementation

TimeField(
    {Key? key,
    this.controller,
    this.fontSize,
    this.fontColor,
    this.maxLength = 8,
    this.inputMask = "##:##:##",
    this.radius,
    this.borderColor,
    this.hintText = "HH:mm:ss",
    this.enabled = true,
    this.showMeridian = false,
    this.fillColor,
    this.inputStyle})
    : super(key: key) {
  if (showMeridian == true) {
    controller?.addListener(() {
      // FIND MERIDIAN
      var time = controller?.text.toHourTime();
      if (time != null) {
        var durationDate = time.convertToDate(date: DateTime.now());
        if (durationDate != null) {
          var formatted = DateFormat('a').format(durationDate);
          _meridianNotifier.value = formatted;
        }
      } else {
        _meridianNotifier.value = "";
      }
    });
  }
}