Parse String to Date in Dart

dependencies:
  intl: ^0.15.8
import 'package:intl/intl.dart';

void main() {
  var str = "2021-11-24";
  var date = new DateFormat("yyyy-MM-dd").parse(str);

  var dateFormat = new DateFormat("dd/MM/yyyy");
  print(dateFormat.format(date));
}
24/11/2021