Created
March 25, 2024 09:28
-
-
Save gochev/4f95c68469a75a00b2ec39a694b2a103 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
var test = Test(something: [5]); | |
test.something[0] = 6; | |
print(test.something); //prints 6 | |
var test2 = Test(something: const [5]); | |
// test2.something[0] = 6; //this will give you an error | |
print(test2.something); //prints 5 | |
} | |
class Test { | |
List<int> something; | |
Test({required this.something}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment