When should Uint8 in Dart/Flutter be used?

676

Edit: The question is answered here

According to the documentation here, it accepts integers and then truncates those to the lower eight bits. This means you can effectively store four list entries in a standard 32 bit integer. When retrieving an integer, the integer is most likely prepended by the amount of bytes a reqular int uses.

Share:
676
Juliantje15
Author by

Juliantje15

IT student who focuses on application development using cross-platform technologies like React Native or Flutter.

Updated on December 09, 2022

Comments

  • Juliantje15
    Juliantje15 over 1 year

    I'm working on a flutter project with lots of bytes and byte arrays. I noticed that i had access to Uint8 and Uint8List. If i understand correctly, the Uint8List will save some memory over using a normal list with bytes. However, it seems that the Uint8List only accepts regular integers. Is there any usecase for using Uint8 type? Or should i be using the int type for bytes?