Skip to content

Instantly share code, notes, and snippets.

@Headmast
Created October 1, 2020 17:00
Show Gist options
  • Save Headmast/91acbd1323877baf5090f9546b3ab8bc to your computer and use it in GitHub Desktop.
Save Headmast/91acbd1323877baf5090f9546b3ab8bc to your computer and use it in GitHub Desktop.
String getMonthName(int index) {
    var months = ['January', 'February', 'March', 'April','May','June', 'July', 'August', 'September', 'October', 'November', 'December'];
  if (index >= 0 && index < 12) {
    return months[index];
  } else {
    return 'Invalin months index';
  }
}

void main() {
  var i = 2;
  print('Test function for ${i} - ${getMonthName(i)}');
}
@artem-zaitsev
Copy link

все ок

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment