5

Is it possible to specify literal typed_data in Dart? It would be very useful if one could do something like:

const Uint8List foo = const Uint8List [0, 1, 2, 3];
2
  • What would you want to use it for? Commented May 20, 2016 at 16:46
  • have you find the solution?
    – ch271828n
    Commented Jan 5, 2022 at 12:12

1 Answer 1

1

This is not supported. There aren't too many advantages in Dart using const anyway.

3
  • 3
    I'd be happy just to have a way to write a Uint8List literal :)
    – lrn
    Commented May 21, 2016 at 9:24
  • 3
    Default parameter values is a common and very useful use case.
    – cbreezier
    Commented Feb 21, 2023 at 5:54
  • 1
    @cbreezier, aggree. That's why I'm here.
    – FERcsI
    Commented Jan 30 at 6:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.