setFormat method

String setFormat({
  1. int? yyyy,
  2. int? mm,
  3. int? dd,
})

Implementation

String setFormat({int? yyyy, int? mm, int? dd}) {
  return widget.format
      .replaceAll('yyyy', yyyy.toString())
      .replaceAll('mm',
          mm.toString().length == 1 ? '0' + mm.toString() : mm.toString())
      .replaceAll('dd',
          dd.toString().length == 1 ? '0' + dd.toString() : dd.toString());
}