2

I'm trying to set a variable as a String of being a few specific options. I'm writing or converting it from TypeScript and am trying to reproduce this:

let myVar: 'a' | 'b' | 'c';
String myVar;

... is as far as I can get.

How can I write this in Dart, please?

  • 1
    Does this answer your question? [String literal type analogue in Dart](https://stackoverflow.com/questions/58578837/string-literal-type-analogue-in-dart) – Lutti Coelho Dec 23 '19 at 20:28
  • another useful [link](https://stackoverflow.com/a/59309104/1891712) – Spatz Dec 23 '19 at 21:43

0 Answers0